OpenOffice-OODoc

 view release on metacpan or  search on metacpan

OODoc/Text.pod  view on Meta::CPAN

        The method returns the number of physical deleted elements, that should
        be 0 (if the index mark did not exist) or 2 (the start and the end
        points). Any other return value means that deleteIndexMark() has cleaned
        up a strange situation (less or more than two range delimiters).
        
        See also deleteIndexMarks().

=head3  deleteIndexMarks([type [, context])

        Without argument, deletes all the TOC marks and alphabetical index marks
        in the document (or the default context).
        
        The first argument, if set, non-blank and non-empty, restricts the
        deletion to one type of index marks; it should be either 'toc' or
        'alphabetical index' (unless the user need to remove non standard index
        marks).
        
        A particular context may set through the third argument in order to
        restrict the index mark removal to the content of a particular element.
        
        See also deleteIndexMark().

=head3	drawPageId(page [, new_id])

	Returns the internal identifier of a presentation page, and changes
	it if a second argument is provided. The page id is a positive
	integer.

	The first argument must comply to the same rules as with getDrawPage.

=head3	drawPageName(page [, newname])

	Returns the visible name of a presentation or drawing page.
	The first argument can be a page order number, a page element or the
	present page name (see getDrawPage). The page is renamed if a
	second argument is provided. Example:

		$doc->drawPageName("oldname", "newname");

=head3	deleteTableColumn(table, col_num)

	See deleteColumn().

=head3	deleteTableRow(table, row_num)

	See deleteRow().

=head3	expandSheet()

	Synonym of expandTable().

=head3	expandTable(table, height, width)

	Increases the size of the given table or spreadsheet.

	This method silently executes a full normalization of the table before
	resizing it. See normalizeSheet() for details about this operation.

	This method is specially useful in order to ensure the availability of
	an appropriate workspace in a spreadsheet whose apparent size is
	almost unlimited through the GUI of a typical desktop software but
	but whose real size is unknown and/or doesn't include all the target
	area of the application.

	The vertical expansion is implemented by repetitive replication of the
	last row, while the horizontal expansion is implemented by repetitive
	replication of the last cell of the last row. So the new cells in the
	right side are copies of the old bottom-right cell, while the new rows
	are copies of the old last row.

	Any size argument which is not larger than the previous height or width
	is silently ignored, so method produces the same effect as
	normalizeSheet() with the "full" parameter.

	The return value is the table element itself in scalar context, or
	the table size in array context.

	Note that there is no direct method to shrink a table. However, it's
	possible to do the job by deleting selected rows and or columns
	through deleteTableColumn() and/or deleteTableRow().

=head3	extendText(element, text [, style [, offset]])

	Inserts the text provided as the second argument into the element
	specified by the first argument. The second argument may be either a
	flat string or another existing text element.
	
	If the 'text' argument is a paragraph or heading element, the text
	content (and not the element itself) is inserted. But if 'text' is
	any other element (for example: a variable text field or a sequence
	of spaces), its inserted as is.

	This method is an improvement of the general extendText() method
	which is documented in the OpenOffice::OODoc::XPath manual page.

	If a third argument is provided and is neither 0 nor an empty string,
	it's regarded as the desired style of the new text, which is inserted
	as a "styled span" (see setTextSpan() for details about text "spans").
	By default, the text is inserted without any special style (i.e. with
	the same style as the containing element).

	The new text is, by default, appended to the existing content of the
	element. However, if a valid numeric value is provided as the fourth
	argument, the new text is inserted within the existing content, at the
	given offset. If the offset is negative, it's counted backwards from
	the end of the string. If it's set to 0, the insertion takes place at
	the beginning.

		$doc->createStyle
			(
			"BlueYellow",
			family		=> "text",
			properties	=>
			    {
			    "fo:color"			=> odfColor("blue"),
			    "fo:background-color"	=> odfColor("yellow")
			    }
			);
		my $p = $doc->getParagraph(4);
		$doc->extendText($p, "New text", "BlueYellow", 5);

OODoc/Text.pod  view on Meta::CPAN


        By default, the new row is inserted at the position of the
        referenced row, which displaces it and the rest of the table down by
        one row position. However, you can insert it after by using the
        'position => after' option. By default, the new row is an exact copy
        of the referenced row, but you can assign particular attributes to
        it in the same manner as the insertElement method of OODoc::XPath.

=head3	insertSection(path, position, name [, options])

=head3	insertSection(element, name [, options])

	Creates a new section and inserts it immediately before or after
	an existing element (paragraph, header, table). The referenced element
        can be indicated as in insertParagraph.

	There is a "position" option which works in the same way as with
	insertParagraph() or insertRow().

	For other options, see appendSection(). For example, insertSection()
	may be used in order to insert a subdocument in a master document.

=head3	insertString(path, position, text, offset)

=head3	insertString(element, text, offset)

	Inserts a flat character string in a given element (whatever the type
	of element) at the given offset. If the offset is not defined, the
	text is appended to the end of the element (however, if the offset is
	provided and set to zero, the string is inserted at the beginning).

=head3	insertTable(path, position, name, rows, columns [, options])

=head3	insertTable(element, name, rows, columns [, options])

        Creates a new table and inserts it immediately before or after
        another element (paragraph, header, table). The referenced element
        can be indicated as in insertParagraph. The other arguments and
        options are the same as for appendTable with the additional option
        'position' as in insertParagraph.

=head3	insertTableColumn(table, col_num [, options])

	See insertColumn().

=head3	insertTableRow(table, row [, options])

=head3	insertTableRow(row_element [, options])

        See insertRow().

=head3	lockSection(section [, key])

	Installs a write protection on the given section.

	If a second argument is provided, it's stored as an encrypted key
	which is associated to the write protection. Caution, it's not the
	key as it should be typed by the OOo end-user.

	Such a write protection works only when the document is edited through
	an OpenOffice.org-compatible desktop software. It doesn't prevent the
	programs using OpenOffice::OODoc from deleting or updating the
	protected sections.

=head3	makeHeading([options])

	Creates a new heading element, or marks as a heading an existing
	element.

	Options:

		element		=> an arbitrary existing element

	If this option is provided, the given element is converted in place
	to a heading, whatever its original type and position. No element
	is created.

	Without the 'element' option, a new heading element is created and
	returned for later use. This element is free; it's not automatically
	attached somewhere in the document. For direct heading creation and
	attachment, you should prefer appendHeading() or insertHeading().

		level		=> a numeric, positive integer value

	Sets the hierarchical level of the heading (remember 1 is the top
	heading level). Caution: no default value.

		style		=> the name of a convenient heading style

	While it's not mandatory, the 'style' option and a properly defined
	heading style are generally required in order to allow the office
	software to really process and display the element as a heading with
	the right hierarchical level. Of course, any previously existing
	hierarchical style is reusable here.

	The main purpose of this method is to allow quick heading hierarchy
	creation in a "flat" document. For exemple, an application can select
	a set of flat paragraphs matching a given condition and convert each
	one in place to a heading with a given level.
	
=head3	moveElementsToSection(section, list)

	Moves a list of elements from any place to a section.
	
	The section may be passed by name or by element reference; it must be
	an existing one (no new section is created).
	
	The list is a set of arbitrary elements (including sections). Each one
	is cut from its previous place and appended to the section in the
	order of the list, without document consistency check.

=head3	normalizeSheet(sheet, rows, columns)

=head3	normalizeSheet(sheet, 'full')

	This method preprocesses a given sheet so its components (rows,
	cells) become available for all the table-oriented methods described
	in this chapter. In some situations, this method must be used before
	any attempt to address any individual table component (column, row or
	cell). The return value is the target table object in a scalar context
	and the size (height, width) in an array context.



( run in 1.867 second using v1.01-cache-2.11-cpan-39bf76dae61 )