App: DocumentObject - New full label member function

====================================================

Before this commit there is a function getFullName(), which
produces a string in the form document#objectname. For "document"
the real name of the document is taken, whereas for objectname it
is the initial name (Sketch, Sketch001), not the label.

The new function fo this commit, getFullLabel(), provides a string
documentlabel#documentobjectlabel, that are
probably easier to identify for end users.
This commit is contained in:
Abdullah Tahiri
2023-01-03 21:00:07 +01:00
committed by abdullahtahiriyo
parent bb1b61dac9
commit 7643c35c3f
2 changed files with 12 additions and 0 deletions

View File

@@ -282,6 +282,16 @@ std::string DocumentObject::getFullName() const {
return name;
}
std::string DocumentObject::getFullLabel() const {
if(!getDocument())
return "?";
auto name = getDocument()->Label.getStrValue();
name += "#";
name += Label.getStrValue();
return name;
}
const char *DocumentObject::getNameInDocument() const
{
// Note: It can happen that we query the internal name of an object even if it is not