diff options
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/styledialog.cpp | 8 | ||||
| -rw-r--r-- | src/ui/interface.cpp | 14 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp index 4576671e7..b1bcddd45 100644 --- a/src/ui/dialog/styledialog.cpp +++ b/src/ui/dialog/styledialog.cpp @@ -355,6 +355,12 @@ void StyleDialog::_readStyleElement() // Remove end-of-lines (check it works on Windoze). content.erase(std::remove(content.begin(), content.end(), '\n'), content.end()); + // Remove comments (/* xxx */) + while(content.find("/*") != std::string::npos) { + size_t start = content.find("/*"); + content.erase(start, (content.find("*/", start) - start) +2); + } + // First split into selector/value chunks. // An attempt to use Glib::Regex failed. A C++11 version worked but // reportedly has problems on Windows. Using split_simple() is simpler @@ -787,7 +793,7 @@ void StyleDialog::_addSelector() * set to ".Class1" */ selectorValue = textEditPtr->get_text(); - Glib::ustring firstWord = selectorValue.substr(0, selectorValue.find(" ")); + Glib::ustring firstWord = selectorValue.substr(0, selectorValue.find_first_of(" >+~")); del->set_sensitive(true); diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp index 33e98a81c..7e80c1a2f 100644 --- a/src/ui/interface.cpp +++ b/src/ui/interface.cpp @@ -1438,6 +1438,13 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : AppendItemFromVerb(Inkscape::Verb::get(SP_VERB_EDIT_DELETE)); positionOfLastDialog = 10; // 9 in front + 1 for the separator in the next if; used to position the dialog menu entries below each other + /* Item menu */ + if (item!=NULL) { + AddSeparator(); + MakeObjectMenu(); + } + AddSeparator(); + /* Lock/Unock Hide/Unhide*/ Geom::Rect b(_desktop->point(),_desktop->point() + Geom::Point(1,1)); std::vector< SPItem * > down_items = _desktop->getDocument()->getItemsPartiallyInBox( _desktop->dkey, b, true, true); bool has_down_hidden = false; @@ -1450,7 +1457,6 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : has_down_locked = true; } } - AddSeparator(); Gtk::MenuItem* mi; mi = Gtk::manage(new Gtk::MenuItem(_("Hide selected objects"),1)); @@ -1484,12 +1490,6 @@ ContextMenu::ContextMenu(SPDesktop *desktop, SPItem *item) : } mi->show(); append(*mi);//insert(*mi,positionOfLastDialog++); - /* Item menu */ - if (item!=NULL) { - AddSeparator(); - MakeObjectMenu(); - } - AddSeparator(); /* layer menu */ SPGroup *group=NULL; if (item) { |
