diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-01 20:34:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-03 09:12:32 +0200 |
commit | ddef1e2c017b7d8e421dedc1a0ce722ff4208985 (patch) | |
tree | 54e52c86e4e33bcb61eee44706117b1616e99624 /include | |
parent | 0a6d946694e4fcb39228c5e1fec58fcfd8a45989 (diff) |
add o3tl::equalsAscii
Change-Id: I042b8dcadbf7581de325c161763fe35aecde5ca2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133694
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/o3tl/string_view.hxx | 6 | ||||
-rw-r--r-- | include/oox/ppt/pptfilterhelpers.hxx | 2 | ||||
-rw-r--r-- | include/oox/ppt/slidetransition.hxx | 2 | ||||
-rw-r--r-- | include/svtools/unoevent.hxx | 4 | ||||
-rw-r--r-- | include/unotools/lingucfg.hxx | 6 |
5 files changed, 13 insertions, 7 deletions
diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx index 6138f5c09c88..0935844349e2 100644 --- a/include/o3tl/string_view.hxx +++ b/include/o3tl/string_view.hxx @@ -22,6 +22,12 @@ namespace o3tl { // Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view: +inline bool equalsAscii(std::u16string_view s1, const char* s2) +{ + return rtl_ustr_ascii_compare_WithLength(s1.data(), s1.size(), s2) == 0; +} + +// Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view: inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2) { if (s1.size() != s2.size()) diff --git a/include/oox/ppt/pptfilterhelpers.hxx b/include/oox/ppt/pptfilterhelpers.hxx index 35372e6fe3e2..58547d9e7ee3 100644 --- a/include/oox/ppt/pptfilterhelpers.hxx +++ b/include/oox/ppt/pptfilterhelpers.hxx @@ -58,7 +58,7 @@ namespace oox::ppt { bool mbDirection; // true: default geometric direction static const transition* getList(); - static const transition* find( const OUString& rName ); + static const transition* find( std::u16string_view rName ); }; struct OOX_DLLPUBLIC convert_subtype diff --git a/include/oox/ppt/slidetransition.hxx b/include/oox/ppt/slidetransition.hxx index 36f5eca9cebe..01603b9fa649 100644 --- a/include/oox/ppt/slidetransition.hxx +++ b/include/oox/ppt/slidetransition.hxx @@ -38,7 +38,7 @@ namespace oox::ppt { { public: SlideTransition(); - explicit SlideTransition(const OUString & ); + explicit SlideTransition(std::u16string_view ); void setSlideProperties( PropertyMap& props ); void setTransitionFilterProperties( const css::uno::Reference< css::animations::XTransitionFilter > & xFilter ); diff --git a/include/svtools/unoevent.hxx b/include/svtools/unoevent.hxx index acad27b51f44..825280e16b8a 100644 --- a/include/svtools/unoevent.hxx +++ b/include/svtools/unoevent.hxx @@ -136,10 +136,10 @@ protected: const SvMacroItemId nEvent ) = 0; /// convert an API event name to the event ID as used by SvxMacroItem - SvMacroItemId mapNameToEventID(const OUString& rName) const; + SvMacroItemId mapNameToEventID(std::u16string_view rName) const; /// get the event ID for the name; return 0 if not supported - SvMacroItemId getMacroID(const OUString& rName) const; + SvMacroItemId getMacroID(std::u16string_view rName) const; }; diff --git a/include/unotools/lingucfg.hxx b/include/unotools/lingucfg.hxx index 20c678b96b4f..b4a0b824e127 100644 --- a/include/unotools/lingucfg.hxx +++ b/include/unotools/lingucfg.hxx @@ -169,18 +169,18 @@ public: const css::uno::Sequence< css::beans::PropertyValue >& rValues ); css::uno::Any - GetProperty( const OUString &rPropertyName ) const; + GetProperty( std::u16string_view rPropertyName ) const; css::uno::Any GetProperty( sal_Int32 nPropertyHandle ) const; - bool SetProperty( const OUString &rPropertyName, + bool SetProperty( std::u16string_view rPropertyName, const css::uno::Any &rValue ); bool SetProperty( sal_Int32 nPropertyHandle, const css::uno::Any &rValue ); void GetOptions( SvtLinguOptions &rOptions ) const; - bool IsReadOnly( const OUString &rPropertyName ) const; + bool IsReadOnly( std::u16string_view rPropertyName ) const; //! //! the following functions work on the 'ServiceManager' sub node of the |