From 602a64939da2df486099eba967aa9148ced1d8d4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 14 Jan 2016 16:31:22 +0200 Subject: loplugin:unusedmethods unused return value in l10ntools,linguistic Change-Id: I11571c25e527787a2054bc8106a27c44b8a96116 --- l10ntools/inc/cfgmerge.hxx | 2 +- l10ntools/inc/export.hxx | 7 ++--- l10ntools/inc/xrmmerge.hxx | 2 +- l10ntools/source/cfgmerge.cxx | 35 ++++++++++++++---------- l10ntools/source/export.cxx | 21 ++++++-------- l10ntools/source/merge.cxx | 7 ----- l10ntools/source/xrmmerge.cxx | 3 +- lingucomponent/source/languageguessing/guess.cxx | 11 -------- lingucomponent/source/languageguessing/guess.hxx | 2 -- linguistic/source/lngsvcmgr.cxx | 5 ++-- 10 files changed, 37 insertions(+), 58 deletions(-) diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx index 355f4c5c52e5..9f90fabc39f0 100644 --- a/l10ntools/inc/cfgmerge.hxx +++ b/l10ntools/inc/cfgmerge.hxx @@ -127,7 +127,7 @@ public: CfgParser(); virtual ~CfgParser(); - int Execute( int nToken, char * pToken ); + void Execute( int nToken, char * pToken ); }; /// Export strings from *.xcu files diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx index e4bbb873485a..7afc931c6ecb 100644 --- a/l10ntools/inc/export.hxx +++ b/l10ntools/inc/export.hxx @@ -144,8 +144,8 @@ private: ParserQueue* pParseQueue; - bool WriteData( ResData *pResData, bool bCreateNew = false ); ///< called before dest. cur ResData - bool WriteExportList( ResData *pResData, ExportList& rExportList, const sal_uInt16 nTyp ); + void WriteData( ResData *pResData, bool bCreateNew = false ); ///< called before dest. cur ResData + void WriteExportList( ResData *pResData, ExportList& rExportList, const sal_uInt16 nTyp ); OString FullId(); ///< creates cur. GID @@ -175,7 +175,7 @@ public: ~Export(); void Init(); - int Execute( int nToken, const char * pToken ); ///< called from lexer + void Execute( int nToken, const char * pToken ); ///< called from lexer void SetError() { bError = true; } bool GetError() { return bError; } @@ -298,7 +298,6 @@ public: ~MergeData(); MergeEntrys* GetMergeEntries() { return pMergeEntrys;} - bool operator==( ResData *pData ); }; diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx index fc58aa6998ff..8b421847bb43 100644 --- a/l10ntools/inc/xrmmerge.hxx +++ b/l10ntools/inc/xrmmerge.hxx @@ -61,7 +61,7 @@ public: XRMResParser(); virtual ~XRMResParser(); - int Execute( int nToken, char * pToken ); + void Execute( int nToken, char * pToken ); void SetError( bool bErr = true ) { bError = bErr; } bool GetError() { return bError; } diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 50c2a15bd2f8..ba2d15721683 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -303,27 +303,34 @@ void CfgExport::Output(const OString&) { } -int CfgParser::Execute( int nToken, char * pToken ) +void CfgParser::Execute( int nToken, char * pToken ) { OString sToken( pToken ); switch ( nToken ) { case CFG_TAG: - if ( sToken.indexOf( "package-id=" ) != -1 ) - return ExecuteAnalyzedToken( CFG_TOKEN_PACKAGE, pToken ); - else if ( sToken.indexOf( "component-id=" ) != -1 ) - return ExecuteAnalyzedToken( CFG_TOKEN_COMPONENT, pToken ); - else if ( sToken.indexOf( "template-id=" ) != -1 ) - return ExecuteAnalyzedToken( CFG_TOKEN_TEMPLATE, pToken ); - else if ( sToken.indexOf( "cfg:name=" ) != -1 ) - return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); - else if ( sToken.indexOf( "oor:name=" ) != -1 ) - return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); - else if ( sToken.indexOf( "oor:value=" ) != -1 ) - return ExecuteAnalyzedToken( CFG_TOKEN_OORVALUE, pToken ); + if ( sToken.indexOf( "package-id=" ) != -1 ) { + ExecuteAnalyzedToken( CFG_TOKEN_PACKAGE, pToken ); + return; + } else if ( sToken.indexOf( "component-id=" ) != -1 ) { + ExecuteAnalyzedToken( CFG_TOKEN_COMPONENT, pToken ); + return; + } else if ( sToken.indexOf( "template-id=" ) != -1 ) { + ExecuteAnalyzedToken( CFG_TOKEN_TEMPLATE, pToken ); + return; + } else if ( sToken.indexOf( "cfg:name=" ) != -1 ) { + ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); + return; + } else if ( sToken.indexOf( "oor:name=" ) != -1 ) { + ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); + return; + } else if ( sToken.indexOf( "oor:value=" ) != -1 ) { + ExecuteAnalyzedToken( CFG_TOKEN_OORVALUE, pToken ); + return; + } break; } - return ExecuteAnalyzedToken( nToken, pToken ); + ExecuteAnalyzedToken( nToken, pToken ); } void CfgParser::Error(const OString& rError) diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 7fd87c0ed164..26b3fe511cef 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -279,7 +279,7 @@ Export::~Export() } } -int Export::Execute( int nToken, const char * pToken ) +void Export::Execute( int nToken, const char * pToken ) { OString sToken( pToken ); @@ -300,7 +300,7 @@ int Export::Execute( int nToken, const char * pToken ) // this tokens are not mandatory for parsing, so ignore them ... if ( bMergeMode ) WriteToMerged( sOrig , false ); // ... or write them directly to dest. - return 0; + return; } ResData *pResData = nullptr; @@ -320,7 +320,7 @@ int Export::Execute( int nToken, const char * pToken ) // no res. exists at cur. level so return if ( bMergeMode ) WriteToMerged( sOrig , false ); - return 0; + return; } if ( bDefine ) { @@ -338,7 +338,7 @@ int Export::Execute( int nToken, const char * pToken ) bNextMustBeDefineEOL = false; if ( bMergeMode ) WriteToMerged( sOrig , false ); - return 1; + return; } } } @@ -375,7 +375,7 @@ int Export::Execute( int nToken, const char * pToken ) case NORMDEFINE: if ( bMergeMode ) WriteToMerged( sOrig , false ); - return 0; + return; case RSCDEFINE: bDefine = true; // res. defined in macro @@ -671,8 +671,6 @@ int Export::Execute( int nToken, const char * pToken ) if ( bExecuteDown ) { Parse( LEVELDOWN, "" ); } - - return 1; } void Export::CutComment( OString &rText ) @@ -691,11 +689,11 @@ void Export::CutComment( OString &rText ) } } -bool Export::WriteData( ResData *pResData, bool bCreateNew ) +void Export::WriteData( ResData *pResData, bool bCreateNew ) { if ( bMergeMode ) { MergeRest( pResData ); - return true; + return; } // mandatory to export: en-US @@ -755,7 +753,6 @@ bool Export::WriteData( ResData *pResData, bool bCreateNew ) if ( bCreateNew ) pResData->m_aList.clear(); } - return true; } OString Export::GetPairedListID(const OString& rText) @@ -780,7 +777,7 @@ OString Export::StripList(const OString & rText) return s1.copy( 0 , s1.lastIndexOf('\"')); } -bool Export::WriteExportList(ResData *pResData, ExportList& rExportList, +void Export::WriteExportList(ResData *pResData, ExportList& rExportList, const sal_uInt16 nTyp) { OString sGID(pResData->sGId); @@ -822,8 +819,6 @@ bool Export::WriteExportList(ResData *pResData, ExportList& rExportList, "Transex3", *aOutput.mPo, global::inputPathname, sType, sGID, sLID, OString(), sText); } - - return true; } OString Export::FullId() diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index c3a0b094a24b..634621616f44 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -206,13 +206,6 @@ MergeData::~MergeData() } -bool MergeData::operator==( ResData *pData ) -{ - return pData->sId == sLID && pData->sGId == sGID - && pData->sResTyp.equalsIgnoreAsciiCase(sTyp); -} - - // class MergeDataFile diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 230f6a62f7fb..53e72eb4968c 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -157,7 +157,7 @@ XRMResParser::~XRMResParser() { } -int XRMResParser::Execute( int nToken, char * pToken ) +void XRMResParser::Execute( int nToken, char * pToken ) { OString rToken( pToken ); @@ -261,7 +261,6 @@ int XRMResParser::Execute( int nToken, char * pToken ) { Output( rToken ); } - return 0; } OString XRMResParser::GetAttribute( const OString &rToken, const OString &rAttribute ) diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx index fa1e6f62b804..9d1751e96741 100644 --- a/lingucomponent/source/languageguessing/guess.cxx +++ b/lingucomponent/source/languageguessing/guess.cxx @@ -109,15 +109,4 @@ Guess::~Guess() { } -bool Guess::operator==(const string& lang) -{ - string toString; - toString += GetLanguage(); - toString += "-"; - toString += GetCountry(); - toString += "-"; - toString += GetEncoding(); - return start(toString, lang); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/languageguessing/guess.hxx b/lingucomponent/source/languageguessing/guess.hxx index 4e9644f5ecd1..98ebe3673824 100644 --- a/lingucomponent/source/languageguessing/guess.hxx +++ b/lingucomponent/source/languageguessing/guess.hxx @@ -52,8 +52,6 @@ class Guess{ string GetCountry() { return country_str;} string GetEncoding() { return encoding_str;} - bool operator==(const string& lang); - protected: string language_str; string country_str; diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index a1c06675a51b..9c5919f11f47 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -191,7 +191,7 @@ class LngSvcMgrListenerHelper : void LaunchEvent( sal_Int16 nLngSvcEvtFlags ); - long Timeout(); + void Timeout(); public: LngSvcMgrListenerHelper( LngSvcMgr &rLngSvcMgr, @@ -260,7 +260,7 @@ void SAL_CALL LngSvcMgrListenerHelper::disposing( const lang::EventObject& rSour } } -long LngSvcMgrListenerHelper::Timeout() +void LngSvcMgrListenerHelper::Timeout() { osl::MutexGuard aGuard( GetLinguMutex() ); @@ -284,7 +284,6 @@ long LngSvcMgrListenerHelper::Timeout() xRef->processLinguServiceEvent( aEvtObj ); } } - return 0; } -- cgit