diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2019-11-21 20:12:52 +0300 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-01-22 20:50:27 +0100 |
commit | a70f4724af04c8bf2d366bcaeb6aeffacc95b344 (patch) | |
tree | e29d25ab4c6c1ef4ac5a7e026c3c345639f54812 | |
parent | db2472d12e31c05fb98fbf384abec93565132eba (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>
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 35d35b635ee0..65ba37f31739 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -709,8 +709,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(); |