summaryrefslogtreecommitdiff
path: root/oox
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 /oox
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 'oox')
-rw-r--r--oox/source/dump/dumperbase.cxx3
-rw-r--r--oox/source/helper/attributelist.cxx2
-rw-r--r--oox/source/ole/axcontrol.cxx2
3 files changed, 4 insertions, 3 deletions
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index d68b382e38e4..2f7d7edc7815 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -32,6 +32,7 @@
#include <oox/helper/binaryoutputstream.hxx>
#include <oox/helper/textinputstream.hxx>
#include <tools/time.hxx>
+#include <o3tl/string_view.hxx>
#ifdef DBG_UTIL
@@ -2381,7 +2382,7 @@ void XmlStreamObject::implDumpText( TextInputStream& rTextStrm )
{
while( (nPos < aElem.getLength()) && (aElem[ nPos ] >= 32) ) ++nPos;
if( nPos < aElem.getLength() )
- aElem = aElem.subView( 0, nPos ) + OUStringChar(' ') + aElem.copy( nPos ).trim();
+ aElem = aElem.subView( 0, nPos ) + OUStringChar(' ') + o3tl::trim(aElem.subView( nPos ));
++nPos;
}
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx
index 47bfb27fc1da..a566069c3a2e 100644
--- a/oox/source/helper/attributelist.cxx
+++ b/oox/source/helper/attributelist.cxx
@@ -349,7 +349,7 @@ std::vector<sal_Int32> AttributeList::getTokenList(sal_Int32 nAttrToken) const
sal_Int32 nIndex = 0;
do
{
- aValues.push_back(AttributeConversion::decodeToken(sValue.getToken(0, ' ', nIndex)));
+ aValues.push_back(AttributeConversion::decodeToken(o3tl::getToken(sValue, 0, ' ', nIndex)));
} while (nIndex >= 0);
return aValues;
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 9b3a1491a435..b8415111d38c 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -2579,7 +2579,7 @@ HtmlSelectModel::importBinaryModel( BinaryInputStream& rInStrm )
// Ultra hacky parser for the info
sal_Int32 nLineIdx {0};
// first line will tell us if multiselect is enabled
- if (data.getToken( 0, '\n', nLineIdx )=="<SELECT MULTIPLE")
+ if (o3tl::getToken(data, 0, '\n', nLineIdx ) == u"<SELECT MULTIPLE")
mnMultiSelect = AX_SELECTION_MULTI;
// skip first and last lines, no data there
if (nLineIdx>0)