From b15ee18a5e81b7c3908fb5343930638cac4918d9 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Mon, 11 Apr 2016 09:09:44 +0200 Subject: cppcheck: silence warnings assertWithSideEffect Mark some class methods as pure. warnings look like this: > dbaccess/source/core/api/RowSetBase.cxx > 593 assertWithSideEffect 398 warning Assert statement calls > a function which may have desired side effects: 'isAfterLast'. Change-Id: I1b69340c3714be4678b599fa9a8ca933122aa857 Reviewed-on: https://gerrit.libreoffice.org/23981 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- dbaccess/source/core/api/RowSetCache.hxx | 4 ++-- sot/source/sdstor/stgcache.hxx | 8 ++++---- svl/source/config/cjkoptions.cxx | 2 +- svl/source/config/ctloptions.cxx | 2 +- vcl/win/gdi/winlayout.cxx | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx index 86bb8ccfe355..c623d3481344 100644 --- a/dbaccess/source/core/api/RowSetCache.hxx +++ b/dbaccess/source/core/api/RowSetCache.hxx @@ -174,8 +174,8 @@ namespace dbaccess // css::sdbc::XResultSet bool next( ); - bool isBeforeFirst( ) { return m_bBeforeFirst;} - bool isAfterLast( ) { return m_bAfterLast;} + bool isBeforeFirst( ) const { return m_bBeforeFirst;} + bool isAfterLast( ) const { return m_bAfterLast;} bool isFirst( ); bool isLast( ); bool beforeFirst( ); diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx index 3c0d866524a0..d0ac5c89494e 100644 --- a/sot/source/sdstor/stgcache.hxx +++ b/sot/source/sdstor/stgcache.hxx @@ -66,13 +66,13 @@ public: void IncRef() { m_nRef++; } sal_uInt16 DecRef() { return --m_nRef; } void SetPhysPageSize( short ); - sal_Int32 GetPhysPages() { return m_nPages; } - short GetPhysPageSize() { return m_nPageSize; } + sal_Int32 GetPhysPages() const { return m_nPages; } + short GetPhysPageSize() const { return m_nPageSize; } SvStream* GetStrm() { return m_pStrm; } void SetStrm( SvStream*, bool ); void SetStrm( UCBStorageStream* ); - bool IsWritable() { return ( m_pStrm && m_pStrm->IsWritable() ); } - bool Good() { return m_nError == SVSTREAM_OK; } + bool IsWritable() const { return ( m_pStrm && m_pStrm->IsWritable() ); } + bool Good() const { return m_nError == SVSTREAM_OK; } ErrCode GetError() { return m_nError; } void MoveError( StorageBase& ); void SetError( ErrCode ); diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx index a9b7786fc32f..906250174d41 100644 --- a/svl/source/config/cjkoptions.cxx +++ b/svl/source/config/cjkoptions.cxx @@ -66,7 +66,7 @@ public: virtual void Notify( const css::uno::Sequence< OUString >& rPropertyNames ) override; void Load(); - bool IsLoaded() { return bIsLoaded; } + bool IsLoaded() const { return bIsLoaded; } bool IsCJKFontEnabled() const { return bCJKFont; } bool IsVerticalTextEnabled() const { return bVerticalText; } diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx index e431ecf64034..7aed551e926a 100644 --- a/svl/source/config/ctloptions.cxx +++ b/svl/source/config/ctloptions.cxx @@ -63,7 +63,7 @@ public: virtual void Notify( const Sequence< OUString >& _aPropertyNames ) override; void Load(); - bool IsLoaded() { return m_bIsLoaded; } + bool IsLoaded() const { return m_bIsLoaded; } void SetCTLFontEnabled( bool _bEnabled ); bool IsCTLFontEnabled() const { return m_bCTLFontEnabled; } diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index f370ff57a4bc..eb4e15e80b89 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -124,7 +124,7 @@ public: return maOpenGLTextureCache[nGlyphIndex]; } - bool IsGlyphCached(int nGlyphIndex) + bool IsGlyphCached(int nGlyphIndex) const { return maOpenGLTextureCache.find(nGlyphIndex) != maOpenGLTextureCache.end(); } -- cgit