summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Le Ray <sebastien-libreoffice@orniz.org>2011-04-29 18:37:41 +0200
committerJan Holesovsky <kendy@suse.cz>2011-05-03 11:02:51 +0200
commit7b8c5bf878c29ece5f3bcfe877ad0f1141bb70f3 (patch)
treed3f513cc822447c7e30ec2292f3582376ad2f574
parent2666ac6bf1a7850ef0c10cdd202557b1b2d25b19 (diff)
Use GetBoundRect() instead of Frm() in layout.
-rw-r--r--sw/source/core/layout/layact.cxx32
-rw-r--r--sw/source/core/view/viewsh.cxx11
2 files changed, 22 insertions, 21 deletions
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index a00165a563..e462b7229a 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1399,9 +1399,15 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
if ( pLay->GetPrev() && !pLay->GetPrev()->IsValid() )
pLay->GetPrev()->SetCompletePaint();
- SwRect aOldRect( pLay->Frm() );
+ SwRect aOldFrame( pLay->Frm() );
+ SwRect aOldRect( aOldFrame );
+ if( pLay->IsPageFrm() )
+ {
+ aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect();
+ }
+
pLay->Calc();
- if ( aOldRect != pLay->Frm() )
+ if ( aOldFrame != pLay->Frm() )
bChanged = sal_True;
sal_Bool bNoPaint = sal_False;
@@ -1424,15 +1430,7 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
if ( pLay->IsPageFrm() )
{
SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
- const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
-
- if(pSh)
- {
- SwPageFrm::GetBorderAndShadowBoundRect(aPaint, pSh, aPaint,
- pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(),
- pPageFrm->SidebarPosition() == sw::sidebarwindows::SIDEBAR_RIGHT);
- }
-
+ aPaint = pPageFrm->GetBoundRect();
}
sal_Bool bPageInBrowseMode = pLay->IsPageFrm();
@@ -1499,12 +1497,16 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
{
// top
SwRect aSpaceToPrevPage( aPageRect );
+ aSpaceToPrevPage.Top( aSpaceToPrevPage.Top() - nHalfDocBorder );
aSpaceToPrevPage.Bottom( pLay->Frm().Top() );
if(aSpaceToPrevPage.Height() > 0 && aSpaceToPrevPage.Width() > 0)
pImp->GetShell()->AddPaintRect( aSpaceToPrevPage );
+ pSh->GetOut()->DrawRect( aSpaceToPrevPage.SVRect() );
+
// left
aSpaceToPrevPage = aPageRect;
+ aSpaceToPrevPage.Left( aSpaceToPrevPage.Left() - nHalfDocBorder );
aSpaceToPrevPage.Right( pLay->Frm().Left() );
if(aSpaceToPrevPage.Height() > 0 && aSpaceToPrevPage.Width() > 0)
pImp->GetShell()->AddPaintRect( aSpaceToPrevPage );
@@ -1578,12 +1580,14 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
// OD 11.11.2002 #104414# - add complete frame area as paint area, if frame
// area has been already added and after formating its lowers the frame area
// is enlarged.
+ SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect() : pLay->Frm() );
+
if ( bAlreadyPainted &&
- ( pLay->Frm().Width() > aFrmAtCompletePaint.Width() ||
- pLay->Frm().Height() > aFrmAtCompletePaint.Height() )
+ ( aBoundRect.Width() > aFrmAtCompletePaint.Width() ||
+ aBoundRect.Height() > aFrmAtCompletePaint.Height() )
)
{
- pImp->GetShell()->AddPaintRect( pLay->Frm() );
+ pImp->GetShell()->AddPaintRect( aBoundRect );
}
return bChanged || bTabChanged;
}
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index bbb846ea68..9903f97b6c 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -995,11 +995,11 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
while ( pPage && pPage->Frm().Top() <= nBottom )
{
- SwRect aPageRect( pPage->Frm() );
+ SwRect aPageRect( pPage->GetBoundRect() );
if ( bBookMode )
{
const SwPageFrm& rFormatPage = static_cast<const SwPageFrm*>(pPage)->GetFormatPage();
- aPageRect.SSize() = rFormatPage.Frm().SSize();
+ aPageRect.SSize() = rFormatPage.GetBoundRect().SSize();
}
if ( aPageRect.IsOver( aBoth ) )
@@ -1010,11 +1010,8 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
if( aSidebarPos != sw::sidebarwindows::SIDEBAR_NONE )
{
- SwRect aShadowRect;
- SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, this,
- aShadowRect, pPage->IsLeftShadowNeeded(), pPage->IsRightShadowNeeded(), aSidebarPos == sw::sidebarwindows::SIDEBAR_RIGHT);
- nPageLeft = aShadowRect.Left();
- nPageRight = aShadowRect.Right();
+ nPageLeft = aPageRect.Left();
+ nPageRight = aPageRect.Right();
}
if( nPageLeft < nMinLeft )