[gnumeric] Allow MS generated ODF files to be opened



commit 3a6625caeb62a36541246c9b277cf18f7c527b34
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sun May 10 14:34:59 2009 -0600

    Allow MS generated ODF files to be opened
    
    2009-05-10  Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* openoffice-read.c (oo_row_start): don't croak on many repeated lines
    	  beyond the size of our sheets
---
 NEWS                                 |    1 +
 plugins/openoffice/ChangeLog         |    7 ++++++-
 plugins/openoffice/openoffice-read.c |   12 ++++++++++--
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index d57a715..623b6a1 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Andreas:
 	* Fix loading of arrays from ods files (and general array 
 	  partitioning) [#581953]
 	* Fix tag ordering in xlsx files [#581896]
+	* Allow MS generated ODF files to be opened 
 
 Jody:
 	* Closer to a turnkey win32 build.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 16dc9ad..780a944 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,8 +1,13 @@
+2009-05-10  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+	* openoffice-read.c (oo_row_start): don't croak on many repeated lines
+	  beyond the size of our sheets
+
 2009-05-10  Morten Welinder  <terra gnome org>
 
 	* openoffice-read.c (openoffice_file_open): Add progress display.
 
-2009-05-081  Andreas J. Guelzow <aguelzow pyrshep ca>
+2009-05-08  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* openoffice-write.c (odf_write_table_style): use "table-properties"
 	  rather than "properties"
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 5050bc7..ad9dd1f 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -754,11 +754,11 @@ oo_row_start (GsfXMLIn *xin, xmlChar const **attrs)
 	state->pos.eval.col = 0;
 
 	if (state->pos.eval.row >= max_rows) {
-		oo_warning (xin, _("Content past the maximum number of rows supported in this build (%u).  Please recompile with larger limits."), max_rows);
+		oo_warning (xin, _("Content past the maximum number of rows (%i) supported for this worksheet. Please restart with a larger number of rows."), max_rows);
 		state->row_inc = 0;
 		return;
 	}
-
+	
 	for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
 		if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_TABLE, "style-name"))
 			row_info = g_hash_table_lookup (state->styles.col_row, attrs[1]);
@@ -771,6 +771,10 @@ oo_row_start (GsfXMLIn *xin, xmlChar const **attrs)
 		colrow_set_visibility (state->pos.sheet, FALSE, FALSE, state->pos.eval.row,
 			state->pos.eval.row+repeat_count - 1);
 
+	/* There are probably lots of empty lines at the end. */
+	if (state->pos.eval.row + repeat_count >= max_rows)
+		repeat_count = max_rows - state->pos.eval.row - 1;
+
 	/* see oo_table_end for details */
 	if (NULL != style) {
 		GnmRange r;
@@ -950,6 +954,10 @@ oo_cell_start (GsfXMLIn *xin, xmlChar const **attrs)
 					expr_string += 5;
 				else if (strncmp (expr_string, "of:", 3) == 0)
 					expr_string += 3;
+				else if (strncmp (expr_string, "=", 1) == 0)
+					/* They really should include a namespace */
+					/* We assume that it is an OpenFormula expression */
+					expr_string += 0;
 				else {
 					oo_warning (xin, _("Missing or unknown expression namespace: %s"), expr_string);
 					continue;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]