[gnumeric] Accept font weights in numerical form too.
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnumeric] Accept font weights in numerical form too.
- Date: Tue, 2 Jun 2009 03:37:57 -0400 (EDT)
commit faa30826a796a8ff5df3c09f2c0c6440fa45da24
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date: Tue Jun 2 01:37:11 2009 -0600
Accept font weights in numerical form too.
2009-06-02 Andreas J. Guelzow <aguelzow pyrshep ca>
* openoffice-read.c (oo_style_prop_cell): Also check font weight
rather than just descriptors.
---
plugins/openoffice/ChangeLog | 5 +++++
plugins/openoffice/openoffice-read.c | 8 ++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index aad5cfa..1e35c11 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,10 @@
2009-06-02 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * openoffice-read.c (oo_style_prop_cell): Also check font weight
+ rather than just descriptors.
+
+2009-06-02 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* openoffice-read.c (odf_map): new
(oo_date_style): only use our magic if the format source is still
set to language
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 594abf6..aeab3af 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -2183,8 +2183,12 @@ oo_style_prop_cell (GsfXMLIn *xin, xmlChar const **attrs)
gnm_style_set_font_uline (style, attr_eq (attrs[1], "none") ? UNDERLINE_NONE : UNDERLINE_SINGLE);
else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_FO, "font-style"))
gnm_style_set_font_italic (style, attr_eq (attrs[1], "italic"));
- else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_FO, "font-weight"))
- gnm_style_set_font_bold (style, attr_eq (attrs[1], "bold"));
+ else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_FO, "font-weight")) {
+ int weight = atoi (CXML2C (attrs[1]));
+ if (attr_eq (attrs[1], "bold"))
+ weight = 700;
+ gnm_style_set_font_bold (style, weight > PANGO_WEIGHT_MEDIUM);
+ }
#if 0
else if (!strcmp (attrs[0], OO_NS_FO, "font-weight")) {
gnm_style_set_font_bold (style, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]