[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu Jul 5 17:08:24 PDT 2012


 sc/source/ui/view/gridwin.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit f99a10d45331c8f007fd521880e7a61546c02fb8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jul 6 02:04:44 2012 +0200

    adjust the calculation of the cursor pos if ALT is used, fdo#48869
    
    Change-Id: I6316717c860d999270aa7f0fb50af5f6dfc7efd7

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 40e8f38..64555e6 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 );
                 }
 


More information about the Libreoffice-commits mailing list