From a45827b2308febc7369db27fb489a6d1389534e1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 28 Jul 2015 08:39:57 +0200 Subject: loplugin:unusedmethods Change-Id: Ib4d77ee01e7362f5951f81fceeca3c489872d971 Reviewed-on: https://gerrit.libreoffice.org/17378 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sot/source/base/factory.cxx | 4 +- sot/source/base/object.cxx | 12 +++--- sot/source/sdstor/stg.cxx | 21 ---------- sot/source/sdstor/stgdir.cxx | 82 ---------------------------------------- sot/source/sdstor/stgdir.hxx | 2 - sot/source/sdstor/stgole.cxx | 12 ------ sot/source/sdstor/stgole.hxx | 2 - sot/source/sdstor/storage.cxx | 22 +++++------ sot/source/sdstor/ucbstorage.cxx | 23 ----------- 9 files changed, 18 insertions(+), 162 deletions(-) (limited to 'sot') diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx index 102e0fc81b91..3fc95ad6dda9 100644 --- a/sot/source/base/factory.cxx +++ b/sot/source/base/factory.cxx @@ -75,12 +75,10 @@ SotData_Impl * SOTDATA() *************************************************************************/ SotFactory::SotFactory( const SvGlobalName & rName, - const OUString & rClassName, - CreateInstanceType pCreateFuncP ) + const OUString & rClassName ) : SvGlobalName ( rName ) , nSuperCount ( 0 ) , pSuperClasses ( NULL ) - , pCreateFunc ( pCreateFuncP ) , aClassName ( rClassName ) { #ifdef DBG_UTIL diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx index aa809904697f..3ed71d7d17ad 100644 --- a/sot/source/base/object.cxx +++ b/sot/source/base/object.cxx @@ -25,9 +25,8 @@ class SotObjectFactory : public SotFactory { public: SotObjectFactory( const SvGlobalName & rName, - const OUString & rClassName, - CreateInstanceType pCreateFuncP ) - : SotFactory( rName, rClassName, pCreateFuncP ) + const OUString & rClassName ) + : SotFactory( rName, rClassName ) {} }; @@ -37,9 +36,10 @@ SotFactory * SotObject::ClassFactory() SotFactory **ppFactory = GetFactoryAdress(); if( !*ppFactory ) { - *ppFactory = new SotObjectFactory( SvGlobalName( 0xf44b7830, 0xf83c, 0x11d0, - 0xaa, 0xa1, 0x0, 0xa0, 0x24, 0x9d, 0x55, 0x90 ), - OUString( "SotObject" ), SotObject::CreateInstance ); + *ppFactory = new SotObjectFactory( + SvGlobalName( 0xf44b7830, 0xf83c, 0x11d0, + 0xaa, 0xa1, 0x0, 0xa0, 0x24, 0x9d, 0x55, 0x90 ), + OUString( "SotObject" ) ); } return *ppFactory; } diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 78c8d64c0056..af2de0e86dc7 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -80,13 +80,6 @@ void StorageBase::ResetError() const const_cast(this)->m_nError = SVSTREAM_OK; } -// Retrieve the underlying SvStream for info purposes - -const SvStream* OLEStorageBase::GetSvStream_Impl() const -{ - return pIo ? pIo->GetStrm() : NULL; -} - OLEStorageBase::OLEStorageBase( StgIo* p, StgDirEntry* pe, StreamMode& nMode ) : nStreamMode( nMode ), pIo( p ), pEntry( pe ) { @@ -679,20 +672,6 @@ bool Storage::Remove( const OUString& rName ) } } -// Rename a storage element - -bool Storage::Rename( const OUString& rOld, const OUString& rNew ) -{ - if( Validate( true ) ) - { - bool b = pIo->pTOC->Rename( *pEntry, rOld, rNew ); - pIo->MoveError( *this ); - return b; - } - else - return false; -} - // Copy one element bool Storage::CopyTo( const OUString& rElem, BaseStorage* pDest, const OUString& rNew ) diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx index e2c8bf7b621e..cb88ca5def0f 100644 --- a/sot/source/sdstor/stgdir.cxx +++ b/sot/source/sdstor/stgdir.cxx @@ -547,68 +547,6 @@ bool StgDirEntry::Commit() return bRes; } -// Revert the entry - -bool StgDirEntry::Revert() -{ - aEntry = aSave; - switch( aEntry.GetType() ) - { - case STG_STREAM: - if( pCurStrm ) - delete pTmpStrm, pTmpStrm = pCurStrm, pCurStrm = NULL; - break; - case STG_STORAGE: - { - bool bSomeRenamed = false; - StgIterator aOIter( *this ); - StgDirEntry* op = aOIter.First(); - while( op ) - { - op->aEntry = op->aSave; - op->bDirty = false; - bSomeRenamed = ( bSomeRenamed || op->bRenamed ); - // Remove any new entries - if( op->bCreated ) - { - op->bCreated = false; - op->Close(); - op->bInvalid = true; - } - // Reactivate any removed entries - else if( op->bRemoved ) - op->bRemoved = op->bInvalid = op->bTemp = false; - op = aOIter.Next(); - } - // Resort all renamed entries - if( bSomeRenamed ) - { - StgIterator aIter( *this ); - StgDirEntry* p = aIter.First(); - while( p ) - { - if( p->bRenamed ) - { - StgAvlNode::Move - ( reinterpret_cast(&p->pUp->pDown), - reinterpret_cast(&p->pUp->pDown), p ); - p->bRenamed = false; - } - p = aIter.Next(); - } - } - DelTemp( false ); - break; - } - case STG_EMPTY: - case STG_LOCKBYTES: - case STG_PROPERTY: - case STG_ROOT: - break; - } - return true; -} - // Copy the stg stream to the temp stream bool StgDirEntry::Strm2Tmp() @@ -1070,24 +1008,4 @@ bool StgDirStrm::Rename( StgDirEntry& rStg, const OUString& rOld, const OUString } } -// Move the given entry to a different storage. - -bool StgDirStrm::Move( StgDirEntry& rStg1, StgDirEntry& rStg2, const OUString& rName ) -{ - StgDirEntry* p = Find( rStg1, rName ); - if( p ) - { - if( !StgAvlNode::Move - ( reinterpret_cast(&rStg1.pDown), reinterpret_cast(&rStg2.pDown), p ) ) - return false; - p->bDirty = true; - return true; - } - else - { - rIo.SetError( SVSTREAM_FILE_NOT_FOUND ); - return false; - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx index 55be53d8d359..e8c3ec7acb90 100644 --- a/sot/source/sdstor/stgdir.hxx +++ b/sot/source/sdstor/stgdir.hxx @@ -77,7 +77,6 @@ public: bool IsDirty(); bool Commit(); - bool Revert(); void OpenStream( StgIo&, bool=false ); // set up an appropriate stream void Close(); @@ -105,7 +104,6 @@ public: StgDirEntry* Find( StgDirEntry&, const OUString& ); StgDirEntry* Create( StgDirEntry&, const OUString&, StgEntryType ); bool Rename( StgDirEntry&, const OUString&, const OUString& ); - bool Move( StgDirEntry&, StgDirEntry&, const OUString& ); }; class StgIterator : public StgAvlIterator diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index ae5b58c39e8a..6d5ff467f4b7 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -169,18 +169,6 @@ StgOleStream::StgOleStream( BaseStorage& rStg, bool bWr ) nFlags = 0; } -bool StgOleStream::Load() -{ - nFlags = 0; - if( GetError() != SVSTREAM_OK ) - return false; - - sal_Int32 version = 0; - Seek( 0L ); - ReadInt32( version ).ReadUInt32( nFlags ); - return GetError() == SVSTREAM_OK; -} - bool StgOleStream::Store() { if( GetError() != SVSTREAM_OK ) diff --git a/sot/source/sdstor/stgole.hxx b/sot/source/sdstor/stgole.hxx index 0ba992f70641..c1088633be0b 100644 --- a/sot/source/sdstor/stgole.hxx +++ b/sot/source/sdstor/stgole.hxx @@ -61,8 +61,6 @@ class StgOleStream : public StgInternalStream sal_uInt32 nFlags; public: StgOleStream( BaseStorage&, bool ); - sal_uInt32& GetFlags() { return nFlags; } - bool Load(); bool Store(); }; diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 60aa4106097a..db02b1750256 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -46,9 +46,8 @@ class SotStorageStreamFactory : public SotFactory { public: SotStorageStreamFactory( const SvGlobalName & rName, - const OUString & rClassName, - CreateInstanceType pCreateFuncP ) - : SotFactory( rName, rClassName, pCreateFuncP ) + const OUString & rClassName ) + : SotFactory( rName, rClassName ) {} }; @@ -58,9 +57,10 @@ SotFactory * SotStorageStream::ClassFactory() SotFactory **ppFactory = GetFactoryAdress(); if( !*ppFactory ) { - *ppFactory = new SotStorageStreamFactory( SvGlobalName( 0xd7deb420, 0xf902, 0x11d0, - 0xaa, 0xa1, 0x0, 0xa0, 0x24, 0x9d, 0x55, 0x90 ), - OUString( "SotStorageStream" ), SotStorageStream::CreateInstance ); + *ppFactory = new SotStorageStreamFactory( + SvGlobalName( 0xd7deb420, 0xf902, 0x11d0, + 0xaa, 0xa1, 0x0, 0xa0, 0x24, 0x9d, 0x55, 0x90 ), + OUString( "SotStorageStream" ) ); (*ppFactory)->PutSuperClass( SotObject::ClassFactory() ); } return *ppFactory; @@ -307,9 +307,8 @@ class SotStorageFactory : public SotFactory { public: SotStorageFactory( const SvGlobalName & rName, - const OUString & rClassName, - CreateInstanceType pCreateFuncP ) - : SotFactory( rName, rClassName, pCreateFuncP ) + const OUString & rClassName ) + : SotFactory( rName, rClassName ) {} }; @@ -319,9 +318,10 @@ SotFactory * SotStorage::ClassFactory() SotFactory **ppFactory = GetFactoryAdress(); if( !*ppFactory ) { - *ppFactory = new SotStorageFactory( SvGlobalName( 0x980ce7e0, 0xf905, 0x11d0, + *ppFactory = new SotStorageFactory( + SvGlobalName( 0x980ce7e0, 0xf905, 0x11d0, 0xaa, 0xa1, 0x0, 0xa0, 0x24, 0x9d, 0x55, 0x90 ), - OUString( "SotStorage" ), SotStorage::CreateInstance ); + OUString( "SotStorage" ) ); (*ppFactory)->PutSuperClass( SotObject::ClassFactory() ); } return *ppFactory; diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index e2c84c0ba28a..fa557af651ea 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -2946,29 +2946,6 @@ bool UCBStorage::Remove( const OUString& rEleName ) return ( pElement != NULL ); } -bool UCBStorage::Rename( const OUString& rEleName, const OUString& rNewName ) -{ - if( rEleName.isEmpty()|| rNewName.isEmpty() ) - return false; - - UCBStorageElement_Impl *pAlreadyExisting = FindElement_Impl( rNewName ); - if ( pAlreadyExisting ) - { - SetError( SVSTREAM_ACCESS_DENIED ); - return false; // can't change to a name that is already used - } - - UCBStorageElement_Impl *pElement = FindElement_Impl( rEleName ); - if ( pElement ) - { - pElement->m_aName = rNewName; - } - else - SetError( SVSTREAM_FILE_NOT_FOUND ); - - return pElement != NULL; -} - bool UCBStorage::ValidateFAT() { // ??? -- cgit v1.2.3