summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-12 12:43:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-13 08:38:53 +0200
commitfdfd517a6f75e394ddcb1e195decbfed33ba56b9 (patch)
treee3bff14e5531affcd908415b4e85d7ceac4aa1fd /l10ntools
parente568c9dca8b93b96a8a130a8fb6f1bba1a33d6ea (diff)
loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/inc/lngmerge.hxx4
-rw-r--r--l10ntools/source/lngmerge.cxx10
2 files changed, 7 insertions, 7 deletions
diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 3a6c2cc27be5..7b60e4ff231b 100644
--- a/l10ntools/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
@@ -45,7 +45,7 @@ private:
std::vector<OString> aLanguages;
static bool isNextGroup(OString &sGroup_out, std::string_view sLine_in);
- static void ReadLine(const OString &rLine_in,
+ static void ReadLine(std::string_view rLine_in,
OStringHashMap &rText_inout);
static void WritePO(PoOfstream &aPOStream, OStringHashMap &rText_inout,
const OString &rActFileName, const OString &rID);
@@ -55,7 +55,7 @@ public:
void CreatePO( const OString &rPOFile );
void Merge(const OString &rPOFile, const OString &rDestinationFile,
- const OString &rLanguage );
+ std::string_view rLanguage );
};
#endif // INCLUDED_L10NTOOLS_INC_LNGMERGE_HXX
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 31bf50fc9126..33d928dbe539 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -134,14 +134,14 @@ bool LngParser::isNextGroup(OString &sGroup_out, std::string_view sLine_in)
return lcl_isNextGroup(sGroup_out, o3tl::trim(sLine_in));
}
-void LngParser::ReadLine(const OString &rLine_in,
+void LngParser::ReadLine(std::string_view rLine_in,
OStringHashMap &rText_inout)
{
- if (!rLine_in.match(" *") && !rLine_in.match("/*"))
+ if (!o3tl::starts_with(rLine_in, " *") && !o3tl::starts_with(rLine_in, "/*"))
{
OString sLang(o3tl::trim(o3tl::getToken(rLine_in, 0, '=')));
if (!sLang.isEmpty()) {
- OString sText(rLine_in.getToken(1, '"'));
+ OString sText(o3tl::getToken(rLine_in,1, '"'));
rText_inout[sLang] = sText;
}
}
@@ -150,13 +150,13 @@ void LngParser::ReadLine(const OString &rLine_in,
void LngParser::Merge(
const OString &rPOFile,
const OString &rDestinationFile,
- const OString &rLanguage )
+ std::string_view rLanguage )
{
std::ofstream aDestination(
rDestinationFile.getStr(), std::ios_base::out | std::ios_base::trunc);
MergeDataFile aMergeDataFile( rPOFile, sSource, false, true );
- if( rLanguage.equalsIgnoreAsciiCase("ALL") )
+ if( o3tl::equalsIgnoreAsciiCase(rLanguage, "ALL") )
aLanguages = aMergeDataFile.GetLanguages();
size_t nPos = 0;