summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2019-11-21 20:12:52 +0300
committerMichael Stahl <michael.stahl@cib.de>2020-01-24 11:12:11 +0100
commitfd0cade5e0fc29436572799aa48f3aca789e1734 (patch)
treedb0d105f34ba3eb699b4117eb991deff3b6f7775
parent4de88a0f0814d88abe8703936afdc76f8bd3d685 (diff)
tdf#128782: sw: assign name to draw object
SwXDrawPage is inserting frame styles without name. This is confusing undo/redo code which is operating styles by names. Change-Id: Ibcda01fbd3ec88e9cdbde446c3f18c7ad6b0cbc8 Reviewed-on: https://gerrit.libreoffice.org/83415 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit c2d689790c332ffd2f0d73de6aae53f26f0fbe53) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87206 Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87304 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--sw/source/core/unocore/unodraw.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index b6536f0397e1..4f6f0df53530 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -719,7 +719,11 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
pDoc->getIDocumentContentOperations().InsertDrawObj( *pTemp, *pObj, aSet );
SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
if(pFormat)
+ {
+ if (pFormat->GetName().isEmpty())
+ pFormat->SetName(pDoc->GetUniqueFrameName(), false);
pFormat->Add(pShape);
+ }
pShape->m_bDescriptor = false;
pPam.reset();