[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sw/source
Pranav Kant
pranavk at collabora.co.uk
Mon Jul 4 15:23:30 UTC 2016
sw/source/uibase/uiview/viewport.cxx | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
New commits:
commit 0fa31116b3d2bb150923e9ee0af6917fd5de1c44
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Mon Jul 4 16:23:09 2016 +0530
sw lok: Handle lok handling code first, for PageUp/Down
m_aVisArea is not set in case of lok, which means
m_nLOKPageUpDownOffset would never be set for lok case.
Change-Id: Ie0416ebb680695430c76b25416f4744172dc3daf
Reviewed-on: https://gerrit.libreoffice.org/26902
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: pranavk <pranavk at collabora.com>
(cherry picked from commit 6db7f9e673a29d88ce3509a1edf4011ab5f3ba67)
Reviewed-on: https://gerrit.libreoffice.org/26912
Tested-by: pranavk <pranavk at collabora.com>
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 5ecfd62..7157d5f 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -533,6 +533,13 @@ void SwView::Scroll( const Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt16 nRan
bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const
{
+ // in the LOK case, force the value set by the API
+ if (comphelper::LibreOfficeKit::isActive() && m_nLOKPageUpDownOffset > 0)
+ {
+ rOff = -m_nLOKPageUpDownOffset;
+ return true;
+ }
+
if ( !m_aVisArea.Top() || !m_aVisArea.GetHeight() )
return false;
long nYScrl = GetYScroll() / 2;
@@ -543,15 +550,18 @@ bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const
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;
}
bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const
{
+ // in the LOK case, force the value set by the API
+ if (comphelper::LibreOfficeKit::isActive() && m_nLOKPageUpDownOffset > 0)
+ {
+ rOff = m_nLOKPageUpDownOffset;
+ return true;
+ }
+
if ( !m_aVisArea.GetHeight() ||
(m_aVisArea.GetHeight() > m_aDocSz.Height()) )
return false;
@@ -564,10 +574,6 @@ bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const
( 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;
}
More information about the Libreoffice-commits
mailing list