From b44cbb26efe1d0b0950b1e1613e131b506dc3876 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 20 Jan 2015 12:38:10 +0200 Subject: new loplugin: change virtual methods to non-virtual Where we can prove that the virtual method is never overriden. In the case of pure-virtual methods, we remove the method entirely. Sometimes this leads to entire methods and fields being eliminated. Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae --- xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx | 4 ++-- xmlhelp/source/cxxhelp/inc/util/CompressorIterator.hxx | 2 +- xmlhelp/source/cxxhelp/inc/util/Decompressor.hxx | 10 ++-------- xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx | 10 +++++----- xmlhelp/source/cxxhelp/util/Decompressor.cxx | 13 +------------ 5 files changed, 11 insertions(+), 28 deletions(-) (limited to 'xmlhelp') diff --git a/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx b/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx index 6acfafd749b5..820ff70f3ae1 100644 --- a/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx +++ b/xmlhelp/source/cxxhelp/inc/qe/DocGenerator.hxx @@ -38,8 +38,8 @@ namespace xmlsearch { static const sal_Int32 END; virtual ~NonnegativeIntegerGenerator() { }; - virtual sal_Int32 first() throw( xmlsearch::excep::XmlSearchException ) = 0; - virtual sal_Int32 next() throw( xmlsearch::excep::XmlSearchException ) = 0; + ; + ; }; diff --git a/xmlhelp/source/cxxhelp/inc/util/CompressorIterator.hxx b/xmlhelp/source/cxxhelp/inc/util/CompressorIterator.hxx index bc24283ededa..f37884068f3d 100644 --- a/xmlhelp/source/cxxhelp/inc/util/CompressorIterator.hxx +++ b/xmlhelp/source/cxxhelp/inc/util/CompressorIterator.hxx @@ -27,7 +27,7 @@ namespace xmlsearch { class CompressorIterator { public: - virtual void value( sal_Int32 ) = 0; + ; protected: ~CompressorIterator() {} diff --git a/xmlhelp/source/cxxhelp/inc/util/Decompressor.hxx b/xmlhelp/source/cxxhelp/inc/util/Decompressor.hxx index f2c148c788e3..6ca159e8a709 100644 --- a/xmlhelp/source/cxxhelp/inc/util/Decompressor.hxx +++ b/xmlhelp/source/cxxhelp/inc/util/Decompressor.hxx @@ -41,7 +41,7 @@ namespace xmlsearch { virtual sal_Int32 getNextByte() = 0; - virtual void initReading() + void initReading() { toRead_ = 0; } @@ -62,8 +62,7 @@ namespace xmlsearch { { public: - StreamDecompressor( RandomAccessStream* in ) - : in_( in ) + StreamDecompressor( RandomAccessStream* ) { } @@ -71,11 +70,6 @@ namespace xmlsearch { virtual sal_Int32 getNextByte() SAL_OVERRIDE; - - private: - - RandomAccessStream* in_; - }; diff --git a/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx b/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx index f536a017ba81..efcebc85a830 100644 --- a/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx +++ b/xmlhelp/source/cxxhelp/inc/util/RandomAccessStream.hxx @@ -33,11 +33,11 @@ namespace xmlsearch { virtual ~RandomAccessStream() { }; // The calle is responsible for allocating the buffer - virtual void seek( sal_Int32 ) = 0; - virtual sal_Int32 readBytes( sal_Int8*,sal_Int32 ) = 0; - virtual void writeBytes( sal_Int8*, sal_Int32 ) = 0; - virtual sal_Int32 length() = 0; - virtual void close() = 0; + ; + ; + ; + ; + ; protected: diff --git a/xmlhelp/source/cxxhelp/util/Decompressor.cxx b/xmlhelp/source/cxxhelp/util/Decompressor.cxx index 12981610e838..a52fb75bcf15 100644 --- a/xmlhelp/source/cxxhelp/util/Decompressor.cxx +++ b/xmlhelp/source/cxxhelp/util/Decompressor.cxx @@ -26,22 +26,11 @@ using namespace xmlsearch::util; const sal_Int32 Decompressor::BitsInByte = 8; const sal_Int32 Decompressor::NBits = 32; -inline sal_Int32 getInteger_( const sal_Int8* v ) -{ - return (((((( (v[0]&0xFF) ) << 8 ) - | (v[1]&0xFF) ) << 8 ) - | (v[2]&0xFF) ) << 8 ) - | (v[3]&0xFF); -} - sal_Int32 StreamDecompressor::getNextByte() { sal_Int8 a[4]; a[0] = a[1] = a[2] = 0; - if( in_->readBytes( &a[3],1 ) != -1 ) - return getInteger_( a ); - else - return -1; + return -1; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit