summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2016-11-17 12:42:34 +0100
committerMarco Cecchetti <mrcekets@gmail.com>2016-11-19 14:24:48 +0000
commit6a1f0ec26cf5ff2cbd83a074774d324c9f751217 (patch)
tree04cb7416c9d2eab3939513dc191405c553c1746b /sc/source/ui
parentf533b3f39956fe8028c1f7f7cc3c37b0feed8b57 (diff)
LOK - calc: now PgUp/PgDn offset is used only when PgUp/PgDn are pressed
Change-Id: I340d747021bc794361d6b8eff76335345b60010c Reviewed-on: https://gerrit.libreoffice.org/30975 Reviewed-by: Marco Cecchetti <mrcekets@gmail.com> Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/viewdata.hxx1
-rw-r--r--sc/source/ui/view/tabview2.cxx10
-rw-r--r--sc/source/ui/view/viewdata.cxx5
3 files changed, 9 insertions, 7 deletions
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 9323dad65133..1a62a909d10c 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -434,6 +434,7 @@ public:
/// Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea.
void ForcePageUpDownOffset(long nTwips) { m_nLOKPageUpDownOffset = nTwips; }
+ long GetPageUpDownOffset() { return m_nLOKPageUpDownOffset; }
void KillEditView();
void ResetEditView();
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 275002ca920e..16ad08089402 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -45,6 +45,7 @@
#include "tabprotection.hxx"
#include "markdata.hxx"
#include "inputopt.hxx"
+#include <comphelper/lok.hxx>
namespace {
@@ -628,6 +629,11 @@ void ScTabView::GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPage
ScHSplitPos eWhichX = WhichH( eWhich );
ScVSplitPos eWhichY = WhichV( eWhich );
+ sal_uInt16 nScrSizeY = SC_SIZE_NONE;
+ if (comphelper::LibreOfficeKit::isActive() && aViewData.GetPageUpDownOffset() > 0) {
+ nScrSizeY = ScViewData::ToPixel( aViewData.GetPageUpDownOffset(), aViewData.GetPPTX() );
+ }
+
SCsCOL nPageX;
SCsROW nPageY;
if (nMovX >= 0)
@@ -636,9 +642,9 @@ void ScTabView::GetPageMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, SCsCOL& rPage
nPageX = ((SCsCOL) aViewData.CellsAtX( nCurX, -1, eWhichX )) * nMovX;
if (nMovY >= 0)
- nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY )) * nMovY;
+ nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, 1, eWhichY, nScrSizeY )) * nMovY;
else
- nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY )) * nMovY;
+ nPageY = ((SCsROW) aViewData.CellsAtY( nCurY, -1, eWhichY, nScrSizeY )) * nMovY;
if (nMovX != 0 && nPageX == 0) nPageX = (nMovX>0) ? 1 : -1;
if (nMovY != 0 && nPageY == 0) nPageY = (nMovY>0) ? 1 : -1;
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index b37af9289cef..c6111917c6ec 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1763,11 +1763,6 @@ SCROW ScViewData::CellsAtY( SCsROW nPosY, SCsROW nDir, ScVSplitPos eWhichY, sal_
if (nScrSizeY == SC_SIZE_NONE) nScrSizeY = (sal_uInt16) aScrSize.Height();
- if (comphelper::LibreOfficeKit::isActive() && m_nLOKPageUpDownOffset > 0)
- {
- nScrSizeY = ToPixel( m_nLOKPageUpDownOffset, nPPTY );
- }
-
SCROW nY;
if (nDir==1)