[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Apr 26 09:34:05 PDT 2011


 sc/source/ui/docshell/docfunc.cxx |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 4fc4f4907792364f8e67ea25eeea2969a4d1201f
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Apr 26 12:23:45 2011 -0400

    n#689442: Don't forget to create undo object for normal merging.

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 11259cc..30551cf 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();
         }


More information about the Libreoffice-commits mailing list