gnumeric r17198 - in trunk: . plugins/excel



Author: mortenw
Date: Sat Mar 14 13:06:41 2009
New Revision: 17198
URL: http://svn.gnome.org/viewvc/gnumeric?rev=17198&view=rev

Log:
2009-03-14  Morten Welinder  <terra gnome org>

	* ms-excel-write.c (excel_font_from_go_font): Don't crash if the
	font descriptor lacks a family.  Part of #575318.



Modified:
   trunk/NEWS
   trunk/plugins/excel/ChangeLog
   trunk/plugins/excel/ms-excel-write.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Sat Mar 14 13:06:41 2009
@@ -28,6 +28,7 @@
 	[Part of #364291]
 	* Fix lotus importer crash.  [#575190]
 	* Improve entry of date for locales not using slashes.  [Part of #33229]
+	* Fix xls writing crash.  [Part of #575318]
 
 Sum1:
 	* Implement OOO probing.  [#574381]

Modified: trunk/plugins/excel/ms-excel-write.c
==============================================================================
--- trunk/plugins/excel/ms-excel-write.c	(original)
+++ trunk/plugins/excel/ms-excel-write.c	Sat Mar 14 13:06:41 2009
@@ -2112,6 +2112,11 @@
 
 	efont = g_new (ExcelWriteFont, 1);
 	efont->font_name	= pango_font_description_get_family (font->desc);
+	if (!efont->font_name) {
+		/* Shouldn't happen, but don't crash.   575318*/
+		efont->font_name = "Sans";
+	}
+
 	efont->font_name_copy	= NULL;
 	efont->size_pts		= (double) pango_font_description_get_size (font->desc) / PANGO_SCALE;
 	efont->is_bold		= pango_font_description_get_weight (font->desc) > PANGO_WEIGHT_NORMAL;



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