[ooo-build-commit] .: 5 commits - patches/dev300

Fridrich Strba fridrich at kemper.freedesktop.org
Thu Sep 16 02:48:06 PDT 2010


 patches/dev300/apply                                     |   14 
 patches/dev300/calc-autofilter-shrink-selection.diff     |   20 
 patches/dev300/calc-cursor-split-view.diff               |   70 
 patches/dev300/calc-enhanced-merge-cells-officecfg.diff  |   20 
 patches/dev300/calc-enhanced-merge-cells-sc.diff         | 1106 ---------------
 patches/dev300/calc-html-csv-import-force-text-cell.diff |  413 -----
 6 files changed, 1643 deletions(-)

New commits:
commit 609dd65004232af9120958e8a09baefafc1bab48
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Sep 16 11:47:38 2010 +0200

    calc-enhanced-merge-cells-officecfg.diff: Merged by git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index a20b354..c5e31f7 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -524,9 +524,6 @@ sw-ww8-styles-import-fix.diff, i#21939, cbosdo
 
 [ CalcFixes ]
 
-# Merging/unmerging of cells on multiple sheets & merge center icon.
-calc-enhanced-merge-cells-officecfg.diff, n#213205, i#67243, i#101042, jholesov/kohei
-
 # support ods import/export of sheet options and password hash.
 calc-ods-sheet-protection-sc.diff,      i#60305, i#71468, kohei
 calc-ods-sheet-protection-xmloff.diff,  i#60305, i#71468, kohei
diff --git a/patches/dev300/calc-enhanced-merge-cells-officecfg.diff b/patches/dev300/calc-enhanced-merge-cells-officecfg.diff
deleted file mode 100644
index 88bef63..0000000
--- a/patches/dev300/calc-enhanced-merge-cells-officecfg.diff
+++ /dev/null
@@ -1,20 +0,0 @@
----
- .../data/org/openoffice/Office/UI/CalcCommands.xcu |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
-index 55b90b5..308eb12 100644
---- officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
-+++ officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
-@@ -1050,7 +1050,7 @@
-             </node>
-             <node oor:name=".uno:ToggleMergeCells" oor:op="replace">
-                 <prop oor:name="Label" oor:type="xs:string">
--                    <value xml:lang="en-US">M~erge Cells</value>
-+                    <value xml:lang="en-US">M~erge and Center Cells</value>
-                 </prop>
-                 <prop oor:name="Properties" oor:type="xs:int">
-                     <value>1</value>
--- 
-1.7.0.1
-
commit ebcaf170f2c5028d360453995da10dc4d7a74a35
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Sep 16 11:45:17 2010 +0200

    calc-enhanced-merge-cells-sc.diff: Migrated to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index e551dd6..a20b354 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -525,7 +525,6 @@ sw-ww8-styles-import-fix.diff, i#21939, cbosdo
 [ CalcFixes ]
 
 # Merging/unmerging of cells on multiple sheets & merge center icon.
-calc-enhanced-merge-cells-sc.diff,        n#213205, i#67243, i#101042, jholesov/kohei
 calc-enhanced-merge-cells-officecfg.diff, n#213205, i#67243, i#101042, jholesov/kohei
 
 # support ods import/export of sheet options and password hash.
