From 45922bee145584c0161fa89735da108ece53e0f5 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 28 May 2014 11:11:31 +0200 Subject: Initialize style store with default styles. Fixes Gtk-CRITICAL and GLib-Gobject-CRITICAL errors. (bzr r13341.1.40) --- src/libnrtype/font-lister.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index 98589d9d7..300273378 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -83,6 +83,15 @@ namespace Inkscape font_list_store->thaw_notify(); style_list_store = Gtk::ListStore::create (FontStyleList); + + // Initialize style store with defaults + style_list_store->freeze_notify(); + style_list_store->clear(); + for (GList *l=default_styles; l; l = l->next) { + Gtk::TreeModel::iterator treeModelIter = style_list_store->append(); + (*treeModelIter)[FontStyleList.styles] = (char*)l->data; + } + style_list_store->thaw_notify(); } // Example of how to use "foreach_iter" -- cgit v1.2.3