Code

fix 1520018: sync up the embed/not embed transform logic when ungrouping with that...
[inkscape.git] / src / extension / paramnotebook.cpp
index eb568ac45b7524aabd8b4dc2488691d3f1fcaa47..cd8bddcaa0e435ceb59de3bafaa41d08922bd448 100644 (file)
@@ -47,7 +47,7 @@ private:
     GSList * parameters; /**< A table to store the parameters for this page.\r
                               This only gets created if there are parameters on this\r
                               page */\r
-    Gtk::Tooltips _tooltips;\r
+    Gtk::Tooltips _tooltips;\r
     \r
 public:\r
     static ParamNotebookPage * makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext);\r
@@ -65,19 +65,18 @@ ParamNotebookPage::ParamNotebookPage (const gchar * name, const gchar * guitext,
     Parameter(name, guitext, desc, scope, ext)\r
 {\r
     parameters = NULL;\r
-    \r
+        \r
     // Read XML to build page\r
     if (xml != NULL) {\r
         Inkscape::XML::Node *child_repr = sp_repr_children(xml);\r
         while (child_repr != NULL) {\r
             char const * chname = child_repr->name();\r
-            if (chname[0] == '_') /* Allow _ for translation of tags */\r
+            if (chname[0] == '_') // Allow _ for translation of tags\r
                 chname++;\r
             if (!strcmp(chname, "param") || !strcmp(chname, "_param")) {\r
                 Parameter * param;\r
                 param = Parameter::make(child_repr, ext);\r
-                if (param != NULL)\r
-                    parameters = g_slist_append(parameters, param);\r
+                if (param != NULL) parameters = g_slist_append(parameters, param);\r
             }\r
             child_repr = sp_repr_next(child_repr);\r
         }\r
@@ -88,6 +87,7 @@ ParamNotebookPage::ParamNotebookPage (const gchar * name, const gchar * guitext,
 \r
 ParamNotebookPage::~ParamNotebookPage (void)\r
 {\r
+    if (_tooltips) delete _tooltips;\r
     //destroy parameters\r
     for (GSList * list = parameters; list != NULL; list = g_slist_next(list)) {\r
         Parameter * param = reinterpret_cast<Parameter *>(list->data);\r
@@ -188,7 +188,9 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension:
 */\r
 Gtk::Widget *\r
 ParamNotebookPage::get_widget (SPDocument * doc, Inkscape::XML::Node * node)\r
-{\r
+{                      \r
+    if (!_tooltips) _tooltips = new Gtk::Tooltips();\r
+    \r
     Gtk::VBox * vbox = Gtk::manage(new Gtk::VBox);\r
     vbox->set_border_width(5);  \r
     \r
@@ -200,8 +202,7 @@ ParamNotebookPage::get_widget (SPDocument * doc, Inkscape::XML::Node * node)
         \r
         vbox->pack_start(*widg, true, true, 2);\r
         if (tip != NULL) {\r
-            _tooltips.set_tip(*widg, Glib::ustring(tip));\r
-            // printf("Setting tooltip: %s\n", tooltip);\r
+            _tooltips->set_tip(*widg, Glib::ustring(tip));\r
         }\r
     }\r
         \r
@@ -224,12 +225,11 @@ ParamNotebook::ParamNotebook (const gchar * name, const gchar * guitext, const g
     pages = NULL;\r
     \r
     // Read XML tree to add pages:\r
-    // printf("Extension Constructor: ");\r
     if (xml != NULL) {\r
         Inkscape::XML::Node *child_repr = sp_repr_children(xml);\r
         while (child_repr != NULL) {\r
             char const * chname = child_repr->name();\r
-            if (chname[0] == '_') /* Allow _ for translation of tags */\r
+            if (chname[0] == '_') // Allow _ for translation of tags\r
                 chname++;\r
             if (!strcmp(chname, "page")) {\r
                 ParamNotebookPage * page;\r