View | Details | Raw Unified | Return to issue 7500
Collapse All | Expand All

(-)sc/source/ui/view/viewfun3.cxx.orig (-11 / +26 lines)
Lines 982-999 Link Here
982
		return FALSE;
982
		return FALSE;
983
	}
983
	}
984
984
985
		//! Test auf Ueberlappung
985
	ScDocFunc& rDocFunc = pDocSh->GetDocFunc(); 
986
		//! nur wirkliche Schnittmenge testen !!!!!!!
986
	if ( bRecord )
987
987
	{
988
	//	pDoc->HasCommonAttr( StartCol,nStartRow, nUndoEndCol,nUndoEndRow, nStartTab,
988
		String aUndo = ScGlobal::GetRscString( pClipDoc->IsCutMode() ? STR_UNDO_MOVE : STR_UNDO_COPY );
989
	//							pClipDoc, nClipStartX, nClipStartY );
989
		pUndoMgr->EnterListAction( aUndo, aUndo );
990
	}
990
991
991
	if (bClipOver)
992
	if (bClipOver)
992
        if (lcl_SelHasAttrib( pDoc, nStartCol,nStartRow, nUndoEndCol,nUndoEndRow, rMark, HASATTR_OVERLAPPED ))
993
        if (lcl_SelHasAttrib( pDoc, nStartCol,nStartRow, nUndoEndCol,nUndoEndRow, rMark, HASATTR_OVERLAPPED ))
993
        {        // "Cell merge not possible if cells already merged"
994
        {       // "Cell merge are possible if we unmerge cells before insertion"
994
			ErrorMessage(STR_MSSG_PASTEFROMCLIP_1);
995
			ScRange destRange( nStartCol, nStartRow, nStartTab, nUndoEndCol, nUndoEndRow, nEndTab );
995
			delete pTransClip;
996
		    rDocFunc.UnmergeCells(destRange, bRecord, TRUE);
996
			return FALSE;
997
			for (SCCOL i = nStartCol; i <= nUndoEndCol; i++)
998
				for (SCCOL j = nStartRow; j <= nUndoEndRow; j++) 
999
					{
1000
						ScRange rrRange (i, j, nEndTab);
1001
						pDoc->ExtendOverlapped(rrRange);
1002
						pDoc->ExtendMerge(rrRange);
1003
						// we can have merged range in the selection, 
1004
						// so we take only those which are in the way
1005
						if (rrRange.aStart.Col() < nStartCol || rrRange.aEnd.Col() > nEndCol || 
1006
							rrRange.aStart.Row() < nStartRow || rrRange.aEnd.Row() > nEndRow) 
1007
						{
1008
							rDocFunc.UnmergeCells(rrRange, bRecord, TRUE);
1009
						}
1010
					}
997
		}
1011
		}
998
1012
999
	if ( !bCutMode )
1013
	if ( !bCutMode )
Lines 1085-1091 Link Here
1085
1099
1086
	// skipped rows and merged cells don't mix
1100
	// skipped rows and merged cells don't mix
1087
	if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
1101
	if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
1088
		pDocSh->GetDocFunc().UnmergeCells( aUserRange, FALSE, TRUE );
1102
		rDocFunc.UnmergeCells( aUserRange, FALSE, TRUE );
1089
1103
1090
    pDoc->ExtendMergeSel( nStartCol, nStartRow, nEndCol, nEndRow, rMark, TRUE );    // Refresh
1104
    pDoc->ExtendMergeSel( nStartCol, nStartRow, nEndCol, nEndRow, rMark, TRUE );    // Refresh
1091
																					// und Bereich neu
1105
																					// und Bereich neu
Lines 1183-1188 Link Here
1183
		}
1197
		}
1184
		else
1198
		else
1185
			pUndoMgr->AddUndoAction( pUndo );
1199
			pUndoMgr->AddUndoAction( pUndo );
1200
1201
		pUndoMgr->LeaveListAction();
1186
	}
1202
	}
1187
1203
1188
	USHORT nPaint = PAINT_GRID;
1204
	USHORT nPaint = PAINT_GRID;
Lines 1360-1366 Link Here
1360
        const BOOL bRecord( pDoc->IsUndoEnabled());
1376
        const BOOL bRecord( pDoc->IsUndoEnabled());
1361
        ScDocument* pUndoDoc = NULL;
1377
        ScDocument* pUndoDoc = NULL;
1362
        ScDocument* pRedoDoc = NULL;
1378
        ScDocument* pRedoDoc = NULL;
1363
        ScDocument* pRefUndoDoc = NULL;
1364
        ScRefUndoData* pUndoData = NULL;
1379
        ScRefUndoData* pUndoData = NULL;
1365
        SCTAB nTab = GetViewData()->GetTabNo();
1380
        SCTAB nTab = GetViewData()->GetTabNo();
1366
        SCTAB nStartTab = nTab;
1381
        SCTAB nStartTab = nTab;

Return to issue 7500