include/svx/svdobj.hxx | 1 + svx/source/svdraw/svdobj.cxx | 6 ++++++ svx/source/tbxctrls/fontworkgallery.cxx | 2 ++ sw/source/core/frmedt/fefly1.cxx | 4 +--- 4 files changed, 10 insertions(+), 3 deletions(-)
New commits: commit 00d4852eef26037f7ddf6778542a131e94c752b2 Author: Jim Raykowski <rayk...@gmail..com> AuthorDate: Wed Apr 15 21:24:44 2020 -0800 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Apr 16 10:09:38 2020 +0200 tdf#122444 Use fontwork name for object name Change-Id: Icdbde958f2e89e669a9399479e0059095a6d8a3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92333 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index b39cceadd7bf..de4ebc3f9b4f 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -427,6 +427,7 @@ public: // It may also have a Title and a Description for accessibility purposes. void SetName(const OUString& rStr); OUString GetName() const; + void MakeNameUnique(); void MakeNameUnique(std::unordered_set<OUString>& rNameSet); void SetTitle(const OUString& rStr); OUString GetTitle() const; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index b1e4a44ae12b..8081df8269e5 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2990,6 +2990,12 @@ bool SdrObject::IsTextBox() const return false; } +void SdrObject::MakeNameUnique() +{ + std::unordered_set<OUString> aNameSet; + MakeNameUnique(aNameSet); +} + void SdrObject::MakeNameUnique(std::unordered_set<OUString>& rNameSet) { if (GetName().isEmpty()) diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index d7dea7f070e1..4268cec97316 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -192,6 +192,8 @@ void FontWorkGalleryDialog::insertSelectedFontwork() pPage->GetObj(0)->CloneSdrObject( bUseSpecialCalcMode ? *mpDestModel : mrSdrView.getSdrModelFromSdrView())); + pNewObject->MakeNameUnique(); + // tdf#117629 // Since the 'old' ::CloneSdrObject also copies the SdrPage* the // SdrObject::getUnoShape() *will* create the wrong UNO API object diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 856ad958b58c..8cec500dc329 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -953,8 +953,6 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, } // insert drawing object into the document creating a new <SwDrawFrameFormat> instance SwDrawFrameFormat* pFormat = GetDoc()->getIDocumentContentOperations().InsertDrawObj( aPam, rDrawObj, rFlyAttrSet ); - OUString sShapeName = GetDoc()->GetUniqueShapeName(); - rDrawObj.SetName(sShapeName); // move object to visible layer SwContact* pContact = static_cast<SwContact*>(rDrawObj.GetUserCall()); @@ -965,7 +963,7 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, if (pFormat) { - pFormat->SetName(sShapeName); + pFormat->SetName(rDrawObj.GetName()); // select drawing object Imp()->GetDrawView()->MarkObj( &rDrawObj, Imp()->GetPageView() ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits