diff --git a/src/App/ElementNamingUtils.h b/src/App/ElementNamingUtils.h index e0104c47fc..a4c2484b35 100644 --- a/src/App/ElementNamingUtils.h +++ b/src/App/ElementNamingUtils.h @@ -2,8 +2,39 @@ #define ELEMENT_NAMING_UTILS_H #include +#include #include "FCGlobal.h" +namespace App +{ + +/** Return type for lookups of new and old style sub-element names + * + */ +struct ElementNamePair +{ + std::string newName; + std::string oldName; + + ElementNamePair() = default; + + ElementNamePair(std::string newNameStr, std::string oldNameStr) : + newName(std::move(newNameStr)), oldName(std::move(oldNameStr)) + { + } + + bool operator==(const ElementNamePair& other) const + { + return this->newName == other.newName && this->oldName == other.oldName; + }; + + void swap(ElementNamePair& other) noexcept + { + std::swap(*this, other); + } +}; + +} // clang-format off namespace Data diff --git a/src/App/ObjectIdentifier.h b/src/App/ObjectIdentifier.h index 2ad34d5d19..4cbe0b7cec 100644 --- a/src/App/ObjectIdentifier.h +++ b/src/App/ObjectIdentifier.h @@ -32,6 +32,8 @@ #include #include +#include "ElementNamingUtils.h" + namespace Py { class Object; } @@ -486,7 +488,7 @@ protected: String documentName; String documentObjectName; String subObjectName; - std::pair shadowSub; + ElementNamePair shadowSub; std::vector components; bool documentNameSet; bool documentObjectNameSet; diff --git a/src/App/Property.h b/src/App/Property.h index 8ce98935da..3dd456428e 100644 --- a/src/App/Property.h +++ b/src/App/Property.h @@ -32,6 +32,7 @@ #include #include +#include "ElementNamingUtils.h" namespace Py { class Object; }