Kaydet (Commit) 928dfebe authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:returnconstant in svl,svtools

Change-Id: Id297a513f3313e10531f0ccd99a16277e4e37fa1
Reviewed-on: https://gerrit.libreoffice.org/58111
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst bd28564b
...@@ -47,7 +47,7 @@ namespace svt ...@@ -47,7 +47,7 @@ namespace svt
private: private:
SVL_DLLPRIVATE void construct( const OUString& _rUrlOrPath ); SVL_DLLPRIVATE void construct( const OUString& _rUrlOrPath );
SVL_DLLPRIVATE bool implInitWithSystemNotation( const OUString& _rSystemPath ); 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_sSystem;
OUString m_sFileURL; OUString m_sFileURL;
......
...@@ -121,7 +121,7 @@ public: ...@@ -121,7 +121,7 @@ public:
css::uno::Sequence< OUString > GetSchemeNames() const; css::uno::Sequence< OUString > GetSchemeNames() const;
void DeleteScheme(const OUString& rScheme ); void DeleteScheme(const OUString& rScheme );
void AddScheme(const OUString& rScheme ); void AddScheme(const OUString& rScheme );
bool LoadScheme(const OUString& rScheme ); void LoadScheme(const OUString& rScheme );
const OUString& GetCurrentSchemeName() const; const OUString& GetCurrentSchemeName() const;
void SetCurrentSchemeName(const OUString& rScheme); void SetCurrentSchemeName(const OUString& rScheme);
......
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
void DeleteScheme(const OUString& rScheme ); void DeleteScheme(const OUString& rScheme );
void AddScheme(const OUString& rScheme ); void AddScheme(const OUString& rScheme );
bool LoadScheme(const OUString& rScheme ); void LoadScheme(const OUString& rScheme );
void SetCurrentSchemeName(const OUString& rScheme); void SetCurrentSchemeName(const OUString& rScheme);
sal_Int32 GetComponentCount() const; sal_Int32 GetComponentCount() const;
......
...@@ -46,8 +46,8 @@ private: ...@@ -46,8 +46,8 @@ private:
// Import/Export // Import/Export
void ImpWriteCERN( SvStream& rOStm ) const; void ImpWriteCERN( SvStream& rOStm ) const;
void ImpWriteNCSA( SvStream& rOStm ) const; void ImpWriteNCSA( SvStream& rOStm ) const;
sal_uLong ImpReadCERN( SvStream& rOStm ); void ImpReadCERN( SvStream& rOStm );
sal_uLong ImpReadNCSA( SvStream& rOStm ); void ImpReadNCSA( SvStream& rOStm );
void ImpReadCERNLine( const OString& rLine ); void ImpReadCERNLine( const OString& rLine );
static Point ImpReadCERNCoords( const char** ppStr ); static Point ImpReadCERNCoords( const char** ppStr );
......
...@@ -154,7 +154,7 @@ public: ...@@ -154,7 +154,7 @@ public:
SvViewDataItem* pViewData = nullptr) override; SvViewDataItem* pViewData = nullptr) override;
virtual SvLBoxItemType GetType() const override; virtual SvLBoxItemType GetType() const override;
bool ClickHdl( SvTreeListEntry* ); void ClickHdl( SvTreeListEntry* );
virtual void Paint(const Point& rPos, virtual void Paint(const Point& rPos,
SvTreeListBox& rOutDev, SvTreeListBox& rOutDev,
......
...@@ -700,11 +700,10 @@ void SAL_CALL FSStorage::renameElement( const OUString& aElementName, const OUSt ...@@ -700,11 +700,10 @@ void SAL_CALL FSStorage::renameElement( const OUString& aElementName, const OUSt
uno::Reference< ucb::XCommandEnvironment > xDummyEnv; uno::Reference< ucb::XCommandEnvironment > xDummyEnv;
::ucbhelper::Content aSourceContent( aOldURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext() ); ::ucbhelper::Content aSourceContent( aOldURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), xDummyEnv, comphelper::getProcessComponentContext() );
if ( !GetContent()->transferContent( aSourceContent, GetContent()->transferContent( aSourceContent,
::ucbhelper::InsertOperation::Move, ::ucbhelper::InsertOperation::Move,
aNewName, aNewName,
ucb::NameClash::ERROR ) ) ucb::NameClash::ERROR );
throw io::IOException(); // TODO: error handling
} }
catch( embed::InvalidStorageException& ) catch( embed::InvalidStorageException& )
{ {
......
...@@ -70,11 +70,10 @@ namespace svt ...@@ -70,11 +70,10 @@ namespace svt
return bSuccess; return bSuccess;
} }
bool OFileNotation::implInitWithURLNotation( const OUString& _rURL ) void OFileNotation::implInitWithURLNotation( const OUString& _rURL )
{ {
m_sFileURL = _rURL; m_sFileURL = _rURL;
osl_getSystemPathFromFileURL( _rURL.pData, &m_sSystem.pData ); osl_getSystemPathFromFileURL( _rURL.pData, &m_sSystem.pData );
return true;
} }
void OFileNotation::construct( const OUString& _rUrlOrPath ) void OFileNotation::construct( const OUString& _rUrlOrPath )
...@@ -86,7 +85,8 @@ namespace svt ...@@ -86,7 +85,8 @@ namespace svt
{ {
case INetProtocol::File: case INetProtocol::File:
// file URL // file URL
bSuccess = implInitWithURLNotation( _rUrlOrPath ); implInitWithURLNotation( _rUrlOrPath );
bSuccess = true;
break; break;
case INetProtocol::NotValid: case INetProtocol::NotValid:
......
...@@ -540,7 +540,7 @@ void EditableColorConfig::AddScheme(const OUString& rScheme ) ...@@ -540,7 +540,7 @@ void EditableColorConfig::AddScheme(const OUString& rScheme )
m_pImpl->AddScheme(rScheme); m_pImpl->AddScheme(rScheme);
} }
bool EditableColorConfig::LoadScheme(const OUString& rScheme ) void EditableColorConfig::LoadScheme(const OUString& rScheme )
{ {
if(m_bModified) if(m_bModified)
m_pImpl->SetModified(); m_pImpl->SetModified();
...@@ -550,7 +550,6 @@ bool EditableColorConfig::LoadScheme(const OUString& rScheme ) ...@@ -550,7 +550,6 @@ bool EditableColorConfig::LoadScheme(const OUString& rScheme )
m_pImpl->Load(rScheme); m_pImpl->Load(rScheme);
//the name of the loaded scheme has to be committed separately //the name of the loaded scheme has to be committed separately
m_pImpl->CommitCurrentSchemeName(); m_pImpl->CommitCurrentSchemeName();
return true;
} }
const OUString& EditableColorConfig::GetCurrentSchemeName()const const OUString& EditableColorConfig::GetCurrentSchemeName()const
......
...@@ -596,7 +596,7 @@ void EditableExtendedColorConfig::AddScheme(const OUString& rScheme ) ...@@ -596,7 +596,7 @@ void EditableExtendedColorConfig::AddScheme(const OUString& rScheme )
m_pImpl->AddScheme(rScheme); m_pImpl->AddScheme(rScheme);
} }
bool EditableExtendedColorConfig::LoadScheme(const OUString& rScheme ) void EditableExtendedColorConfig::LoadScheme(const OUString& rScheme )
{ {
if(m_bModified) if(m_bModified)
m_pImpl->SetModified(); m_pImpl->SetModified();
...@@ -606,7 +606,6 @@ bool EditableExtendedColorConfig::LoadScheme(const OUString& rScheme ) ...@@ -606,7 +606,6 @@ bool EditableExtendedColorConfig::LoadScheme(const OUString& rScheme )
m_pImpl->Load(rScheme); m_pImpl->Load(rScheme);
//the name of the loaded scheme has to be committed separately //the name of the loaded scheme has to be committed separately
m_pImpl->CommitCurrentSchemeName(); m_pImpl->CommitCurrentSchemeName();
return true;
} }
// Changes the name of the current scheme but doesn't load it! // Changes the name of the current scheme but doesn't load it!
......
...@@ -248,7 +248,7 @@ SvLBoxItemType SvLBoxButton::GetType() const ...@@ -248,7 +248,7 @@ SvLBoxItemType SvLBoxButton::GetType() const
return SvLBoxItemType::Button; return SvLBoxItemType::Button;
} }
bool SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry ) void SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry )
{ {
if ( CheckModification() ) if ( CheckModification() )
{ {
...@@ -259,7 +259,6 @@ bool SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry ) ...@@ -259,7 +259,6 @@ bool SvLBoxButton::ClickHdl( SvTreeListEntry* pEntry )
pData->StoreButtonState( pEntry ); pData->StoreButtonState( pEntry );
pData->CallLink(); pData->CallLink();
} }
return false;
} }
void SvLBoxButton::Paint( void SvLBoxButton::Paint(
......
...@@ -219,8 +219,8 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat ) ...@@ -219,8 +219,8 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat )
switch ( nFormat ) switch ( nFormat )
{ {
case IMAP_FORMAT_BIN : Read( rIStm ); break; case IMAP_FORMAT_BIN : Read( rIStm ); break;
case IMAP_FORMAT_CERN : nRet = ImpReadCERN( rIStm ); break; case IMAP_FORMAT_CERN : ImpReadCERN( rIStm ); break;
case IMAP_FORMAT_NCSA : nRet = ImpReadNCSA( rIStm ); break; case IMAP_FORMAT_NCSA : ImpReadNCSA( rIStm ); break;
default: default:
break; break;
...@@ -232,7 +232,7 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat ) ...@@ -232,7 +232,7 @@ sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat )
return nRet; return nRet;
} }
sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm ) void ImageMap::ImpReadCERN( SvStream& rIStm )
{ {
// delete old content // delete old content
ClearImageMap(); ClearImageMap();
...@@ -240,8 +240,6 @@ sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm ) ...@@ -240,8 +240,6 @@ sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm )
OString aStr; OString aStr;
while ( rIStm.ReadLine( aStr ) ) while ( rIStm.ReadLine( aStr ) )
ImpReadCERNLine( aStr ); ImpReadCERNLine( aStr );
return IMAP_ERR_OK;
} }
void ImageMap::ImpReadCERNLine( const OString& rLine ) void ImageMap::ImpReadCERNLine( const OString& rLine )
...@@ -369,7 +367,7 @@ OUString ImageMap::ImpReadCERNURL( const char** ppStr ) ...@@ -369,7 +367,7 @@ OUString ImageMap::ImpReadCERNURL( const char** ppStr )
return INetURLObject::GetAbsURL( "", aStr ); return INetURLObject::GetAbsURL( "", aStr );
} }
sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm ) void ImageMap::ImpReadNCSA( SvStream& rIStm )
{ {
// delete old content // delete old content
ClearImageMap(); ClearImageMap();
...@@ -377,8 +375,6 @@ sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm ) ...@@ -377,8 +375,6 @@ sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm )
OString aStr; OString aStr;
while ( rIStm.ReadLine( aStr ) ) while ( rIStm.ReadLine( aStr ) )
ImpReadNCSALine( aStr ); ImpReadNCSALine( aStr );
return IMAP_ERR_OK;
} }
void ImageMap::ImpReadNCSALine( const OString& rLine ) void ImageMap::ImpReadNCSALine( const OString& rLine )
......
...@@ -508,7 +508,7 @@ public: ...@@ -508,7 +508,7 @@ public:
explicit SvUnoImageMap(); explicit SvUnoImageMap();
SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* pSupportedMacroItems ); SvUnoImageMap( const ImageMap& rMap, const SvEventDescription* pSupportedMacroItems );
bool fillImageMap( ImageMap& rMap ) const; void fillImageMap( ImageMap& rMap ) const;
/// @throws IllegalArgumentException /// @throws IllegalArgumentException
static SvUnoImageMapObject* getObject( const Any& aElement ); static SvUnoImageMapObject* getObject( const Any& aElement );
...@@ -667,7 +667,7 @@ Sequence< OUString > SAL_CALL SvUnoImageMap::getSupportedServiceNames( ) ...@@ -667,7 +667,7 @@ Sequence< OUString > SAL_CALL SvUnoImageMap::getSupportedServiceNames( )
return Sequence< OUString >( &aSN, 1 ); return Sequence< OUString >( &aSN, 1 );
} }
bool SvUnoImageMap::fillImageMap( ImageMap& rMap ) const void SvUnoImageMap::fillImageMap( ImageMap& rMap ) const
{ {
rMap.ClearImageMap(); rMap.ClearImageMap();
...@@ -679,8 +679,6 @@ bool SvUnoImageMap::fillImageMap( ImageMap& rMap ) const ...@@ -679,8 +679,6 @@ bool SvUnoImageMap::fillImageMap( ImageMap& rMap ) const
rMap.InsertIMapObject( *pNewMapObject ); rMap.InsertIMapObject( *pNewMapObject );
delete pNewMapObject; delete pNewMapObject;
} }
return true;
} }
...@@ -718,7 +716,8 @@ bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, Image ...@@ -718,7 +716,8 @@ bool SvUnoImageMap_fillImageMap( const Reference< XInterface >& xImageMap, Image
if( nullptr == pUnoImageMap ) if( nullptr == pUnoImageMap )
return false; return false;
return pUnoImageMap->fillImageMap( rMap ); pUnoImageMap->fillImageMap( rMap );
return true;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment