Kaydet (Commit) d9369b97 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwViewShellImp::SetFirstVisPage: use vcl::RenderContext

Change-Id: If36b6fdda54dfbe6e4eea14883d659302a1db6be
(cherry picked from commit 85cd7a6c)
üst c926d60a
...@@ -89,7 +89,7 @@ class SwViewShellImp ...@@ -89,7 +89,7 @@ class SwViewShellImp
SwPagePreviewLayout* mpPgPreviewLayout; SwPagePreviewLayout* mpPgPreviewLayout;
void SetFirstVisPage(); // Recalculate the first visible Page void SetFirstVisPage(OutputDevice* pRenderContext); // Recalculate the first visible Page
void StartAction(); // Show handle and hide void StartAction(); // Show handle and hide
void EndAction(); // Called by SwViewShell::ImplXXXAction void EndAction(); // Called by SwViewShell::ImplXXXAction
......
...@@ -169,7 +169,7 @@ bool SwViewShellImp::IsUpdateExpFields() ...@@ -169,7 +169,7 @@ bool SwViewShellImp::IsUpdateExpFields()
return false; return false;
} }
void SwViewShellImp::SetFirstVisPage() void SwViewShellImp::SetFirstVisPage(OutputDevice* pRenderContext)
{ {
if ( pSh->mbDocSizeChgd && pSh->VisArea().Top() > pSh->GetLayout()->Frm().Height() ) if ( pSh->mbDocSizeChgd && pSh->VisArea().Top() > pSh->GetLayout()->Frm().Height() )
{ {
...@@ -186,18 +186,18 @@ void SwViewShellImp::SetFirstVisPage() ...@@ -186,18 +186,18 @@ void SwViewShellImp::SetFirstVisPage()
const bool bBookMode = pSwViewOption->IsViewLayoutBookMode(); const bool bBookMode = pSwViewOption->IsViewLayoutBookMode();
SwPageFrm *pPage = static_cast<SwPageFrm*>(pSh->GetLayout()->Lower()); SwPageFrm *pPage = static_cast<SwPageFrm*>(pSh->GetLayout()->Lower());
SwRect aPageRect = pPage->GetBoundRect(pSh->GetOut()); SwRect aPageRect = pPage->GetBoundRect(pRenderContext);
float fAmount = pSh->VisArea().Height() * 0.43; float fAmount = pSh->VisArea().Height() * 0.43;
while ( pPage && aPageRect.Bottom() < pSh->VisArea().Top() + fAmount ) while ( pPage && aPageRect.Bottom() < pSh->VisArea().Top() + fAmount )
{ {
pPage = static_cast<SwPageFrm*>(pPage->GetNext()); pPage = static_cast<SwPageFrm*>(pPage->GetNext());
if ( pPage ) if ( pPage )
{ {
aPageRect = pPage->GetBoundRect(pSh->GetOut()); aPageRect = pPage->GetBoundRect(pRenderContext);
if ( bBookMode && pPage->IsEmptyPage() ) if ( bBookMode && pPage->IsEmptyPage() )
{ {
const SwPageFrm& rFormatPage = pPage->GetFormatPage(); const SwPageFrm& rFormatPage = pPage->GetFormatPage();
aPageRect.SSize() = rFormatPage.GetBoundRect(pSh->GetOut()).SSize(); aPageRect.SSize() = rFormatPage.GetBoundRect(pRenderContext).SSize();
} }
} }
} }
...@@ -273,14 +273,14 @@ Color SwViewShellImp::GetRetoucheColor() const ...@@ -273,14 +273,14 @@ Color SwViewShellImp::GetRetoucheColor() const
SwPageFrm *SwViewShellImp::GetFirstVisPage() SwPageFrm *SwViewShellImp::GetFirstVisPage()
{ {
if ( bFirstPageInvalid ) if ( bFirstPageInvalid )
SetFirstVisPage(); SetFirstVisPage(pSh->GetOut());
return pFirstVisPage; return pFirstVisPage;
} }
const SwPageFrm *SwViewShellImp::GetFirstVisPage() const const SwPageFrm *SwViewShellImp::GetFirstVisPage() const
{ {
if ( bFirstPageInvalid ) if ( bFirstPageInvalid )
const_cast<SwViewShellImp*>(this)->SetFirstVisPage(); const_cast<SwViewShellImp*>(this)->SetFirstVisPage(pSh->GetOut());
return pFirstVisPage; return pFirstVisPage;
} }
......
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