diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-04-26 12:23:45 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-04-26 12:32:58 -0400 |
commit | 4fc4f4907792364f8e67ea25eeea2969a4d1201f (patch) | |
tree | ff6ba329e5c2d484aa141bb944df4f2fba3949fa | |
parent | 71080f2079e7be6157d1b7f319c614a270442b40 (diff) |
n#689442: Don't forget to create undo object for normal merging.
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 11259cc96..30551cf19 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4344,17 +4344,14 @@ sal_Bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, sal_Bool bCont for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() ) bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0); - if (bNeedContents || bHasNotes || rOption.mbCenter) + if (!pUndoDoc) { - if (!pUndoDoc) - { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); - pUndoDoc->InitUndo(pDoc, nTab1, nTab2); - } - // note captions are collected by drawing undo - pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, - IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc ); + pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc->InitUndo(pDoc, nTab1, nTab2); } + // note captions are collected by drawing undo + pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, + IDF_ALL|IDF_NOCAPTIONS, false, pUndoDoc ); if( bHasNotes ) pDoc->BeginDrawUndo(); } |