diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-01 17:42:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-02 13:31:19 +0200 |
commit | 1927b51993fb68907a75765676179b08ab195196 (patch) | |
tree | 1b7d09c1b5e7ea945fb6ea618a4c100e8630ebb4 /l10ntools/source/localize.cxx | |
parent | 0dfa444f393a5766d36fe7d2480d0c8ec832e329 (diff) |
loplugin:stringviewparam convert methods using indexOf
.. and lastIndexOf, which convert to find and rfind
Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools/source/localize.cxx')
-rw-r--r-- | l10ntools/source/localize.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 8dc1f26422ac..d89f89150d04 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -117,13 +117,13 @@ void handleCommand( void InitPoFile( std::string_view rProject, const OString& rInPath, - const OString& rPotDir, const OString& rOutPath ) + std::string_view rPotDir, const OString& rOutPath ) { //Create directory for po file { OUString outDir = OStringToOUString( - rPotDir.subView(0,rPotDir.lastIndexOf('/')), RTL_TEXTENCODING_UTF8); + rPotDir.substr(0,rPotDir.rfind('/')), RTL_TEXTENCODING_UTF8); OUString outDirUrl; if (osl::FileBase::getFileURLFromSystemPath(outDir, outDirUrl) != osl::FileBase::E_None) @@ -174,7 +174,7 @@ bool fileExists(const OString& fileName) OString gDestRoot; -bool handleFile(std::string_view rProject, const OUString& rUrl, const OString& rPotDir) +bool handleFile(std::string_view rProject, const OUString& rUrl, std::string_view rPotDir) { struct Command { std::u16string_view extension; @@ -216,7 +216,7 @@ bool handleFile(std::string_view rProject, const OUString& rUrl, const OString& if (bSimpleModuleCase) sOutPath = gDestRoot + "/" + rProject + "/messages.pot"; else - sOutPath = rPotDir + ".pot"; + sOutPath = OString::Concat(rPotDir) + ".pot"; if (!fileExists(sOutPath)) { @@ -280,7 +280,7 @@ bool handleFile(std::string_view rProject, const OUString& rUrl, const OString& void handleFilesOfDir( std::vector<OUString>& aFiles, std::string_view rProject, - const OString& rPotDir ) + std::string_view rPotDir ) { ///Handle files in lexical order std::sort(aFiles.begin(), aFiles.end()); |