From efbfc732bbed46c3e615fcd88294a02ee98b7530 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 28 Oct 2011 21:41:31 +0200 Subject: one constructor cannot call the other to initialize the object. See C++faq-lite 10.3 (bzr r10699) --- src/extension/param/parameter.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/extension/param/parameter.cpp') 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; } -- cgit v1.2.3