sc/inc/docuno.hxx | 3 +++ sc/source/ui/inc/viewdata.hxx | 5 +++++ sc/source/ui/unoobj/docuno.cxx | 11 +++++++++++ sc/source/ui/view/viewdata.cxx | 11 +++++++++-- 4 files changed, 28 insertions(+), 2 deletions(-)
New commits: commit bf8355a42b6a92b5ef92543448e20df5fdeeafaf Author: Marco Cecchetti <[email protected]> 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/29577 Reviewed-by: Marco Cecchetti <[email protected]> Tested-by: Marco Cecchetti <[email protected]> diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 81b0924..d1b92b1 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -422,6 +422,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 5c3cc9f..14b26a9 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -214,6 +214,8 @@ private: bool bPagebreak:1; // Page break preview mode bool bSelCtrlMouseClick:1; // special selection handling for ctrl-mouse-click + long m_nLOKPageUpDownOffset; + DECL_DLLPRIVATE_LINK_TYPED( EditEngineHdl, EditStatus&, void ); SAL_DLLPRIVATE void CalcPPT(); @@ -404,6 +406,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 b75bc52..68efb4c 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -960,6 +960,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 058b992..0bf45ea 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -352,7 +352,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 @@ -440,7 +441,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() ); @@ -1705,6 +1707,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 [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
