[gnumeric] Read rich-text font-size from ODF files. [part of #759983]



commit 2a41bb590fbbf78c430c2e2c4357d7a5387db409
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Tue Dec 29 21:38:00 2015 -0700

    Read rich-text font-size from ODF files. [part of #759983]
    
    2015-12-29  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (od_style_prop_text): read font-size

 NEWS                                 |    3 +++
 plugins/openoffice/ChangeLog         |    4 ++++
 plugins/openoffice/openoffice-read.c |    8 +++++++-
 3 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 3c23620..df806f4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 Gnumeric 1.12.27
 
+Andreas:
+       * Read rich-text font-size from ODF files. [part of #759983]
+
 Morten:
        * Teach ssconvert to split sheets into separate .txt files [#694408]
 
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 5c99d69..aaf352f 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-29  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (od_style_prop_text): read font-size
+
 2015-12-28  Morten Welinder <terra gnome org>
 
        * Release 1.12.26
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index d0ac5dd..4d7fe6b 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -7598,6 +7598,7 @@ od_style_prop_text (GsfXMLIn *xin, xmlChar const **attrs)
        OOParseState *state = (OOParseState *)xin->user_state;
        PangoAttribute *attr;
        int       tmp;
+       gnm_float size = -1.0;
        int underline_type = 0;
        int underline_style = 0;
        gboolean underline_bold = FALSE;
@@ -7605,7 +7606,12 @@ od_style_prop_text (GsfXMLIn *xin, xmlChar const **attrs)
 
        g_return_if_fail (state->cur_style.text != NULL);
        for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
-               if (oo_attr_font_weight (xin, attrs, &tmp)) {
+               if (NULL != oo_attr_distance (xin, attrs, OO_NS_FO, "font-size", &size) && size >= 0.) {
+                       attr = pango_attr_size_new ((int) gnm_floor (size * PANGO_SCALE + 0.5));
+                       attr->start_index = 0;
+                       attr->end_index = 0;
+                       pango_attr_list_insert (state->cur_style.text, attr);                   ;
+               } else if (oo_attr_font_weight (xin, attrs, &tmp)) {
                        attr = pango_attr_weight_new (tmp);
                        attr->start_index = 0;
                        attr->end_index = 0;


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