[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source

Mark Hung (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 20 14:41:10 UTC 2020


 sc/source/ui/view/spelleng.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a9bad3ef281c825bf57437a1b5154e413d7f18cd
Author:     Mark Hung <marklh9 at gmail.com>
AuthorDate: Mon Oct 19 22:33:21 2020 +0800
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 20 16:40:32 2020 +0200

    tdf#137594 prevent converting unallocated columns.
    
    Check col against GetAllocatedColumnsCount()
    instead of MaxCol(). This prevents allocating
    a new column just for converting an empty cell.
    
    Change-Id: I5c8dcfffc2661ab9c4fd9c2c53ed389e57351517
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104528
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit aa99b57cdc8cb3763aa935ed84e7d80c4e56a172)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104503
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index 5035cd31a858..2b754ce08ddf 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -153,7 +153,7 @@ bool ScConversionEngineBase::FindNextConversionCell()
                 bLoop = false;
                 mbFinished = true;
             }
-            else if( nNewCol > mrDoc.MaxCol() )
+            else if( nNewCol >= mrDoc.GetAllocatedColumnsCount(mnStartTab) )
             {
                 // no more cells in the sheet - try to restart at top of sheet
 
@@ -178,6 +178,7 @@ bool ScConversionEngineBase::FindNextConversionCell()
             }
             else
             {
+                // GetPattern may implicitly allocates the column if not exists,
                 pPattern = mrDoc.GetPattern( nNewCol, nNewRow, mnStartTab );
                 if( pPattern && (pPattern != pLastPattern) )
                 {


More information about the Libreoffice-commits mailing list