diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 10:50:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-14 07:54:28 +0200 |
commit | bc2101646bc6e63944c42500af5a15134b9b2d17 (patch) | |
tree | ca1da50da2e3e76eef650a1ae3956c16e0a19f33 /xmloff | |
parent | ad97694737c99889bc0eb21efccb83768d510361 (diff) |
loplugin:stringviewparam improvements
improve the check by checking for methods that exclude
using string_view, rather than checking for methods that
__can__ use string_view, which leads to exposing
some holes in our o3tl/string_view.hxx coverage.
Change-Id: Ic9dd60441c671f502692f9cd2a1bb67301c4b960
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150277
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/prstylecond.hxx | 2 | ||||
-rw-r--r-- | xmloff/source/style/prstylecond.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/transform/TransformerBase.cxx | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/xmloff/inc/prstylecond.hxx b/xmloff/inc/prstylecond.hxx index e658a83b9125..ca4240bb5375 100644 --- a/xmloff/inc/prstylecond.hxx +++ b/xmloff/inc/prstylecond.hxx @@ -19,6 +19,6 @@ #include <rtl/ustring.hxx> -OUString GetParaStyleCondExternal(OUString const&); +OUString GetParaStyleCondExternal(std::u16string_view); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/style/prstylecond.cxx b/xmloff/source/style/prstylecond.cxx index 4da002488c36..a7ab66f8352d 100644 --- a/xmloff/source/style/prstylecond.cxx +++ b/xmloff/source/style/prstylecond.cxx @@ -68,11 +68,11 @@ const ConditionMap g_ConditionMap[] = { "NumberingLevel10", XML_LIST_LEVEL, 10 } }; -OUString GetParaStyleCondExternal( OUString const &internal) +OUString GetParaStyleCondExternal( std::u16string_view internal) { for (size_t i = 0; i < SAL_N_ELEMENTS(g_ConditionMap); ++i) { - if (internal.compareToAscii( g_ConditionMap[i].aInternal ) == 0) + if (o3tl::equalsAscii(internal, g_ConditionMap[i].aInternal )) { OUString aResult = GetXMLToken( g_ConditionMap[i].nExternal ) + "()"; diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx index e15e81d85d14..288f013a9253 100644 --- a/xmloff/source/transform/TransformerBase.cxx +++ b/xmloff/source/transform/TransformerBase.cxx @@ -454,11 +454,11 @@ void SAL_CALL XMLTransformerBase::initialize( const Sequence< Any >& aArguments assert(m_xHandler.is()); // can't do anything without that } -static sal_Int16 lcl_getUnit( const OUString& rValue ) +static sal_Int16 lcl_getUnit( std::u16string_view rValue ) { - if( rValue.endsWithIgnoreAsciiCase( "cm" ) ) + if( o3tl::endsWithIgnoreAsciiCase( rValue, "cm" ) ) return util::MeasureUnit::CM; - else if ( rValue.endsWithIgnoreAsciiCase( "mm" ) ) + else if ( o3tl::endsWithIgnoreAsciiCase( rValue, "mm" ) ) return util::MeasureUnit::MM; else return util::MeasureUnit::INCH; |