* Refactored code; moved mutable fields into a separate inner class. * Added resolvedProperty to ResolveResults class. * Set resolved document name, even if it does not resolve correctly, so we can give a better error message later. * If the document name is explicitly set, and it does not resolve, don't try any further. * If document name is set, use that instead of the ObjectIdentifier's owner when looking up the document object.
This commit is contained in:
@@ -227,23 +227,32 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
struct ResolveResults {
|
||||
|
||||
ResolveResults(const ObjectIdentifier & oi);
|
||||
|
||||
int propertyIndex;
|
||||
App::Document * resolvedDocument;
|
||||
String resolvedDocumentName;
|
||||
App::DocumentObject * resolvedDocumentObject;
|
||||
String resolvedDocumentObjectName;
|
||||
App::Property * resolvedProperty;
|
||||
std::string propertyName;
|
||||
};
|
||||
|
||||
std::string getPythonAccessor() const;
|
||||
|
||||
void resolve() const;
|
||||
void resolve(ResolveResults & results) const;
|
||||
|
||||
App::DocumentObject *getDocumentObject(const App::Document *doc, const String &name, bool &byIdentifier) const;
|
||||
|
||||
const App::PropertyContainer * owner;
|
||||
String documentName;
|
||||
bool documentNameSet;
|
||||
String documentObjectName;
|
||||
bool documentObjectNameSet;
|
||||
std::vector<Component> components;
|
||||
|
||||
/// Mutable elements, updated by resolve()
|
||||
mutable int propertyIndex;
|
||||
mutable String documentName;
|
||||
mutable String documentObjectName;
|
||||
mutable std::string propertyName;
|
||||
|
||||
};
|
||||
|
||||
std::size_t hash_value(const App::ObjectIdentifier & path);
|
||||
|
||||
Reference in New Issue
Block a user