summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2019-11-21 20:12:52 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-11-27 22:43:41 +0100
commitc2d689790c332ffd2f0d73de6aae53f26f0fbe53 (patch)
treeca24314df7fae483a5b0914a20699fe6609a278b /sw
parente0b70b1491143adb47990b746fe0b2e52b1ee7cb (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>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unodraw.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 4d14d25467e1..9dd329920602 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -713,8 +713,12 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
UnoActionContext aAction(pDoc);
pDoc->getIDocumentContentOperations().InsertDrawObj( *pTemp, *pObj, aSet );
SwFrameFormat* pFormat = ::FindFrameFormat( pObj );
- if(pFormat)
+ if (pFormat)
+ {
+ if (pFormat->GetName().isEmpty())
+ pFormat->SetName(pDoc->GetUniqueFrameName(), false);
pShape->SetFrameFormat(pFormat);
+ }
pShape->m_bDescriptor = false;
pPam.reset();