diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-25 09:53:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-06-25 10:52:35 +0200 |
commit | 702cb2b28431d4acec302af20169fbb447a2980a (patch) | |
tree | a2c4998235fffb8cec009cac9d006f097d7c314f /sw | |
parent | 5cfc0e3899b51fd2751141d7f1f523803f46c8d1 (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.
Change-Id: I8070dd3d6622d211885067514d6eb728716830ee
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/viscrs.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/frmtool.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 36 | ||||
-rw-r--r-- | sw/source/core/text/inftxt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/txtfly.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/view/pagepreviewlayout.cxx | 6 |
7 files changed, 26 insertions, 26 deletions
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 38cb79e8ef52..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, static_cast<SwViewShell const *>(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 aa2975bc89e2..14e7d3e67199 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 33b61875de2c..bbde2a846d60 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1235,7 +1235,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; @@ -1249,7 +1249,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() ); @@ -1510,7 +1510,7 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm, } } - ::SwAlignRect( rRect, properties.pSGlobalShell ); + ::SwAlignRect( rRect, properties.pSGlobalShell, properties.pSGlobalShell->GetOut() ); } /** @@ -1826,7 +1826,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 ); @@ -2077,7 +2077,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 ); @@ -2587,7 +2587,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 ) { @@ -3479,7 +3479,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; } @@ -5073,7 +5073,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; @@ -5468,7 +5468,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#. @@ -6036,7 +6036,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() ); @@ -6126,7 +6126,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()) @@ -6254,7 +6254,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 @@ -6376,7 +6376,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 ); @@ -6566,7 +6566,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 { @@ -6642,7 +6642,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; } @@ -7044,7 +7044,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 ) ); @@ -7134,7 +7134,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; @@ -7236,7 +7236,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 8b585516db6e..1f79bba70d0b 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -623,7 +623,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 e2f8fc731905..4fb2249accb4 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -1075,7 +1075,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 ); @@ -1228,7 +1228,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 @@ -1273,8 +1273,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(), |