Skip to content

Commit

Permalink
App: improve document::readObjects()
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Sep 10, 2019
1 parent 4b0baba commit 5e42d48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App/Document.cpp
Expand Up @@ -1982,7 +1982,7 @@ Document::readObjects(Base::XMLReader& reader)
reader.readElement("Object");
std::string type = reader.getAttribute("type");
std::string name = reader.getAttribute("name");
const char *viewType = reader.hasAttribute("ViewType")?reader.getAttribute("ViewType"):0;
std::string viewType = reader.hasAttribute("ViewType")?reader.getAttribute("ViewType"):"";

bool partial = false;
if(d->partialLoadObjects.size()) {
Expand Down Expand Up @@ -2019,7 +2019,7 @@ Document::readObjects(Base::XMLReader& reader)
// otherwise we may cause a dependency to itself
// Example: Object 'Cut001' references object 'Cut' and removing the
// digits we make an object 'Cut' referencing itself.
App::DocumentObject* obj = addObject(type.c_str(), obj_name, /*isNew=*/ false, viewType, partial);
App::DocumentObject* obj = addObject(type.c_str(), obj_name, /*isNew=*/ false, viewType.c_str(), partial);
if (obj) {
if(lastId < obj->_Id)
lastId = obj->_Id;
Expand Down

0 comments on commit 5e42d48

Please sign in to comment.