summaryrefslogtreecommitdiff
path: root/sw/source/uibase/uiview
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2016-07-04 16:23:09 +0530
committerpranavk <pranavk@collabora.com>2016-07-04 15:19:52 +0000
commit6db7f9e673a29d88ce3509a1edf4011ab5f3ba67 (patch)
tree426064c2d79247d95422a7e274d9c1aa1e73c46d /sw/source/uibase/uiview
parent3e27c437709e8f1e0df78826452f29330c68ebb5 (diff)
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@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.com>
Diffstat (limited to 'sw/source/uibase/uiview')
-rw-r--r--sw/source/uibase/uiview/viewport.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 9b7af74a4804..7be971df4bf0 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -532,6 +532,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;
@@ -542,15 +549,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;
@@ -563,10 +573,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;
}