[gnumeric] xlsx: fix comment writing.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: fix comment writing.
- Date: Thu, 16 Apr 2015 22:42:05 +0000 (UTC)
commit f0299f479b0bcf28cf97adeab706508a849e6d5f
Author: Morten Welinder <terra gnome org>
Date: Thu Apr 16 18:41:29 2015 -0400
xlsx: fix comment writing.
The fix to use deterministic ordering was good, but the order actually
matters so use the right one.
plugins/excel/ChangeLog | 5 +++++
plugins/excel/xlsx-write.c | 10 +++++-----
samples/cell-comment-tests.gnumeric | Bin 3420 -> 3413 bytes
3 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 5433d29..f54246b 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-16 Morten Welinder <terra gnome org>
+
+ * xlsx-write.c (xlsx_write_comments): Write comments in id order
+ since we refer to them by their implied id based on the order.
+
2015-04-15 Morten Welinder <terra gnome org>
* xlsx-write.c (xlsx_write_comments): Write comment authors in
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 9cfc3e8..c589087 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -2671,11 +2671,11 @@ xlsx_write_print_info (XLSXWriteState *state, GsfXMLOut *xml)
/**********************************************************************/
static int
-by_key_str (gpointer key_a, G_GNUC_UNUSED gpointer val_a,
- gpointer key_b, G_GNUC_UNUSED gpointer val_b,
- G_GNUC_UNUSED gpointer user)
+by_val_int (G_GNUC_UNUSED gpointer key_a, gpointer val_a,
+ G_GNUC_UNUSED gpointer key_b, gpointer val_b,
+ G_GNUC_UNUSED gpointer user)
{
- return strcmp (key_a, key_b);
+ return GPOINTER_TO_INT (val_a) - GPOINTER_TO_INT (val_b);
}
static void
@@ -2716,7 +2716,7 @@ xlsx_write_comments (XLSXWriteState *state, GsfOutput *sheet_part, GSList *objec
/* save authors */
gsf_xml_out_start_element (xml, "authors");
gnm_hash_table_foreach_ordered (authors, (GHFunc) write_comment_author,
- by_key_str, xml);
+ by_val_int, xml);
gsf_xml_out_end_element (xml); /* </authors> */
/* save comments */
gsf_xml_out_start_element (xml, "commentList");
diff --git a/samples/cell-comment-tests.gnumeric b/samples/cell-comment-tests.gnumeric
index 3fbefcc..839062e 100644
Binary files a/samples/cell-comment-tests.gnumeric and b/samples/cell-comment-tests.gnumeric differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]