diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2011-10-28 19:41:31 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2011-10-28 19:41:31 +0000 |
| commit | efbfc732bbed46c3e615fcd88294a02ee98b7530 (patch) | |
| tree | 13f5812e3c192ba8cce4b174c798bc12ffad4c1a /src/extension/param/parameter.cpp | |
| parent | fix initialization. add todo comment about gui-hidden not being used. (diff) | |
| download | inkscape-efbfc732bbed46c3e615fcd88294a02ee98b7530.tar.gz inkscape-efbfc732bbed46c3e615fcd88294a02ee98b7530.zip | |
one constructor cannot call the other to initialize the object. See C++faq-lite 10.3
(bzr r10699)
Diffstat (limited to 'src/extension/param/parameter.cpp')
| -rw-r--r-- | src/extension/param/parameter.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 0a88fdda8..106cd76a6 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -307,11 +307,27 @@ Parameter::Parameter (const gchar * name, const gchar * guitext, const gchar * d _gui_tip = g_strdup(gui_tip); } + if (guitext != NULL) { + _text = g_strdup(guitext); + } else { + _text = g_strdup(name); + } + + return; +} - if (guitext != NULL) +/** \brief Oop, now that we need a parameter, we need it's name. */ +Parameter::Parameter (const gchar * name, const gchar * guitext, Inkscape::Extension::Extension * ext) : + extension(ext), _name(NULL), _desc(NULL), _scope(Parameter::SCOPE_USER), _text(NULL), _gui_hidden(false), _gui_tip(NULL) +{ + if (name != NULL) { + _name = g_strdup(name); + } + if (guitext != NULL) { _text = g_strdup(guitext); - else + } else { _text = g_strdup(name); + } return; } |
