[gnumeric] xlsx: place headerfooter in the right place. Excel cares.



commit cca094a8e7eb6f16d0ed1030c49f99d2212f74fe
Author: Morten Welinder <terra gnome org>
Date:   Sun Feb 23 15:06:18 2014 -0500

    xlsx: place headerfooter in the right place.  Excel cares.

 plugins/excel/ChangeLog    |    5 +++++
 plugins/excel/xlsx-write.c |   12 ++++++------
 2 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 858a437..5d5e93a 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-23  Morten Welinder  <terra gnome org>
+
+       * xlsx-write.c (xlsx_write_print_info): headerFooter before page
+       breaks.  Evidently Excel cares.
+
 2014-02-22  Morten Welinder  <terra gnome org>
 
        * ms-biff.c (ms_biff_query_next): Handle BIFF_CONTINUE for a whole
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 66fb1c6..439f390 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -1989,7 +1989,7 @@ xlsx_write_print_info_hf1 (GString *res, const char *s, const char *section)
 #endif
        };
 
-       if (!s)
+       if (!s || *s == 0)
                return;
 
        g_string_append (res, section);
@@ -2151,15 +2151,15 @@ xlsx_write_print_info (XLSXWriteState *state, GsfXMLOut *xml)
 
        gsf_xml_out_end_element (xml); /* </pageSetup> */
 
-       if (NULL != pi->page_breaks.v)
-               xlsx_write_breaks (state, xml, pi->page_breaks.v);
-       if (NULL != pi->page_breaks.h)
-               xlsx_write_breaks (state, xml, pi->page_breaks.h);
-
        gsf_xml_out_start_element (xml, "headerFooter");
        xlsx_write_print_info_hf (state, xml, pi->header, "oddHeader");
        xlsx_write_print_info_hf (state, xml, pi->footer, "oddFooter");
        gsf_xml_out_end_element (xml); /* </headerFooter> */
+
+       if (NULL != pi->page_breaks.v)
+               xlsx_write_breaks (state, xml, pi->page_breaks.v);
+       if (NULL != pi->page_breaks.h)
+               xlsx_write_breaks (state, xml, pi->page_breaks.h);
 }
 
 /**********************************************************************/


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