[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Dec 17 12:18:54 PST 2010


 sc/source/ui/view/tabview2.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit bd80366a3ff7e209450813c78ec6963ffc55ef96
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Dec 17 14:48:10 2010 -0500

    Use the current cursor position when expanding a selection.
    
    When expanding a selection via shift-ctrl-<arrow key> use the
    current cursor position to deteremine how much the current selection
    should be expanded.  The old way was to use the block end position
    which is is diagonally opposite of the cursor position. (n#659795)

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 6b7671b..73daaac 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -450,8 +450,12 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
     }
     else if (IsBlockMode())
     {
+        // block end position.
         nNewX = nBlockEndX;
         nNewY = nBlockEndY;
+        // cursor position - diagonally opposite of the block end position.
+        nCurX = aViewData.GetCurX();
+        nCurY = aViewData.GetCurY();
     }
     else
     {
@@ -467,16 +471,16 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
     SCsCOLROW i;
     if ( nMovX > 0 )
         for ( i=0; i<nMovX; i++ )
-            pDoc->FindAreaPos( nNewX, nNewY, nTab,  1,  0 );
+            pDoc->FindAreaPos( nNewX, nCurY, nTab,  1,  0 );
     if ( nMovX < 0 )
         for ( i=0; i<-nMovX; i++ )
-            pDoc->FindAreaPos( nNewX, nNewY, nTab, -1,  0 );
+            pDoc->FindAreaPos( nNewX, nCurY, nTab, -1,  0 );
     if ( nMovY > 0 )
         for ( i=0; i<nMovY; i++ )
-            pDoc->FindAreaPos( nNewX, nNewY, nTab,  0,  1 );
+            pDoc->FindAreaPos( nCurX, nNewY, nTab,  0,  1 );
     if ( nMovY < 0 )
         for ( i=0; i<-nMovY; i++ )
-            pDoc->FindAreaPos( nNewX, nNewY, nTab,  0, -1 );
+            pDoc->FindAreaPos( nCurX, nNewY, nTab,  0, -1 );
 
     if (eMode==SC_FOLLOW_JUMP)                  // unten/rechts nicht zuviel grau anzeigen
     {


More information about the Libreoffice-commits mailing list