diff --git a/patches/dev300/calc-enhanced-merge-cells-sc.diff b/patches/dev300/calc-enhanced-merge-cells-sc.diff
deleted file mode 100644
index 72f7842..0000000
--- a/patches/dev300/calc-enhanced-merge-cells-sc.diff
+++ /dev/null
@@ -1,1106 +0,0 @@
----
- sc/source/ui/docshell/docfunc.cxx     |  224 +++++++++++++++++++++------------
- sc/source/ui/inc/cellmergeoption.hxx  |   60 +++++++++
- sc/source/ui/inc/docfunc.hxx          |    6 +-
- sc/source/ui/inc/undoblk.hxx          |   14 ++-
- sc/source/ui/inc/viewfunc.hxx         |    2 +-
- sc/source/ui/undo/undoblk.cxx         |  103 +++++++++------
- sc/source/ui/undo/undoblk3.cxx        |  107 ++++++++++------
- sc/source/ui/unoobj/cellsuno.cxx      |    9 +-
- sc/source/ui/view/cellmergeoption.cxx |   74 +++++++++++
- sc/source/ui/view/cellsh3.cxx         |    4 +-
- sc/source/ui/view/makefile.mk         |    1 +
- sc/source/ui/view/viewfun2.cxx        |   82 +++++++++++-
- sc/uiconfig/scalc/menubar/menubar.xml |    8 +-
- 13 files changed, 515 insertions(+), 179 deletions(-)
- create mode 100644 sc/source/ui/inc/cellmergeoption.hxx
- create mode 100644 sc/source/ui/view/cellmergeoption.cxx
-
-diff --git sc/source/ui/docshell/docfunc.cxx sc/source/ui/docshell/docfunc.cxx
-index 59635b8..80af0ec 100644
---- sc/source/ui/docshell/docfunc.cxx
-+++ sc/source/ui/docshell/docfunc.cxx
-@@ -65,6 +65,7 @@
- #include "dociter.hxx"
- #include "autoform.hxx"
- #include "cell.hxx"
-+#include "cellmergeoption.hxx"
- #include "detdata.hxx"
- #include "detfunc.hxx"
- #include "docpool.hxx"
-@@ -103,6 +104,7 @@
- #include <memory>
- #include <basic/basmgr.hxx>
- #include <boost/scoped_ptr.hpp>
-+#include <set>
- 
- using namespace com::sun::star;
- using ::com::sun::star::uno::Sequence;
-@@ -1675,7 +1677,11 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
-                     default:
-                         break;
-                 }
--                MergeCells(aRange, FALSE, TRUE, TRUE);
-+                ScCellMergeOption aMergeOption(
-+                    aRange.aStart.Col(), aRange.aStart.Row(),
-+                    aRange.aEnd.Col(), aRange.aEnd.Row() );
-+                aMergeOption.maTabs.insert(aRange.aStart.Tab());
-+                MergeCells(aMergeOption, FALSE, TRUE, TRUE);
-             }
-             qIncreaseRange.pop_back();
-         }
-@@ -1724,7 +1730,10 @@ BOOL ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
-             while( !qIncreaseRange.empty() )
-             {
-                 ScRange aRange = qIncreaseRange.back();
--                MergeCells(aRange, FALSE, TRUE, TRUE);
-+                 ScCellMergeOption aMergeOption(
-+                    aRange.aStart.Col(), aRange.aStart.Row(),
-+                    aRange.aEnd.Col(), aRange.aEnd.Row() );
-+                MergeCells(aMergeOption, FALSE, TRUE, TRUE);
-                 qIncreaseRange.pop_back();
-             }
- 
-@@ -2162,7 +2171,10 @@ BOOL ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
- 
-         if( !pDoc->HasAttrib( aRange, HASATTR_OVERLAPPED | HASATTR_MERGED ) )
-         {
--            MergeCells( aRange, FALSE, TRUE, TRUE );
-+            ScCellMergeOption aMergeOption(
-+                aRange.aStart.Col(), aRange.aStart.Row(),
-+                aRange.aEnd.Col(), aRange.aEnd.Row() );
-+            MergeCells( aMergeOption, FALSE, TRUE, TRUE );
-         }
-         qDecreaseRange.pop_back();
-     }
-@@ -4298,86 +4310,110 @@ BOOL ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark,
- 
- //------------------------------------------------------------------------
- 
--BOOL ScDocFunc::MergeCells( const ScRange& rRange, BOOL bContents, BOOL bRecord, BOOL bApi )
-+BOOL ScDocFunc::MergeCells( const ScCellMergeOption& rOption, BOOL bContents, BOOL bRecord, BOOL bApi )
- {
-+    using ::std::set;
-+
-     ScDocShellModificator aModificator( rDocShell );
- 
-+    SCCOL nStartCol = rOption.mnStartCol;
-+    SCROW nStartRow = rOption.mnStartRow;
-+    SCCOL nEndCol = rOption.mnEndCol;
-+    SCROW nEndRow = rOption.mnEndRow;
-+    if ((nStartCol == nEndCol && nStartRow == nEndRow) || rOption.maTabs.empty())
-+    {
-+        // Nothing to do.  Bail out quick.
-+        return TRUE;
-+    }
-+
-     ScDocument* pDoc = rDocShell.GetDocument();
--    SCCOL nStartCol = rRange.aStart.Col();
--    SCROW nStartRow = rRange.aStart.Row();
--    SCCOL nEndCol = rRange.aEnd.Col();
--    SCROW nEndRow = rRange.aEnd.Row();
--    SCTAB nTab = rRange.aStart.Tab();
-+    set<SCTAB>::const_iterator itrBeg = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end();
-+    SCTAB nTab1 = *itrBeg, nTab2 = *rOption.maTabs.rbegin();
- 
-     if (bRecord && !pDoc->IsUndoEnabled())
-         bRecord = FALSE;
- 
--    ScEditableTester aTester( pDoc, nTab, nStartCol, nStartRow, nEndCol, nEndRow );
--    if (!aTester.IsEditable())
-+    for (set<SCTAB>::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
-     {
--        if (!bApi)
--            rDocShell.ErrorMessage(aTester.GetMessageId());
--        return FALSE;
--    }
-+        ScEditableTester aTester( pDoc, *itr, nStartCol, nStartRow, nEndCol, nEndRow );
-+        if (!aTester.IsEditable())
-+        {
-+            if (!bApi)
-+                rDocShell.ErrorMessage(aTester.GetMessageId());
-+            return FALSE;
-+        }
- 
--    if ( nStartCol == nEndCol && nStartRow == nEndRow )
--    {
--        // nichts zu tun
--        return TRUE;
-+        if ( pDoc->HasAttrib( nStartCol, nStartRow, *itr, nEndCol, nEndRow, *itr,
-+                                HASATTR_MERGED | HASATTR_OVERLAPPED ) )
-+        {
-+            // "Zusammenfassen nicht verschachteln !"
-+            if (!bApi)
-+                rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0);
-+            return FALSE;
-+        }
-     }
- 
--    if ( pDoc->HasAttrib( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
--                            HASATTR_MERGED | HASATTR_OVERLAPPED ) )
-+    ScDocument* pUndoDoc = NULL;
-+    bool bNeedContentsUndo = false;
-+    for (set<SCTAB>::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
-     {
--        // "Zusammenfassen nicht verschachteln !"
--        if (!bApi)
--            rDocShell.ErrorMessage(STR_MSSG_MERGECELLS_0);
--        return FALSE;
--    }
-+        SCTAB nTab = *itr;
-+        bool bNeedContents = bContents &&
-+                ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
-+                  !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) );
- 
--    BOOL bNeedContents = bContents &&
--            ( !pDoc->IsBlockEmpty( nTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
--              !pDoc->IsBlockEmpty( nTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) );
-+        if (bRecord)
-+        {
-+            // test if the range contains other notes which also implies that we need an undo document
-+            bool bHasNotes = false;
-+            for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() )
-+                for( aPos.SetRow( nStartRow ); !bHasNotes && (aPos.Row() <= nEndRow); aPos.IncRow() )
-+                    bHasNotes = ((aPos.Col() != nStartCol) || (aPos.Row() != nStartRow)) && (pDoc->GetNote( aPos ) != 0);
- 
--    ScDocument* pUndoDoc = 0;
--    if (bRecord)
--    {
--        // test if the range contains other notes which also implies that we need an undo document
--        bool bHasNotes = false;
--        for( ScAddress aPos( nStartCol, nStartRow, nTab ); !bHasNotes && (aPos.Col() <= nEndCol); aPos.IncCol() )
--            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)
-+                {
-+                    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();
-+        }
-+
-+        if (bNeedContents)
-+            pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
-+        pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
- 
--        if (bNeedContents || bHasNotes)
-+        if (rOption.mbCenter)
-         {
--            pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
--            pUndoDoc->InitUndo( pDoc, nTab, nTab );
--            // note captions are collected by drawing undo
--            pDoc->CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
--                                    IDF_ALL|IDF_NOCAPTIONS, FALSE, pUndoDoc );
-+            pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) );
-+            pDoc->ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) );
-         }
--        if( bHasNotes )
--            pDoc->BeginDrawUndo();
--    }
- 
--    if (bNeedContents)
--        pDoc->DoMergeContents( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
--    pDoc->DoMerge( nTab, nStartCol,nStartRow, nEndCol,nEndRow );
-+        if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) )
-+            rDocShell.PostPaint( nStartCol, nStartRow, nTab,
-+                                 nEndCol, nEndRow, nTab, PAINT_GRID );
-+        if (bNeedContents || rOption.mbCenter)
-+        {
-+            ScRange aRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab);
-+            pDoc->SetDirty(aRange);
-+        }
- 
--    if( bRecord )
-+        bNeedContentsUndo |= bNeedContents;
-+    }
-+
-+    if (pUndoDoc)
-     {
--        SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : 0;
-+        SdrUndoGroup* pDrawUndo = pDoc->GetDrawLayer() ? pDoc->GetDrawLayer()->GetCalcUndo() : NULL;
-         rDocShell.GetUndoManager()->AddUndoAction(
--            new ScUndoMerge( &rDocShell,
--                            nStartCol, nStartRow, nTab,
--                            nEndCol, nEndRow, nTab, bNeedContents, pUndoDoc, pDrawUndo ) );
-+            new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, pUndoDoc, pDrawUndo) );
-     }
- 
--    if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) )
--        rDocShell.PostPaint( nStartCol, nStartRow, nTab,
--                                            nEndCol, nEndRow, nTab, PAINT_GRID );
--    if (bNeedContents)
--        pDoc->SetDirty( rRange );
-     aModificator.SetDocumentModified();
- 
-     SfxBindings* pBindings = rDocShell.GetViewBindings();
-@@ -4393,49 +4429,81 @@ BOOL ScDocFunc::MergeCells( const ScRange& rRange, BOOL bContents, BOOL bRecord,
- 
- BOOL ScDocFunc::UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi )
- {
--    ScDocShellModificator aModificator( rDocShell );
-+    ScCellMergeOption aOption(rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row());
-+    SCTAB nTab1 = rRange.aStart.Tab(), nTab2 = rRange.aEnd.Tab();
-+    for (SCTAB i = nTab1; i <= nTab2; ++i)
-+        aOption.maTabs.insert(i);
-+
-+    return UnmergeCells(aOption, bRecord, bApi);
-+}
-+
-+bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BOOL bApi )
-+{
-+    using ::std::set;
-+
-+    if (rOption.maTabs.empty())
-+        // Nothing to unmerge.
-+        return true;
- 
-+    ScDocShellModificator aModificator( rDocShell );
-     ScDocument* pDoc = rDocShell.GetDocument();
--    SCTAB nTab = rRange.aStart.Tab();
- 
-     if (bRecord && !pDoc->IsUndoEnabled())
-         bRecord = FALSE;
- 
--    if ( pDoc->HasAttrib( rRange, HASATTR_MERGED ) )
-+    ScDocument* pUndoDoc = NULL;
-+    bool bBeep = false;
-+    for (set<SCTAB>::const_iterator itr = rOption.maTabs.begin(), itrEnd = rOption.maTabs.end();
-+          itr != itrEnd; ++itr)
-     {
--        ScRange aExtended = rRange;
--        pDoc->ExtendMerge( aExtended );
-+        SCTAB nTab = *itr;
-+        ScRange aRange = rOption.getSingleRange(nTab);
-+        if ( !pDoc->HasAttrib(aRange, HASATTR_MERGED) )
-+        {
-+            bBeep = true;
-+            continue;
-+        }
-+
-+        ScRange aExtended = aRange;
-+        pDoc->ExtendMerge(aExtended);
-         ScRange aRefresh = aExtended;
--        pDoc->ExtendOverlapped( aRefresh );
-+        pDoc->ExtendOverlapped(aRefresh);
- 
-         if (bRecord)
-         {
--            ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
--            pUndoDoc->InitUndo( pDoc, nTab, nTab );
--            pDoc->CopyToDocument( aExtended, IDF_ATTRIB, FALSE, pUndoDoc );
--            rDocShell.GetUndoManager()->AddUndoAction(
--                new ScUndoRemoveMerge( &rDocShell, rRange, pUndoDoc ) );
-+            if (!pUndoDoc)
-+            {
-+                pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
-+                pUndoDoc->InitUndo(pDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin());
-+            }
-+            pDoc->CopyToDocument(aExtended, IDF_ATTRIB, FALSE, pUndoDoc);
-         }
- 
-         const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
-         ScPatternAttr aPattern( pDoc->GetPool() );
-         aPattern.GetItemSet().Put( rDefAttr );
--        pDoc->ApplyPatternAreaTab( rRange.aStart.Col(), rRange.aStart.Row(),
--                                    rRange.aEnd.Col(), rRange.aEnd.Row(), nTab,
--                                    aPattern );
-+        pDoc->ApplyPatternAreaTab( aRange.aStart.Col(), aRange.aStart.Row(),
-+                                   aRange.aEnd.Col(), aRange.aEnd.Row(), nTab,
-+                                   aPattern );
- 
-         pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(),
--                                aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
--                                SC_MF_HOR | SC_MF_VER );
-+                              aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
-+                              SC_MF_HOR | SC_MF_VER );
- 
-         pDoc->ExtendMerge( aRefresh, TRUE, FALSE );
- 
-         if ( !AdjustRowHeight( aExtended ) )
-             rDocShell.PostPaint( aExtended, PAINT_GRID );
--        aModificator.SetDocumentModified();
-     }
--    else if (!bApi)
--        Sound::Beep();		//! FALSE zurueck???
-+    if (bBeep && !bApi)
-+        Sound::Beep();
-+
-+    if (bRecord)
-+    {
-+        rDocShell.GetUndoManager()->AddUndoAction(
-+            new ScUndoRemoveMerge( &rDocShell, rOption, pUndoDoc ) );
-+    }
-+    aModificator.SetDocumentModified();
- 
-     return TRUE;
- }
-diff --git sc/source/ui/inc/cellmergeoption.hxx sc/source/ui/inc/cellmergeoption.hxx
-new file mode 100644
-index 0000000..b0ed0b1
---- /dev/null
-+++ sc/source/ui/inc/cellmergeoption.hxx
-@@ -0,0 +1,60 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: docfunc.hxx,v $
-+ * $Revision: 1.18.30.2 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org.  If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+#ifndef SC_CELLMERGEOPTION_HXX
-+#define SC_CELLMERGEOPTION_HXX
-+
-+#include "address.hxx"
-+
-+#include <set>
-+
-+class ScRange;
-+
-+struct ScCellMergeOption
-+{
-+    ::std::set<SCTAB> maTabs;
-+    SCCOL mnStartCol;
-+    SCROW mnStartRow;
-+    SCCOL mnEndCol;
-+    SCROW mnEndRow;
-+    bool mbCenter;
-+
-+    explicit ScCellMergeOption();
-+    explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow,
-+                               SCCOL nEndCol, SCROW nEndRow,
-+                               bool bCenter = false);
-+    explicit ScCellMergeOption(const ScCellMergeOption& r);
-+
-+    ScRange getSingleRange(SCTAB nTab) const;
-+    ScRange getFirstSingleRange() const;
-+};
-+
-+
-+#endif
-diff --git sc/source/ui/inc/docfunc.hxx sc/source/ui/inc/docfunc.hxx
-index 8158707..dfded9e 100644
---- sc/source/ui/inc/docfunc.hxx
-+++ sc/source/ui/inc/docfunc.hxx
-@@ -45,6 +45,7 @@ class ScBaseCell;
- class ScTokenArray;
- struct ScTabOpParam;
- class ScTableProtection;
-+struct ScCellMergeOption;
- 
- // ---------------------------------------------------------------------------
- 
-@@ -167,9 +168,10 @@ public:
- 
-     BOOL			ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, BOOL bApi );
- 
--    BOOL			MergeCells( const ScRange& rRange, BOOL bContents,
-+    BOOL			MergeCells( const ScCellMergeOption& rOption, BOOL bContents,
-                                 BOOL bRecord, BOOL bApi );
--    BOOL			UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi );
-+	BOOL			UnmergeCells( const ScRange& rRange, BOOL bRecord, BOOL bApi );
-+    bool			UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BOOL bApi );
- 
-     BOOL            SetNewRangeNames( ScRangeName* pNewRanges, BOOL bApi );     // takes ownership of pNewRanges
-     BOOL			ModifyRangeNames( const ScRangeName& rNewRanges, BOOL bApi );
-diff --git sc/source/ui/inc/undoblk.hxx sc/source/ui/inc/undoblk.hxx
-index f1aab93..5a0af10 100644
---- sc/source/ui/inc/undoblk.hxx
-+++ sc/source/ui/inc/undoblk.hxx
-@@ -31,6 +31,7 @@
- #include "markdata.hxx"
- #include "viewutil.hxx"
- #include "spellparam.hxx"
-+#include "cellmergeoption.hxx"
- 
- #include "cell.hxx"
- 
-@@ -452,10 +453,8 @@ class ScUndoMerge: public ScSimpleUndo
- {
- public:
-                     TYPEINFO();
--                    ScUndoMerge( ScDocShell* pNewDocShell,
--                                 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
--                                 SCCOL nEndX,   SCROW nEndY,   SCTAB nEndZ,
--                                 bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo );
-+                    ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
-+                                 bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo);
-     virtual 		~ScUndoMerge();
- 
-     virtual void	Undo();
-@@ -466,7 +465,7 @@ public:
-     virtual String	GetComment() const;
- 
- private:
--    ScRange         maRange;
-+    ScCellMergeOption maOption;
-     bool            mbMergeContents;        // Merge contents in Redo().
-     ScDocument*		mpUndoDoc;              // wenn Daten zusammengefasst
-     SdrUndoAction*  mpDrawUndo;
-@@ -947,7 +946,7 @@ class ScUndoRemoveMerge: public ScBlockUndo
- public:
-                     TYPEINFO();
-                     ScUndoRemoveMerge( ScDocShell* pNewDocShell,
--                                       const ScRange& rArea,
-+                                       const ScCellMergeOption& rOption,
-                                        ScDocument* pNewUndoDoc );
-     virtual 		~ScUndoRemoveMerge();
- 
-@@ -959,6 +958,9 @@ public:
-     virtual String	GetComment() const;
- 
- private:
-+    void            SetCurTab();
-+
-+    ScCellMergeOption maOption;
-     ScDocument*		pUndoDoc;
- };
- 
-diff --git sc/source/ui/inc/viewfunc.hxx sc/source/ui/inc/viewfunc.hxx
-index 1f969da..5483138 100644
---- sc/source/ui/inc/viewfunc.hxx
-+++ sc/source/ui/inc/viewfunc.hxx
-@@ -239,7 +239,7 @@ public:
-     BOOL			TestMergeCells();
-     BOOL			TestRemoveMerge();
- 
--    BOOL			MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord = TRUE );
-+    BOOL			MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord = TRUE, BOOL bCenter = FALSE );
-     BOOL			RemoveMerge( BOOL bRecord = TRUE );
- 
-     void			FillSimple( FillDir eDir, BOOL bRecord = TRUE );
-diff --git sc/source/ui/undo/undoblk.cxx sc/source/ui/undo/undoblk.cxx
-index 3f36fed..389d9b7 100644
---- sc/source/ui/undo/undoblk.cxx
-+++ sc/source/ui/undo/undoblk.cxx
-@@ -64,6 +64,7 @@
- #include "clipparam.hxx"
- #include "sc.hrc"
- 
-+#include <set>
- 
- // STATIC DATA -----------------------------------------------------------
- 
-@@ -2051,8 +2052,9 @@ BOOL __EXPORT ScUndoRemoveBreaks::CanRepeat(SfxRepeatTarget& rTarget) const
- //
- 
- ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell,
--                                       const ScRange& rArea, ScDocument* pNewUndoDoc ) :
--    ScBlockUndo( pNewDocShell, rArea, SC_UNDO_SIMPLE ),
-+                                      const ScCellMergeOption& rOption, ScDocument* pNewUndoDoc ) :
-+    ScBlockUndo( pNewDocShell, rOption.getFirstSingleRange(), SC_UNDO_SIMPLE ),
-+    maOption(rOption),
-     pUndoDoc( pNewUndoDoc )
- {
- }
-@@ -2069,66 +2071,78 @@ String __EXPORT ScUndoRemoveMerge::GetComment() const
- 
- void __EXPORT ScUndoRemoveMerge::Undo()
- {
--    BeginUndo();
--
--    ScDocument* pDoc = pDocShell->GetDocument();
--
--    ScRange aExtended = aBlockRange;
--    pUndoDoc->ExtendMerge( aExtended );
-+    using ::std::set;
- 
--    pDoc->DeleteAreaTab( aExtended, IDF_ATTRIB );
--    pUndoDoc->CopyToDocument( aExtended, IDF_ATTRIB, FALSE, pDoc );
-+    SetCurTab();
-+    BeginUndo();
- 
--    BOOL bDidPaint = FALSE;
-     ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
--    if ( pViewShell )
-+
-+    ScDocument* pDoc = pDocShell->GetDocument();
-+    for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
-+          itr != itrEnd; ++itr)
-     {
--        pViewShell->SetTabNo( aExtended.aStart.Tab() );
--        bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() );
-+        // There is no need to extend merge area because it's already been extended.
-+        ScRange aRange = maOption.getSingleRange(*itr);
-+        pDoc->DeleteAreaTab(aRange, IDF_ATTRIB);
-+        pUndoDoc->CopyToDocument(aRange, IDF_ATTRIB, FALSE, pDoc);
-+
-+        bool bDidPaint = false;
-+        if ( pViewShell )
-+        {
-+            pViewShell->SetTabNo(*itr);
-+            bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow);
-+        }
-+        if (!bDidPaint)
-+            ScUndoUtil::PaintMore(pDocShell, aRange);
-     }
--    if (!bDidPaint)
--        ScUndoUtil::PaintMore( pDocShell, aExtended );
- 
-     EndUndo();
- }
- 
- void __EXPORT ScUndoRemoveMerge::Redo()
- {
-+    using ::std::set;
-+
-+    SetCurTab();
-     BeginRedo();
- 
--    SCTAB nTab = aBlockRange.aStart.Tab();
-     ScDocument* pDoc = pDocShell->GetDocument();
--    ScRange aExtended = aBlockRange;
--    pDoc->ExtendMerge( aExtended );
--    ScRange aRefresh = aExtended;
--    pDoc->ExtendOverlapped( aRefresh );
-+    ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
-+
-+    for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
-+          itr != itrEnd; ++itr)
-+    {
-+        SCTAB nTab = *itr;
-+        // There is no need to extend merge area because it's already been extended.
-+        ScRange aRange = maOption.getSingleRange(nTab);
- 
--    //	ausfuehren
-+        //	ausfuehren
- 
--    const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
--    ScPatternAttr aPattern( pDoc->GetPool() );
--    aPattern.GetItemSet().Put( rDefAttr );
--    pDoc->ApplyPatternAreaTab( aBlockRange.aStart.Col(), aBlockRange.aStart.Row(),
--                                aBlockRange.aEnd.Col(), aBlockRange.aEnd.Row(), nTab,
--                                aPattern );
-+        const SfxPoolItem& rDefAttr = pDoc->GetPool()->GetDefaultItem( ATTR_MERGE );
-+        ScPatternAttr aPattern( pDoc->GetPool() );
-+        aPattern.GetItemSet().Put( rDefAttr );
-+        pDoc->ApplyPatternAreaTab( maOption.mnStartCol, maOption.mnStartRow,
-+                                   maOption.mnEndCol, maOption.mnEndRow, nTab,
-+                                   aPattern );
- 
--    pDoc->RemoveFlagsTab( aExtended.aStart.Col(), aExtended.aStart.Row(),
--                            aExtended.aEnd.Col(), aExtended.aEnd.Row(), nTab,
--                            SC_MF_HOR | SC_MF_VER );
-+        pDoc->RemoveFlagsTab( maOption.mnStartCol, maOption.mnStartRow,
-+                              maOption.mnEndCol, maOption.mnEndRow, nTab,
-+                              SC_MF_HOR | SC_MF_VER );
- 
--    pDoc->ExtendMerge( aRefresh, TRUE, FALSE );
-+        pDoc->ExtendMerge(aRange, TRUE, FALSE);
- 
--    //	Paint
-+        //	Paint
- 
--    BOOL bDidPaint = FALSE;
--    ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
--    if ( pViewShell )
--    {
--        pViewShell->SetTabNo( aExtended.aStart.Tab() );
--        bDidPaint = pViewShell->AdjustRowHeight( aExtended.aStart.Row(), aExtended.aEnd.Row() );
-+        BOOL bDidPaint = FALSE;
-+        if ( pViewShell )
-+        {
-+            pViewShell->SetTabNo(nTab);
-+            bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow);
-+        }
-+        if (!bDidPaint)
-+            ScUndoUtil::PaintMore(pDocShell, aRange);
-     }
--    if (!bDidPaint)
--        ScUndoUtil::PaintMore( pDocShell, aExtended );
- 
-     EndRedo();
- }
-@@ -2144,6 +2158,13 @@ BOOL __EXPORT ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const
-     return (rTarget.ISA(ScTabViewTarget));
- }
- 
-+void ScUndoRemoveMerge::SetCurTab()
-+{
-+    SCTAB nCurTab = pDocShell->GetCurTab();
-+    aBlockRange.aStart.SetTab(nCurTab);
-+    aBlockRange.aEnd.SetTab(nCurTab);
-+}
-+
- // -----------------------------------------------------------------------
- //
- //		nur Umrandung setzen, per ScRangeList (StarOne)
-diff --git sc/source/ui/undo/undoblk3.cxx sc/source/ui/undo/undoblk3.cxx
-index 629fb32..84fc105 100644
---- sc/source/ui/undo/undoblk3.cxx
-+++ sc/source/ui/undo/undoblk3.cxx
-@@ -31,6 +31,7 @@
- // INCLUDE -------------------------------------------------------------------
- 
- #include "scitems.hxx"
-+#include <svx/algitem.hxx>
- #include <editeng/boxitem.hxx>
- #include <svl/srchitem.hxx>
- #include <sfx2/linkmgr.hxx>
-@@ -798,14 +799,12 @@ BOOL __EXPORT ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const
- 
- //----------------------------------------------------------------------------
- 
--ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell,
--                            SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
--                            SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
--                            bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo )
-+ScUndoMerge::ScUndoMerge( ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
-+                          bool bMergeContents, ScDocument* pUndoDoc, SdrUndoAction* pDrawUndo )
-         //
-     :	ScSimpleUndo( pNewDocShell ),
-         //
--        maRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ),
-+        maOption(rOption),
-         mbMergeContents( bMergeContents ),
-         mpUndoDoc( pUndoDoc ),
-         mpDrawUndo( pDrawUndo )
-@@ -834,51 +833,77 @@ String ScUndoMerge::GetComment() const
- 
- void ScUndoMerge::DoChange( bool bUndo ) const
- {
--    ScDocument* pDoc = pDocShell->GetDocument();
-+    using ::std::set;
- 
--    ScUndoUtil::MarkSimpleBlock( pDocShell, maRange );
-+    if (maOption.maTabs.empty())
-+        // Nothing to do.
-+        return;
- 
--    if (bUndo)
--        // remove merge (contents are copied back below from undo document)
--        pDoc->RemoveMerge( maRange.aStart.Col(), maRange.aStart.Row(), maRange.aStart.Tab() );
--    else
--        // repeat merge, but do not remove note captions (will be done by drawing redo below)
--/*!*/	pDoc->DoMerge( maRange.aStart.Tab(),
--                       maRange.aStart.Col(), maRange.aStart.Row(),
--                       maRange.aEnd.Col(),   maRange.aEnd.Row(), false );
-+    ScDocument* pDoc = pDocShell->GetDocument();
-+    ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- 
--    // undo -> copy back deleted contents
--    if (bUndo && mpUndoDoc)
--    {
--        pDoc->DeleteAreaTab( maRange, IDF_CONTENTS|IDF_NOCAPTIONS );
--        mpUndoDoc->CopyToDocument( maRange, IDF_ALL|IDF_NOCAPTIONS, FALSE, pDoc );
--    }
-+    ScRange aCurRange = maOption.getSingleRange(pDocShell->GetCurTab());
-+    ScUndoUtil::MarkSimpleBlock(pDocShell, aCurRange);
- 
--    // redo -> merge contents again
--    else if (!bUndo && mbMergeContents)
-+    for (set<SCTAB>::const_iterator itr = maOption.maTabs.begin(), itrEnd = maOption.maTabs.end();
-+          itr != itrEnd; ++itr)
-     {
--/*!*/   pDoc->DoMergeContents( maRange.aStart.Tab(),
--                               maRange.aStart.Col(), maRange.aStart.Row(),
--                               maRange.aEnd.Col(),   maRange.aEnd.Row()   );
--    }
-+        SCTAB nTab = *itr;
-+        ScRange aRange = maOption.getSingleRange(nTab);
- 
--    if (bUndo)
--        DoSdrUndoAction( mpDrawUndo, pDoc );
--    else
--        RedoSdrUndoAction( mpDrawUndo );
-+        if (bUndo)
-+            // remove merge (contents are copied back below from undo document)
-+            pDoc->RemoveMerge( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab() );
-+        else
-+        {
-+            // repeat merge, but do not remove note captions (will be done by drawing redo below)
-+            pDoc->DoMerge( aRange.aStart.Tab(),
-+                           aRange.aStart.Col(), aRange.aStart.Row(),
-+                           aRange.aEnd.Col(),   aRange.aEnd.Row(), false );
- 
--    BOOL bDidPaint = FALSE;
--    ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
--    if ( pViewShell )
--    {
--        pViewShell->SetTabNo( maRange.aStart.Tab() );
--        bDidPaint = pViewShell->AdjustRowHeight( maRange.aStart.Row(), maRange.aEnd.Row() );
--    }
-+            if (maOption.mbCenter)
-+            {
-+                pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
-+                                 aRange.aStart.Tab(),
-+                                 SvxHorJustifyItem( SVX_HOR_JUSTIFY_CENTER, ATTR_HOR_JUSTIFY ) );
-+                pDoc->ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(),
-+                                 aRange.aStart.Tab(),
-+                                 SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) );
-+            }
-+        }
-+
-+        // undo -> copy back deleted contents
-+        if (bUndo && mpUndoDoc)
-+        {
-+            pDoc->DeleteAreaTab( aRange, IDF_CONTENTS|IDF_NOCAPTIONS );
-+            mpUndoDoc->CopyToDocument( aRange, IDF_ALL|IDF_NOCAPTIONS, FALSE, pDoc );
-+        }
-+
-+        // redo -> merge contents again
-+        else if (!bUndo && mbMergeContents)
-+        {
-+            pDoc->DoMergeContents( aRange.aStart.Tab(),
-+                                   aRange.aStart.Col(), aRange.aStart.Row(),
-+                                   aRange.aEnd.Col(), aRange.aEnd.Row() );
-+        }
- 
--    if (!bDidPaint)
--        ScUndoUtil::PaintMore( pDocShell, maRange );
-+        if (bUndo)
-+            DoSdrUndoAction( mpDrawUndo, pDoc );
-+        else
-+            RedoSdrUndoAction( mpDrawUndo );
-+
-+        bool bDidPaint = false;
-+        if ( pViewShell )
-+        {
-+            pViewShell->SetTabNo(nTab);
-+            bDidPaint = pViewShell->AdjustRowHeight(maOption.mnStartRow, maOption.mnEndRow);
-+        }
-+
-+        if (!bDidPaint)
-+            ScUndoUtil::PaintMore(pDocShell, aRange);
-+    }
- 
--    ShowTable( maRange );
-+    ShowTable(aCurRange);
- }
- 
- 
-diff --git sc/source/ui/unoobj/cellsuno.cxx sc/source/ui/unoobj/cellsuno.cxx
-index daed766..82b91c5 100644
---- sc/source/ui/unoobj/cellsuno.cxx
-+++ sc/source/ui/unoobj/cellsuno.cxx
-@@ -68,6 +68,7 @@
- #include <com/sun/star/text/WritingMode2.hpp>
- 
- #include "autoform.hxx"
-+#include "cellmergeoption.hxx"
- #include "cellsuno.hxx"
- #include "cursuno.hxx"
- #include "textuno.hxx"
-@@ -5342,10 +5343,14 @@ void SAL_CALL ScCellRangeObj::merge( sal_Bool bMerge ) throw(uno::RuntimeExcepti
-     if ( pDocSh )
-     {
-         ScDocFunc aFunc(*pDocSh);
-+        ScCellMergeOption aMergeOption(
-+            aRange.aStart.Col(), aRange.aStart.Row(),
-+            aRange.aEnd.Col(), aRange.aEnd.Row(), false);
-+        aMergeOption.maTabs.insert(aRange.aStart.Tab());
-         if ( bMerge )
--            aFunc.MergeCells( aRange, FALSE, TRUE, TRUE );
-+            aFunc.MergeCells( aMergeOption, FALSE, TRUE, TRUE );
-         else
--            aFunc.UnmergeCells( aRange, TRUE, TRUE );
-+            aFunc.UnmergeCells( aMergeOption, TRUE, TRUE );
- 
-         //!	Fehler abfangen?
-     }
-diff --git sc/source/ui/view/cellmergeoption.cxx sc/source/ui/view/cellmergeoption.cxx
-new file mode 100644
-index 0000000..eb34c48
---- /dev/null
-+++ sc/source/ui/view/cellmergeoption.cxx
-@@ -0,0 +1,74 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: docfunc.hxx,v $
-+ * $Revision: 1.18.30.2 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org.  If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+#include "cellmergeoption.hxx"
-+#include "address.hxx"
-+
-+ScCellMergeOption::ScCellMergeOption() :
-+    mnStartCol(0),
-+    mnStartRow(0),
-+    mnEndCol(0),
-+    mnEndRow(0),
-+    mbCenter(false)
-+{
-+}
-+
-+ScCellMergeOption::ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bCenter) :
-+    mnStartCol(nStartCol),
-+    mnStartRow(nStartRow),
-+    mnEndCol(nEndCol),
-+    mnEndRow(nEndRow),
-+    mbCenter(bCenter)
-+{
-+}
-+
-+ScCellMergeOption::ScCellMergeOption(const ScCellMergeOption& r) :
-+    maTabs(r.maTabs),
-+    mnStartCol(r.mnStartCol),
-+    mnStartRow(r.mnStartRow),
-+    mnEndCol(r.mnEndCol),
-+    mnEndRow(r.mnEndRow),
-+    mbCenter(r.mbCenter)
-+{
-+}
-+
-+ScRange ScCellMergeOption::getSingleRange(SCTAB nTab) const
-+{
-+    return ScRange(mnStartCol, mnStartRow, nTab, mnEndCol, mnEndRow, nTab);
-+}
-+
-+ScRange ScCellMergeOption::getFirstSingleRange() const
-+{
-+    SCTAB nTab = 0;
-+    if (!maTabs.empty())
-+        nTab = *maTabs.begin();
-+
-+    return getSingleRange(nTab);
-+}
-diff --git sc/source/ui/view/cellsh3.cxx sc/source/ui/view/cellsh3.cxx
-index e08ec21..a2a7520 100644
---- sc/source/ui/view/cellsh3.cxx
-+++ sc/source/ui/view/cellsh3.cxx
-@@ -769,6 +769,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
-             {
-                 // test whether to merge or to split
-                 bool bMerge = false;
-+                BOOL bCenter = FALSE;
-                 switch( nSlot )
-                 {
-                     case FID_MERGE_ON:
-@@ -779,6 +780,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
-                     break;
-                     case FID_MERGE_TOGGLE:
-                     {
-+                        bCenter = TRUE;
-                         SfxPoolItem* pItem = 0;
-                         if( rBindings.QueryState( nSlot, pItem ) >= SFX_ITEM_DEFAULT )
-                             bMerge = !static_cast< SfxBoolItem* >( pItem )->GetValue();
-@@ -799,7 +801,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
-                         bMoveContents = ((const SfxBoolItem*)pItem)->GetValue();
-                     }
- 
--                    if (pTabViewShell->MergeCells( bApi, bMoveContents ))
-+                    if (pTabViewShell->MergeCells( bApi, bMoveContents, TRUE, bCenter ))
-                     {
-                         if (!bApi && bMoveContents)             // "ja" im Dialog geklickt
-                             rReq.AppendItem( SfxBoolItem( nSlot, bMoveContents ) );
-diff --git sc/source/ui/view/makefile.mk sc/source/ui/view/makefile.mk
-index 129f4a7..242c4be 100644
---- sc/source/ui/view/makefile.mk
-+++ sc/source/ui/view/makefile.mk
-@@ -97,6 +97,7 @@ SLOFILES =  \
-         $(SLO)$/overlayobject.obj \
-         $(SLO)$/gridmerg.obj \
-         $(SLO)$/invmerge.obj \
-+        $(SLO)$/cellmergeoption.obj \
-         $(SLO)$/select.obj \
-         $(SLO)$/olinewin.obj \
-         $(SLO)$/hintwin.obj \
-diff --git sc/source/ui/view/viewfun2.cxx sc/source/ui/view/viewfun2.cxx
-index 053cd25..9f2bc5e 100644
---- sc/source/ui/view/viewfun2.cxx
-+++ sc/source/ui/view/viewfun2.cxx
-@@ -62,6 +62,7 @@
- #include "attrib.hxx"
- #include "autoform.hxx"
- #include "cell.hxx"					// EnterAutoSum
-+#include "cellmergeoption.hxx"
- #include "compiler.hxx"
- #include "docfunc.hxx"
- #include "docpool.hxx"
-@@ -1087,7 +1088,7 @@ BOOL ScViewFunc::TestMergeCells()			// Vorab-Test (fuer Menue)
- 
- //----------------------------------------------------------------------------
- 
--BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord )
-+BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord, BOOL bCenter )
- {
-     //	Editable- und Verschachtelungs-Abfrage muss vorneweg sein (auch in DocFunc),
-     //	damit dann nicht die Inhalte-QueryBox kommt
-@@ -1130,10 +1131,26 @@ BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord )
-         return FALSE;
-     }
- 
-+    // Check for the contents of all selected tables.
-+    bool bAskDialog = false;
-+    SCTAB nTabCount = pDoc->GetTableCount();
-+    ScCellMergeOption aMergeOption(nStartCol, nStartRow, nEndCol, nEndRow, bCenter);
-+    for (SCTAB i = 0; i < nTabCount; ++i)
-+    {
-+        if (!rMark.GetTableSelect(i))
-+            // this table is not selected.
-+            continue;
-+
-+        aMergeOption.maTabs.insert(i);
-+
-+        if (!pDoc->IsBlockEmpty(i, nStartCol, nStartRow+1, nStartCol, nEndRow) ||
-+            !pDoc->IsBlockEmpty(i, nStartCol+1, nStartRow, nEndCol, nEndRow))
-+            bAskDialog = true;
-+    }
-+
-     BOOL bOk = TRUE;
- 
--    if ( !pDoc->IsBlockEmpty( nStartTab, nStartCol,nStartRow+1, nStartCol,nEndRow, true ) ||
--         !pDoc->IsBlockEmpty( nStartTab, nStartCol+1,nStartRow, nEndCol,nEndRow, true ) )
-+    if (bAskDialog)
-     {
-         if (!bApi)
-         {
-@@ -1153,7 +1170,7 @@ BOOL ScViewFunc::MergeCells( BOOL bApi, BOOL& rDoContents, BOOL bRecord )
-     if (bOk)
-     {
-         HideCursor();
--        bOk = pDocSh->GetDocFunc().MergeCells( aMarkRange, rDoContents, bRecord, bApi );
-+        bOk = pDocSh->GetDocFunc().MergeCells( aMergeOption, rDoContents, bRecord, bApi );
-         ShowCursor();
- 
-         if (bOk)
-@@ -1189,6 +1206,32 @@ BOOL ScViewFunc::TestRemoveMerge()
- 
- //----------------------------------------------------------------------------
- 
-+static bool lcl_extendMergeRange(ScCellMergeOption& rOption, const ScRange& rRange)
-+{
-+    bool bExtended = false;
-+    if (rOption.mnStartCol > rRange.aStart.Col())
-+    {
-+        rOption.mnStartCol = rRange.aStart.Col();
-+        bExtended = true;
-+    }
-+    if (rOption.mnStartRow > rRange.aStart.Row())
-+    {
-+        rOption.mnStartRow = rRange.aStart.Row();
-+        bExtended = true;
-+    }
-+    if (rOption.mnEndCol < rRange.aEnd.Col())
-+    {
-+        rOption.mnEndCol = rRange.aEnd.Col();
-+        bExtended = true;
-+    }
-+    if (rOption.mnEndRow < rRange.aEnd.Row())
-+    {
-+        rOption.mnEndRow = rRange.aEnd.Row();
-+        bExtended = true;
-+    }
-+    return bExtended;
-+}
-+
- BOOL ScViewFunc::RemoveMerge( BOOL bRecord )
- {
-     ScRange aRange;
-@@ -1200,12 +1243,39 @@ BOOL ScViewFunc::RemoveMerge( BOOL bRecord )
-     }
-     else if (GetViewData()->GetSimpleArea( aRange ) == SC_MARK_SIMPLE)
-     {
-+        ScDocument* pDoc = GetViewData()->GetDocument();
-         ScRange aExtended( aRange );
--        GetViewData()->GetDocument()->ExtendMerge( aExtended );
-+        pDoc->ExtendMerge( aExtended );
-         ScDocShell* pDocSh = GetViewData()->GetDocShell();
-+        const ScMarkData& rMark = GetViewData()->GetMarkData();
-+        SCTAB nTabCount = pDoc->GetTableCount();
-+        ScCellMergeOption aOption(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row());
-+        bool bExtended = false;
-+        do
-+        {
-+            bExtended = false;
-+            for (SCTAB i = 0; i < nTabCount; ++i)
-+            {
-+                if (!rMark.GetTableSelect(i))
-+                    // This table is not selected.
-+                    continue;
-+
-+                aOption.maTabs.insert(i);
-+                aExtended.aStart.SetTab(i);
-+                aExtended.aEnd.SetTab(i);
-+                pDoc->ExtendMerge(aExtended);
-+                pDoc->ExtendOverlapped(aExtended);
-+
-+                // Expand the current range to be inclusive of all merged
-+                // areas on all sheets.
-+                bExtended = lcl_extendMergeRange(aOption, aExtended);
-+            }
-+        }
-+        while (bExtended);
- 
-         HideCursor();
--        BOOL bOk = pDocSh->GetDocFunc().UnmergeCells( aRange, bRecord, FALSE );
-+        BOOL bOk = pDocSh->GetDocFunc().UnmergeCells(aOption, bRecord, FALSE );
-+        aExtended = aOption.getFirstSingleRange();
-         MarkRange( aExtended );
-         ShowCursor();
- 
-diff --git sc/uiconfig/scalc/menubar/menubar.xml sc/uiconfig/scalc/menubar/menubar.xml
-index 855db09..09b3502 100644
---- sc/uiconfig/scalc/menubar/menubar.xml
-+++ sc/uiconfig/scalc/menubar/menubar.xml
-@@ -219,7 +219,13 @@
-                     <menu:menuitem menu:id=".uno:SetTabBgColor"/>
-                 </menu:menupopup>
-             </menu:menu>
--            <menu:menuitem menu:id=".uno:ToggleMergeCells"/>
-+            <menu:menu menu:id=".uno:MergeCellsMenu">
-+                <menu:menupopup>
-+                    <menu:menuitem menu:id=".uno:ToggleMergeCells"/>
-+                    <menu:menuitem menu:id=".uno:MergeCells"/>
-+                    <menu:menuitem menu:id=".uno:SplitCell"/>
-+                </menu:menupopup>
-+            </menu:menu>
-             <menu:menuseparator/>
-             <menu:menuitem menu:id=".uno:PageFormatDialog"/>
-             <menu:menu menu:id=".uno:PrintRangesMenu">
--- 
-1.7.0.1
-
commit 6029455f0c186ce12b494551e93b46dbfa130035
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Sep 16 11:34:11 2010 +0200

    calc-html-csv-import-force-text-cell.diff: Migrated to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index b605ad1..e551dd6 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -533,10 +533,6 @@ calc-ods-sheet-protection-sc.diff,      i#60305, i#71468, kohei
 calc-ods-sheet-protection-xmloff.diff,  i#60305, i#71468, kohei
 calc-ods-sheet-protection-svtools.diff, i#60305, i#71468, kohei
 
-# set cell format to Text when a string format is requested, and don't 
-# prepend ' in front of the value.
-calc-html-csv-import-force-text-cell.diff, n#523414, kohei
-
 # When finding or replacing cell contents, skip filtered cells.
 calc-find-replace-skip-filtered-svl.diff, n#539282, n#580408, i#108087, kohei
 calc-find-replace-skip-filtered-sc.diff,  n#539282, n#580408, i#108087, kohei
diff --git a/patches/dev300/calc-html-csv-import-force-text-cell.diff b/patches/dev300/calc-html-csv-import-force-text-cell.diff
deleted file mode 100644
index 7c9adf9..0000000
--- a/patches/dev300/calc-html-csv-import-force-text-cell.diff
+++ /dev/null
@@ -1,413 +0,0 @@
- sc/inc/column.hxx                  |    4 +-
- sc/inc/document.hxx                |    3 +-
- sc/inc/stringutil.hxx              |   35 +++++++++++++++++++++++
- sc/inc/table.hxx                   |    4 +-
- sc/source/core/data/column3.cxx    |   55 ++++++++++++++++++++---------------
- sc/source/core/data/document.cxx   |    4 +-
- sc/source/core/data/table2.cxx     |    4 +-
- sc/source/core/tool/stringutil.cxx |    9 ++++++
- sc/source/filter/rtf/eeimpars.cxx  |   13 +++++++-
- sc/source/ui/docshell/impex.cxx    |   23 ++++++++++++++-
- 10 files changed, 118 insertions(+), 36 deletions(-)
-
-diff --git sc/inc/column.hxx sc/inc/column.hxx
-index 6a9ef60..1968815 100644
---- sc/inc/column.hxx
-+++ sc/inc/column.hxx
-@@ -66,6 +66,7 @@ struct ScFunctionData;
- struct ScLineFlags;
- struct ScMergePatternState;
- class ScFlatBoolRowSegments;
-+struct ScSetStringParam;
- 
- #define COLUMN_DELTA	4
- 
-@@ -236,8 +237,7 @@ public:
-                 //	TRUE = Zahlformat gesetzt
-     BOOL		SetString( SCROW nRow, SCTAB nTab, const String& rString,
-                            formula::FormulaGrammar::AddressConvention conv = formula::FormulaGrammar::CONV_OOO,
--                           SvNumberFormatter* pFormatter = NULL,
--                           bool bDetectNumberFormat = true );
-+                           ScSetStringParam* pParam = NULL );
-     void		SetValue( SCROW nRow, const double& rVal);
-     void		SetError( SCROW nRow, const USHORT nError);
- 
-diff --git sc/inc/document.hxx sc/inc/document.hxx
-index a90abcb..21944f2 100644
---- sc/inc/document.hxx
-+++ sc/inc/document.hxx
-@@ -146,6 +146,7 @@ class ScFormulaParserPool;
- struct ScClipParam;        
- struct ScClipRangeNameData;
- class ScRowBreakIterator;
-+struct ScSetStringParam;
- 
- namespace com { namespace sun { namespace star {
-     namespace lang {
-@@ -758,7 +759,7 @@ public:
-                     //	return TRUE = Zahlformat gesetzt
-     SC_DLLPUBLIC BOOL           SetString(
-         SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, 
--        SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
-+        ScSetStringParam* pParam = NULL );
-     SC_DLLPUBLIC void           SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
-     void 			SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError);
- 
-diff --git sc/inc/stringutil.hxx sc/inc/stringutil.hxx
-index 4ca8629..3468640 100644
---- sc/inc/stringutil.hxx
-+++ sc/inc/stringutil.hxx
-@@ -32,6 +32,41 @@
- #define SC_STRINGUTIL_HXX
- 
- #include "rtl/ustring.hxx"
-+#include "scdllapi.h"
-+
-+class SvNumberFormatter;
-+
-+/**
-+ * Store parameters used in the ScDocument::SetString() method.  Various
-+ * options for string-setting operation are specified herein.
-+ */
-+struct SC_DLLPUBLIC ScSetStringParam
-+{
-+    /**
-+     * Stores the pointer to the number formatter instance to be used during
-+     * number format detection.  The caller must manage the life cycle of the
-+     * instance.
-+     */
-+    SvNumberFormatter* mpNumFormatter;
-+
-+    /**
-+     * When true, we try to detect special number format (dates etc) from the
-+     * input string, when false, we only try to detect a basic decimal number
-+     * format.
-+     */
-+    bool mbDetectNumberFormat;
-+
-+    /**
-+     * When true, set the format of the cell to Text when a string cell is
-+     * requested for a number input.  We may want to do this during text file
-+     * import (csv, html etc).
-+     */
-+    bool mbSetTextCellFormat;
-+
-+    ScSetStringParam();
-+};
-+
-+// ============================================================================
- 
- class ScStringUtil
- {
-diff --git sc/inc/table.hxx sc/inc/table.hxx
-index 114f71e..87320cf 100644
---- sc/inc/table.hxx
-+++ sc/inc/table.hxx
-@@ -84,7 +84,7 @@ class CollatorWrapper;
- class ScFlatUInt16RowSegments;
- class ScFlatBoolRowSegments;
- class ScFlatBoolColSegments;
--
-+struct ScSetStringParam;
- 
- class ScTable
- {
-@@ -291,7 +291,7 @@ public:
-     void		PutCell(SCCOL nCol, SCROW nRow, ULONG nFormatIndex, ScBaseCell* pCell);
-                 //	TRUE = Zahlformat gesetzt
-     BOOL		SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, 
--                           SvNumberFormatter* pFormatter = NULL, bool bDetectNumberFormat = true );
-+                           ScSetStringParam* pParam = NULL );
-     void		SetValue( SCCOL nCol, SCROW nRow, const double& rVal );
-     void 		SetError( SCCOL nCol, SCROW nRow, USHORT nError);
- 
-diff --git sc/source/core/data/column3.cxx sc/source/core/data/column3.cxx
-index 4c062a6..3b2965b 100644
---- sc/source/core/data/column3.cxx
-+++ sc/source/core/data/column3.cxx
-@@ -52,6 +52,7 @@
- #include "detfunc.hxx"			// fuer Notizen bei DeleteRange
- #include "postit.hxx"
- #include "stringutil.hxx"
-+#include "docpool.hxx"
- 
- #include <com/sun/star/i18n/LocaleDataItem.hpp>
- 
-@@ -1249,7 +1250,7 @@ void ScColumn::StartListeningInArea( SCROW nRow1, SCROW nRow2 )
- //	TRUE = Zahlformat gesetzt
- BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-                           formula::FormulaGrammar::AddressConvention eConv,
--                          SvNumberFormatter* pLangFormatter, bool bDetectNumberFormat )
-+                          ScSetStringParam* pParam )
- {
-     BOOL bNumFmtSet = FALSE;
-     if (VALIDROW(nRow))
-@@ -1258,14 +1259,15 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-         BOOL bIsLoading = FALSE;
-         if (rString.Len() > 0)
-         {
-+            ScSetStringParam aParam;
-+            if (pParam)
-+                aParam = *pParam;
-+
-             double nVal;
-             sal_uInt32 nIndex, nOldIndex = 0;
-             sal_Unicode cFirstChar;
--            // #i110979# If a different NumberFormatter is passed in (pLangFormatter),
--            // its formats aren't valid in the document.
--            // Only use the language / LocaleDataWrapper from pLangFormatter,
--            // always the document's number formatter for IsNumberFormat.
--            SvNumberFormatter* pFormatter = pDocument->GetFormatTable();
-+            if (!aParam.mpNumFormatter)
-+                aParam.mpNumFormatter = pDocument->GetFormatTable();
-             SfxObjectShell* pDocSh = pDocument->GetDocumentShell();
-             if ( pDocSh )
-                 bIsLoading = pDocSh->IsLoading();
-@@ -1274,7 +1276,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-             {
-                 nIndex = nOldIndex = GetNumberFormat( nRow );
-                 if ( rString.Len() > 1
--                        && pFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT )
-+                        && aParam.mpNumFormatter->GetType(nIndex) != NUMBERFORMAT_TEXT )
-                     cFirstChar = rString.GetChar(0);
-                 else
-                     cFirstChar = 0;								// Text
-@@ -1330,7 +1332,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-                     }
-                     // nIndex fuer IsNumberFormat vorbelegen
-                     if ( !bIsText )
--                        nIndex = nOldIndex = pFormatter->GetStandardIndex();
-+                        nIndex = nOldIndex = aParam.mpNumFormatter->GetStandardIndex();
-                 }
- 
-                 do
-@@ -1338,23 +1340,17 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-                     if (bIsText)
-                         break;
- 
--                    if (bDetectNumberFormat)
-+                    if (aParam.mbDetectNumberFormat)
-                     {
--                        if ( pLangFormatter )
--                        {
--                            // for number detection: valid format index for selected language
--                            nIndex = pFormatter->GetStandardIndex( pLangFormatter->GetLanguage() );
--                        }
--
--                        if (!pFormatter->IsNumberFormat(rString, nIndex, nVal))
-+                        if (!aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal))
-                             break;
- 
--                        if ( pLangFormatter )
-+                        if ( aParam.mpNumFormatter )
-                         {
-                             // convert back to the original language if a built-in format was detected
--                            const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
-+                            const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex );
-                             if ( pOldFormat )
--                                nIndex = pFormatter->GetFormatForLanguageIfBuiltIn( nIndex, pOldFormat->GetLanguage() );
-+                                nIndex = aParam.mpNumFormatter->GetFormatForLanguageIfBuiltIn( nIndex, pOldFormat->GetLanguage() );
-                         }
- 
-                         pNewCell = new ScValueCell( nVal );
-@@ -1365,21 +1361,21 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-                             // Exception: If the new format is boolean, always apply it.
- 
-                             BOOL bOverwrite = FALSE;
--                            const SvNumberformat* pOldFormat = pFormatter->GetEntry( nOldIndex );
-+                            const SvNumberformat* pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex );
-                             if ( pOldFormat )
-                             {
-                                 short nOldType = pOldFormat->GetType() & ~NUMBERFORMAT_DEFINED;
-                                 if ( nOldType == NUMBERFORMAT_NUMBER || nOldType == NUMBERFORMAT_DATE ||
-                                      nOldType == NUMBERFORMAT_TIME || nOldType == NUMBERFORMAT_LOGICAL )
-                                 {
--                                    if ( nOldIndex == pFormatter->GetStandardFormat(
-+                                    if ( nOldIndex == aParam.mpNumFormatter->GetStandardFormat(
-                                                         nOldType, pOldFormat->GetLanguage() ) )
-                                     {
-                                         bOverwrite = TRUE;      // default of these types can be overwritten
-                                     }
-                                 }
-                             }
--                            if ( !bOverwrite && pFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
-+                            if ( !bOverwrite && aParam.mpNumFormatter->GetType( nIndex ) == NUMBERFORMAT_LOGICAL )
-                             {
-                                 bOverwrite = TRUE;              // overwrite anything if boolean was detected
-                             }
-@@ -1395,8 +1391,7 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-                     else
-                     {
-                         // Only check if the string is a regular number.
--                        SvNumberFormatter* pLocaleSource = pLangFormatter ? pLangFormatter : pFormatter;
--                        const LocaleDataWrapper* pLocale = pLocaleSource->GetLocaleData();
-+                        const LocaleDataWrapper* pLocale = aParam.mpNumFormatter->GetLocaleData();
-                         if (!pLocale)
-                             break;
-                         
-@@ -1418,7 +1413,19 @@ BOOL ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
-                 while (false);
- 
-                 if (!pNewCell)
-+                {
-+                    if (aParam.mbSetTextCellFormat && aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal))
-+                    {
-+                        // Set the cell format type to Text.
-+                        sal_uInt32 nFormat = aParam.mpNumFormatter->GetStandardFormat(NUMBERFORMAT_TEXT);
-+                        ScPatternAttr aNewAttrs(pDocument->GetPool());
-+                        SfxItemSet& rSet = aNewAttrs.GetItemSet();
-+                        rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) );
-+                        ApplyPattern(nRow, aNewAttrs);
-+                    }
-+
-                     pNewCell = new ScStringCell(rString);
-+                }
-             }
-         }
- 
-diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
-index 3a76585..40acf12 100644
---- sc/source/core/data/document.cxx
-+++ sc/source/core/data/document.cxx
-@@ -2658,10 +2658,10 @@ void ScDocument::PutCell( const ScAddress& rPos, ScBaseCell* pCell, BOOL bForceT
- 
- 
- BOOL ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString, 
--                            SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
-+                            ScSetStringParam* pParam )
- {
-     if ( ValidTab(nTab) && pTab[nTab] )
--        return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pFormatter, bDetectNumberFormat );
-+        return pTab[nTab]->SetString( nCol, nRow, nTab, rString, pParam );
-     else
-         return FALSE;
- }
-diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 50b86f6..1ae6cb0 100644
---- sc/source/core/data/table2.cxx
-+++ sc/source/core/data/table2.cxx
-@@ -927,11 +927,11 @@ void ScTable::PutCell( const ScAddress& rPos, ScBaseCell* pCell )
- 
- 
- BOOL ScTable::SetString( SCCOL nCol, SCROW nRow, SCTAB nTabP, const String& rString, 
--                         SvNumberFormatter* pFormatter, bool bDetectNumberFormat )
-+                         ScSetStringParam* pParam )
- {
-     if (ValidColRow(nCol,nRow))
-         return aCol[nCol].SetString( 
--            nRow, nTabP, rString, pDocument->GetAddressConvention(), pFormatter, bDetectNumberFormat );
-+            nRow, nTabP, rString, pDocument->GetAddressConvention(), pParam );
-     else
-         return FALSE;
- }
-diff --git sc/source/core/tool/stringutil.cxx sc/source/core/tool/stringutil.cxx
-index ae6247f..d5e09a6 100644
---- sc/source/core/tool/stringutil.cxx
-+++ sc/source/core/tool/stringutil.cxx
-@@ -40,6 +40,15 @@
- using ::rtl::OUString;
- using ::rtl::OUStringBuffer;
- 
-+ScSetStringParam::ScSetStringParam() :
-+    mpNumFormatter(NULL),
-+    mbDetectNumberFormat(true),
-+    mbSetTextCellFormat(false)
-+{
-+}
-+
-+// ============================================================================-
-+
- bool ScStringUtil::parseSimpleNumber(
-     const OUString& rStr, sal_Unicode dsep, sal_Unicode gsep, double& rVal)
- {
-diff --git sc/source/filter/rtf/eeimpars.cxx sc/source/filter/rtf/eeimpars.cxx
-index 0bc43ca..fadb53e 100644
---- sc/source/filter/rtf/eeimpars.cxx
-+++ sc/source/filter/rtf/eeimpars.cxx
-@@ -66,6 +66,7 @@
- #include "drwlayer.hxx"
- #include "rangenam.hxx"
- #include "progress.hxx"
-+#include "stringutil.hxx"
- 
- #include "globstr.hrc"
- 
-@@ -329,12 +330,17 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu
-             // Daten eintragen
-             if (bSimple)
-             {
-+                ScSetStringParam aParam;
-+                aParam.mpNumFormatter = pFormatter;
-+                aParam.mbDetectNumberFormat = true;
-+                aParam.mbSetTextCellFormat = true;
-+
-                 if ( aValStr.Len() )
-                     mpDoc->SetValue( nCol, nRow, nTab, fVal );
-                 else if ( !pE->aSel.HasRange() )
-                 {
-                     // maybe ALT text of IMG or similar
--                    mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, pFormatter );
-+                    mpDoc->SetString( nCol, nRow, nTab, pE->aAltText, &aParam );
-                     // wenn SelRange komplett leer kann nachfolgender Text im gleichen Absatz liegen!
-                 }
-                 else
-@@ -379,7 +385,10 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu
-                     if (bNumbersEnglishUS && !bEnUsRecognized)
-                         mpDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aStr));
-                     else
--                        mpDoc->SetString( nCol, nRow, nTab, aStr, pFormatter, bConvertDate );
-+                    {
-+                        aParam.mbDetectNumberFormat = bConvertDate;
-+                        mpDoc->SetString( nCol, nRow, nTab, aStr, &aParam );
-+                    }
-                 }
-             }
-             else
-diff --git sc/source/ui/docshell/impex.cxx sc/source/ui/docshell/impex.cxx
-index 5bf49e8..9c839f5 100644
---- sc/source/ui/docshell/impex.cxx
-+++ sc/source/ui/docshell/impex.cxx
-@@ -82,6 +82,9 @@ class StarBASIC;
- 
- // ause
- #include "editutil.hxx"
-+#include "patattr.hxx"
-+#include "docpool.hxx"
-+#include "stringutil.hxx"
- 
- #include "globstr.hrc"
- #include <vcl/msgbox.hxx>
-@@ -914,6 +917,18 @@ static bool lcl_PutString(
- 
-     if ( nColFormat == SC_COL_TEXT )
-     {
-+        double fDummy;
-+        sal_uInt32 nIndex;
-+        if (pFormatter->IsNumberFormat(rStr, nIndex, fDummy))
-+        {
-+            // Set the format of this cell to Text.
-+            sal_uInt32 nFormat = pFormatter->GetStandardFormat(NUMBERFORMAT_TEXT);
-+            ScPatternAttr aNewAttrs(pDoc->GetPool());
-+            SfxItemSet& rSet = aNewAttrs.GetItemSet();
-+            rSet.Put( SfxUInt32Item(ATTR_VALUE_FORMAT, nFormat) );
-+            pDoc->ApplyPattern(nCol, nRow, nTab, aNewAttrs);
-+
-+        }
-         pDoc->PutCell( nCol, nRow, nTab, ScBaseCell::CreateTextCell( rStr, pDoc ) );
-         return bMultiLine;
-     }
-@@ -1126,7 +1141,13 @@ static bool lcl_PutString(
- 
-     // Standard or date not determined -> SetString / EditCell
-     if( rStr.Search( _LF ) == STRING_NOTFOUND )
--        pDoc->SetString( nCol, nRow, nTab, rStr, pFormatter, bDetectNumFormat );
-+    {
-+        ScSetStringParam aParam;
-+        aParam.mpNumFormatter = pFormatter;
-+        aParam.mbDetectNumberFormat = bDetectNumFormat;
-+        aParam.mbSetTextCellFormat = true;
-+        pDoc->SetString( nCol, nRow, nTab, rStr, &aParam );
-+    }
-     else 
-     {
-         bMultiLine = true;
commit 83eaba3d6df9300473e325fa8fab09342b629180
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Sep 16 11:30:35 2010 +0200

    calc-autofilter-shrink-selection.diff: Migrated to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 974b3bc..b605ad1 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -533,9 +533,6 @@ calc-ods-sheet-protection-sc.diff,      i#60305, i#71468, kohei
 calc-ods-sheet-protection-xmloff.diff,  i#60305, i#71468, kohei
 calc-ods-sheet-protection-svtools.diff, i#60305, i#71468, kohei
 
-# shrink selection to data area before setting autofilter.
-calc-autofilter-shrink-selection.diff, n#514164, kohei
-
 # set cell format to Text when a string format is requested, and don't 
 # prepend ' in front of the value.
 calc-html-csv-import-force-text-cell.diff, n#523414, kohei
diff --git a/patches/dev300/calc-autofilter-shrink-selection.diff b/patches/dev300/calc-autofilter-shrink-selection.diff
deleted file mode 100644
index 0c69740..0000000
--- a/patches/dev300/calc-autofilter-shrink-selection.diff
+++ /dev/null
@@ -1,20 +0,0 @@
----
- sc/source/ui/view/dbfunc.cxx |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git sc/source/ui/view/dbfunc.cxx sc/source/ui/view/dbfunc.cxx
-index 2eefb06..891cf0e 100644
---- sc/source/ui/view/dbfunc.cxx
-+++ sc/source/ui/view/dbfunc.cxx
-@@ -344,7 +344,7 @@ void ScDBFunc::ToggleAutoFilter()
- 
-     ScQueryParam	aParam;
-     ScDocument*		pDoc	= GetViewData()->GetDocument();
--    ScDBData*		pDBData = GetDBData( FALSE, SC_DB_MAKE, SC_DBSEL_ROW_DOWN );
-+    ScDBData*		pDBData = GetDBData(false, SC_DB_MAKE, SC_DBSEL_ROW_DOWN, false, true);
- 
-     pDBData->SetByRow( TRUE );				//! Undo, vorher abfragen ??
-     pDBData->GetQueryParam( aParam );
--- 
-1.7.0.1
-
commit 6d905ba669edcd1a6e71beaf4ad4904777f4e771
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Sep 16 11:23:15 2010 +0200

    calc-cursor-split-view.diff: Migrated to git

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 5fc5173..974b3bc 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -533,9 +533,6 @@ calc-ods-sheet-protection-sc.diff,      i#60305, i#71468, kohei
 calc-ods-sheet-protection-xmloff.diff,  i#60305, i#71468, kohei
 calc-ods-sheet-protection-svtools.diff, i#60305, i#71468, kohei
 
-# show cursor in non-active panes, instead of ugly black box.
-calc-cursor-split-view.diff, n#433834, kohei
-
 # shrink selection to data area before setting autofilter.
 calc-autofilter-shrink-selection.diff, n#514164, kohei
 
diff --git a/patches/dev300/calc-cursor-split-view.diff b/patches/dev300/calc-cursor-split-view.diff
deleted file mode 100644
index 9a6cf23..0000000
--- a/patches/dev300/calc-cursor-split-view.diff
+++ /dev/null
@@ -1,70 +0,0 @@
----
- sc/source/ui/view/gridwin.cxx |   38 ++++++++++++++++++--------------------
- 1 files changed, 18 insertions(+), 20 deletions(-)
-
-diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx
-index da1f083..4db161c 100644
---- sc/source/ui/view/gridwin.cxx
-+++ sc/source/ui/view/gridwin.cxx
-@@ -5317,24 +5317,16 @@ void ScGridWindow::UpdateCursorOverlay()
-             if ( bLayoutRTL )
-                 aScrPos.X() -= nSizeXPix - 2;       // move instead of mirroring
- 
--            BOOL bFix = ( pViewData->GetHSplitMode() == SC_SPLIT_FIX ||
--                            pViewData->GetVSplitMode() == SC_SPLIT_FIX );
--            if ( pViewData->GetActivePart()==eWhich || bFix )
--            {
--                aScrPos.X() -= 2;
--                aScrPos.Y() -= 2;
--                Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) );
--
--                aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ));
--                aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ));
--                aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ));
--                aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ));
--            }
--            else
--            {
--                Rectangle aRect( aScrPos, Size( nSizeXPix - 1, nSizeYPix - 1 ) );
--                aPixelRects.push_back( aRect );
--            }
-+            // Now, draw the cursor.
-+
-+            aScrPos.X() -= 2;
-+            aScrPos.Y() -= 2;
-+            Rectangle aRect( aScrPos, Size( nSizeXPix + 3, nSizeYPix + 3 ) );
-+
-+            aPixelRects.push_back(Rectangle( aRect.Left(), aRect.Top(), aRect.Left()+2, aRect.Bottom() ));
-+            aPixelRects.push_back(Rectangle( aRect.Right()-2, aRect.Top(), aRect.Right(), aRect.Bottom() ));
-+            aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Top(), aRect.Right()-3, aRect.Top()+2 ));
-+            aPixelRects.push_back(Rectangle( aRect.Left()+3, aRect.Bottom()-2, aRect.Right()-3, aRect.Bottom() ));
-         }
-     }
- 
-@@ -5345,7 +5337,10 @@ void ScGridWindow::UpdateCursorOverlay()
- 
-         if(pOverlayManager)
-         {
--            const Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
-+            Color aCursorColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
-+            if (pViewData->GetActivePart() != eWhich)
-+                // non-active pane uses a different color.
-+                aCursorColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
-             std::vector< basegfx::B2DRange > aRanges;
-             const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
-             
-@@ -5494,7 +5489,10 @@ void ScGridWindow::UpdateAutoFillOverlay()
- 
-         if(pOverlayManager)
-         {
--            const Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
-+            Color aHandleColor( SC_MOD()->GetColorConfig().GetColorValue(svtools::FONTCOLOR).nColor );
-+            if (pViewData->GetActivePart() != eWhich)
-+                // non-active pane uses a different color.
-+                aHandleColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
-             std::vector< basegfx::B2DRange > aRanges;
-             const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
-             basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1);
--- 
-1.7.0.1
-


More information about the ooo-build-commit mailing list