summaryrefslogtreecommitdiff
path: root/extensions
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 /extensions
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 'extensions')
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx5
-rw-r--r--extensions/source/propctrlr/stringrepresentation.cxx11
2 files changed, 9 insertions, 7 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index 4aec523f9614..ba1b943f29a5 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -38,6 +38,7 @@
#include <tools/datetime.hxx>
#include <unotools/datetime.hxx>
+#include <o3tl/string_view.hxx>
#include <limits>
#include <memory>
@@ -680,7 +681,7 @@ namespace pcr
namespace
{
- StlSyntaxSequence< OUString > lcl_convertMultiLineToList( const OUString& _rCompsedTextWithLineBreaks )
+ StlSyntaxSequence< OUString > lcl_convertMultiLineToList( std::u16string_view _rCompsedTextWithLineBreaks )
{
sal_Int32 nLines = comphelper::string::getTokenCount(_rCompsedTextWithLineBreaks, '\n');
StlSyntaxSequence< OUString > aStrings( nLines );
@@ -690,7 +691,7 @@ namespace pcr
sal_Int32 nIdx {0};
do
{
- *stringItem = _rCompsedTextWithLineBreaks.getToken( 0, '\n', nIdx );
+ *stringItem = o3tl::getToken(_rCompsedTextWithLineBreaks, 0, '\n', nIdx );
++stringItem;
}
while (nIdx>0);
diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx
index 3c984eb0a867..e436b28e0b64 100644
--- a/extensions/source/propctrlr/stringrepresentation.cxx
+++ b/extensions/source/propctrlr/stringrepresentation.cxx
@@ -39,6 +39,7 @@
#include <sal/log.hxx>
#include <yesno.hrc>
#include <comphelper/types.hxx>
+#include <o3tl/string_view.hxx>
#include "modulepcr.hxx"
#include <algorithm>
@@ -304,9 +305,9 @@ namespace
{
return OUString::number( _rIntValue );
}
- sal_Int32 operator()( const OUString& _rStringValue ) const
+ sal_Int32 operator()( std::u16string_view _rStringValue ) const
{
- return _rStringValue.toInt32();
+ return o3tl::toInt32(_rStringValue);
}
};
@@ -336,16 +337,16 @@ namespace
}
template < class ElementType, class Transformer >
- void splitComposedStringToSequence( const OUString& _rComposed, Sequence< ElementType >& _out_SplitUp, const Transformer& _rTransformer )
+ void splitComposedStringToSequence( std::u16string_view _rComposed, Sequence< ElementType >& _out_SplitUp, const Transformer& _rTransformer )
{
_out_SplitUp.realloc( 0 );
- if ( _rComposed.isEmpty() )
+ if ( _rComposed.empty() )
return;
sal_Int32 tokenPos = 0;
do
{
_out_SplitUp.realloc( _out_SplitUp.getLength() + 1 );
- _out_SplitUp.getArray()[ _out_SplitUp.getLength() - 1 ] = static_cast<ElementType>(_rTransformer( _rComposed.getToken( 0, '\n', tokenPos ) ));
+ _out_SplitUp.getArray()[ _out_SplitUp.getLength() - 1 ] = static_cast<ElementType>(_rTransformer( OUString(o3tl::getToken(_rComposed, 0, '\n', tokenPos )) ));
}
while ( tokenPos != -1 );
}