[Libreoffice-commits] core.git: 2 commits - framework/source sc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 23 17:57:50 UTC 2019


 framework/source/uielement/toolbarmanager.cxx |    3 ++-
 sc/source/core/data/patattr.cxx               |   10 ++--------
 2 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 1e3d0a57689006cd7244481958025177c01e4d09
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Apr 23 11:23:36 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 23 19:56:53 2019 +0200

    fix bad comparison in StrCmp/StrLess
    
    comment from Miklos:
     > Won't this do a comparison of two null-terminated strings, while
     > the strings here are utf16, i.e. abc is a\0b\0c\0? That would mean
     > in practice you compare the first char only.
    
    introduced in
        commit 003d11f410b7e515981b3efbd65d936d94d87121
        Date:   Sat Apr 20 08:32:33 2019 +0200
        tdf#81765 slow loading of .ods with >1000 of conditional formats
    
    Change-Id: I60ea18772753f50f880c65d8cff594267d724e76
    Reviewed-on: https://gerrit.libreoffice.org/71114
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index bff76e330233..13639a9977e3 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -117,10 +117,7 @@ static bool StrCmp( const OUString* pStr1, const OUString* pStr2 )
         return false;
     if (!pStr1 && pStr2)
         return false;
-    // we don't care about a proper lexicographic ordering, we just care about a stable order, and
-    // this is faster
-    return strcmp(reinterpret_cast<const char*>(pStr1->getStr()),
-                  reinterpret_cast<const char*>(pStr2->getStr())) == 0;
+    return *pStr1 == *pStr2;
 }
 
 static bool StrLess( const OUString* pStr1, const OUString* pStr2 )
@@ -131,10 +128,7 @@ static bool StrLess( const OUString* pStr1, const OUString* pStr2 )
         return false;
     if (!pStr1 && pStr2)
         return true;
-    // we don't care about a proper lexicographic ordering, we just care about a stable order, and
-    // this is faster
-    return strcmp(reinterpret_cast<const char*>(pStr1->getStr()),
-                  reinterpret_cast<const char*>(pStr2->getStr())) < 0;
+    return *pStr1 < *pStr2;
 }
 
 static bool EqualPatternSets( const SfxItemSet& rSet1, const SfxItemSet& rSet2 )
commit 7482a400cc90ddb8bf1d53d7655a4027e50fe593
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Apr 23 16:12:30 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 23 19:56:41 2019 +0200

    tdf#124886 Toolbar button icons are off by one
    
    regression from
        commit 1a5b12aa5da2c718848d3cc5d9bce7bfcdeacf54
        Date:   Thu Apr 18 15:13:19 2019 +0200
        optimise find/insert pattern
    
    Change-Id: I24edd5a89beed392c86058cd60155caf94bcf9ca
    Reviewed-on: https://gerrit.libreoffice.org/71137
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index abaface6e133..280958311ae4 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1046,6 +1046,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
                     if ( pIter.second )
                     {
                         aCmdInfo.nId = nId;
+                        pIter.first->second.nId = nId;
                     }
                     else
                     {
@@ -1199,7 +1200,7 @@ void ToolBarManager::FillOverflowToolbar( ToolBox const * pParent )
             if ( pIter.second )
             {
                 aCmdInfo.nId = nId;
-                const CommandToInfoMap::value_type aValue( aCommandURL, aCmdInfo );
+                pIter.first->second.nId = nId;
             }
             else
             {


More information about the Libreoffice-commits mailing list