Kaydet (Commit) 70c13d2d authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Andras Timar

SwLayAction::FormatLayout: use vcl::RenderContext

Change-Id: I3bc993b00940732fd9ca26ccec7d025c8558516a
(cherry picked from commit b13fbaf6)
üst 19ec0f21
...@@ -100,7 +100,7 @@ class SwLayAction ...@@ -100,7 +100,7 @@ class SwLayAction
inline bool _PaintContent( const SwContentFrm *, const SwPageFrm *, inline bool _PaintContent( const SwContentFrm *, const SwPageFrm *,
const SwRect & ); const SwRect & );
bool FormatLayout( SwLayoutFrm *, bool bAddRect = true ); bool FormatLayout( OutputDevice* pRenderContext, SwLayoutFrm *, bool bAddRect = true );
bool FormatLayoutTab( SwTabFrm *, bool bAddRect = true ); bool FormatLayoutTab( SwTabFrm *, bool bAddRect = true );
bool FormatContent( const SwPageFrm* pPage ); bool FormatContent( const SwPageFrm* pPage );
void _FormatContent( const SwContentFrm* pContent, void _FormatContent( const SwContentFrm* pContent,
......
...@@ -572,7 +572,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) ...@@ -572,7 +572,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
break; break;
} }
FormatLayout( pPage ); FormatLayout( pRenderContext, pPage );
XCHECKPAGE; XCHECKPAGE;
} }
// #i28701# - change condition // #i28701# - change condition
...@@ -755,7 +755,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext) ...@@ -755,7 +755,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
break; break;
} }
FormatLayout( pPg ); FormatLayout( pRenderContext, pPg );
XCHECKPAGE; XCHECKPAGE;
} }
...@@ -1026,7 +1026,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) ...@@ -1026,7 +1026,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
} }
} }
else else
FormatLayout( prPage ); FormatLayout( pSh->GetOut(), prPage );
if ( IsAgain() ) if ( IsAgain() )
return false; return false;
} }
...@@ -1216,7 +1216,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage ) ...@@ -1216,7 +1216,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
} }
// OD 15.11.2002 #105155# - introduce support for vertical layout // OD 15.11.2002 #105155# - introduce support for vertical layout
bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay, bool bAddRect )
{ {
OSL_ENSURE( !IsAgain(), "Attention to the invalid page." ); OSL_ENSURE( !IsAgain(), "Attention to the invalid page." );
if ( IsAgain() ) if ( IsAgain() )
...@@ -1236,7 +1236,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) ...@@ -1236,7 +1236,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
SwRect aOldRect( aOldFrame ); SwRect aOldRect( aOldFrame );
if( pLay->IsPageFrm() ) if( pLay->IsPageFrm() )
{ {
aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut()); aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext);
} }
pLay->Calc(); pLay->Calc();
...@@ -1264,7 +1264,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) ...@@ -1264,7 +1264,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
if ( pLay->IsPageFrm() ) if ( pLay->IsPageFrm() )
{ {
SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay); SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
aPaint = pPageFrm->GetBoundRect(pPageFrm->getRootFrm()->GetCurrShell()->GetOut()); aPaint = pPageFrm->GetBoundRect(pRenderContext);
} }
bool bPageInBrowseMode = pLay->IsPageFrm(); bool bPageInBrowseMode = pLay->IsPageFrm();
...@@ -1320,7 +1320,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) ...@@ -1320,7 +1320,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
if(pSh) if(pSh)
{ {
SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh, SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh,
pSh->GetOut(), pRenderContext,
aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(), aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(),
pPageFrm->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT); pPageFrm->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
} }
...@@ -1335,7 +1335,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) ...@@ -1335,7 +1335,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
pImp->GetShell()->AddPaintRect( aSpaceToPrevPage ); pImp->GetShell()->AddPaintRect( aSpaceToPrevPage );
if (pSh) if (pSh)
pSh->GetOut()->DrawRect( aSpaceToPrevPage.SVRect() ); pRenderContext->DrawRect( aSpaceToPrevPage.SVRect() );
// left // left
aSpaceToPrevPage = aPageRect; aSpaceToPrevPage = aPageRect;
...@@ -1399,7 +1399,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) ...@@ -1399,7 +1399,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect ); bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect );
// Skip the ones already registered for deletion // Skip the ones already registered for deletion
else if( !pLow->IsSctFrm() || static_cast<SwSectionFrm*>(pLow)->GetSection() ) else if( !pLow->IsSctFrm() || static_cast<SwSectionFrm*>(pLow)->GetSection() )
bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect ); bChanged |= FormatLayout( pRenderContext, static_cast<SwLayoutFrm*>(pLow), bAddRect );
} }
else if ( pImp->GetShell()->IsPaintLocked() ) else if ( pImp->GetShell()->IsPaintLocked() )
// Shortcut to minimize the cycles. With Lock, the // Shortcut to minimize the cycles. With Lock, the
...@@ -1413,7 +1413,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect ) ...@@ -1413,7 +1413,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
// OD 11.11.2002 #104414# - add complete frame area as paint area, if frame // OD 11.11.2002 #104414# - add complete frame area as paint area, if frame
// area has been already added and after formatting its lowers the frame area // area has been already added and after formatting its lowers the frame area
// is enlarged. // is enlarged.
SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut()) : pLay->Frm() ); SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext) : pLay->Frm() );
if ( bAlreadyPainted && if ( bAlreadyPainted &&
( aBoundRect.Width() > aFrmAtCompletePaint.Width() || ( aBoundRect.Width() > aFrmAtCompletePaint.Width() ||
...@@ -1467,7 +1467,7 @@ bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly ) ...@@ -1467,7 +1467,7 @@ bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
if ( pLow->IsTabFrm() ) if ( pLow->IsTabFrm() )
bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect ); bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect );
else else
bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect ); bChanged |= FormatLayout( pImp->GetShell()->GetOut(), static_cast<SwLayoutFrm*>(pLow), bAddRect );
} }
pLow = pLow->GetNext(); pLow = pLow->GetNext();
} }
...@@ -1614,7 +1614,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect ) ...@@ -1614,7 +1614,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect )
SwLayoutFrm *pLow = static_cast<SwLayoutFrm*>(pTab->Lower()); SwLayoutFrm *pLow = static_cast<SwLayoutFrm*>(pTab->Lower());
while ( pLow ) while ( pLow )
{ {
bChanged |= FormatLayout( pLow, bAddRect ); bChanged |= FormatLayout( pImp->GetShell()->GetOut(), pLow, bAddRect );
if ( IsAgain() ) if ( IsAgain() )
return false; return false;
pLow = static_cast<SwLayoutFrm*>(pLow->GetNext()); pLow = static_cast<SwLayoutFrm*>(pLow->GetNext());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment