summaryrefslogtreecommitdiff
path: root/filter
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 /filter
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 'filter')
-rw-r--r--filter/source/config/cache/filtercache.cxx5
-rw-r--r--filter/source/config/cache/filtercache.hxx2
-rw-r--r--filter/source/config/cache/querytokenizer.cxx11
-rw-r--r--filter/source/config/cache/querytokenizer.hxx2
-rw-r--r--filter/source/svg/svgfontexport.cxx5
-rw-r--r--filter/source/svg/svgfontexport.hxx2
6 files changed, 15 insertions, 12 deletions
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index eb602355ce20..7d64e645b668 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -51,6 +51,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <officecfg/Setup.hxx>
+#include <o3tl/string_view.hxx>
namespace filter::config{
@@ -2146,14 +2147,14 @@ CacheItem FilterCache::impl_readOldItem(const css::uno::Reference< css::containe
}
-std::vector<OUString> FilterCache::impl_tokenizeString(const OUString& sData ,
+std::vector<OUString> FilterCache::impl_tokenizeString(std::u16string_view sData ,
sal_Unicode cSeparator)
{
std::vector<OUString> lData ;
sal_Int32 nToken = 0;
do
{
- OUString sToken = sData.getToken(0, cSeparator, nToken);
+ OUString sToken( o3tl::getToken(sData, 0, cSeparator, nToken) );
lData.push_back(sToken);
}
while(nToken >= 0);
diff --git a/filter/source/config/cache/filtercache.hxx b/filter/source/config/cache/filtercache.hxx
index 42be4314cb38..526ce85d6126 100644
--- a/filter/source/config/cache/filtercache.hxx
+++ b/filter/source/config/cache/filtercache.hxx
@@ -891,7 +891,7 @@ class FilterCache : public cppu::BaseMutex
/** TODO */
- static std::vector<OUString> impl_tokenizeString(const OUString& sData ,
+ static std::vector<OUString> impl_tokenizeString(std::u16string_view sData ,
sal_Unicode cSeparator);
diff --git a/filter/source/config/cache/querytokenizer.cxx b/filter/source/config/cache/querytokenizer.cxx
index 9b64f68fe6d8..f5b021f53b45 100644
--- a/filter/source/config/cache/querytokenizer.cxx
+++ b/filter/source/config/cache/querytokenizer.cxx
@@ -20,23 +20,24 @@
#include "querytokenizer.hxx"
#include <osl/diagnose.h>
+#include <o3tl/string_view.hxx>
namespace filter::config{
-QueryTokenizer::QueryTokenizer(const OUString& sQuery)
+QueryTokenizer::QueryTokenizer(std::u16string_view sQuery)
: m_bValid(true)
{
sal_Int32 token = 0;
while(token != -1)
{
- OUString sToken = sQuery.getToken(0, ':', token);
- if (!sToken.isEmpty())
+ std::u16string_view sToken = o3tl::getToken(sQuery,0, ':', token);
+ if (!sToken.empty())
{
sal_Int32 nIdx{ 0 };
- const OUString sKey{ sToken.getToken(0, '=', nIdx) };
- const OUString sVal{ sToken.getToken(0, ':', nIdx) };
+ const OUString sKey{ o3tl::getToken(sToken, 0, '=', nIdx) };
+ const OUString sVal{ o3tl::getToken(sToken, 0, ':', nIdx) };
if (sKey.isEmpty())
m_bValid = false;
diff --git a/filter/source/config/cache/querytokenizer.hxx b/filter/source/config/cache/querytokenizer.hxx
index e0b8d5218130..0c7e79b3ddc7 100644
--- a/filter/source/config/cache/querytokenizer.hxx
+++ b/filter/source/config/cache/querytokenizer.hxx
@@ -73,7 +73,7 @@ class QueryTokenizer : public std::unordered_map< OUString, OUString >
@param sQuery
the query string.
*/
- explicit QueryTokenizer(const OUString& sQuery);
+ explicit QueryTokenizer(std::u16string_view sQuery);
/** @short destruct an instance of this class.
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index b0cbed97e4e7..7e75d65e6bc2 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -29,6 +29,7 @@
#include <vcl/settings.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <xmloff/namespacemap.hxx>
+#include <o3tl/string_view.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/XBreakIterator.hpp>
@@ -307,9 +308,9 @@ void SVGFontExport::EmbedFonts()
}
-OUString SVGFontExport::GetMappedFontName( const OUString& rFontName ) const
+OUString SVGFontExport::GetMappedFontName( std::u16string_view rFontName ) const
{
- OUString aRet( rFontName.getToken( 0, ';' ) );
+ OUString aRet( o3tl::getToken(rFontName, 0, ';' ) );
if( mnCurFontId )
aRet += " embedded";
diff --git a/filter/source/svg/svgfontexport.hxx b/filter/source/svg/svgfontexport.hxx
index 6492ebd9c04c..259196f9e031 100644
--- a/filter/source/svg/svgfontexport.hxx
+++ b/filter/source/svg/svgfontexport.hxx
@@ -66,7 +66,7 @@ public:
~SVGFontExport();
void EmbedFonts();
- OUString GetMappedFontName( const OUString& rFontName ) const;
+ OUString GetMappedFontName( std::u16string_view rFontName ) const;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */