R/addTOC.R

# Method Docx.addTOC 
# 
# Author: David GOHEL <david.gohel@lysis-consultants.fr>
# Date: 1 avr. 2013
# Version: 0.1
###############################################################################
#TODO : check stylename is existing
setMethod("addTOC", "Docx", function(x, stylename, ... ) {
			if( missing( stylename ) ){
				.jcall( x@obj, "V", "addTableOfContents" )
			} else {
				if( !is.element( stylename , styles( x ) ) ){
					stop(paste("Style {", stylename, "} does not exists.", sep = "") )
				}
				else .jcall( x@obj, "V", "addTableOfContents", stylename )
			}
			x
	})
setMethod("addPageBreak", "Docx", function( x ) {
			.jcall( x@obj, "V", "addPageBreak" )
			x
		})

setMethod("addLineBreak", "Docx", function( x ) {
			.jcall( x@obj, "V", "addLineBreak" )
			x
		})
davidgohel/R2DOCX documentation built on May 14, 2019, 11:13 p.m.