diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-12 12:43:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 08:38:53 +0200 |
commit | fdfd517a6f75e394ddcb1e195decbfed33ba56b9 (patch) | |
tree | e3bff14e5531affcd908415b4e85d7ceac4aa1fd /vbahelper/source | |
parent | e568c9dca8b93b96a8a130a8fb6f1bba1a33d6ea (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 'vbahelper/source')
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.cxx | 9 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbarhelper.hxx | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx index 562205451839..fdc2fee94b29 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.cxx @@ -26,6 +26,7 @@ #include <vbahelper/vbahelper.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <o3tl/string_view.hxx> #include <map> #include <string_view> @@ -161,14 +162,14 @@ uno::Reference< frame::XLayoutManager > VbaCommandBarHelper::getLayoutManager() return xLayoutManager; } -bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OUString& sName ) +bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, std::u16string_view sName ) { if( m_xDocCfgMgr->hasSettings( sResourceUrl ) ) { OUString sUIName; uno::Reference< beans::XPropertySet > xPropertySet( m_xDocCfgMgr->getSettings( sResourceUrl, false ), uno::UNO_QUERY_THROW ); xPropertySet->getPropertyValue( ITEM_DESCRIPTOR_UINAME ) >>= sUIName; - if( sName.equalsIgnoreAsciiCase( sUIName ) ) + if( o3tl::equalsIgnoreAsciiCase( sName, sUIName ) ) return true; } return false; @@ -200,7 +201,7 @@ OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css: } // if found, return the position of the control. if not found, return -1 -sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const OUString& sName, bool bMenu ) +sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, std::u16string_view sName, bool bMenu ) { sal_Int32 nCount = xIndexAccess->getCount(); css::uno::Sequence< css::beans::PropertyValue > aProps; @@ -225,7 +226,7 @@ sal_Int32 VbaCommandBarHelper::findControlByName( const css::uno::Reference< css } OUString sNewLabel = aBuffer.makeStringAndClear(); SAL_INFO("vbahelper", "VbaCommandBarHelper::findControlByName, control name: " << sNewLabel); - if( sName.equalsIgnoreAsciiCase( sNewLabel ) ) + if( o3tl::equalsIgnoreAsciiCase( sName, sNewLabel ) ) return i; } diff --git a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx index c177385cc285..774ec4839f7b 100644 --- a/vbahelper/source/vbahelper/vbacommandbarhelper.hxx +++ b/vbahelper/source/vbahelper/vbacommandbarhelper.hxx @@ -59,7 +59,7 @@ private: /// @throws css::uno::RuntimeException void Init(); /// @throws css::uno::RuntimeException - bool hasToolbar( const OUString& sResourceUrl, const OUString& sName ); + bool hasToolbar( const OUString& sResourceUrl, std::u16string_view sName ); public: /// @throws css::uno::RuntimeException VbaCommandBarHelper( const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel ); @@ -85,7 +85,7 @@ public: /// @throws css::uno::RuntimeException OUString findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const OUString& sName ); /// @throws css::uno::RuntimeException - static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, const OUString& sName, bool bMenu ); + static sal_Int32 findControlByName( const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, std::u16string_view sName, bool bMenu ); static OUString generateCustomURL(); }; |