From b3294e2a424c216e48804eeb0f78b403aa06189f Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 8 Mar 2022 14:37:18 +0100 Subject: stop ScTable::ExtendMerge() from needless complaining MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sc/source/core/data/table2.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index f606fdd44902..80b488703d0b 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -2275,13 +2275,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(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 ); -- cgit