From 8285c1d4e50fe7dcacfcf80c88b9fcca201a65c6 Mon Sep 17 00:00:00 2001 From: logari81 Date: Wed, 26 Oct 2011 11:02:04 +0000 Subject: [PATCH] + clean up the synchronization of Contraints and Geometry lists git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5069 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- .../Sketcher/App/PropertyConstraintList.cpp | 18 ++++-------------- src/Mod/Sketcher/App/PropertyConstraintList.h | 3 +-- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.cpp b/src/Mod/Sketcher/App/PropertyConstraintList.cpp index c291712cb..28614ee6e 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.cpp +++ b/src/Mod/Sketcher/App/PropertyConstraintList.cpp @@ -179,10 +179,8 @@ void PropertyConstraintList::Restore(Base::XMLReader &reader) Property *PropertyConstraintList::Copy(void) const { PropertyConstraintList *p = new PropertyConstraintList(); - p->setValidGeometryKeys(validGeometryKeys); - if (invalidGeometry) - p->invalidateGeometry(); - p->setValues(_lValueList); + p->applyValidGeometryKeys(validGeometryKeys); + p->applyValues(_lValueList); return p; } @@ -191,9 +189,7 @@ void PropertyConstraintList::Paste(const Property &from) const PropertyConstraintList& FromList = dynamic_cast(from); aboutToSetValue(); applyValues(FromList._lValueList); - setValidGeometryKeys(FromList.validGeometryKeys); - if (FromList.invalidGeometry) - invalidateGeometry(); + applyValidGeometryKeys(FromList.validGeometryKeys); hasSetValue(); } @@ -217,15 +213,9 @@ void PropertyConstraintList::acceptGeometry(const std::vector hasSetValue(); } -void PropertyConstraintList::setValidGeometryKeys(const std::vector &keys) +void PropertyConstraintList::applyValidGeometryKeys(const std::vector &keys) { validGeometryKeys = keys; - invalidGeometry = false; -} - -void PropertyConstraintList::invalidateGeometry() -{ - invalidGeometry = true; } void PropertyConstraintList::checkGeometry(const std::vector &GeoList) diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.h b/src/Mod/Sketcher/App/PropertyConstraintList.h index 56b9d2eb1..7933f3777 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.h +++ b/src/Mod/Sketcher/App/PropertyConstraintList.h @@ -87,7 +87,6 @@ public: virtual unsigned int getMemSize(void) const; void acceptGeometry(const std::vector &GeoList); - void invalidateGeometry(); void checkGeometry(const std::vector &GeoList); private: @@ -97,7 +96,7 @@ private: bool invalidGeometry; void applyValues(const std::vector&); - void setValidGeometryKeys(const std::vector &keys); + void applyValidGeometryKeys(const std::vector &keys); static std::vector _emptyValueList; };