diff options
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/cellmergeoption.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/cellmergeoption.cxx | 13 |
3 files changed, 15 insertions, 3 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index be84aa5dd..abe1c586d 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2200,9 +2200,7 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) ) { - ScCellMergeOption aMergeOption( - aRange.aStart.Col(), aRange.aStart.Row(), - aRange.aEnd.Col(), aRange.aEnd.Row() ); + ScCellMergeOption aMergeOption(aRange); MergeCells( aMergeOption, FALSE, TRUE, TRUE ); } qDecreaseRange.pop_back(); diff --git a/sc/source/ui/inc/cellmergeoption.hxx b/sc/source/ui/inc/cellmergeoption.hxx index 86e24167e..01fa0eb27 100644 --- a/sc/source/ui/inc/cellmergeoption.hxx +++ b/sc/source/ui/inc/cellmergeoption.hxx @@ -48,6 +48,7 @@ struct ScCellMergeOption bool mbCenter; explicit ScCellMergeOption(); + explicit ScCellMergeOption(const ScRange& rRange); explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter = false); diff --git a/sc/source/ui/view/cellmergeoption.cxx b/sc/source/ui/view/cellmergeoption.cxx index ff5220ec9..2352f0740 100644 --- a/sc/source/ui/view/cellmergeoption.cxx +++ b/sc/source/ui/view/cellmergeoption.cxx @@ -41,6 +41,19 @@ ScCellMergeOption::ScCellMergeOption() : { } +ScCellMergeOption::ScCellMergeOption(const ScRange& rRange) : + mnStartCol(rRange.aStart.Col()), + mnStartRow(rRange.aStart.Row()), + mnEndCol(rRange.aEnd.Col()), + mnEndRow(rRange.aEnd.Row()), + mbCenter(false) +{ + SCTAB nTab1 = rRange.aStart.Tab(); + SCTAB nTab2 = rRange.aEnd.Tab(); + for (SCTAB i = nTab1; i <= nTab2; ++i) + maTabs.insert(i); +} + ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) : mnStartCol(nStartCol), mnStartRow(nStartRow), |