[gnumeric] Fix xlsx export of scale to page information. [#776196]



commit efe0131a9e3f6a737aeac1283ea829e63a261e35
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Tue Jan 3 15:30:13 2017 -0700

    Fix xlsx export of scale to page information. [#776196]
    
    2017-01-03  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * xlsx-read.c (xlsx_CT_PageSetup): the default for fitTo* is 1
        * xlsx-write.c (xlsx_write_print_info):  the default for fitTo* is 1

 NEWS                       |    1 +
 plugins/excel/ChangeLog    |    5 +++++
 plugins/excel/xlsx-read.c  |    3 +++
 plugins/excel/xlsx-write.c |    4 ++--
 4 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 5aebaf0..dfa6001 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Gnumeric 1.12.33
 Andreas:
        * Fix export/import of scaling information to/from ODF.
        * Fix Wilcoxon Signed Rank Test handling of ties. [#772718]
+       * Fix xlsx export of scale to page information. [#776196]
 
 Morten:
        * Speed up sstest part of test suite.
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 1ac7cb5..122fff5 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-03  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * xlsx-read.c (xlsx_CT_PageSetup): the default for fitTo* is 1
+       * xlsx-write.c (xlsx_write_print_info):  the default for fitTo* is 1
+
 2016-08-20  Morten Welinder <terra gnome org>
 
        * Release 1.12.32
diff --git a/plugins/excel/xlsx-read.c b/plugins/excel/xlsx-read.c
index 20975e5..d93a14f 100644
--- a/plugins/excel/xlsx-read.c
+++ b/plugins/excel/xlsx-read.c
@@ -1928,6 +1928,9 @@ xlsx_CT_PageSetup (GsfXMLIn *xin, xmlChar const **attrs)
 
        if (pi->page_setup == NULL)
                gnm_print_info_load_defaults (pi);
+       /* In xlsx the default is 1 not 0 */
+       pi->scaling.dim.rows = 1;
+       pi->scaling.dim.cols = 1;
 
        for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2) {
                if (attr_enum (xin, attrs, "orientation", orientation_types, &orient))
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index da354ed..0fe90ab 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -2607,9 +2607,9 @@ xlsx_write_print_info (XLSXWriteState *state, GsfXMLOut *xml)
        }
        if (pi->start_page >= 0)
                gsf_xml_out_add_int (xml, "firstPageNumber", pi->start_page);
-       if (pi->scaling.dim.rows > 0)
+       if (pi->scaling.dim.rows != 1)
                gsf_xml_out_add_int (xml, "fitToHeight", pi->scaling.dim.rows);
-       if (pi->scaling.dim.cols > 0)
+       if (pi->scaling.dim.cols != 1)
                gsf_xml_out_add_int (xml, "fitToWidth", pi->scaling.dim.cols);
        /* horizontalDpi skipped */
        /* id skipped */


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