diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-16 23:25:30 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-16 23:25:30 +0000 |
| commit | e0c8791758a7295b3c987234e3ec1aacce006fc1 (patch) | |
| tree | 521d52b7a5b64dba3015ee522d80d12c83792ec2 /src/ui | |
| parent | Fix last bug pointed by Eduard Brawn in MR 126 (diff) | |
| download | inkscape-e0c8791758a7295b3c987234e3ec1aacce006fc1.tar.gz inkscape-e0c8791758a7295b3c987234e3ec1aacce006fc1.zip | |
Fix a bug pointed by suv when the title of a symbol has duplicates
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index c552a0bba..609edee2e 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -434,8 +434,8 @@ void SymbolsDialog::rebuild() { //We are not in search all docs if (search->get_text() != _("Searching...") && - search->get_text() != _("Loading all symbols...") && - search->get_text() != _("Searching....") ) + search->get_text() != _("Loading all symbols...") && + search->get_text() != _("Searching....") ) { search_str = ""; search->set_text(""); @@ -572,17 +572,17 @@ SPDocument* SymbolsDialog::selectedSymbols() { SPDocument* symbol_document = symbol_sets[doc_title]; if( !symbol_document ) { symbol_document = getSymbolsSet(doc_title).second; - } - // Symbol must be from Current Document (this method of checking should be language independent). - if( !symbol_document ) { - // Symbol must be from Current Document (this method of - // checking should be language independent). - symbol_document = current_document; - add_symbol->set_sensitive( true ); - remove_symbol->set_sensitive( true ); - } else { - add_symbol->set_sensitive( false ); - remove_symbol->set_sensitive( false ); + // Symbol must be from Current Document (this method of checking should be language independent). + if( !symbol_document ) { + // Symbol must be from Current Document (this method of + // checking should be language independent). + symbol_document = current_document; + add_symbol->set_sensitive( true ); + remove_symbol->set_sensitive( true ); + } else { + add_symbol->set_sensitive( false ); + remove_symbol->set_sensitive( false ); + } } return symbol_document; } @@ -890,9 +890,18 @@ void SymbolsDialog::symbolsInDocRecursive (SPObject *r, std::map<Glib::ustring, if(r->title()) { Glib::ustring current = symbol_set->get_active_text(); if (current == ALLDOCS) { - l[doc_title + r->title()] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); + if (l.count(doc_title + r->title()) > 0) { + l[doc_title + r->title() + Glib::ustring("_") + r->getId()] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); + } else { + l[doc_title + r->title()] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); + } } else { - l[r->title()] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); + if (l.count(r->title()) > 0) { + l[r->title() + Glib::ustring("_") + r->getId()] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); + } else { + l[r->title()] = std::make_pair(doc_title,dynamic_cast<SPSymbol *>(r)); + } + } } else { Glib::ustring id = r->getAttribute("id"); |
