diff options
author | massinissaHamidi <hamidi.massinissa@yahoo.fr> | 2015-05-07 01:53:33 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-05-16 04:15:48 +0000 |
commit | 1622b67e4b2bc8ecc5dd3ededc0a6e5adb936a6e (patch) | |
tree | 95e8393bd3c2a25201e63eaaca83d0ee05e38413 | |
parent | 6664859e1e8b3f8b7db8c931b8d0335510c20ce0 (diff) |
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@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/view/viewimp.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 93737e5b1254..e5c5c6f0eaed 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 e85e2a0fdc0c..e759fcf0a0b4 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 7d5495cc2ddf..bedaee9f038b 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) ) |