diff options
-rw-r--r-- | include/svx/svdobj.hxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index ebcad8a002b4..c6e394d7b539 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -375,7 +375,7 @@ public: // or SdrOle2Obj. // It may also have a Title and a Description for accessibility purposes. void SetName(const OUString& rStr, const bool bSetChanged = true); - OUString GetName() const; + const OUString & GetName() const; void MakeNameUnique(); void MakeNameUnique(std::unordered_set<OUString>& rNameSet); void SetTitle(const OUString& rStr); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index cdae6b949c43..cb89a2fc5555 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -800,14 +800,16 @@ void SdrObject::SetName(const OUString& rStr, const bool bSetChanged) } } -OUString SdrObject::GetName() const +const OUString & SdrObject::GetName() const { + static const OUString EMPTY = u""; + if(m_pPlusData) { return m_pPlusData->aObjName; } - return OUString(); + return EMPTY; } void SdrObject::SetTitle(const OUString& rStr) |