[gnumeric] Fix export/import of scaling information to/from ODF.



commit cce1fca59dac700d99f086da0c0a0dd5d9900813
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Mon Aug 29 10:40:46 2016 -0600

    Fix export/import of scaling information to/from ODF.
    
    2016-08-29  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_page_layout_properties): scaling.percentage.? is in the range 0..100
        * openoffice-write.c (odf_write_page_layout): scaling.percentage.? is in the range 0..100

 NEWS                                  |    3 +++
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-read.c  |    2 +-
 plugins/openoffice/openoffice-write.c |    2 +-
 4 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index a6911ae..02e6cb9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.12.33
 
+Andreas:
+       * Fix export/import of scaling information to/from ODF.
+
 Morten:
        * Speed up sstest part of test suite.
        * Bring documentation build into the 21 century.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 4ebc33c..0b3b365 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2016-08-29  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (odf_page_layout_properties): scaling.percentage.? is in the range 0..100
+       * openoffice-write.c (odf_write_page_layout): scaling.percentage.? is in the range 0..100
+
 2016-08-20  Morten Welinder <terra gnome org>
 
        * Release 1.12.32
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 43357de..45c2af6 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -5918,7 +5918,7 @@ odf_page_layout_properties (GsfXMLIn *xin, xmlChar const **attrs)
                pi->scaling.type = PRINT_SCALE_FIT_PAGES;
        } else {
                pi->scaling.type = PRINT_SCALE_PERCENTAGE;
-               pi->scaling.percentage.x = pi->scaling.percentage.y = scale_to;
+               pi->scaling.percentage.x = pi->scaling.percentage.y = scale_to * 100;
        }
 
        if (gnm_style_print && pi->comment_placement != GNM_PRINT_COMMENTS_NONE)
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 390f794..cb65054 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -5649,7 +5649,7 @@ odf_write_page_layout (GnmOOExport *state, GnmPrintInformation *pi,
                break;
        }
        case PRINT_SCALE_PERCENTAGE:
-               odf_add_percent (state->xml, STYLE "scale-to", pi->scaling.percentage.x);
+               odf_add_percent (state->xml, STYLE "scale-to", pi->scaling.percentage.x/100);
                break;
        default:
                odf_add_percent (state->xml, STYLE "scale-to", 1.);


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