Spreadsheet: Override DocumentObject::renameObjectIdentifiers() to get better renaming support.

This commit is contained in:
Eivind Kvedalen
2016-02-08 21:03:24 +01:00
committed by wmayer
parent 452650440b
commit 8c8e2c15ab
4 changed files with 20 additions and 0 deletions

View File

@@ -41,6 +41,7 @@
#include "SpreadsheetExpression.h"
#include "Utils.h"
#include <PropertySheetPy.h>
#include <App/ExpressionVisitors.h>
using namespace App;
using namespace Base;
@@ -1160,6 +1161,14 @@ void PropertySheet::renamedDocument(const App::Document * doc)
}
}
void PropertySheet::renameObjectIdentifiers(const std::map<App::ObjectIdentifier, App::ObjectIdentifier> &paths)
{
RenameObjectIdentifierExpressionVisitor<PropertySheet> v(*this, paths, *this);
for (std::map<CellAddress, Cell*>::iterator it = data.begin(); it != data.end(); ++it)
it->second->visit(v);
}
void PropertySheet::deletedDocumentObject(const App::DocumentObject *docObj)
{
docDeps.erase(const_cast<App::DocumentObject*>(docObj));