[gnumeric] .gnumeric: don't save a 0x0 size.



commit 848616b8ed706a914f466e9510c33c35e45d7195
Author: Morten Welinder <terra gnome org>
Date:   Mon Feb 24 13:09:47 2014 -0500

    .gnumeric: don't save a 0x0 size.

 ChangeLog           |    2 ++
 src/xml-sax-write.c |   11 +++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5a05cf9..32cde1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2014-02-24  Morten Welinder  <terra gnome org>
 
+       * src/xml-sax-write.c (xml_write_geometry): Don't output a 0x0 size.
+
        * src/colrow.c (colrow_equal): Don't use floating-point equality
        here.  Allow a difference of 1e-5 pt for size.
 
diff --git a/src/xml-sax-write.c b/src/xml-sax-write.c
index 48ce084..47667e1 100644
--- a/src/xml-sax-write.c
+++ b/src/xml-sax-write.c
@@ -254,10 +254,13 @@ xml_write_named_expressions (GnmOutputXML *state, GnmNamedExprCollection *scope)
 static void
 xml_write_geometry (GnmOutputXML *state)
 {
-       gsf_xml_out_start_element (state->output, GNM "Geometry");
-       gsf_xml_out_add_int (state->output, "Width", state->wb_view->preferred_width);
-       gsf_xml_out_add_int (state->output, "Height", state->wb_view->preferred_height);
-       gsf_xml_out_end_element (state->output); /* </gnm:Geometry> */
+       if (state->wb_view->preferred_width > 0 ||
+           state->wb_view->preferred_height > 0) {
+               gsf_xml_out_start_element (state->output, GNM "Geometry");
+               gsf_xml_out_add_int (state->output, "Width", state->wb_view->preferred_width);
+               gsf_xml_out_add_int (state->output, "Height", state->wb_view->preferred_height);
+               gsf_xml_out_end_element (state->output); /* </gnm:Geometry> */
+       }
 }
 
 static void


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