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:09 +0200
commitc433fa0639ccf5caeb0c128c8a3794322e2a1c81 (patch)
treec117a25be25af5da647c8244f33a362eea714220
parentdd209b77391903cb6f9f04c44e10a05f31076f4a (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 6187397979e8..c98b89e91cb1 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -4113,6 +4113,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 )
{
@@ -4126,11 +4129,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 );
@@ -4189,8 +4194,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 );
}