Spreadsheet: Override DocumentObject::renameObjectIdentifiers() to get better renaming support.
This commit is contained in:
parent
810135fad4
commit
1802d94a1a
|
@ -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));
|
||||
|
|
|
@ -141,6 +141,8 @@ public:
|
|||
|
||||
void renamedDocument(const App::Document *doc);
|
||||
|
||||
void renameObjectIdentifiers(const std::map<App::ObjectIdentifier, App::ObjectIdentifier> &paths);
|
||||
|
||||
void deletedDocumentObject(const App::DocumentObject *docObj);
|
||||
|
||||
void documentSet();
|
||||
|
|
|
@ -1312,6 +1312,13 @@ void Sheet::observeDocument(Document * document)
|
|||
}
|
||||
}
|
||||
|
||||
void Sheet::renameObjectIdentifiers(const std::map<ObjectIdentifier, ObjectIdentifier> &paths)
|
||||
{
|
||||
DocumentObject::renameObjectIdentifiers(paths);
|
||||
|
||||
cells.renameObjectIdentifiers(paths);
|
||||
}
|
||||
|
||||
TYPESYSTEM_SOURCE(Spreadsheet::PropertySpreadsheetQuantity, App::PropertyQuantity);
|
||||
|
||||
Property *PropertySpreadsheetQuantity::Copy() const
|
||||
|
|
|
@ -227,6 +227,8 @@ public:
|
|||
|
||||
void observeDocument(App::Document *document);
|
||||
|
||||
virtual void renameObjectIdentifiers(const std::map<App::ObjectIdentifier, App::ObjectIdentifier> & paths);
|
||||
|
||||
protected:
|
||||
|
||||
void providesTo(CellAddress address, std::set<CellAddress> & result) const;
|
||||
|
|
Loading…
Reference in New Issue
Block a user