From 928dfebe109794eb079469a46f549e25b3b1e89d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 26 Jul 2018 14:36:38 +0200 Subject: loplugin:returnconstant in svl,svtools Change-Id: Id297a513f3313e10531f0ccd99a16277e4e37fa1 Reviewed-on: https://gerrit.libreoffice.org/58111 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svtools/source/config/colorcfg.cxx | 3 +-- svtools/source/config/extcolorcfg.cxx | 3 +-- svtools/source/contnr/svlbitm.cxx | 3 +-- svtools/source/misc/imap2.cxx | 12 ++++-------- svtools/source/uno/unoimap.cxx | 9 ++++----- 5 files changed, 11 insertions(+), 19 deletions(-) (limited to 'svtools') diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index 580c28034f47..378f046a3714 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -540,7 +540,7 @@ void EditableColorConfig::AddScheme(const OUString& rScheme ) m_pImpl->AddScheme(rScheme); } -bool EditableColorConfig::LoadScheme(const OUString& rScheme ) +void EditableColorConfig::LoadScheme(const OUString& rScheme ) { if(m_bModified) m_pImpl->SetModified(); @@ -550,7 +550,6 @@ bool EditableColorConfig::LoadScheme(const OUString& rScheme ) m_pImpl->Load(rScheme); //the name of the loaded scheme has to be committed separately m_pImpl->CommitCurrentSchemeName(); - return true; } const OUString& EditableColorConfig::GetCurrentSchemeName()const diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index 76c4c6ac5343..8e09110ca02f 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -596,7 +596,7 @@ void EditableExtendedColorConfig::AddScheme(const OUString& rScheme ) m_pImpl->AddScheme(rScheme); } -bool EditableExtendedColorConfig::LoadScheme(const OUString& rScheme ) +void EditableExtendedColorConfig::LoadScheme(const OUString& rScheme ) { if(m_bModified) m_pImpl->SetModified(); @@ -606,7 +606,6 @@ bool EditableExtendedColorConfig::LoadScheme(const OUString& rScheme ) m_pImpl->Load(rScheme); //the name of the loaded scheme has to be committed separately m_pImpl->CommitCurrentSchemeName(); - return true; } // Changes the name of the current scheme but doesn't load it! diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index f12c2911673f..11eeb0165f5e 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -248,7 +248,7 @@ SvLBoxItemType SvLBoxButton::GetType() const return SvLBoxItemType::Button; } -bool SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry ) +void SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry ) { if ( CheckModification() ) { @@ -259,7 +259,6 @@ bool SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry ) pData->StoreButtonState( pEntry ); pData->CallLink(); } - return false; } void SvLBoxButton::Paint( diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 0bccdab00f83..da99028254fa 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -219,8 +219,8 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat ) switch ( nFormat ) { case IMAP_FORMAT_BIN : Read( rIStm ); break; - case IMAP_FORMAT_CERN : nRet = ImpReadCERN( rIStm ); break; - case IMAP_FORMAT_NCSA : nRet = ImpReadNCSA( rIStm ); break; + case IMAP_FORMAT_CERN : ImpReadCERN( rIStm ); break; + case IMAP_FORMAT_NCSA : ImpReadNCSA( rIStm ); break; default: break; @@ -232,7 +232,7 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat ) return nRet; } -sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm ) +void ImageMap::ImpReadCERN( SvStream& rIStm ) { // delete old content ClearImageMap(); @@ -240,8 +240,6 @@ sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm ) OString aStr; while ( rIStm.ReadLine( aStr ) ) ImpReadCERNLine( aStr ); - - return IMAP_ERR_OK; } void ImageMap::ImpReadCERNLine( const OString& rLine ) @@ -369,7 +367,7 @@ OUString ImageMap::ImpReadCERNURL( const char** ppStr ) return INetURLObject::GetAbsURL( "", aStr ); } -sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm ) +void ImageMap::ImpReadNCSA( SvStream& rIStm ) { // delete old content ClearImageMap(); @@ -377,8 +375,6 @@ sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm ) OString aStr; while ( rIStm.ReadLine( aStr ) ) ImpReadNCSALine( aStr ); - - return IMAP_ERR_OK; } void ImageMap::ImpReadNCSALine( const OString& rLine ) diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx index 65757ccbda15..4c337df681d3 100644 --- a/svtools/source/uno/unoimap.cxx +++ b/svtools/source/uno/unoimap.cxx @@ -508,7 +508,7 @@ public: explicit SvUnoImageMap(); SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* pSupportedMacroItems ); - bool fillImageMap( ImageMap& rMap ) const; + void fillImageMap( ImageMap& rMap ) const; /// @throws IllegalArgumentException static SvUnoImageMapObject* getObject( const Any& aElement ); @@ -667,7 +667,7 @@ Sequence< OUString > SAL_CALL SvUnoImageMap::getSupportedServiceNames( ) return Sequence< OUString >( &aSN, 1 ); } -bool SvUnoImageMap::fillImageMap( ImageMap& rMap ) const +void SvUnoImageMap::fillImageMap( ImageMap& rMap ) const { rMap.ClearImageMap(); @@ -679,8 +679,6 @@ bool SvUnoImageMap::fillImageMap( ImageMap& rMap ) const rMap.InsertIMapObject( *pNewMapObject ); delete pNewMapObject; } - - return true; } @@ -718,7 +716,8 @@ bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, Image if( nullptr == pUnoImageMap ) return false; - return pUnoImageMap->fillImageMap( rMap ); + pUnoImageMap->fillImageMap( rMap ); + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit