diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2007-03-13 22:22:36 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2007-03-13 22:22:36 +0000 |
| commit | 63eb21544d2846b5c1bcb72639aa52d2f1fee586 (patch) | |
| tree | a647851dd80fbefdd50fac1a3b0968132f34b0a0 /src/extension/paramradiobutton.cpp | |
| parent | fix 1659445 without unfixing 1595030 (diff) | |
| download | inkscape-63eb21544d2846b5c1bcb72639aa52d2f1fee586.tar.gz inkscape-63eb21544d2846b5c1bcb72639aa52d2f1fee586.zip | |
Fixed [ 1678374 ]; hopefully made the optiongroup code more robust for different INX definitions.
(bzr r2637)
Diffstat (limited to 'src/extension/paramradiobutton.cpp')
| -rw-r--r-- | src/extension/paramradiobutton.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/extension/paramradiobutton.cpp b/src/extension/paramradiobutton.cpp index 3ca051f14..94270af84 100644 --- a/src/extension/paramradiobutton.cpp +++ b/src/extension/paramradiobutton.cpp @@ -77,10 +77,16 @@ ParamRadioButton::ParamRadioButton (const gchar * name, const gchar * guitext, c const char * contents = sp_repr_children(child_repr)->content(); if (contents != NULL) newguitext = new Glib::ustring(contents); + else + continue; + const char * val = child_repr->attribute("value"); if (val != NULL) newvalue = new Glib::ustring(val); - if ( (newguitext) && (newvalue) ) { + else + newvalue = new Glib::ustring(*newguitext); + + if ( (newguitext) && (newvalue) ) { // logical error if this is not true here choices = g_slist_append( choices, new optionentry(newvalue, newguitext) ); } } @@ -91,10 +97,10 @@ ParamRadioButton::ParamRadioButton (const gchar * name, const gchar * guitext, c // Initialize _value with the default value from xml // for simplicity : default to the contents of the first xml-child const char * defaultval = NULL; - if (sp_repr_children(sp_repr_children(xml)) != NULL) - defaultval = sp_repr_children(xml)->attribute("value"); + if (choices) + defaultval = ((optionentry*) choices->data)->value->c_str(); - gchar * pref_name = this->pref_name(); + gchar * pref_name = this->pref_name(); const gchar * paramval = prefs_get_string_attribute(PREF_DIR, pref_name); g_free(pref_name); |
