[gnumeric] xls: fix ABR.



commit a3c14ae723fc4307d86fa096085bc7fe3631c76c
Author: Morten Welinder <terra gnome org>
Date:   Sun May 10 17:13:46 2015 -0400

    xls: fix ABR.

 NEWS                    |    2 +-
 plugins/excel/ChangeLog |    2 ++
 plugins/excel/ms-obj.c  |    2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index b75c332..8e21c98 100644
--- a/NEWS
+++ b/NEWS
@@ -15,7 +15,7 @@ Morten:
        * Solver code refactoring.
        * Plug leaks.
        * Fuzzed file fixes.  [#748595] [#748597] [#749031] [#749030]
-         [#749069] [#748533] [#749118] [#749166] [#749181]
+         [#749069] [#748533] [#749118] [#749166] [#749181] [#749184]
        * Make solver check linearity of model.
        * Fix xls saving of marker style.  [#749185]
 
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 8566ae9..6fb3c5e 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,7 @@
 2015-05-10  Morten Welinder  <terra gnome org>
 
+       * ms-obj.c (ms_read_TXO): Fix maxlen calculation for UTF-16.
+
        * ms-chart.c (chart_write_MARKERFORMAT): Shape map was missing an
        item.
 
diff --git a/plugins/excel/ms-obj.c b/plugins/excel/ms-obj.c
index a2d7a58..9b6b02f 100644
--- a/plugins/excel/ms-obj.c
+++ b/plugins/excel/ms-obj.c
@@ -437,7 +437,7 @@ ms_read_TXO (BiffQuery *q, MSContainer *c, PangoAttrList **markup)
                        continue;
 
                use_utf16 = q->data[0] != 0;
-               maxlen = use_utf16 ? q->length / 2 : q->length-1;
+               maxlen = (q->length - 1) / (use_utf16 ? 2 : 1);
                text = excel_get_chars (c->importer,
                        q->data + 1, MIN (text_len, maxlen), use_utf16, NULL);
                g_string_append (accum, text);


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