diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-03-08 14:37:18 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-03-23 09:09:09 +0100 |
commit | b3294e2a424c216e48804eeb0f78b403aa06189f (patch) | |
tree | ac8f649cf47fe3a74a1a9d0b6ad6ede82c09829f | |
parent | 28bdeb7320d697fe036efadf01820ec86dd786e3 (diff) |
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.lunak@collabora.com>
-rw-r--r-- | sc/source/core/data/table2.cxx | 9 |
1 files 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<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 ); |