From d71a12db05be41af107fb396f023121cc45ee60d Mon Sep 17 00:00:00 2001 From: Ed Martin Date: Sun, 17 Jan 2016 02:48:55 -0500 Subject: [PATCH] Spreadsheet: Issue #2355: Do not recompute the spreadsheet and its dependents unless the change affects the spreadsheet --- src/Mod/Spreadsheet/App/PropertySheet.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp index 5f1eab36c..576c7ae1d 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp @@ -1059,9 +1059,6 @@ void PropertySheet::invalidateDependants(const App::DocumentObject *docObj) const char * docName = docObj->getDocument()->Label.getValue(); const char * docObjName = docObj->getNameInDocument(); - // Touch to force recompute - touch(); - // Recompute cells that depend on this cell std::string fullName = std::string(docName) + "#" + std::string(docObjName); std::map >::const_iterator i = documentObjectToCellMap.find(fullName); @@ -1069,6 +1066,9 @@ void PropertySheet::invalidateDependants(const App::DocumentObject *docObj) if (i == documentObjectToCellMap.end()) return; + // Touch to force recompute + touch(); + std::set s = i->second; std::set::const_iterator j = s.begin(); std::set::const_iterator end = s.end(); @@ -1084,12 +1084,12 @@ void PropertySheet::invalidateDependants(const App::DocumentObject *docObj) void PropertySheet::renamedDocumentObject(const App::DocumentObject * docObj) { - // Touch to force recompute - touch(); - if (documentObjectName.find(docObj) == documentObjectName.end()) return; + // Touch to force recompute + touch(); + std::map::iterator i = data.begin(); Signaller signaller(*this); @@ -1105,11 +1105,10 @@ void PropertySheet::renamedDocumentObject(const App::DocumentObject * docObj) void PropertySheet::renamedDocument(const App::Document * doc) { - // Touch to force recompute - touch(); - if (documentName.find(doc) == documentName.end()) return; + // Touch to force recompute + touch(); std::map::iterator i = data.begin(); @@ -1140,8 +1139,6 @@ void PropertySheet::recomputeDependants(const App::DocumentObject *docObj) const char * docName = docObj->getDocument()->Label.getValue(); const char * docObjName = docObj->getNameInDocument(); - // Touch to force recompute - touch(); // Recompute cells that depend on this cell std::string fullName = std::string(docName) + "#" + std::string(docObjName); @@ -1150,6 +1147,9 @@ void PropertySheet::recomputeDependants(const App::DocumentObject *docObj) if (i == documentObjectToCellMap.end()) return; + // Touch to force recompute + touch(); + std::set::const_iterator j = i->second.begin(); std::set::const_iterator end = i->second.end();