some additions to pR 1794:

add a special XMLAttributeError class to indicate an error when accessing a missing attribute
in PropertyContainer::Restore make error handling more flexible
This commit is contained in:
wmayer
2018-11-19 19:07:56 +01:00
parent 7216dba2f3
commit ddb20468ad
7 changed files with 71 additions and 19 deletions

View File

@@ -1581,7 +1581,7 @@ Document::readObjects(Base::XMLReader& reader)
pObj->setStatus(ObjectStatus::Restore, false);
if(reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestoreInDocumentObject)) {
if (reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestoreInDocumentObject)) {
Base::Console().Error("Object \"%s\" was subject to a partial restore. As a result geometry may have changed or be incomplete.\n",name.c_str());
reader.clearPartialRestoreDocumentObject();
}
@@ -1882,7 +1882,7 @@ void Document::restore (void)
GetApplication().signalFinishRestoreDocument(*this);
setStatus(Document::Restoring, false);
if(reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestore)) {
if (reader.testStatus(Base::XMLReader::ReaderStatus::PartialRestore)) {
setStatus(Document::PartialRestore, true);
Base::Console().Error("There were errors while loading the file. Some data might have been modified or not recovered at all. Look above for more specific information about the objects involved.\n");
}