Spreadsheet: Fix for issue #3225.

Done by adding a selector function to Document::renameObjectIdentifiers(...) to ensure
that the Spreadsheet document object is not rewritten twice.
This commit is contained in:
Eivind Kvedalen
2017-11-04 20:05:31 +01:00
committed by wmayer
parent 8b55b3407e
commit dd6757bbb8
4 changed files with 21 additions and 7 deletions

View File

@@ -2029,7 +2029,7 @@ std::vector<App::DocumentObject*> Document::getDependencyList(const std::vector<
* @param paths Map with current and new names
*/
void Document::renameObjectIdentifiers(const std::map<App::ObjectIdentifier, App::ObjectIdentifier> &paths)
void Document::renameObjectIdentifiers(const std::map<App::ObjectIdentifier, App::ObjectIdentifier> &paths, const std::function<bool(const App::DocumentObject*)> & selector)
{
std::map<App::ObjectIdentifier, App::ObjectIdentifier> extendedPaths;
@@ -2040,7 +2040,8 @@ void Document::renameObjectIdentifiers(const std::map<App::ObjectIdentifier, App
}
for (std::vector<DocumentObject*>::iterator it = d->objectArray.begin(); it != d->objectArray.end(); ++it)
(*it)->renameObjectIdentifiers(extendedPaths);
if (selector(*it))
(*it)->renameObjectIdentifiers(extendedPaths);
}
#ifdef USE_OLD_DAG