summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-09 09:55:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-10 12:59:38 +0200
commite4ff847fe0796420ba8023b70cad8589f5f19e9f (patch)
tree136786200de69f70dde4190c9725f35fe14b33e0 /connectivity
parent5a89496ffcfcd561b3e595e01f35e0302fa00841 (diff)
loplugin:stringview check for getToken and trim
since we now have o3tl versions of those that work on string_view. Also improve those o3tl functions to support both string_view and u16string_view Change-Id: Iacab2996becec62aa78a5597c52d983bb784749a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132755 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
index ae775b6fca01..a146d0c09680 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
@@ -22,6 +22,7 @@
#include <osl/file.h>
#include <rtl/byteseq.hxx>
#include <sal/log.hxx>
+#include <o3tl/string_view.hxx>
IniParser::IniParser(OUString const & rIniName)
{
@@ -62,9 +63,9 @@ IniParser::IniParser(OUString const & rIniName)
ini_Section *aSection = &mAllSection[sectionName];
struct ini_NameValue nameValue;
nameValue.sName = OStringToOUString(
- line.copy(0,nIndex).trim(), RTL_TEXTENCODING_ASCII_US );
+ o3tl::trim(line.subView(0,nIndex)), RTL_TEXTENCODING_ASCII_US );
nameValue.sValue = OStringToOUString(
- line.copy(nIndex+1).trim(), RTL_TEXTENCODING_UTF8 );
+ o3tl::trim(line.subView(nIndex+1)), RTL_TEXTENCODING_UTF8 );
aSection->vVector.push_back(nameValue);
@@ -76,7 +77,7 @@ IniParser::IniParser(OUString const & rIniName)
if ( nIndexEnd > nIndexStart && nIndexStart >=0)
{
sectionName = OStringToOUString(
- line.copy(nIndexStart + 1,nIndexEnd - nIndexStart -1).trim(), RTL_TEXTENCODING_ASCII_US );
+ o3tl::trim(line.subView(nIndexStart + 1,nIndexEnd - nIndexStart -1)), RTL_TEXTENCODING_ASCII_US );
if (sectionName.isEmpty())
sectionName = "no name section";
}