diff options
-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 ); |