From 23046111d01ab0ec5feb570d428aea5ed4ece5fc Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 27 Apr 2023 19:19:43 +0200 Subject: remove dead code in SwDoc::CloneSdrObj Dead because isType(pObj.get() is unconditionally true, which renders the entire if statement dead. Ever since it was introduced in commit 68428bf17441dc0ec9dfcffd7cc6073660e552f0 Author: Vladimir Glazounov 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 - do *not* connect draw frame format to layout, if its corresponding 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 --- sw/source/core/doc/doclay.cxx | 13 ------------- 1 file changed, 13 deletions(-) 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 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( pObj.get() ) == nullptr && - dynamic_cast( pObj.get() ) == nullptr && - !isType(pObj.get()) ) - { - if ( getIDocumentDrawModelAccess().IsVisibleLayerId( nLayerIdForClone ) ) - { - nLayerIdForClone = getIDocumentDrawModelAccess().GetInvisibleLayerIdByVisibleOne( nLayerIdForClone ); - } - } - pObj->SetLayer( nLayerIdForClone ); - return pObj; } -- cgit