[gnumeric] make all superscript/subscripts consistent
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] make all superscript/subscripts consistent
- Date: Sat, 22 Oct 2011 19:08:45 +0000 (UTC)
commit 3964235f6353a403490736e06029021ebc5d8321
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Sat Oct 22 13:08:06 2011 -0600
make all superscript/subscripts consistent
2011-10-22 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/mstyle.c (gnm_style_get_pango_attrs): use new goffice
defines for super/subscripts
* src/wbc-gtk-actions.c (toggle_font_attr): ditto
ChangeLog | 6 ++++++
src/mstyle.c | 8 ++++----
src/wbc-gtk-actions.c | 27 ++++++++++++++++++++++-----
3 files changed, 32 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 99a1b03..9b6563f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-22 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * src/mstyle.c (gnm_style_get_pango_attrs): use new goffice
+ defines for super/subscripts
+ * src/wbc-gtk-actions.c (toggle_font_attr): ditto
+
2011-10-21 Andreas J. Guelzow <aguelzow pyrshep ca>
* schemas/org.gnome.gnumeric.gschema.xml.in.in: updated
diff --git a/src/mstyle.c b/src/mstyle.c
index 15e8082..9b79987 100644
--- a/src/mstyle.c
+++ b/src/mstyle.c
@@ -1685,12 +1685,12 @@ gnm_style_get_pango_attrs (GnmStyle const *style,
case GO_FONT_SCRIPT_STANDARD :
break;
case GO_FONT_SCRIPT_SUB :
- add_attr (l, pango_attr_rise_new (-5000));
- zoom *= .5;
+ add_attr (l, pango_attr_rise_new (GO_SUBSCRIPT_RISE));
+ zoom *= GO_SUBSCRIPT_SCALE;
break;
case GO_FONT_SCRIPT_SUPER :
- add_attr (l, pango_attr_rise_new (5000));
- zoom *= .5;
+ add_attr (l, pango_attr_rise_new (GO_SUPERSCRIPT_RISE));
+ zoom *= GO_SUPERSCRIPT_SCALE;
}
{
diff --git a/src/wbc-gtk-actions.c b/src/wbc-gtk-actions.c
index f198ac9..a6c08a2 100644
--- a/src/wbc-gtk-actions.c
+++ b/src/wbc-gtk-actions.c
@@ -1622,11 +1622,28 @@ toggle_font_attr (WBCGtk *wbcg, GtkToggleAction *act,
attr = pango_attr_strikethrough_new (val);
break;
case MSTYLE_FONT_SCRIPT:
- if (val == GO_FONT_SCRIPT_STANDARD)
- wbcg_edit_add_markup (wbcg, pango_attr_scale_new (1.));
- else
- wbcg_edit_add_markup (wbcg, pango_attr_scale_new (0.75));
- attr = pango_attr_rise_new (5000 * val);
+ switch (val) {
+ default:
+ case GO_FONT_SCRIPT_STANDARD:
+ wbcg_edit_add_markup
+ (wbcg, pango_attr_scale_new (1.));
+ attr = pango_attr_rise_new (0);
+ break;
+ case GO_FONT_SCRIPT_SUPER:
+ wbcg_edit_add_markup
+ (wbcg, pango_attr_scale_new
+ (GO_SUPERSCRIPT_SCALE));
+ attr = pango_attr_rise_new
+ (GO_SUPERSCRIPT_RISE);
+ break;
+ case GO_FONT_SCRIPT_SUB:
+ wbcg_edit_add_markup
+ (wbcg, pango_attr_scale_new
+ (GO_SUBSCRIPT_SCALE));
+ attr = pango_attr_rise_new
+ (GO_SUBSCRIPT_RISE);
+ break;
+ }
break;
}
wbcg_edit_add_markup (wbcg, attr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]