sc/inc/docuno.hxx | 3 +++ sc/source/ui/inc/viewdata.hxx | 6 ++++++ sc/source/ui/unoobj/docuno.cxx | 11 +++++++++++ sc/source/ui/view/viewdata.cxx | 11 +++++++++-- 4 files changed, 29 insertions(+), 2 deletions(-)
New commits: commit cd1d2b3e1b5802576414cf497a3d2b56e4b0eb70 Author: Marco Cecchetti <marco.cecche...@collabora.com> Date: Thu Oct 6 17:31:15 2016 +0200 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 <mrcek...@gmail.com> Tested-by: Marco Cecchetti <mrcek...@gmail.com> diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 1487b0b..55957f3 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -423,6 +423,9 @@ public: /// @see vcl::ITiledRenderable::getTrackedChanges(). OUString getTrackedChanges() override; + + /// @see vcl::ITiledRenderable::setClientVisibleArea(). + virtual void setClientVisibleArea(const Rectangle& rRectangle) override; }; class ScDrawPagesObj : public cppu::WeakImplHelper< diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index e007a4b..b0cd0a3 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 43151ab..3ccd145 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 34aa647..90d5cd6 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits