summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-06-25 11:18:01 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-06-25 14:14:57 +0200
commitd7dd8bb3bdd0fee44d6704cbf34d4a39cd7a3d29 (patch)
tree9bda2e4e5c48cde796dea7a8a839a9058916bc76 /sw
parentf53c186b8d2f5a13a3a644dbff7f21548c32c4d4 (diff)
SwPageFrm::GetBorderAndShadowBoundRect: use vcl::RenderContext
Change-Id: If861aa0a579eb953cd2fc7b790b3514ab1d0ffd0
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/pagefrm.hxx1
-rw-r--r--sw/source/core/layout/layact.cxx1
-rw-r--r--sw/source/core/layout/pagechg.cxx4
-rw-r--r--sw/source/core/layout/paintfrm.cxx14
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx2
5 files changed, 12 insertions, 10 deletions
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index 1023beea9ac4..58559fdb1ddc 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -300,6 +300,7 @@ public:
*/
static void GetBorderAndShadowBoundRect( const SwRect& _rPageRect,
const SwViewShell* _pViewShell,
+ OutputDevice* pRenderContext,
SwRect& _orBorderAndShadowBoundRect,
const bool bLeftShadow,
const bool bRightShadow,
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 520808d6a619..7563bcedc87d 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1320,6 +1320,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
if(pSh)
{
SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh,
+ pSh->GetOut(),
aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(),
pPageFrm->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 8a070d8cdf17..0ba69f9ac8e7 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -260,7 +260,7 @@ void SwPageFrm::DestroyImpl()
// including border and shadow area.
const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
SwRect aRetoucheRect;
- SwPageFrm::GetBorderAndShadowBoundRect( Frm(), pSh, aRetoucheRect, IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar );
+ SwPageFrm::GetBorderAndShadowBoundRect( Frm(), pSh, pSh->GetOut(), aRetoucheRect, IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar );
pSh->AddPaintRect( aRetoucheRect );
}
}
@@ -623,7 +623,7 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
// page frame for determine 'old' rectangle - it's used for invalidating.
const bool bRightSidebar = (SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
SwRect aOldRectWithBorderAndShadow;
- SwPageFrm::GetBorderAndShadowBoundRect( aOldPageFrmRect, pSh, aOldRectWithBorderAndShadow,
+ SwPageFrm::GetBorderAndShadowBoundRect( aOldPageFrmRect, pSh, pSh->GetOut(), aOldRectWithBorderAndShadow,
IsLeftShadowNeeded(), IsRightShadowNeeded(), bRightSidebar );
pSh->InvalidateWindows( aOldRectWithBorderAndShadow );
}
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index bbde2a846d60..b5ee4147870c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3295,7 +3295,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
if ( !pPage->IsEmptyPage() )
{
SwRect aPaintRect;
- SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, aPaintRect,
+ SwPageFrm::GetBorderAndShadowBoundRect( pPage->Frm(), pSh, &rRenderContext, aPaintRect,
bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
if ( aRect.IsOver( aPaintRect ) )
@@ -3459,7 +3459,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
const SwPageFrm& rFormatPage = pPage->GetFormatPage();
aEmptyPageRect.SSize() = rFormatPage.Frm().SSize();
- SwPageFrm::GetBorderAndShadowBoundRect( aEmptyPageRect, pSh, aPaintRect,
+ SwPageFrm::GetBorderAndShadowBoundRect( aEmptyPageRect, pSh, &rRenderContext, aPaintRect,
bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
aPaintRect._Intersection( aRect );
@@ -6369,6 +6369,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
*/
/*static*/ void SwPageFrm::GetBorderAndShadowBoundRect( const SwRect& _rPageRect,
const SwViewShell* _pViewShell,
+ OutputDevice* pRenderContext,
SwRect& _orBorderAndShadowBoundRect,
bool bLeftShadow,
bool bRightShadow,
@@ -6376,9 +6377,8 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
)
{
SwRect aAlignedPageRect( _rPageRect );
- ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
- SwRect aPagePxRect =
- _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
+ ::SwAlignRect( aAlignedPageRect, _pViewShell, pRenderContext );
+ SwRect aPagePxRect = pRenderContext->LogicToPixel( aAlignedPageRect.SVRect() );
aPagePxRect.Bottom( aPagePxRect.Bottom() + mnShadowPxWidth + 1 );
aPagePxRect.Top( aPagePxRect.Top() - mnShadowPxWidth - 1 );
@@ -6391,7 +6391,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
if(bLeftShadow) aPagePxRect.Left( aTmpRect.Left() - mnShadowPxWidth - 1);
if(bRightShadow) aPagePxRect.Right( aTmpRect.Right() + mnShadowPxWidth + 1);
- _orBorderAndShadowBoundRect = _pViewShell->GetOut()->PixelToLogic( aPagePxRect.SVRect() );
+ _orBorderAndShadowBoundRect = pRenderContext->PixelToLogic( aPagePxRect.SVRect() );
}
SwRect SwPageFrm::GetBoundRect() const
@@ -6404,7 +6404,7 @@ SwRect SwPageFrm::GetBoundRect() const
return SwRect( Point(0, 0), Size(0, 0) );
}
- SwPageFrm::GetBorderAndShadowBoundRect( aPageRect, pSh, aResult,
+ SwPageFrm::GetBorderAndShadowBoundRect( aPageRect, pSh, pSh->GetOut(), aResult,
IsLeftShadowNeeded(), IsRightShadowNeeded(), SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT );
return aResult;
}
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 4fb2249accb4..9d91d13e5063 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1102,7 +1102,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan
// paint page border and shadow
{
SwRect aPageBorderRect;
- SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, aPageBorderRect,
+ SwPageFrm::GetBorderAndShadowBoundRect( SwRect( aPageRect ), &mrParentViewShell, &rRenderContext, aPageBorderRect,
(*aPageIter)->pPage->IsLeftShadowNeeded(), (*aPageIter)->pPage->IsRightShadowNeeded(), true );
const vcl::Region aDLRegion(aPageBorderRect.SVRect());
mrParentViewShell.DLPrePaint2(aDLRegion);