diff options
| author | Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> | 2019-10-01 00:03:59 +0000 |
|---|---|---|
| committer | Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> | 2019-10-01 00:03:59 +0000 |
| commit | f539fd5733969477b9e6d9ac50c6c139cc3ff7b2 (patch) | |
| tree | 65382961d74ba8e2b74d08d5e665f42f1f970a56 /src/document.cpp | |
| parent | Reduce memory leak when dragging selection (diff) | |
| download | inkscape-f539fd5733969477b9e6d9ac50c6c139cc3ff7b2.tar.gz inkscape-f539fd5733969477b9e6d9ac50c6c139cc3ff7b2.zip | |
Allow duplication of objects with empty ids
.
Diffstat (limited to 'src/document.cpp')
| -rw-r--r-- | src/document.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/document.cpp b/src/document.cpp index c08e5b554..e1f621f9e 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -992,20 +992,16 @@ void SPDocument::bindObjectToId(gchar const *id, SPObject *object) { SPObject *SPDocument::getObjectById(Glib::ustring const &id) const { - if (id.empty() || iddef.empty()) { - return nullptr; + if (iddef.empty()) { + return nullptr; } std::map<std::string, SPObject *>::const_iterator rv = iddef.find(id); - if(rv != iddef.end()) - { + if (rv != iddef.end()) { return (rv->second); - } - else - { + } else { return nullptr; } - return getObjectById( id ); } SPObject *SPDocument::getObjectById(gchar const *id) const |
