From: gouldtj Date: Mon, 30 Jan 2006 05:12:10 +0000 (+0000) Subject: r10818@tres: ted | 2006-01-29 16:08:07 -0800 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f39e9c184bc2208c6a3c05cb4f90d337442756cd;p=inkscape.git r10818@tres: ted | 2006-01-29 16:08:07 -0800 Whoo hoo, we do submenus now too! --- diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 1d0c4c4af..f88833ec4 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -68,6 +68,7 @@ Effect::merge_menu (Inkscape::XML::Node * base, Inkscape::XML::Node * mergee) { Glib::ustring mergename; Inkscape::XML::Node * tomerge = NULL; + Inkscape::XML::Node * submenu = NULL; /* printf("Merge menu with '%s' '%s' '%s'\n", base != NULL ? base->name() : "NULL", @@ -89,8 +90,7 @@ Effect::merge_menu (Inkscape::XML::Node * base, mergename = _(menuname); } - base->appendChild(tomerge); - Inkscape::GC::release(tomerge); + int position = -1; if (start != NULL) { Inkscape::XML::Node * menupass; @@ -116,15 +116,31 @@ Effect::merge_menu (Inkscape::XML::Node * base, Glib::ustring compare(_(compare_char)); + if (mergename == compare) { + Inkscape::GC::release(tomerge); + tomerge = NULL; + submenu = menupass; + break; + } + if (mergename < compare) { - tomerge->setPosition(menupass->position()); + position = menupass->position(); break; } } // for menu items } // start != NULL + if (tomerge != NULL) { + base->appendChild(tomerge); + Inkscape::GC::release(tomerge); + if (position != -1) + tomerge->setPosition(position); + } + if (patern != NULL) { - merge_menu(tomerge, tomerge->firstChild(), patern->firstChild(), mergee); + if (submenu == NULL) + submenu = tomerge; + merge_menu(submenu, submenu->firstChild(), patern->firstChild(), mergee); } return;