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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 30 19:41:52 UTC 2021


 sc/source/core/data/attarray.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 61386aa03cd166473a58dbb4be0dd5e0ce82195c
Author:     Noel Grandin <noel at peralex.com>
AuthorDate: Fri Apr 30 18:27:31 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Apr 30 21:41:13 2021 +0200

    tdf#79049 speed up OOXML workbook load (3)
    
    Exit this loop early if we aren't going to make progress
    anyhow.
    This takes the load time from 40s to 34s for me.
    
    Change-Id: I31887442cde6e3fc05f1fce10bb3dde9c2b88bf2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114942
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index da8490b72f99..d7683b601435 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1959,17 +1959,21 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW& rLastRow, SCROW nLastData ) const
     Search( nLastData, nPos );
     while ( nPos < mvData.size() )
     {
+        SCROW nAttrStartRow = ( nPos > 0 ) ? ( mvData[nPos-1].nEndRow + 1 ) : 0;
+        if ( nAttrStartRow <= nLastData )
+            nAttrStartRow = nLastData + 1;
         // find range of visually equal formats
         SCSIZE nEndPos = nPos;
         while ( nEndPos < mvData.size()-1 &&
                 mvData[nEndPos].pPattern->IsVisibleEqual( *mvData[nEndPos+1].pPattern))
+        {
+            if ( (mvData[nEndPos].nEndRow + 1 - nAttrStartRow) >= SC_VISATTR_STOP )
+                return false; // ignore this range and below
             ++nEndPos;
-        SCROW nAttrStartRow = ( nPos > 0 ) ? ( mvData[nPos-1].nEndRow + 1 ) : 0;
-        if ( nAttrStartRow <= nLastData )
-            nAttrStartRow = nLastData + 1;
+        }
         SCROW nAttrSize = mvData[nEndPos].nEndRow + 1 - nAttrStartRow;
         if ( nAttrSize >= SC_VISATTR_STOP )
-            break;  // while, ignore this range and below
+            return false; // ignore this range and below
         else if ( mvData[nEndPos].pPattern->IsVisible() )
         {
             rLastRow = mvData[nEndPos].nEndRow;


More information about the Libreoffice-commits mailing list