Skip to content

Commit

Permalink
Spreadsheet: Issue #2355: Do not recompute the spreadsheet and its de…
Browse files Browse the repository at this point in the history
…pendents unless the change affects the spreadsheet
  • Loading branch information
edman007 authored and wwmayer committed Jan 26, 2016
1 parent 670eaf0 commit d71a12d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Mod/Spreadsheet/App/PropertySheet.cpp
Expand Up @@ -1059,16 +1059,16 @@ 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<std::string, std::set< CellAddress > >::const_iterator i = documentObjectToCellMap.find(fullName);

if (i == documentObjectToCellMap.end())
return;

// Touch to force recompute
touch();

std::set<CellAddress> s = i->second;
std::set<CellAddress>::const_iterator j = s.begin();
std::set<CellAddress>::const_iterator end = s.end();
Expand All @@ -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<CellAddress, Cell* >::iterator i = data.begin();

Signaller signaller(*this);
Expand All @@ -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<CellAddress, Cell* >::iterator i = data.begin();

Expand Down Expand Up @@ -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);
Expand All @@ -1150,6 +1147,9 @@ void PropertySheet::recomputeDependants(const App::DocumentObject *docObj)
if (i == documentObjectToCellMap.end())
return;

// Touch to force recompute
touch();

std::set<CellAddress>::const_iterator j = i->second.begin();
std::set<CellAddress>::const_iterator end = i->second.end();

Expand Down

0 comments on commit d71a12d

Please sign in to comment.