From f539fd5733969477b9e6d9ac50c6c139cc3ff7b2 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Tue, 1 Oct 2019 00:03:59 +0000 Subject: Allow duplication of objects with empty ids . --- src/document.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/document.cpp') 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::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 -- cgit v1.2.3