[Libreoffice-commits] core.git: sw/source

Pranav Kant pranavk at collabora.co.uk
Mon Jul 4 15:20:13 UTC 2016


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

New commits:
commit 6db7f9e673a29d88ce3509a1edf4011ab5f3ba67
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>

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;
 }
 


More information about the Libreoffice-commits mailing list