[gnumeric] xls/biff8: when put rich text formatting on normal text.



commit 4b84fb9e9d63fb12b9c33bdebe3f1752e21a5366
Author: Morten Welinder <terra gnome org>
Date:   Tue Feb 25 22:35:19 2014 -0500

    xls/biff8: when put rich text formatting on normal text.

 NEWS                         |    1 +
 plugins/excel/ChangeLog      |    3 +++
 plugins/excel/ms-container.c |   13 +++++++++----
 3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/NEWS b/NEWS
index d7041fc..d52f6fb 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,7 @@ Morten:
        * Fix xlsx import of comments.
        * Work around gtk+ criticals.  [#725142]
        * Fix xls/biff8 export of long comments.  [#725168]
+       * Fix xls/biff8 import of comment's text attributes.  [#725168]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.11
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 2ba64d7..01d229c 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,8 @@
 2014-02-25  Morten Welinder  <terra gnome org>
 
+       * ms-container.c (ms_container_read_markup): Return NULL when no
+       attributes are present.  idx==0 is the normal font.
+
        * ms-excel-write.c (excel_write_string_in_chunks): BIFF_TXO uses
        BIFF_CONTINUE records in a non-standard way.
 
diff --git a/plugins/excel/ms-container.c b/plugins/excel/ms-container.c
index 5f9938a..d0a212b 100644
--- a/plugins/excel/ms-container.c
+++ b/plugins/excel/ms-container.c
@@ -268,7 +268,7 @@ ms_container_read_markup (MSContainer const *c,
        str_len = g_utf8_strlen (str, -1);
 
        txo_run.last = G_MAXINT;
-       txo_run.accum = pango_attr_list_new ();
+       txo_run.accum = NULL;
        for (txo_len -= 16 ; (gssize)txo_len >= 0 ; txo_len -= 8) {
                guint16 o = GSF_LE_GET_GUINT16 (data + txo_len);
                guint16 idx = GSF_LE_GET_GUINT16 (data + txo_len + 2);
@@ -277,9 +277,14 @@ ms_container_read_markup (MSContainer const *c,
                txo_run.first = g_utf8_offset_to_pointer (str, o) - str;
                XL_CHECK_CONDITION_VAL (txo_run.first < txo_run.last, txo_run.accum);
 
-               pango_attr_list_filter (ms_container_get_markup (c, idx),
-                                       (PangoAttrFilterFunc) append_txorun,
-                                       &txo_run);
+               if (idx != 0) {
+                       if (!txo_run.accum)
+                               txo_run.accum = pango_attr_list_new ();
+                       pango_attr_list_filter
+                               (ms_container_get_markup (c, idx),
+                                (PangoAttrFilterFunc) append_txorun,
+                                &txo_run);
+               }
                txo_run.last = txo_run.first;
        }
        return txo_run.accum;


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