summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-06 02:04:44 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-07-06 02:06:47 +0200
commitf99a10d45331c8f007fd521880e7a61546c02fb8 (patch)
treec70f1456e3c05e165abc26b948a169a70d556a09
parenta0c5a0b7ece71c849d714a03cdc74362cff7c2e0 (diff)
adjust the calculation of the cursor pos if ALT is used, fdo#48869
Change-Id: I6316717c860d999270aa7f0fb50af5f6dfc7efd7
-rw-r--r--sc/source/ui/view/gridwin.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 40e8f383809d..64555e68c2bb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4114,6 +4114,9 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
String aUndo = ScGlobal::GetRscString( bIsMove ? STR_UNDO_MOVE : STR_UNDO_COPY );
pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo );
+ SCsCOL nCorrectCursorPosCol = 0;
+ SCsROW nCorrectCursorPosRow = 0;
+
bDone = sal_True;
if ( meDragInsertMode != INS_NONE )
{
@@ -4127,11 +4130,13 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
nDestPosX == aSource.aStart.Col() && nDestPosY < aSource.aStart.Row() )
{
bDone = aSource.Move( 0, nSizeY, 0, pSourceDoc );
+ nCorrectCursorPosRow = nSizeY;
}
else if ( meDragInsertMode == INS_CELLSRIGHT &&
nDestPosY == aSource.aStart.Row() && nDestPosX < aSource.aStart.Col() )
{
bDone = aSource.Move( nSizeX, 0, 0, pSourceDoc );
+ nCorrectCursorPosCol = nSizeX;
}
}
pDocSh->UpdateOle( pViewData );
@@ -4190,8 +4195,8 @@ sal_Int8 ScGridWindow::DropTransferObj( ScTransferObj* pTransObj, SCCOL nDestPos
{
pView->MarkRange( aDest, false, false );
- SCCOL nDCol = pViewData->GetCurX() - aSource.aStart.Col();
- SCROW nDRow = pViewData->GetCurY() - aSource.aStart.Row();
+ SCCOL nDCol = pViewData->GetCurX() - aSource.aStart.Col() + nCorrectCursorPosCol;
+ SCROW nDRow = pViewData->GetCurY() - aSource.aStart.Row() + nCorrectCursorPosRow;
pView->SetCursor( aDest.aStart.Col() + nDCol, aDest.aStart.Row() + nDRow );
}