sw/source/core/doc/doclay.cxx |   13 -------------
 1 file changed, 13 deletions(-)

New commits:
commit 23046111d01ab0ec5feb570d428aea5ed4ece5fc
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Apr 27 19:19:43 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Apr 28 12:34:05 2023 +0200

    remove dead code in SwDoc::CloneSdrObj
    
    Dead because
        isType<SdrObject>(pObj.get()
    is unconditionally true, which renders the entire if statement dead.
    
    Ever since it was introduced in
    
        commit 68428bf17441dc0ec9dfcffd7cc6073660e552f0
        Author: Vladimir Glazounov <v...@openoffice.org>
        Date:   Fri Jul 4 12:19:41 2003 +0000
        INTEGRATION: CWS aig02 (1.12.32); FILE MERGED
    2003/07/03 13:29:21 od 1.12.32.4: #108784# further adjustments for
    support of drawing objects in header/footer
    <SwDoc::CopyLayoutFmt(..)> - do *not* connect draw frame
    format to
                 layout, if its corresponding <MakeFrms> will not be called.
    2003/07/02 16:04:01 od 1.12.32.3: #108784# - consider 'invisible'
    layer at drawing page for support of
                   drawing objects in header/footer
    2003/06/26 18:17:53 od 1.12.32.2: #108784# - further adjustments for
    support of drawing objects in header/footer
    2003/06/26 17:02:11 dvo 1.12.32.1: #108784# copy shapes (but not
    controls) into header/footers
    
    Change-Id: Idca3d73ac5b790f93e56214ce1aaa3e99a173a6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151141
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 4ec0f8922da2..d37c5dc59d3c 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -137,19 +137,6 @@ rtl::Reference<SdrObject> SwDoc::CloneSdrObj( const 
SdrObject& rObj, bool bMoveW
     else if( bInsInPage )
         pPg->InsertObjectThenMakeNameUnique( pObj.get() );
 
-    // For drawing objects: set layer of cloned object to invisible layer
-    SdrLayerID nLayerIdForClone = rObj.GetLayer();
-    if ( dynamic_cast<const SwFlyDrawObj*>( pObj.get() ) ==  nullptr &&
-         dynamic_cast<const SwVirtFlyDrawObj*>( pObj.get() ) ==  nullptr &&
-         !isType<SdrObject>(pObj.get()) )
-    {
-        if ( getIDocumentDrawModelAccess().IsVisibleLayerId( nLayerIdForClone 
) )
-        {
-            nLayerIdForClone = 
getIDocumentDrawModelAccess().GetInvisibleLayerIdByVisibleOne( nLayerIdForClone 
);
-        }
-    }
-    pObj->SetLayer( nLayerIdForClone );
-
     return pObj;
 }
 

Reply via email to