diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-22 09:09:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-06-23 08:54:00 +0200 |
commit | 6cac364376785bfc82fabf7f9ae82c94d3b2825f (patch) | |
tree | 9582a98995be51c3ca5fd4fb95046b532092acd9 /l10ntools/source | |
parent | 154cffd87ee4a21b5c0c291f84c95d74cde2a143 (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools/source')
-rw-r--r-- | l10ntools/source/cfgmerge.cxx | 10 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 5 | ||||
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 5 | ||||
-rw-r--r-- | l10ntools/source/merge.cxx | 11 | ||||
-rw-r--r-- | l10ntools/source/propmerge.cxx | 7 | ||||
-rw-r--r-- | l10ntools/source/treemerge.cxx | 5 | ||||
-rw-r--r-- | l10ntools/source/xmlparse.cxx | 9 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 9 |
8 files changed, 34 insertions, 27 deletions
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 <helper.hxx> #include <export.hxx> #include <cfgmerge.hxx> +#include <utility> #include <tokens.h> 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 <stdio.h> #include <stdlib.h> #include <helpmerge.hxx> +#include <utility> #include <vector> #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 <common.hxx> #include <po.hxx> #include <lngmerge.hxx> +#include <utility> 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 <fstream> #include <iostream> #include <string> +#include <utility> #include <vector> #include <export.hxx> @@ -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 <export.hxx> #include <common.hxx> #include <propmerge.hxx> +#include <utility> 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 <common.hxx> #include <po.hxx> #include <treemerge.hxx> +#include <utility> 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 <string_view> #include <helper.hxx> +#include <utility> #include <xmlparse.hxx> #include <fstream> #include <iostream> @@ -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 <common.hxx> #include <export.hxx> #include <po.hxx> +#include <utility> #include <xrmlex.hxx> #include <xrmmerge.hxx> #include <tokens.h> @@ -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")) { |