diff --git a/src/App/Document.cpp b/src/App/Document.cpp index 753db48e9e..f4d4908256 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -1202,9 +1202,9 @@ void Document::Restore(Base::XMLReader &reader) string name = reader.getAttribute("name"); DocumentObject* pObj = getObject(name.c_str()); if (pObj) { // check if this feature has been registered - pObj->StatusBits.set(4); + pObj->setStatus(ObjectStatus::Restore, true); pObj->Restore(reader); - pObj->StatusBits.reset(4); + pObj->setStatus(ObjectStatus::Restore, false); } reader.readEndElement("Feature"); } @@ -1330,9 +1330,9 @@ Document::readObjects(Base::XMLReader& reader) std::string name = reader.getName(reader.getAttribute("name")); DocumentObject* pObj = getObject(name.c_str()); if (pObj) { // check if this feature has been registered - pObj->StatusBits.set(4); + pObj->setStatus(ObjectStatus::Restore, true); pObj->Restore(reader); - pObj->StatusBits.reset(4); + pObj->setStatus(ObjectStatus::Restore, false); } reader.readEndElement("Object"); } @@ -2203,7 +2203,7 @@ DocumentObject * Document::addObject(const char* sType, const char* pObjectName, } // mark the object as new (i.e. set status bit 2) and send the signal - pcObject->StatusBits.set(2); + pcObject->setStatus(ObjectStatus::New, true); signalNewObject(*pcObject); // do no transactions if we do a rollback! @@ -2287,7 +2287,7 @@ std::vector Document::addObjects(const char* sType, const std: } // mark the object as new (i.e. set status bit 2) and send the signal - pcObject->StatusBits.set(2); + pcObject->setStatus(ObjectStatus::New, true); signalNewObject(*pcObject); // do no transactions if we do a rollback! @@ -2338,7 +2338,7 @@ void Document::addObject(DocumentObject* pcObject, const char* pObjectName) pcObject->Label.setValue( ObjectName ); // mark the object as new (i.e. set status bit 2) and send the signal - pcObject->StatusBits.set(2); + pcObject->setStatus(ObjectStatus::New, true); signalNewObject(*pcObject); // do no transactions if we do a rollback! @@ -2391,13 +2391,13 @@ void Document::remObject(const char* sName) d->activeObject = 0; // Mark the object as about to be deleted - pos->second->StatusBits.set (ObjectStatus::Delete); + pos->second->setStatus(ObjectStatus::Delete, true); if (!d->undoing && !d->rollback) { pos->second->unsetupObject(); } signalDeletedObject(*(pos->second)); - pos->second->StatusBits.reset (ObjectStatus::Delete); // Unset the bit to be on the safe side + pos->second->setStatus(ObjectStatus::Delete, false); // Unset the bit to be on the safe side // do no transactions if we do a rollback! if (!d->rollback && d->activeUndoTransaction) { @@ -2468,13 +2468,13 @@ void Document::_remObject(DocumentObject* pcObject) d->activeObject = 0; // Mark the object as about to be deleted - pcObject->StatusBits.set (ObjectStatus::Delete); + pcObject->setStatus(ObjectStatus::Delete, true); if (!d->undoing && !d->rollback) { pcObject->unsetupObject(); } signalDeletedObject(*pcObject); // TODO Check me if it's needed (2015-09-01, Fat-Zer) - pcObject->StatusBits.reset (ObjectStatus::Delete); // Unset the bit to be on the safe side + pcObject->setStatus(ObjectStatus::Delete, false); // Unset the bit to be on the safe side //remove the tip if needed if (Tip.getValue() == pcObject) { diff --git a/src/App/DocumentObject.cpp b/src/App/DocumentObject.cpp index cce8557709..4198c42426 100644 --- a/src/App/DocumentObject.cpp +++ b/src/App/DocumentObject.cpp @@ -425,7 +425,7 @@ void DocumentObject::onChanged(const Property* prop) if (prop->getType() & Prop_Output) return; // set object touched - StatusBits.set(0); + StatusBits.set(ObjectStatus::Touch); } PyObject *DocumentObject::getPyObject(void) @@ -445,7 +445,7 @@ std::vector DocumentObject::getPySubObjects(const std::vector StatusBits; - void setError(void){StatusBits.set(1);} - void resetError(void){StatusBits.reset(1);} + void setError(void){StatusBits.set(ObjectStatus::Error);} + void resetError(void){StatusBits.reset(ObjectStatus::Error);} void setDocument(App::Document* doc); /// get called before the value is changed diff --git a/src/App/Property.cpp b/src/App/Property.cpp index fbfbc7a17a..aadacf2841 100644 --- a/src/App/Property.cpp +++ b/src/App/Property.cpp @@ -108,7 +108,7 @@ void Property::touch() { if (father) father->onChanged(this); - StatusBits.set(0); + StatusBits.set(Touched); } void Property::setReadOnly(bool readOnly) @@ -123,7 +123,7 @@ void Property::hasSetValue(void) { if (father) father->onChanged(this); - StatusBits.set(0); + StatusBits.set(Touched); } void Property::aboutToSetValue(void) diff --git a/src/App/Property.h b/src/App/Property.h index 43a1bbe912..b8daf080d8 100644 --- a/src/App/Property.h +++ b/src/App/Property.h @@ -122,11 +122,11 @@ public: void touch(); /// Test if this property is touched inline bool isTouched(void) const { - return StatusBits.test(0); + return StatusBits.test(Touched); } /// Reset this property touched inline void purgeTouched(void) { - StatusBits.reset(0); + StatusBits.reset(Touched); } /// return the status bits inline unsigned long getStatus() const {