[gnumeric] xlsx: improve handling of style-only cells.



commit 9cf41be2fb261b677ee99ae8df5fcb3000e7e85f
Author: Morten Welinder <terra gnome org>
Date:   Mon Apr 29 10:27:00 2013 -0400

    xlsx: improve handling of style-only cells.
    
    Don't create a GnmCell for those.

 NEWS                      |    3 +++
 plugins/excel/ChangeLog   |    4 ++++
 plugins/excel/xlsx-read.c |   10 ++++++++--
 3 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3c2c151..ecf8e25 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ Gnumeric 1.12.3
 Andreas:
        * Fix border handling for merged cells in LaTeX export.
 
+Morten:
+       * Improve xlsx import of style-only cells.
+
 --------------------------------------------------------------------------
 Gnumeric 1.12.2
 
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 9ee7b22..4f43f12 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-29  Morten Welinder  <terra gnome org>
+
+       * xlsx-read.c (xlsx_cell_end): Don't create empty cells.
+
 2013-04-26  Morten Welinder <terra gnome org>
 
        * Release 1.12.2
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 0fbbc05..221b001 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1338,8 +1338,14 @@ static void
 xlsx_cell_end (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
 {
        XLSXReadState *state = (XLSXReadState *)xin->user_state;
-       GnmCell *cell = sheet_cell_fetch (state->sheet,
-               state->pos.col, state->pos.row);
+       GnmCell *cell;
+
+       if (state->texpr == NULL && state->val == NULL) {
+               /* A cell with only style.  */
+               return;
+       }
+
+       cell = sheet_cell_fetch (state->sheet, state->pos.col, state->pos.row);
 
        if (NULL == cell) {
                xlsx_warning (xin, _("Invalid cell %s"),


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