sw/source/uibase/uiview/viewport.cxx |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

New commits:
commit 6db7f9e673a29d88ce3509a1edf4011ab5f3ba67
Author: Pranav Kant <pran...@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 <c...@libreoffice.org>
    Reviewed-by: pranavk <pran...@collabora.com>

diff --git a/sw/source/uibase/uiview/viewport.cxx 
b/sw/source/uibase/uiview/viewport.cxx
index 9b7af74..7be971d 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;
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to