From 6cac364376785bfc82fabf7f9ae82c94d3b2825f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 22 Jun 2022 09:09:57 +0200 Subject: clang-tidy modernize-pass-by-value in l10ntools Change-Id: Icf07a0f3784f0f39fa6b141a24aa25fddab71901 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136272 Tested-by: Jenkins Reviewed-by: Noel Grandin --- l10ntools/source/cfgmerge.cxx | 10 +++++----- l10ntools/source/helpmerge.cxx | 5 +++-- l10ntools/source/lngmerge.cxx | 5 +++-- l10ntools/source/merge.cxx | 11 ++++++----- l10ntools/source/propmerge.cxx | 7 ++++--- l10ntools/source/treemerge.cxx | 5 +++-- l10ntools/source/xmlparse.cxx | 9 +++++---- l10ntools/source/xrmmerge.cxx | 9 +++++---- 8 files changed, 34 insertions(+), 27 deletions(-) (limited to 'l10ntools/source') diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 9d6689fe8251..1e43f3e99394 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include namespace { @@ -327,9 +328,8 @@ void CfgParser::Execute( int nToken, char * pToken ) CfgExport::CfgExport( const OString &rOutputFile, - const OString &rFilePath ) - - : sPath( rFilePath ) + OString sFilePath ) + : sPath(std::move( sFilePath )) { pOutputStream.open( rOutputFile, PoOfstream::APP ); if (!pOutputStream.isOpen()) @@ -386,8 +386,8 @@ void CfgExport::WorkOnText( CfgMerge::CfgMerge( const OString &rMergeSource, const OString &rOutputFile, - const OString &rFilename, const OString &rLanguage ) - : sFilename( rFilename ), + OString _sFilename, const OString &rLanguage ) + : sFilename(std::move( _sFilename )), bEnglish( false ) { pOutputStream.open( diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index 42cdb6ce19ab..abdc47d1c1d4 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #ifdef _WIN32 @@ -66,8 +67,8 @@ void HelpParser::Dump(LangHashMap* rElem_in,const OString & sKey_in) } #endif -HelpParser::HelpParser( const OString &rHelpFile ) - : sHelpFile( rHelpFile ) +HelpParser::HelpParser( OString _sHelpFile ) + : sHelpFile(std::move( _sHelpFile )) {}; /*****************************************************************************/ diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 33d928dbe539..176cf46b6285 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -29,6 +29,7 @@ #include #include #include +#include namespace { @@ -57,8 +58,8 @@ void lcl_RemoveUTF8ByteOrderMarker( OString &rString ) -LngParser::LngParser(const OString &rLngFile) - : sSource( rLngFile ) +LngParser::LngParser(OString sLngFile) + : sSource(std::move( sLngFile )) { std::ifstream aStream(sSource.getStr()); if (!aStream.is_open()) diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 588cb73d8614..263e3d588121 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -65,17 +66,17 @@ namespace -ResData::ResData( const OString &rGId ) +ResData::ResData( OString _sGId ) : - sGId( rGId ) + sGId(std::move( _sGId )) { sGId = sGId.replaceAll("\r", OString()); } -ResData::ResData( const OString &rGId, const OString &rFilename) +ResData::ResData( OString _sGId, OString _sFilename) : - sGId( rGId ), - sFilename( rFilename ) + sGId(std::move( _sGId )), + sFilename(std::move( _sFilename )) { sGId = sGId.replaceAll("\r", OString()); } diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx index 7b74ab4d3cf8..c17519364443 100644 --- a/l10ntools/source/propmerge.cxx +++ b/l10ntools/source/propmerge.cxx @@ -20,6 +20,7 @@ #include #include #include +#include namespace { @@ -88,10 +89,10 @@ namespace //Open source file and store its lines PropParser::PropParser( - const OString& rInputFile, const OString& rLang, + OString _sInputFile, OString _sLang, const bool bMergeMode ) - : m_sSource( rInputFile ) - , m_sLang( rLang ) + : m_sSource(std::move( _sInputFile )) + , m_sLang(std::move( _sLang )) , m_bIsInitialized( false ) { std::ifstream aIfstream( m_sSource.getStr() ); diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx index 8e577f3dadbc..ff48aeda6b74 100644 --- a/l10ntools/source/treemerge.cxx +++ b/l10ntools/source/treemerge.cxx @@ -20,6 +20,7 @@ #include #include #include +#include namespace @@ -197,9 +198,9 @@ namespace } TreeParser::TreeParser( - const OString& rInputFile, const OString& rLang ) + const OString& rInputFile, OString _sLang ) : m_pSource( nullptr ) - , m_sLang( rLang ) + , m_sLang(std::move( _sLang )) , m_bIsInitialized( false ) { m_pSource = xmlParseFile( rInputFile.getStr() ); diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index 7e067f7f039b..b32ed4f5037a 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -300,9 +301,9 @@ XMLFile::~XMLFile() } } -XMLFile::XMLFile( const OString &rFileName ) // the file name, empty if created from memory stream +XMLFile::XMLFile( OString _sFileName ) // the file name, empty if created from memory stream : XMLParentNode( nullptr ) - , m_sFileName( rFileName ) + , m_sFileName(std::move( _sFileName )) { m_aNodes_localize.emplace( OString("bookmark") , true ); m_aNodes_localize.emplace( OString("variable") , true ); @@ -531,11 +532,11 @@ bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) } XMLElement::XMLElement( - const OString &rName, // the element name + OString _sName, // the element name XMLParentNode *pParent // parent node of this element ) : XMLParentNode( pParent ) - , m_sElementName( rName ) + , m_sElementName(std::move( _sName )) { } diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index b7a7e0042c01..e48348bdb5b7 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -275,8 +276,8 @@ void XRMResParser::Error( const OString &rError ) XRMResExport::XRMResExport( - const OString &rOutputFile, const OString &rFilePath ) - : sPath( rFilePath ) + const OString &rOutputFile, OString _sFilePath ) + : sPath(std::move( _sFilePath )) { pOutputStream.open( rOutputFile, PoOfstream::APP ); if (!pOutputStream.isOpen()) @@ -346,8 +347,8 @@ void XRMResExport::EndOfText( XRMResMerge::XRMResMerge( const OString &rMergeSource, const OString &rOutputFile, - const OString &rFilename ) - : sFilename( rFilename ) + OString _sFilename ) + : sFilename(std::move( _sFilename )) { if (!rMergeSource.isEmpty() && sLanguage.equalsIgnoreAsciiCase("ALL")) { -- cgit suse-3.6'>distro/suse/suse-3.6 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2016-08-18screenshots: add dialog test cases for uuiArmin Le Grand