[Libreoffice-commits] core.git: toolkit/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 2 15:56:18 UTC 2018


 toolkit/source/awt/vclxtoolkit.cxx |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 5929d8ea469a971aa77371ed4b841c90a36e7da5
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Nov 2 14:50:18 2018 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Nov 2 16:55:52 2018 +0100

    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 at redhat.com>

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;
     }
 


More information about the Libreoffice-commits mailing list