[ooo-build-commit] Branch 'ooo-build-3-1-1' - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Fri Sep 25 09:27:45 PDT 2009
patches/dev300/apply | 2
patches/dev300/calc-insert-over-merged-cells.diff | 70 ++++++++++++++++++++++
2 files changed, 72 insertions(+)
New commits:
commit c8cc62560c0ffe9032ea988ada60944303bef877
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Fri Sep 25 10:59:02 2009 -0400
[experimental] Backported upstream fix from i#7500.
* patches/dev300/apply:
* patches/dev300/calc-insert-over-merged-cells.diff: backported
from i#7500. (n#540923)
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 6fc2ca3..a3479d5 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -3412,6 +3412,8 @@ calc-find-replace-skip-filtered.diff, n#539282, kohei
# force-interpret formula cell results.
calc-getpivotdata-force-interpret-formula.diff, n#540563, kohei
+# allow insertion of merged cells over existing merged cells.
+calc-insert-over-merged-cells.diff, n#540923, i#7500, kohei
[ AutoLayout ]
sd-layoutcode.diff, cocofan
diff --git a/patches/dev300/calc-insert-over-merged-cells.diff b/patches/dev300/calc-insert-over-merged-cells.diff
new file mode 100644
index 0000000..c8c4f1d
--- /dev/null
+++ b/patches/dev300/calc-insert-over-merged-cells.diff
@@ -0,0 +1,70 @@
+diff --git sc/source/ui/view/viewfun3.cxx sc/source/ui/view/viewfun3.cxx
+index 4d86fec..f44e673 100644
+--- sc/source/ui/view/viewfun3.cxx
++++ sc/source/ui/view/viewfun3.cxx
+@@ -185,6 +185,9 @@
+ #include <sot/exchange.hxx>
+ #include <memory>
+
++#include "attrib.hxx"
++#include "patattr.hxx"
++#include "dociter.hxx"
+ #include "viewfunc.hxx"
+ #include "tabvwsh.hxx"
+ #include "docsh.hxx"
+@@ -1218,11 +1221,35 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
+ // pDoc->HasCommonAttr( StartCol,nStartRow, nUndoEndCol,nUndoEndRow, nStartTab,
+ // pClipDoc, nClipStartX, nClipStartY );
+
++ ScDocFunc& rDocFunc = pDocSh->GetDocFunc();
++ if ( bRecord )
++ {
++ String aUndo = ScGlobal::GetRscString( pClipDoc->IsCutMode() ? STR_UNDO_MOVE : STR_UNDO_COPY );
++ pUndoMgr->EnterListAction( aUndo, aUndo );
++ }
++
+ if (bClipOver)
+ if (lcl_SelHasAttrib( pDoc, nStartCol,nStartRow, nUndoEndCol,nUndoEndRow, aFilteredMark, HASATTR_OVERLAPPED ))
+ { // "Cell merge not possible if cells already merged"
+- ErrorMessage(STR_MSSG_PASTEFROMCLIP_1);
+- return FALSE;
++ ScDocAttrIterator aIter( pDoc, nStartTab, nStartCol, nStartRow, nUndoEndCol, nUndoEndRow );
++ const ScPatternAttr* pPattern = NULL;
++ const ScMergeAttr* pMergeFlag = NULL;
++ const ScMergeFlagAttr* pMergeFlagAttr = NULL;
++ SCCOL nCol = -1;
++ SCROW nRow1 = -1;
++ SCROW nRow2 = -1;
++ while ( ( pPattern = aIter.GetNext( nCol, nRow1, nRow2 ) ) != NULL )
++ {
++ pMergeFlag = (const ScMergeAttr*) &pPattern->GetItem(ATTR_MERGE);
++ pMergeFlagAttr = (const ScMergeFlagAttr*) &pPattern->GetItem(ATTR_MERGE_FLAG);
++ if( ( pMergeFlag && pMergeFlag->IsMerged() ) || ( pMergeFlagAttr && pMergeFlagAttr->IsOverlapped() ) )
++ {
++ ScRange aRange(nCol, nRow1, nStartTab);
++ pDoc->ExtendOverlapped(aRange);
++ pDoc->ExtendMerge(aRange, TRUE, TRUE);
++ rDocFunc.UnmergeCells(aRange, bRecord, TRUE);
++ }
++ }
+ }
+
+ if ( !bCutMode )
+@@ -1325,7 +1352,7 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
+
+ // skipped rows and merged cells don't mix
+ if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
+- pDocSh->GetDocFunc().UnmergeCells( aUserRange, FALSE, TRUE );
++ rDocFunc.UnmergeCells( aUserRange, FALSE, TRUE );
+
+ pDoc->ExtendMergeSel( nStartCol, nStartRow, nEndCol, nEndRow, aFilteredMark, TRUE ); // Refresh
+ // und Bereich neu
+@@ -1418,6 +1445,8 @@ BOOL ScViewFunc::PasteFromClip( USHORT nFlags, ScDocument* pClipDoc,
+ }
+ else
+ pUndoMgr->AddUndoAction( pUndo );
++
++ pUndoMgr->LeaveListAction();
+ }
+
+ USHORT nPaint = PAINT_GRID;
More information about the ooo-build-commit
mailing list