diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-11-02 14:50:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-11-02 16:55:52 +0100 |
commit | 5929d8ea469a971aa77371ed4b841c90a36e7da5 (patch) | |
tree | 4816b5674d29478c76694d8ff78a3c4998ed591b /toolkit | |
parent | 4b0db40ab4a05a0940096654e8d60ed04f0cd2e6 (diff) |
Replace function only used in an assert with a lambda
Change-Id: Id1809b6f14690dff2edbc806a33297fda4373c6f
Reviewed-on: https://gerrit.libreoffice.org/62782
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index a22f9308095b..6ecb5cebbded 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -761,13 +761,6 @@ static ComponentInfo const aComponentInfos [] = { OUStringLiteral("workwindow"), WindowType::WORKWINDOW } }; -#if !defined NDEBUG -bool ComponentInfoCompare( const ComponentInfo & lhs, const ComponentInfo & rhs) -{ - return rtl_str_compare_WithLength(lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size) < 0; -} -#endif - bool ComponentInfoFindCompare( const ComponentInfo & lhs, const OUString & s) { return rtl_ustr_ascii_compareIgnoreAsciiCase_WithLengths(s.pData->buffer, s.pData->length, @@ -780,7 +773,12 @@ WindowType ImplGetComponentType( const OUString& rServiceName ) if( !bSorted ) { assert( std::is_sorted( std::begin(aComponentInfos), std::end(aComponentInfos), - ComponentInfoCompare ) ); + [](const ComponentInfo & lhs, const ComponentInfo & rhs) { + return + rtl_str_compare_WithLength( + lhs.sName.data, lhs.sName.size, rhs.sName.data, rhs.sName.size) + < 0; + } ) ); bSorted = true; } |