summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-06-25 09:53:02 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-06-26 09:20:00 +0200
commit804e5dc4c02cfafd8a469aa54c60a30d4cd2ad62 (patch)
tree3ccd891a5def0c2dc35499db8efe1bef4f398c0b /sw
parentcfa21cc3664ce3b6588c9d2090851c4bdf28ca0b (diff)
SwAlignRect: use vcl::RenderContext
If the caller has a vcl::RenderContext already, use it. Otherwise just use GetOut() on the shell in the caller for now. (cherry picked from commit 702cb2b28431d4acec302af20169fbb447a2980a) Conflicts: sw/source/core/crsr/viscrs.cxx Change-Id: I8070dd3d6622d211885067514d6eb728716830ee
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/viscrs.cxx2
-rw-r--r--sw/source/core/doc/notxtfrm.cxx2
-rw-r--r--sw/source/core/inc/frmtool.hxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx36
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/core/text/txtfly.cxx2
-rw-r--r--sw/source/core/view/pagepreviewlayout.cxx6
7 files changed, 26 insertions, 26 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index c3d591c8c215..3e92ce5ef4e5 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -167,7 +167,7 @@ void SwVisCrsr::_SetPosAndShow()
if( aRect.Height() )
{
::SwCalcPixStatics( m_pCrsrShell->GetOut() );
- ::SwAlignRect( aRect, (SwViewShell*)m_pCrsrShell );
+ ::SwAlignRect( aRect, static_cast<SwViewShell const *>(m_pCrsrShell), m_pCrsrShell->GetOut() );
}
if( !m_pCrsrShell->IsOverwriteCrsr() || m_bIsDragCrsr ||
m_pCrsrShell->IsSelection() )
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 4cd00c54f859..f72d7c7f30de 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -848,7 +848,7 @@ void SwNoTextFrm::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfArea
// Use aligned rectangle <aAlignedGrfArea> instead of <rGrfArea> in
// the following code.
SwRect aAlignedGrfArea = rGrfArea;
- ::SwAlignRect( aAlignedGrfArea, pShell );
+ ::SwAlignRect( aAlignedGrfArea, pShell, pOut );
if( !bIsChart )
{
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index cc86fdc6ebbc..23a222659bcb 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -79,7 +79,7 @@ void paintGraphicUsingPrimitivesHelper(
// method to align rectangle.
// Created declaration here to avoid <extern> declarations
-void SwAlignRect( SwRect &rRect, const SwViewShell *pSh );
+void SwAlignRect( SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext* pRenderContext );
// method to align graphic rectangle
// Created declaration here to avoid <extern> declarations
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 3aff68ab3f85..beec5b14bd85 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1234,7 +1234,7 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
* that the border "leaves its original pixel", if it has to
* No prior adjustments for odd relation between pixel and twip
*/
-void SwAlignRect( SwRect &rRect, const SwViewShell *pSh )
+void SwAlignRect( SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext* pRenderContext )
{
if( !rRect.HasArea() )
return;
@@ -1248,7 +1248,7 @@ void SwAlignRect( SwRect &rRect, const SwViewShell *pSh )
}
const vcl::RenderContext *pOut = gProp.bSFlyMetafile ?
- gProp.pSFlyMetafileOut.get() : pSh->GetOut();
+ gProp.pSFlyMetafileOut.get() : pRenderContext;
// Hold original rectangle in pixel
const Rectangle aOrgPxRect = pOut->LogicToPixel( rRect.SVRect() );
@@ -1509,7 +1509,7 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
}
}
- ::SwAlignRect( rRect, properties.pSGlobalShell );
+ ::SwAlignRect( rRect, properties.pSGlobalShell, properties.pSGlobalShell->GetOut() );
}
/**
@@ -1825,7 +1825,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOu
// Calculate align rectangle from parameter <rGrf> and use aligned
// rectangle <aAlignedGrfRect> in the following code
SwRect aAlignedGrfRect = rGrf;
- ::SwAlignRect( aAlignedGrfRect, &rSh );
+ ::SwAlignRect( aAlignedGrfRect, &rSh, pOut );
// Change type from <bool> to <bool>.
const bool bNotInside = bClip && !rOut.IsInside( aAlignedGrfRect );
@@ -2076,7 +2076,7 @@ void DrawGraphic(
GraphicObject* pGraphicObj = const_cast< GraphicObject* >(pBrush->GetGraphicObject());
// calculate aligned paint rectangle
SwRect aAlignedPaintRect = rOut;
- ::SwAlignRect( aAlignedPaintRect, &rSh );
+ ::SwAlignRect( aAlignedPaintRect, &rSh, pOutDev );
// draw background color for aligned paint rectangle
lcl_DrawGraphicBackgrd( *pBrush, pOutDev, aAlignedPaintRect, *pGraphicObj, bGrfNum, gProp );
@@ -2586,7 +2586,7 @@ void SwTabFrmPainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) const
SwRect aUpper( pUpper->Prt() );
aUpper.Pos() += pUpper->Frm().Pos();
SwRect aUpperAligned( aUpper );
- ::SwAlignRect( aUpperAligned, gProp.pSGlobalShell );
+ ::SwAlignRect( aUpperAligned, gProp.pSGlobalShell, &rDev );
while ( true )
{
@@ -3478,7 +3478,7 @@ void SwRootFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S
// OD 20.02.2003 #107369# - use aligned page rectangle
{
SwRect aTmpPageRect( aEmptyPageRect );
- ::SwAlignRect( aTmpPageRect, pSh );
+ ::SwAlignRect( aTmpPageRect, pSh, &rRenderContext );
aEmptyPageRect = aTmpPageRect;
}
@@ -5072,7 +5072,7 @@ void PaintCharacterBorder(
const bool bJoinWithNext )
{
SwRect aAlignedRect(rPaintArea);
- SwAlignRect(aAlignedRect, gProp.pSGlobalShell);
+ SwAlignRect(aAlignedRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut());
bool bTop = true;
bool bBottom = true;
@@ -5467,7 +5467,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
//happen, that some parts won't be processed.
SwRect aRect( Prt() );
aRect += Frm().Pos();
- ::SwAlignRect( aRect, gProp.pSGlobalShell );
+ ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
// OD 27.09.2002 #103636# - new local boolean variable in order to
// suspend border paint under special cases - see below.
// NOTE: This is a fix for the implementation of feature #99657#.
@@ -6035,7 +6035,7 @@ bool SwPageFrm::IsLeftShadowNeeded() const
{
const SwPostItMgr *pMgr = _pViewShell->GetPostItMgr();
SwRect aAlignedPageRect( _rPageRect );
- ::SwAlignRect( aAlignedPageRect, _pViewShell );
+ ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
SwRect aPagePxRect =
_pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
@@ -6125,7 +6125,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
static Color aShadowColor( COL_AUTO );
SwRect aAlignedPageRect( _rPageRect );
- ::SwAlignRect( aAlignedPageRect, _pViewShell );
+ ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
SwRect aPagePxRect = _pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
if (aShadowColor != SwViewOption::GetShadowColor())
@@ -6253,7 +6253,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
return;
SwRect aPageRect( _rPageRect );
- SwAlignRect( aPageRect, _pViewShell );
+ SwAlignRect( aPageRect, _pViewShell, _pViewShell->GetOut() );
const SwPostItMgr *pMgr = _pViewShell->GetPostItMgr();
if (pMgr && pMgr->ShowNotes() && pMgr->HasNotes()) // do not show anything in print preview
@@ -6375,7 +6375,7 @@ static void lcl_paintBitmapExToRect(vcl::RenderContext *pOut, const Point& aPoin
)
{
SwRect aAlignedPageRect( _rPageRect );
- ::SwAlignRect( aAlignedPageRect, _pViewShell );
+ ::SwAlignRect( aAlignedPageRect, _pViewShell, _pViewShell->GetOut() );
SwRect aPagePxRect =
_pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );
aPagePxRect.Bottom( aPagePxRect.Bottom() + mnShadowPxWidth + 1 );
@@ -6565,7 +6565,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
(IsTextFrm() && Prt().SSize() == Frm().SSize()) )
{
aRect = Frm();
- ::SwAlignRect( aRect, gProp.pSGlobalShell );
+ ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
}
else
{
@@ -6641,7 +6641,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
{
if (1 < aRegion.size())
{
- ::SwAlignRect( aRegion[i], gProp.pSGlobalShell );
+ ::SwAlignRect( aRegion[i], gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
if( !aRegion[i].HasArea() )
continue;
}
@@ -7043,7 +7043,7 @@ void SwColumnFrm::PaintSubsidiaryLines( const SwPageFrm *,
if ( pFootnoteCont )
aArea.AddBottom( pFootnoteCont->Frm().Bottom() - aArea.Bottom() );
- ::SwAlignRect( aArea, gProp.pSGlobalShell );
+ ::SwAlignRect( aArea, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
if ( !gProp.pSGlobalShell->GetViewOptions()->IsViewMetaChars( ) )
ProcessPrimitives( lcl_CreateColumnAreaDelimiterPrimitives( aArea ) );
@@ -7133,7 +7133,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
if ( !bUseFrmArea )
aOriginal.Pos() += Frm().Pos();
- ::SwAlignRect( aOriginal, gProp.pSGlobalShell );
+ ::SwAlignRect( aOriginal, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
if ( !aOriginal.IsOver( rRect ) )
return;
@@ -7235,7 +7235,7 @@ void SwPageFrm::RefreshExtraData( const SwRect &rRect ) const
|| (sal_Int16)SW_MOD()->GetRedlineMarkPos() != text::HoriOrientation::NONE;
SwRect aRect( rRect );
- ::SwAlignRect( aRect, gProp.pSGlobalShell );
+ ::SwAlignRect( aRect, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() );
if ( aRect.HasArea() )
{
SwLayoutFrm::RefreshExtraData( aRect );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index e07a40b037cc..861f412f4d64 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -766,7 +766,7 @@ void SwTextPaintInfo::CalcRect( const SwLinePortion& rPor,
if( aRect.HasArea() && pIntersect )
{
- ::SwAlignRect( aRect, GetVsh() );
+ ::SwAlignRect( aRect, GetVsh(), GetOut() );
if ( GetOut()->IsClipRegion() )
{
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index ed33e4c08011..ba482881c435 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -625,7 +625,7 @@ void SwTextFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
// #i68520#
SwRect aFly( pAnchoredObjTmp->GetObjRect() );
// OD 24.01.2003 #106593#
- ::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell() );
+ ::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell(), pOut );
if( aFly.Width() > 0 && aFly.Height() > 0 )
aRegion -= aFly;
}
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 02c2af9a5f66..b8bb276dcf3b 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1073,7 +1073,7 @@ bool SwPagePreviewLayout::Paint(vcl::RenderContext& rRenderContext, const Rectan
// OD 20.02.2003 #107369# - use aligned page rectangle
{
SwRect aTmpPageRect( aPageRect );
- ::SwAlignRect( aTmpPageRect, &mrParentViewShell);
+ ::SwAlignRect( aTmpPageRect, &mrParentViewShell, &rRenderContext );
aPageRect = aTmpPageRect.SVRect();
}
pOutputDev->DrawRect( aPageRect );
@@ -1226,7 +1226,7 @@ void SwPagePreviewLayout::_PaintSelectMarkAtPage(
_aSelectedPreviewPage->aPageSize );
// OD 19.02.2003 #107369# - use aligned page rectangle, as it is used for
// page border and shadow paint - see <SwPageFrm::PaintBorderAndShadow(..)>
- ::SwAlignRect( aPageRect, &mrParentViewShell);
+ ::SwAlignRect( aPageRect, &mrParentViewShell, pOutputDev );
Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
// draw two rectangle
@@ -1271,8 +1271,8 @@ void SwPagePreviewLayout::MarkNewSelectedPage( const sal_uInt16 _nSelectedPage )
// OD 20.02.2003 #107369# - invalidate only areas of selection mark.
SwRect aPageRect( pOldSelectedPreviewPage->aPreviewWinPos,
pOldSelectedPreviewPage->aPageSize );
- ::SwAlignRect( aPageRect, &mrParentViewShell);
OutputDevice* pOutputDev = mrParentViewShell.GetOut();
+ ::SwAlignRect( aPageRect, &mrParentViewShell, pOutputDev );
Rectangle aPxPageRect = pOutputDev->LogicToPixel( aPageRect.SVRect() );
// invalidate top mark line
Rectangle aInvalPxRect( aPxPageRect.Left(), aPxPageRect.Top(),