diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-02-08 13:48:13 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-02-08 13:56:21 +0100 |
commit | 8045c3931878c75da8e5229899ccbc895ccbed8a (patch) | |
tree | 3a8659336ee8a4a3f99b3eccaa54808e58695ebf /sw/source | |
parent | 95d45e8a19babfc319b3e92ee89bb13fd9924631 (diff) |
sw lok: For PgDown/PgUp, don't set the VisArea, instead use a dedicated var.
The m_aVisArea may be changed by many other means (called internally from
LibreOffice), so let's introduce a dedicated offset for PgUp / PgDown handling
overwriting the computed value (if set).
Change-Id: I7c869b1e3582145b58f0185f4df2882d07a81ddf
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewport.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index c5d6a6b9a5b4..17256a51eee8 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -713,7 +713,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_bInDtor(false), m_bOldShellWasPagePreview(false), m_bIsPreviewDoubleClick(false), - m_bAnnotationMode(false) + m_bAnnotationMode(false), + m_nLOKPageUpDownOffset(0) { static bool bRequestDoubleBuffering = getenv("VCL_DOUBLEBUFFERING_ENABLE"); if (bRequestDoubleBuffering) diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 326d2515cb3a..5ecfd6260431 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -542,6 +542,11 @@ bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const rOff = rOff - m_aVisArea.Top(); else if( GetWrtShell().GetCharRect().Top() < (m_aVisArea.Top() + nYScrl)) rOff += nYScrl; + + // in the LOK case, force the value set by the API + if (comphelper::LibreOfficeKit::isActive() && m_nLOKPageUpDownOffset > 0) + rOff = -m_nLOKPageUpDownOffset; + return true; } @@ -558,6 +563,11 @@ bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const else if( GetWrtShell().GetCharRect().Bottom() > ( m_aVisArea.Bottom() - nYScrl )) rOff -= nYScrl; + + // in the LOK case, force the value set by the API + if (comphelper::LibreOfficeKit::isActive() && m_nLOKPageUpDownOffset > 0) + rOff = m_nLOKPageUpDownOffset; + return rOff > 0; } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index aedf88ce7695..383f6ee3ccf5 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3192,7 +3192,8 @@ void SwXTextDocument::setClientVisibleArea(const Rectangle& rRectangle) if (!pView) return; - pView->SetVisArea(rRectangle); + // set the PgUp/PgDown offset + pView->ForcePageUpDownOffset(2 * rRectangle.GetHeight() / 3); } Pointer SwXTextDocument::getPointer() |