[gnumeric] xls: fix writing of non-ascii names.



commit 83d93c524aada491459d99ab102af8bad87233d9
Author: Morten Welinder <terra gnome org>
Date:   Sun Apr 14 13:05:51 2013 -0400

    xls: fix writing of non-ascii names.

 NEWS                           | 1 +
 plugins/excel/ChangeLog        | 6 ++++++
 plugins/excel/ms-excel-write.c | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/NEWS b/NEWS
index cb4c921..d3afae4 100644
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,7 @@ Morten:
        * Add version number to translation files.
        * Improve precision of R.PBETA slightly.  [#697850]
        * Add new test for a collection of special functions.
+       * Fix xls writing of non-ascii names.  [#608780]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.1
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 18ee823..abb3b9f 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-14  Morten Welinder  <terra gnome org>
+
+       * ms-excel-write.c (excel_write_NAME): Store the name's length in
+       characters, not bytes.  This matches the read side and fixes
+       #608780.
+
 2013-04-10  Morten Welinder  <terra gnome org>
 
        * ms-formula-write.c (do_excel_write_prep_expr): Fix unintentional
diff --git a/plugins/excel/ms-excel-write.c b/plugins/excel/ms-excel-write.c
index d555ec7..d7f32b8 100644
--- a/plugins/excel/ms-excel-write.c
+++ b/plugins/excel/ms-excel-write.c
@@ -1589,7 +1589,7 @@ excel_write_NAME (G_GNUC_UNUSED gpointer key,
                        ms_biff_put_var_write (ewb->bp, data, 15);
                }
        } else {
-               excel_strlen (name, &name_len);
+               name_len = excel_strlen (name, NULL);
                GSF_LE_SET_GUINT8 (data + 3, name_len); /* name_len */
                ms_biff_put_var_write (ewb->bp, data, 14);
                excel_write_string (ewb->bp, STR_NO_LENGTH, name);


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