[gnumeric] .gnumeric: don't write col/row records when the style is the default.



commit 55f73500c795d27d45ff3b3f260e7de46af94fbd
Author: Morten Welinder <terra gnome org>
Date:   Sat Mar 10 15:01:23 2012 -0500

    .gnumeric: don't write col/row records when the style is the default.

 ChangeLog           |    3 +++
 NEWS                |    1 +
 src/xml-sax-write.c |    5 ++++-
 3 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e0edff8..19b3dc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-03-10  Morten Welinder  <terra gnome org>
 
+	* src/xml-sax-write.c (xml_write_colrow_info): Don't write records
+	that match the default col/row style.
+
 	* src/sheet-object-widget.h: Grand rename.  Make GNM_IS_SOW
 	public.
 
diff --git a/NEWS b/NEWS
index 072e852..ef65510 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Morten:
 	* Fix xls export for formulas in conditions.  [Part of #671513]
 	* Export non-visible style stuff to xls.  [Part of #671513]
 	* Improve xls import re. hard column widths.
+	* Export only needed col/row styles to .gnumeric.
 
 --------------------------------------------------------------------------
 Gnumeric 1.11.2
diff --git a/src/xml-sax-write.c b/src/xml-sax-write.c
index 9a48ef3..d744855 100644
--- a/src/xml-sax-write.c
+++ b/src/xml-sax-write.c
@@ -710,12 +710,15 @@ xml_write_colrow_info (GnmColRowIter const *iter, closure_write_colrow *closure)
 {
 	ColRowInfo const *prev = closure->prev;
 	GsfXMLOut *output = closure->state->output;
+	ColRowInfo const *def =
+		sheet_colrow_get_default (closure->state->sheet,
+					  closure->is_column);
 
 	closure->rle_count++;
 	if (NULL != iter && colrow_equal (prev, iter->cri))
 		return FALSE;
 
-	if (prev != NULL) {
+	if (prev != NULL && !colrow_equal (prev, def)) {
 		if (closure->is_column)
 			gsf_xml_out_start_element (output, GNM "ColInfo");
 		else



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