diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-10-06 17:31:15 +0200 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2016-10-06 16:44:21 +0000 |
commit | cd1d2b3e1b5802576414cf497a3d2b56e4b0eb70 (patch) | |
tree | df5b1539010226dc9405e4ecfe6199724f31222e /sc/source | |
parent | af58bbf076069dc3dd467e9b9f0c34b937c2c09c (diff) |
LOK: Calc: page-up/down - cursor moves far more than a page
Change-Id: I1253044f26553dab08bc2a38c706f634e9377c86
Reviewed-on: https://gerrit.libreoffice.org/29578
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/inc/viewdata.hxx | 6 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 11 |
3 files changed, 26 insertions, 2 deletions
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index e007a4b6f055..b0cd0a3f5078 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -225,8 +225,11 @@ private: bool bPagebreak:1; // Page break preview mode bool bSelCtrlMouseClick:1; // special selection handling for ctrl-mouse-click + long m_nLOKPageUpDownOffset; + DECL_DLLPRIVATE_LINK( EditEngineHdl, EditStatus&, void ); + SAL_DLLPRIVATE void CalcPPT(); SAL_DLLPRIVATE void CreateTabData( SCTAB nNewTab ); SAL_DLLPRIVATE void CreateTabData( std::vector< SCTAB >& rvTabs ); @@ -422,6 +425,9 @@ public: bool IsOutlineMode () const { return pOptions->GetOption( VOPT_OUTLINER ); } void SetOutlineMode ( bool bNewMode ) { pOptions->SetOption( VOPT_OUTLINER, bNewMode ); } + /// Force page size for PgUp/PgDown to overwrite the computation based on m_aVisArea. + void ForcePageUpDownOffset(long nTwips) { m_nLOKPageUpDownOffset = nTwips; } + void KillEditView(); void ResetEditView(); void SetEditEngine( ScSplitPos eWhich, diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 43151abaae3e..3ccd1453bff9 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -966,6 +966,17 @@ OUString ScModelObj::getTrackedChanges() return aRet; } +void ScModelObj::setClientVisibleArea(const Rectangle& rRectangle) +{ + ScViewData* pViewData = pDocShell->GetViewData(); + if (!pViewData) + return; + + // set the PgUp/PgDown offset + pViewData->ForcePageUpDownOffset(rRectangle.GetHeight()); +} + + void ScModelObj::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/) { SolarMutexGuard aGuard; diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 34aa647f7da0..90d5cd6e10bc 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -356,7 +356,8 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : bIsRefMode ( false ), bDelMarkValid( false ), bPagebreak ( false ), - bSelCtrlMouseClick( false ) + bSelCtrlMouseClick( false ), + m_nLOKPageUpDownOffset( 0 ) { mpMarkData->SelectOneTable(0); // Sync with nTabNo @@ -444,7 +445,8 @@ ScViewData::ScViewData( const ScViewData& rViewData ) : bIsRefMode ( false ), bDelMarkValid( false ), bPagebreak ( rViewData.bPagebreak ), - bSelCtrlMouseClick( rViewData.bSelCtrlMouseClick ) + bSelCtrlMouseClick( rViewData.bSelCtrlMouseClick ), + m_nLOKPageUpDownOffset( rViewData.m_nLOKPageUpDownOffset ) { SetGridMode ( rViewData.IsGridMode() ); @@ -1731,6 +1733,11 @@ 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) |