[Libreoffice-commits] core.git: sw/inc sw/source

Vasily Melenchuk (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 5 16:18:01 UTC 2020


 sw/inc/doc.hxx                 |    1 +
 sw/source/core/doc/docdraw.cxx |    5 +++--
 sw/source/core/doc/doclay.cxx  |    5 +++++
 3 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit b2d9603bc02db3a6711948274c5fa2b5cf148d48
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Wed Feb 5 10:57:21 2020 +0300
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Wed Feb 5 17:17:30 2020 +0100

    sw: set uniqe name and style to grouped shapes
    
    Unique name is required to dsiplay object in Navigator, style
    is used by undo/redo code.
    
    Change-Id: Id2417cbee3f92c0ee555eb093e1e9bbbc0a83e0b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87996
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 20954f7ed608..14d98f6d5fee 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -680,6 +680,7 @@ public:
     OUString GetUniqueOLEName() const;
     OUString GetUniqueFrameName() const;
     OUString GetUniqueShapeName() const;
+    OUString GetUniqueDrawObjectName() const;
 
     o3tl::sorted_vector<SwRootFrame*> GetAllLayouts();
 
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 47a217269d45..6a9b4d290096 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -239,7 +239,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
             pObj->NbcMove( Size( aAnchorPos.getX(), aAnchorPos.getY() ) );
         }
 
-        pFormat = MakeDrawFrameFormat( "DrawObject",
+        pFormat = MakeDrawFrameFormat( GetUniqueDrawObjectName(),
                                 GetDfltFrameFormat() );
         pFormat->SetFormatAttr( aAnch );
         // #i36010# - set layout direction of the position
@@ -250,6 +250,7 @@ SwDrawContact* SwDoc::GroupSelection( SdrView& rDrawView )
         OSL_ENSURE( rMrkList.GetMarkCount() == 1, "GroupMarked more or none groups." );
 
         SdrObject* pNewGroupObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
+        pNewGroupObj->SetName(pFormat->GetName());
         pNewContact = new SwDrawContact( pFormat, pNewGroupObj );
         // #i35635#
         pNewContact->MoveObjToVisibleLayer( pNewGroupObj );
@@ -322,7 +323,7 @@ void SwDoc::UnGroupSelection( SdrView& rDrawView )
                     for ( size_t i2 = 0; i2 < pLst->GetObjCount(); ++i2 )
                     {
                         SdrObject* pSubObj = pLst->GetObj( i2 );
-                        SwDrawFrameFormat *pFormat = MakeDrawFrameFormat( "DrawObject",
+                        SwDrawFrameFormat *pFormat = MakeDrawFrameFormat( GetUniqueShapeName(),
                                                             GetDfltFrameFormat() );
                         pFormat->SetFormatAttr( aAnch );
                         // #i36010# - set layout direction of the position
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index d741c14ba068..c62a91c56a33 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1381,6 +1381,11 @@ OUString SwDoc::GetUniqueShapeName() const
     return lcl_GetUniqueFlyName(this, STR_SHAPE_DEFNAME, RES_DRAWFRMFMT);
 }
 
+OUString SwDoc::GetUniqueDrawObjectName() const
+{
+    return lcl_GetUniqueFlyName(this, "DrawObject", RES_DRAWFRMFMT);
+}
+
 const SwFlyFrameFormat* SwDoc::FindFlyByName( const OUString& rName, SwNodeType nNdTyp ) const
 {
     auto range = GetSpzFrameFormats()->rangeFind( RES_FLYFRMFMT, rName );


More information about the Libreoffice-commits mailing list