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-26 09:20:23 +0200
commit56422fa26e3b3116b283628e0782ab4bc592f886 (patch)
treebafc7a2e653ce291843cc7a669cf3c1088361626 /sw
parent804e5dc4c02cfafd8a469aa54c60a30d4cd2ad62 (diff)
SwPageFrm::GetBorderAndShadowBoundRect: use vcl::RenderContext
Change-Id: If861aa0a579eb953cd2fc7b790b3514ab1d0ffd0 (cherry picked from commit d7dd8bb3bdd0fee44d6704cbf34d4a39cd7a3d29)
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 4c61de4a5606..efb23c9e6707 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 4dd76a03e7bf..933ef1d43d78 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -259,7 +259,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 );
}
}
@@ -622,7 +622,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 beec5b14bd85..784627b14c2c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3294,7 +3294,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 ) )
@@ -3458,7 +3458,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 );
@@ -6368,6 +6368,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,
@@ -6375,9 +6376,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 );
@@ -6390,7 +6390,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
@@ -6403,7 +6403,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 b8bb276dcf3b..e24f1c01144f 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1100,7 +1100,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);