sc/source/core/data/table2.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 18e2a86f92689dcd43975e69ed79f6575de12a75
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Tue Mar 8 14:37:18 2022 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Tue Mar 8 16:13:08 2022 +0100

    stop ScTable::ExtendMerge() from needless complaining
    
    With dynamic columns it is possible for it to be called
    for unallocated columns, and those can't be merged.
    
    Change-Id: If4a365ba175b9ea7e68704bb4db85a30e5f8a0db
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131211
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 039ca40187c3..79c45ed386a4 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2269,13 +2269,10 @@ bool ScTable::ExtendMerge( SCCOL nStartCol, SCROW 
nStartRow,
         OSL_FAIL("ScTable::ExtendMerge: invalid column number");
         return false;
     }
-    if ( nStartCol >= aCol.size() )
-    {
-        OSL_FAIL("ScTable::ExtendMerge: invalid nStartCol");
-        return false;
-    }
+    if( rEndCol >= aCol.size())
+        assert( !aDefaultColData.GetAttr( nStartRow, ATTR_MERGE ).IsMerged());
     bool bFound = false;
-    SCCOL nOldEndX = std::min( rEndCol, static_cast<SCCOL>(aCol.size()-1) );
+    SCCOL nOldEndX = ClampToAllocatedColumns(rEndCol);
     SCROW nOldEndY = rEndRow;
     for (SCCOL i=nStartCol; i<=nOldEndX; i++)
         bFound |= aCol[i].ExtendMerge( i, nStartRow, nOldEndY, rEndCol, 
rEndRow, bRefresh );

Reply via email to