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 ++++++++++++++++++-- src/extension/param/parameter.h | 4 +--- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'src') 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; } diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index e7a7538b7..ad07f5306 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -83,9 +83,7 @@ public: Inkscape::Extension::Extension * ext); Parameter (const gchar * name, const gchar * guitext, - Inkscape::Extension::Extension * ext) { - Parameter(name, guitext, NULL, Parameter::SCOPE_USER, false, NULL, ext); - }; + Inkscape::Extension::Extension * ext); virtual ~Parameter (void); bool get_bool (const SPDocument * doc, -- cgit v1.2.3