[gnumeric] Format Dialog: fix multihead problem.



commit ee43e6b97e958b815cfb117d5939715d53aee5c5
Author: Morten Welinder <terra gnome org>
Date:   Fri Dec 30 18:46:56 2011 -0500

    Format Dialog: fix multihead problem.

 NEWS                         |    1 +
 src/widgets/ChangeLog        |    5 +++++
 src/widgets/gnm-format-sel.c |    4 ++--
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index bd68cf8..e20a4ce 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Morten:
 	* Improve parsing on numbers with non-ascii digits.
 	* Make solver check for exceeding the time limit.
 	* Fix object life-cycle problems in solver.
+	* Fix multihead problem with format dialog.
 
 --------------------------------------------------------------------------
 Gnumeric 1.11.1
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index 1cfb527..af8ea86 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-30  Morten Welinder  <terra gnome org>
+
+	* gnm-format-sel.c (cb_generate_preview): Get the pango context
+	from the widget.
+
 2011-12-27  Jean Brefort  <jean brefort normalesup org>
 
 	* gnm-dao.c (gnm_dao_init), (gnm_dao_new): don't use GtkTable anymore.
diff --git a/src/widgets/gnm-format-sel.c b/src/widgets/gnm-format-sel.c
index 69f075c..86ebd1a 100644
--- a/src/widgets/gnm-format-sel.c
+++ b/src/widgets/gnm-format-sel.c
@@ -32,7 +32,8 @@ cb_generate_preview (GOFormatSel *gfs, PangoAttrList **attrs)
 		return NULL;
 	else {
 		GOFormat const *fmt = go_format_sel_get_fmt (gfs);
-		PangoContext *context = gnm_pango_context_get ();
+		GtkWidget *w = GTK_WIDGET (gfs);
+		PangoContext *context = gtk_widget_get_pango_context (w);
 		PangoLayout *layout = pango_layout_new (context);
 		char *str;
 		GOFormatNumberError err;
@@ -50,7 +51,6 @@ cb_generate_preview (GOFormatSel *gfs, PangoAttrList **attrs)
 			*attrs = pango_attr_list_ref (pango_layout_get_attributes (layout));
 		}
 		g_object_unref (layout);
-		g_object_unref (context);
 		return str;
 	}
 }



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