From ed617a7e6caf8a7f9f0f67bceb1280f61f5428c8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 14 Jun 2019 11:37:59 +0200 Subject: loplugin:unusedmethods Change-Id: I7787a8eedf500b0b16c04114935d3d3124d9ac3d Reviewed-on: https://gerrit.libreoffice.org/74032 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/inc/SwXMLTextBlocks.hxx | 1 - sw/source/core/inc/swblocks.hxx | 1 - sw/source/core/swg/SwXMLTextBlocks.cxx | 53 ---------------------------------- 3 files changed, 55 deletions(-) (limited to 'sw') diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx index d4cfd8030c77..752bc0ad300d 100644 --- a/sw/source/core/inc/SwXMLTextBlocks.hxx +++ b/sw/source/core/inc/SwXMLTextBlocks.hxx @@ -58,7 +58,6 @@ public: virtual ~SwXMLTextBlocks() override; virtual ErrCode Delete( sal_uInt16 ) override; virtual ErrCode Rename( sal_uInt16, const OUString&, const OUString& ) override; - virtual ErrCode CopyBlock( SwImpBlocks& rImp, OUString& rShort, const OUString& rLong) override; virtual void ClearDoc() override; virtual ErrCode GetDoc( sal_uInt16 ) override; virtual ErrCode BeginPutDoc( const OUString&, const OUString& ) override; diff --git a/sw/source/core/inc/swblocks.hxx b/sw/source/core/inc/swblocks.hxx index 9043fb85a2c2..a51e7f5b0a95 100644 --- a/sw/source/core/inc/swblocks.hxx +++ b/sw/source/core/inc/swblocks.hxx @@ -108,7 +108,6 @@ public: virtual ErrCode Delete( sal_uInt16 ) = 0; virtual ErrCode Rename( sal_uInt16, const OUString&, const OUString& ) = 0; - virtual ErrCode CopyBlock( SwImpBlocks& rImp, OUString& rShort, const OUString& rLong) = 0; virtual ErrCode GetDoc( sal_uInt16 ) = 0; virtual ErrCode BeginPutDoc( const OUString&, const OUString& ) = 0; virtual ErrCode PutDoc() = 0; diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index b5aa656dc7c3..78ff47515f5f 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -234,59 +234,6 @@ ErrCode SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const OUString& rNewShort, con return ERRCODE_NONE; } -ErrCode SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, OUString& rShort, - const OUString& rLong) -{ - ErrCode nError = ERRCODE_NONE; - OpenFile(); - rDestImp.OpenFile(false); - const OUString aGroup( rShort ); - bool bTextOnly = IsOnlyTextBlock ( rShort ) ;//pImp->pBlkRoot->IsStream( aGroup ); - sal_uInt16 nIndex = GetIndex ( rShort ); - OUString sPackageName( GetPackageName (nIndex) ); - OUString sDestShortName( sPackageName ); - sal_uInt16 nIdx = 0; - - OSL_ENSURE( xBlkRoot.is(), "No storage set" ); - if(!xBlkRoot.is()) - return ERR_SWG_WRITE_ERROR; - - uno::Reference < container::XNameAccess > xAccess( static_cast(rDestImp).xBlkRoot, uno::UNO_QUERY ); - while ( xAccess->hasByName( sDestShortName ) ) - { - ++nIdx; - // If someone is that crazy ... - if(USHRT_MAX == nIdx) - { - CloseFile(); - rDestImp.CloseFile(); - return ERR_SWG_WRITE_ERROR; - } - sDestShortName = sPackageName + OUString::number( nIdx ); - } - - try - { - uno::Reference < embed::XStorage > rSourceRoot = xBlkRoot->openStorageElement( aGroup, embed::ElementModes::READ ); - uno::Reference < embed::XStorage > rDestRoot = static_cast(rDestImp).xBlkRoot->openStorageElement( sDestShortName, embed::ElementModes::READWRITE ); - rSourceRoot->copyToStorage( rDestRoot ); - } - catch (const uno::Exception&) - { - nError = ERR_SWG_WRITE_ERROR; - } - - if(!nError) - { - rShort = sDestShortName; - static_cast(rDestImp).AddName( rShort, rLong, bTextOnly ); - static_cast(rDestImp).MakeBlockList(); - } - CloseFile(); - rDestImp.CloseFile(); - return nError; -} - ErrCode SwXMLTextBlocks::StartPutBlock( const OUString& rShort, const OUString& rPackageName ) { OSL_ENSURE( xBlkRoot.is(), "No storage set" ); -- cgit v1.2.3