nemiver r716 - in trunk: . src/uicommon



Author: jjongsma
Date: Thu Jan 31 04:50:44 2008
New Revision: 716
URL: http://svn.gnome.org/viewvc/nemiver?rev=716&view=rev

Log:
	* src/uicommon/nmv-hex-editor.cc: Fix crash in the memory view on startup
	when the specified font description doesn't match any actual fonts (e.g. if
	the 'custom-font-name' gconf key is blank).  Fixes Bug #512845


Modified:
   trunk/ChangeLog
   trunk/src/uicommon/nmv-hex-editor.cc

Modified: trunk/src/uicommon/nmv-hex-editor.cc
==============================================================================
--- trunk/src/uicommon/nmv-hex-editor.cc	(original)
+++ trunk/src/uicommon/nmv-hex-editor.cc	Thu Jan 31 04:50:44 2008
@@ -147,11 +147,13 @@
     Glib::RefPtr<Pango::Context> context =
         Glib::wrap (gdk_pango_context_get ());
     Glib::RefPtr<Pango::Font> new_font = context->load_font (a_desc);
-    Pango::FontMetrics new_metrics = new_font->get_metrics ();
+    if (new_font) {
+        Pango::FontMetrics new_metrics = new_font->get_metrics ();
 
-    gtk_hex_set_font (m_priv->hex.get (),
-            const_cast<PangoFontMetrics*>(new_metrics.gobj ()),
-            const_cast<PangoFontDescription*>(a_desc.gobj ()));
+        gtk_hex_set_font (m_priv->hex.get (),
+                const_cast<PangoFontMetrics*>(new_metrics.gobj ()),
+                const_cast<PangoFontDescription*>(a_desc.gobj ()));
+    }
 }
 
 



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