[gnumeric] Fix column and row header display under Quartz. [#600085]



commit b174e6b38505373c2f6ded38a057a1994c7ef67a
Author: Andreas J. Guelzow <aguelzow math concordia ab ca>
Date:   Fri Mar 19 09:17:47 2010 -0600

     Fix column and row header display under Quartz. [#600085]
    
    2010-03-13 Andreas J. Guelzow <aguelzow pyrshep ca>
    
    	* src/item-bar.c (item_bar_calc_size): use pango_itemize to create
    	  PangoItem and PangoAnalysis
    	(item_bar_init): initialize pango.item to NULL

 ChangeLog      |    6 ++++++
 NEWS           |    4 +++-
 src/item-bar.c |   27 +++++++++++++++++----------
 3 files changed, 26 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b408618..f0765ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-03-13 Andreas J. Guelzow <aguelzow pyrshep ca>
 
+	* src/item-bar.c (item_bar_calc_size): use pango_itemize to create
+	  PangoItem and PangoAnalysis
+	(item_bar_init): initialize pango.item to NULL
+
+2010-03-13 Andreas J. Guelzow <aguelzow pyrshep ca>
+
 	* src/wbc-gtk-actions.c (wbc_gtk_init_actions): move disabling
 	  of solver menu item from here to
 	* src/wbc-gtk.c (wbc_gtk_init): here
diff --git a/NEWS b/NEWS
index 5fdb1b8..da743be 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,9 @@ Gnumeric 1.10.2
 
 Andreas:
 
-	* fix build with --disable-solver. [#612820]
+	* Fix build with --disable-solver. [#612820]
+	* Fix column and row header display under Quartz. [#600085]
+
 Morten:
 	* Improve object sizing tooltip positioning a bit.
 	* Fix filter critical.  [#611073]
diff --git a/src/item-bar.c b/src/item-bar.c
index 5c46ae6..7afd632 100644
--- a/src/item-bar.c
+++ b/src/item-bar.c
@@ -114,6 +114,8 @@ item_bar_calc_size (ItemBar *ib)
 	PangoLayout *layout;
 	PangoRectangle ink_rect, logical_rect;
 	gboolean const char_label = ib->is_col_header && !sheet->convs->r1c1_addresses;
+	GList *item_list;
+	PangoAttrList *attr_list;
 
 	ib_fonts_unref (ib);
 
@@ -153,19 +155,24 @@ item_bar_calc_size (ItemBar *ib)
 	pango_layout_get_extents (layout, NULL, &logical_rect);
 	ib->cell_width = 5 + 5 + PANGO_PIXELS (logical_rect.width);
 
-	pango_font_description_free (desc);
-	g_object_unref (layout);
+	attr_list = pango_attr_list_new ();
+	pango_attr_list_insert (attr_list, pango_attr_font_desc_new (desc));
+	item_list = pango_itemize (context, "A", 0, 1, attr_list, NULL);
+	pango_attr_list_unref (attr_list);
+
+	ib->pango.item = item_list->data;
+	item_list->data = NULL;
+
+	if (item_list->next != NULL)
+	  g_warning ("Leaking pango items");
 
-	ib->pango.item->analysis.font = g_object_ref (ib->normal_font);
-	ib->pango.item->analysis.language =
-		pango_context_get_language (context);
-	ib->pango.item->analysis.shape_engine =
-		pango_font_find_shaper (ib->normal_font,
-					ib->pango.item->analysis.language,
-					'A');
+	g_list_free (item_list);
 
 	ib->indent = ib_compute_pixels_from_indent (sheet, ib->is_col_header);
 
+	pango_font_description_free (desc);
+	g_object_unref (layout);
+
 	return ib->indent +
 		(ib->is_col_header ? ib->cell_height : ib->cell_width);
 }
@@ -1086,7 +1093,7 @@ item_bar_init (ItemBar *ib)
 
 	ib->colrow_being_resized = -1;
 	ib->has_resize_guides = FALSE;
-	ib->pango.item = pango_item_new ();
+	ib->pango.item = NULL;
 	ib->pango.glyphs = pango_glyph_string_new ();
 }
 



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