summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabview2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/tabview2.cxx')
-rw-r--r--sc/source/ui/view/tabview2.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 888e27c4cef6..4566805ed4b2 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -45,6 +45,7 @@
#include "scmod.hxx"
#include "tabprotection.hxx"
#include "markdata.hxx"
+#include "inputopt.hxx"
namespace {
@@ -610,6 +611,7 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
{
SCCOL nNewX = -1;
SCROW nNewY = -1;
+
// current cursor position.
SCCOL nCurX = aViewData.GetCurX();
SCROW nCurY = aViewData.GetCurY();
@@ -637,20 +639,24 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
SCTAB nTab = aViewData.GetTabNo();
// FindAreaPos kennt nur -1 oder 1 als Richtung
+ ScModule* pScModule = SC_MOD();
+ bool bLegacyCellSelection = pScModule->GetInputOptions().GetLegacyCellSelection();
+ SCCOL nVirtualX = bLegacyCellSelection ? nNewX : nCurX;
+ SCROW nVirtualY = bLegacyCellSelection ? nNewY : nCurY;
SCsCOLROW i;
if ( nMovX > 0 )
for ( i=0; i<nMovX; i++ )
- pDoc->FindAreaPos( nNewX, nCurY, nTab, SC_MOVE_RIGHT );
+ pDoc->FindAreaPos( nNewX, nVirtualY, nTab, SC_MOVE_RIGHT );
if ( nMovX < 0 )
for ( i=0; i<-nMovX; i++ )
- pDoc->FindAreaPos( nNewX, nCurY, nTab, SC_MOVE_LEFT );
+ pDoc->FindAreaPos( nNewX, nVirtualY, nTab, SC_MOVE_LEFT );
if ( nMovY > 0 )
for ( i=0; i<nMovY; i++ )
- pDoc->FindAreaPos( nCurX, nNewY, nTab, SC_MOVE_DOWN );
+ pDoc->FindAreaPos( nVirtualX, nNewY, nTab, SC_MOVE_DOWN );
if ( nMovY < 0 )
for ( i=0; i<-nMovY; i++ )
- pDoc->FindAreaPos( nCurX, nNewY, nTab, SC_MOVE_UP );
+ pDoc->FindAreaPos( nVirtualX, nNewY, nTab, SC_MOVE_UP );
if (eMode==SC_FOLLOW_JUMP) // unten/rechts nicht zuviel grau anzeigen
{