OpenOffice-OODoc

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	Makefile.PL: Updated dependencies (updated INSTALL accordingly).
	Makefile.PL: utf8 becomes the default character set.
	File.pm: Archive::Zip 1.18 now required; IO::File required; file handles supported.
        Meta.pm: Added user-defined property access methods; added getTemplate(), unlinkTemplate().
        Text.pm: Added setNote(), fixed a bug in getTableByName() [#48356].
2.108	2009-05-24
	Some doc cleaning
	Meta.pm: added getUserProperty(), setUserProperty(), removeUserProperty()
	XPath.pm: added new check in constructor according to [#43744]
	XPath.pm: avoided a useless warning in getAttributes() [#42038]
	Text.pm: improved expandTable() according to [#41975] (thanks to
	Barry Slaymaker), changed getTable(), some code cleaning
	Image.pm: importImage() now can automatically import externally linked images
	File.pm: save() now checks the source files availability
2.107	2008-12-07
	Text.pm: added getCellPosition(), adapted from a proposal by dhoworth
	Makefile.PL: updated the XML::Twig version requirement
	Makefile.PL: (grrr...) removed the accent in the author's name, due to
	a Solaris-specific trouble with non-ASCII characters in the makefiles
	XPath.pm: now uses XML::Twig 3.32 instead of 3.22
2.106	2008-11-05

Changes  view on Meta::CPAN

	File.pm: changed the way of creating new documents
	Replaced XML templates by ODF and OOo files (including a few paragraph
	styles)
	XPath.pm: given priority to 'member' option over 'part' option, to 'archive'
	over 'container', for legacy reasons; other parameter priority changes;
	code cleaning in the constructor
	XPath.pm: bugfix related to non-ASCII characters in frame names
	Text.pm: bugfixes related to non-ASCII characters in styles and draw page names
	Text.pm: removed some code redundancies in table cell related accessors
	Text.pm: added updateUserFieldReferences()
	Text.pm: added expandTable()
	Text.pm: removed an undesirable warning in getTable()
	Text.pm: fixed a bug in getTableCell()
	Examples: Changed text2table in order to use expandTable()
2.102	2008-05-04
	Cleaned some code examples
2.101	2008-05-04
	Intro.pod: doc update
	Meta.pm: fixed wrong exports for ooLocaltime() and ooTimelocal(), added
	odfXxx aliases for deprecated ooXxx functions
	Meta.pod: doc update
	Styles.pm: added new odfXxx aliases for deprecated ooXxx global functions
	Styles.pod: doc update; fixed #29578
	OODoc.pm: added new odfXxx aliases for deprecated ooXxx global functions

OODoc/Text.pm  view on Meta::CPAN

	*getColumn			= *getTableColumn;
	*getRow				= *getTableRow;
	*getHeaderRow			= *getTableHeaderRow;
	*getCell			= *getTableCell;
	*getSheet			= *getTable;
	*selectTableByName		= *getTableByName;
	*getSheetByName			= *getTableByName;
	*getTableContent		= *getTableText;
	*normalizeTable			= *normalizeSheet;
	*normalizeTables		= *normalizeSheets;
	*expandSheet			= *expandTable;
	*insertColumn			= *insertTableColumn;
	*deleteColumn			= *deleteTableColumn;
	*replicateRow			= *replicateTableRow;
	*insertRow			= *insertTableRow;
	*appendRow			= *appendTableRow;
	*deleteRow			= *deleteTableRow;
	*appendHeader			= *appendHeading;
	*insertHeader			= *insertHeading;
	*removeHeader			= *removeHeading;
	*deleteHeading			= *removeHeading;

OODoc/Text.pm  view on Meta::CPAN

			}
		$width = $row_width if $row_width > $width;
		}
	return ($height, $width);
	}

#-----------------------------------------------------------------------------
# increases the size of an existing table
# improved by Barry Slaymaker [rt.cpan.org #41975]

sub	expandTable
	{
	my $self	= shift;
	my $table	= shift;
	my $length	= shift || 0;
	my $width	= shift || 0;
	my $context	= shift;

	my ($old_length, $old_width) = $self->getTableSize($table);
	$table = $self->normalizeSheet($table, 'full');
	unless ($table)
		{
		warn	"[" . __PACKAGE__ . "::expandTable] " .
			"Unknown or badly formed table\n";
		return undef;
		}
	my $last_col	= $self->getTableColumn($table, -1);
	my $last_row	= $self->getRow($table, -1);
	my $i		= 0;
	my $j		= 0;

	# expand column declarations
	for ($i = $old_width ; $i < $width ; $i++)

OODoc/Text.pod  view on Meta::CPAN

=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

OODoc/Text.pod  view on Meta::CPAN

	mapping between the logical view and the physical XML storage of the
	table. But, according to the OpenDocument specification, several
	contiguous objects (cells or rows) are allowed to be mapped to a
	single XML object when they have the same content and the same
	style, in order to save some storage space. This optimization is
	systematically used, for example, by OpenOffice.org Calc. In addition,
	OODoc can't address a cell that could be displayed through the GUI
	of a typical interactive spreadsheet software but that isn't stored
	because it's not initialized yet. As a consequence, the direct
	addressing logic of getTableCell() may require some preprocessing.
	See normalizeSheet() and/or expandTable() about such preprocessing.

	Remember that the table addressing is zero-based and
	the row comes before the column in OpenOffice::OODoc, so, for
	example:

		$cell1 = $doc->getTableCell($table, 0, 0);
		$cell2 = $doc->getTableCell($table, 31, 25);

	returns respectively the A1 and Z32 cells.

OODoc/Text.pod  view on Meta::CPAN

	They simply take some more disk space when the processed spreadsheet
	is saved. If the document is later read then written by OOo Calc,
	the storage is optimized again, so the effects of normalizeSheet()
	disappear.

	normalizeSheet() is neutral against already normalized tables.

	An explicit call to this method can be replaced by getTable() with the
	additional length and width parameters. In addition, normalizeSheet()
	is automatically executed before resizing each time a table is
	processed by expandTable().

=head3	normalizeTable(table [, rows [, columns]])

	See normalizeSheet().

=head3	outputDelimitersOn()

=head3	outputDelimitersOff()

        Turns delimiters on or off. Used to mark up text exported by certain

examples/text2table  view on Meta::CPAN


my ($input_file, $output_file, $lines, $columns) = @ARGV;

die "Usage : txt2table <input file> <output OOo file> <lines> <columns>\n"
	unless ($input_file && $output_file && $lines && $columns);

	# create the OOo spreadsheet
my $doc = odfDocument(file => $output_file, create => 'spreadsheet');

	# select & size the 1st (and only) sheet in the document
my $sheet = $doc->expandTable(0, $lines, $columns);
	# rename it as the input file (why not ?)
$doc->renameTable($sheet, $input_file);

	# populate the table
open INPUT, "<", $input_file or die "Input file $input_file unavailable\n";
my $line = undef;
my @rows = $doc->getTableRows($sheet);
for (my $i = 0 ; $i < $lines && ($line = <INPUT>) ; $i++)
	{
	my $row = $rows[$i];



( run in 0.263 second using v1.01-cache-2.11-cpan-65fba6d93b7 )