diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2020-08-20 12:06:03 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-08-31 07:18:19 +0200 |
commit | aa5b8ff2805d6272dfc7975245901f51dd270778 (patch) | |
tree | 0d89591cb55a4185ece00e2b398b0c100f9f265f /sw | |
parent | 5120a7169c05ea16ad06afd60081e18a40d8c68e (diff) |
tdf#133490: set name for pasted frame format
In some copy/paste operations resulting frame format name can
be empty. This can lead to problems with udo/redo which relies
on format names.
Change-Id: I3cb542321d37cc00e2dee83d0f667164d83ead78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101042
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit a6c2a87612a10d55fc59fa01e44d67d95505834f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101367
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentLayoutManager.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index 67875e86efbb..57e436a8bac6 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -40,6 +40,7 @@ #include <ndindex.hxx> #include <pam.hxx> #include <com/sun/star/embed/EmbedStates.hpp> +#include <svx/svdobj.hxx> using namespace ::com::sun::star; @@ -483,6 +484,14 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( pDestTextBox->SetOtherTextBoxFormat(pDest); } + if (pDest->GetName().isEmpty()) + { + // Format name should have unique name. Let's use object name as a fallback + SdrObject *pObj = pDest->FindSdrObject(); + if (pObj) + pDest->SetName(pObj->GetName()); + } + return pDest; } |