summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Francis <dennisfrancis.in@gmail.com>2016-01-18 06:47:02 +0530
committerEike Rathke <erack@redhat.com>2016-02-02 10:17:30 +0000
commitb5c191c130a132fb5f80ce9eefe4e98f1ad9422f (patch)
tree126b5e22bebc914a93eb02e352df438ab84c75e5
parent50d3ea929e5519d7727f18183d5f4df4f455286e (diff)
Fix for tdf#97084 : Scroll view to the ref boundary...
...but maintain the fix for tdf#96524 Change-Id: I35128843d13904e9e0cf9ded559c352acb3c7c46 Reviewed-on: https://gerrit.libreoffice.org/21559 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/ui/view/tabview2.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 7ccf8610fcb0..556390daecb7 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -912,9 +912,19 @@ void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode)
pDoc->SkipOverlapped(nNewX, nNewY, nRefTab);
UpdateRef(nNewX, nNewY, nRefTab);
- if ((aViewData.GetRefStartX() == MAXCOL || nNewX != MAXCOL) &&
- (aViewData.GetRefStartY() == MAXROW || nNewY != MAXROW))
- AlignToCursor(nNewX, nNewY, eMode);
+ SCCOL nTargetCol = nNewX;
+ SCROW nTargetRow = nNewY;
+ if (((aViewData.GetRefStartX() == 0) || (aViewData.GetRefStartY() == 0)) &&
+ ((nNewX != MAXCOL) || (nNewY != MAXROW)))
+ {
+ // Row selection
+ if ((aViewData.GetRefStartX() == 0) && (nNewX == MAXCOL))
+ nTargetCol = aViewData.GetCurX();
+ // Column selection
+ if ((aViewData.GetRefStartY() == 0) && (nNewY == MAXROW))
+ nTargetRow = aViewData.GetCurY();
+ }
+ AlignToCursor(nTargetCol, nTargetRow, eMode);
}
else
{