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

massinissaHamidi hamidi.massinissa at yahoo.fr
Fri May 15 21:16:12 PDT 2015


 sw/source/core/layout/paintfrm.cxx |    3 ++-
 sw/source/core/view/viewimp.cxx    |    3 ++-
 sw/source/core/view/viewsh.cxx     |    6 ++++++
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 1622b67e4b2bc8ecc5dd3ededc0a6e5adb936a6e
Author: massinissaHamidi <hamidi.massinissa at yahoo.fr>
Date:   Thu May 7 01:53:33 2015 +0200

    tdf#90150 : Page numbering in the status bar which may cause confusion
    
    Changes :
    
    - The page number changes when a certain amount of the previous page is
      reached. This is done in SetFirstVisPage.
    
    - Since the page number (and pFirstVisPage) changes before the entire
      previous page disappear from VisArea, there is still a portion of it
      which is visible and must be added for paint. This is done with
      GetPrev.
    
    Change-Id: If7704011bc11efe88321bf448d61708097334d7d
    Reviewed-on: https://gerrit.libreoffice.org/15657
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 93737e5..e5c5c6f 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3257,7 +3257,8 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
     const_cast<SwRootFrm*>(this)->SetCallbackActionEnabled( false );
 
     const SwPageFrm *pPage = pSh->Imp()->GetFirstVisPage();
-
+    if ( pPage->GetPrev() )
+        pPage = static_cast<const SwPageFrm*>(pPage->GetPrev());
     const bool bBookMode = gProp.pSGlobalShell->GetViewOptions()->IsViewLayoutBookMode();
     if ( bBookMode && pPage->GetPrev() && static_cast<const SwPageFrm*>(pPage->GetPrev())->IsEmptyPage() )
         pPage = static_cast<const SwPageFrm*>(pPage->GetPrev());
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index e85e2a0..e759fcf 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -187,7 +187,8 @@ void SwViewShellImp::SetFirstVisPage()
 
         SwPageFrm *pPage = static_cast<SwPageFrm*>(pSh->GetLayout()->Lower());
         SwRect aPageRect = pPage->GetBoundRect();
-        while ( pPage && !aPageRect.IsOver( pSh->VisArea() ) )
+        float fAmount = pSh->VisArea().Height() * 0.43;
+        while ( pPage && aPageRect.Bottom() < pSh->VisArea().Top() + fAmount )
         {
             pPage = static_cast<SwPageFrm*>(pPage->GetNext());
             if ( pPage )
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7d5495c..bedaee9 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1459,6 +1459,12 @@ void SwViewShell::PaintDesktop( const SwRect &rRect )
     else
     {
         const SwFrm *pPage = Imp()->GetFirstVisPage();
+        //Here we have to get the previous page since
+        //GetFirstVisPage return the current one but
+        //there is a portion of the previous page
+        //which is still visible
+        if ( pPage->GetPrev() )
+            pPage = pPage->GetPrev();
         const SwTwips nBottom = rRect.Bottom();
         while ( pPage && !aRegion.empty() &&
                 (pPage->Frm().Top() <= nBottom) )


More information about the Libreoffice-commits mailing list