include/svl/filenotation.hxx | 2 +- include/svtools/colorcfg.hxx | 2 +- include/svtools/extcolorcfg.hxx | 2 +- include/svtools/imap.hxx | 4 ++-- include/svtools/svlbitm.hxx | 2 +- svl/source/fsstor/fsstorage.cxx | 5 ++--- svl/source/misc/filenotation.cxx | 6 +++--- 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 ++++----- 12 files changed, 22 insertions(+), 31 deletions(-)
New commits: commit 928dfebe109794eb079469a46f549e25b3b1e89d Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jul 26 14:36:38 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Jul 27 12:16:53 2018 +0200 loplugin:returnconstant in svl,svtools Change-Id: Id297a513f3313e10531f0ccd99a16277e4e37fa1 Reviewed-on: https://gerrit.libreoffice.org/58111 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svl/filenotation.hxx b/include/svl/filenotation.hxx index e5cf1c78a320..d33e442b9396 100644 --- a/include/svl/filenotation.hxx +++ b/include/svl/filenotation.hxx @@ -47,7 +47,7 @@ namespace svt private: SVL_DLLPRIVATE void construct( const OUString& _rUrlOrPath ); SVL_DLLPRIVATE bool implInitWithSystemNotation( const OUString& _rSystemPath ); - SVL_DLLPRIVATE bool implInitWithURLNotation( const OUString& _rURL ); + SVL_DLLPRIVATE void implInitWithURLNotation( const OUString& _rURL ); OUString m_sSystem; OUString m_sFileURL; diff --git a/include/svtools/colorcfg.hxx b/include/svtools/colorcfg.hxx index 450eed0e82c0..381ef70570c4 100644 --- a/include/svtools/colorcfg.hxx +++ b/include/svtools/colorcfg.hxx @@ -121,7 +121,7 @@ public: css::uno::Sequence< OUString > GetSchemeNames() const; void DeleteScheme(const OUString& rScheme ); void AddScheme(const OUString& rScheme ); - bool LoadScheme(const OUString& rScheme ); + void LoadScheme(const OUString& rScheme ); const OUString& GetCurrentSchemeName() const; void SetCurrentSchemeName(const OUString& rScheme); diff --git a/include/svtools/extcolorcfg.hxx b/include/svtools/extcolorcfg.hxx index 17e885661371..752784c92390 100644 --- a/include/svtools/extcolorcfg.hxx +++ b/include/svtools/extcolorcfg.hxx @@ -87,7 +87,7 @@ public: void DeleteScheme(const OUString& rScheme ); void AddScheme(const OUString& rScheme ); - bool LoadScheme(const OUString& rScheme ); + void LoadScheme(const OUString& rScheme ); void SetCurrentSchemeName(const OUString& rScheme); sal_Int32 GetComponentCount() const; diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx index 232248d20039..af094cbab817 100644 --- a/include/svtools/imap.hxx +++ b/include/svtools/imap.hxx @@ -46,8 +46,8 @@ private: // Import/Export void ImpWriteCERN( SvStream& rOStm ) const; void ImpWriteNCSA( SvStream& rOStm ) const; - sal_uLong ImpReadCERN( SvStream& rOStm ); - sal_uLong ImpReadNCSA( SvStream& rOStm ); + void ImpReadCERN( SvStream& rOStm ); + void ImpReadNCSA( SvStream& rOStm ); void ImpReadCERNLine( const OString& rLine ); static Point ImpReadCERNCoords( const char** ppStr ); diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx index a6ca61dceef0..3b603f47bbcf 100644 --- a/include/svtools/svlbitm.hxx +++ b/include/svtools/svlbitm.hxx @@ -154,7 +154,7 @@ public: SvViewDataItem* pViewData = nullptr) override; virtual SvLBoxItemType GetType() const override; - bool ClickHdl( SvTreeListEntry* ); + void ClickHdl( SvTreeListEntry* ); virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 6a28dc07d422..f01d7c583b9e 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -700,11 +700,10 @@ void SAL_CALL FSStorage::renameElement( const OUString& aElementName, const OUSt uno::Reference< ucb::XCommandEnvironment > xDummyEnv; ::ucbhelper::Content aSourceContent( aOldURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext() ); - if ( !GetContent()->transferContent( aSourceContent, + GetContent()->transferContent( aSourceContent, ::ucbhelper::InsertOperation::Move, aNewName, - ucb::NameClash::ERROR ) ) - throw io::IOException(); // TODO: error handling + ucb::NameClash::ERROR ); } catch( embed::InvalidStorageException& ) { diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx index bc3f5ccf946c..c4337708bc8b 100644 --- a/svl/source/misc/filenotation.cxx +++ b/svl/source/misc/filenotation.cxx @@ -70,11 +70,10 @@ namespace svt return bSuccess; } - bool OFileNotation::implInitWithURLNotation( const OUString& _rURL ) + void OFileNotation::implInitWithURLNotation( const OUString& _rURL ) { m_sFileURL = _rURL; osl_getSystemPathFromFileURL( _rURL.pData, &m_sSystem.pData ); - return true; } void OFileNotation::construct( const OUString& _rUrlOrPath ) @@ -86,7 +85,8 @@ namespace svt { case INetProtocol::File: // file URL - bSuccess = implInitWithURLNotation( _rUrlOrPath ); + implInitWithURLNotation( _rUrlOrPath ); + bSuccess = true; break; case INetProtocol::NotValid: 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: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits