From a93d9fa2d5fa8dc056f60820a6801a0652da4847 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 7 Dec 2018 19:40:14 +0300 Subject: [PATCH] Fix for the tests SketchPlugin_TestMirror and SketchPlugin_TestMultiRotation in RefList Hash usage --- src/Model/Model_AttributeRefList.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Model/Model_AttributeRefList.cpp b/src/Model/Model_AttributeRefList.cpp index 4c152b929..e8a17a734 100644 --- a/src/Model/Model_AttributeRefList.cpp +++ b/src/Model/Model_AttributeRefList.cpp @@ -124,7 +124,6 @@ void Model_AttributeRefList::remove(ObjectPtr theObject) void Model_AttributeRefList::clear() { - eraseHash(); std::list anOldList = list(); myRef->Clear(); std::list::iterator anOldIter = anOldList.begin(); @@ -132,6 +131,7 @@ void Model_AttributeRefList::clear() REMOVE_BACK_REF((*anOldIter)); } myExtDocRef->Clear(); + eraseHash(); owner()->data()->sendAttributeUpdated(this); } @@ -318,8 +318,8 @@ void Model_AttributeRefList::remove(const std::set& theIndices) REMOVE_BACK_REF(anObj); } } - eraseHash(); if (!aLabelsToRemove.IsEmpty()) { + eraseHash(); owner()->data()->sendAttributeUpdated(this); } } @@ -347,6 +347,7 @@ void Model_AttributeRefList::createHash() { if (myHashUsed) return; + eraseHash(); std::shared_ptr aDoc = std::dynamic_pointer_cast( owner()->document()); if (aDoc) { -- 2.39.2