summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-05-18 11:44:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-05-19 09:45:46 +0200
commit692c5df18ec1f558abe1a3a658c9881cfb7210a9 (patch)
treef9d6d6d6750ffcfa9401660314c0a1d61993766b
parent1815aa9472080b9dac263d393b9c922dd16351fe (diff)
ImplPlayWithRenderer never checks its OutputDevice against nullptr
just pass a reference instead and spread that around to some similar cases Change-Id: Ifb2dee8c7bf02a9f01982b928c90666cbbdd84fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115759 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--canvas/source/vcl/canvashelper.cxx22
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx8
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx4
-rw-r--r--cui/source/options/personalization.cxx2
-rw-r--r--cui/source/tabpages/grfpage.cxx2
-rw-r--r--cui/source/tabpages/numpages.cxx10
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx4
-rw-r--r--editeng/source/editeng/editeng.cxx52
-rw-r--r--editeng/source/editeng/impedit.hxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx118
-rw-r--r--editeng/source/outliner/outleeng.cxx6
-rw-r--r--editeng/source/outliner/outleeng.hxx2
-rw-r--r--editeng/source/outliner/outlin2.cxx8
-rw-r--r--editeng/source/outliner/outliner.cxx36
-rw-r--r--forms/source/richtext/richtextimplcontrol.cxx2
-rw-r--r--include/editeng/editeng.hxx10
-rw-r--r--include/editeng/outliner.hxx10
-rw-r--r--include/vcl/GraphicObject.hxx18
-rw-r--r--include/vcl/animate/Animation.hxx6
-rw-r--r--include/vcl/gdimtf.hxx9
-rw-r--r--include/vcl/graph.hxx26
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx2
-rw-r--r--sc/source/ui/view/gridwin4.cxx2
-rw-r--r--sc/source/ui/view/output2.cxx16
-rw-r--r--sc/source/ui/view/preview.cxx2
-rw-r--r--sc/source/ui/view/printfun.cxx34
-rw-r--r--sd/source/filter/html/buttonset.cxx2
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx2
-rw-r--r--sd/source/ui/slideshow/showwin.cxx4
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx2
-rw-r--r--sfx2/source/doc/new.cxx2
-rw-r--r--svtools/source/graphic/renderer.cxx3
-rw-r--r--svx/source/dialog/_contdlg.cxx2
-rw-r--r--svx/source/dialog/contwnd.cxx2
-rw-r--r--svx/source/dialog/dlgctrl.cxx2
-rw-r--r--svx/source/dialog/graphctl.cxx2
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.cxx2
-rw-r--r--svx/source/gallery2/galctrl.cxx8
-rw-r--r--svx/source/svdraw/svdotext.cxx2
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx6
-rw-r--r--sw/inc/ndgrf.hxx2
-rw-r--r--sw/source/core/doc/notxtfrm.cxx6
-rw-r--r--sw/source/core/frmedt/fecopy.cxx4
-rw-r--r--sw/source/core/inc/frmtool.hxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx92
-rw-r--r--sw/source/core/text/porfld.cxx8
-rw-r--r--sw/source/core/view/vprint.cxx2
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx2
-rw-r--r--sw/source/ui/misc/outline.cxx8
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControl.cxx2
-rw-r--r--vcl/inc/impgraph.hxx20
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx2
-rw-r--r--vcl/source/animate/Animation.cxx28
-rw-r--r--vcl/source/filter/graphicfilter.cxx2
-rw-r--r--vcl/source/gdi/gdimtf.cxx69
-rw-r--r--vcl/source/gdi/graph.cxx72
-rw-r--r--vcl/source/gdi/impgraph.cxx28
-rw-r--r--vcl/source/gdi/oldprintadaptor.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl2.cxx4
-rw-r--r--vcl/source/gdi/print3.cxx2
-rw-r--r--vcl/source/graphic/GraphicObject.cxx68
-rw-r--r--vcl/source/graphic/GraphicObject2.cxx46
-rw-r--r--vcl/source/outdev/outdev.cxx2
-rw-r--r--vcl/source/outdev/transparent.cxx6
-rw-r--r--vcl/source/window/paint.cxx2
-rw-r--r--vcl/source/window/printdlg.cxx2
-rw-r--r--vcl/workben/mtfdemo.cxx2
67 files changed, 467 insertions, 472 deletions
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index bec73b3d336a..a6cd6e0b6fd3 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -835,16 +835,16 @@ namespace vclcanvas
const ::Size aSz( ::basegfx::fround( aScale.getX() * aBmpSize.Width() ),
::basegfx::fround( aScale.getY() * aBmpSize.Height() ) );
- pGrfObj->Draw( &mpOutDevProvider->getOutDev(),
- aPt,
- aSz,
- &aGrfAttr );
+ pGrfObj->Draw(mpOutDevProvider->getOutDev(),
+ aPt,
+ aSz,
+ &aGrfAttr);
if( mp2ndOutDevProvider )
- pGrfObj->Draw( &mp2ndOutDevProvider->getOutDev(),
- aPt,
- aSz,
- &aGrfAttr );
+ pGrfObj->Draw(mp2ndOutDevProvider->getOutDev(),
+ aPt,
+ aSz,
+ &aGrfAttr);
// created GraphicObject, which possibly cached
// display bitmap - return cache object, to retain
@@ -1161,12 +1161,12 @@ namespace vclcanvas
tools::OutDevStateKeeper aStateKeeper( mpProtectedOutDevProvider );
setupOutDevState( viewState, renderState, IGNORE_COLOR );
- if( !rGrf->Draw( &mpOutDevProvider->getOutDev(), rPt, rSz, &rAttr ) )
+ if (!rGrf->Draw(mpOutDevProvider->getOutDev(), rPt, rSz, &rAttr))
return false;
// #i80779# Redraw also into mask outdev
- if( mp2ndOutDevProvider )
- return rGrf->Draw( &mp2ndOutDevProvider->getOutDev(), rPt, rSz, &rAttr );
+ if (mp2ndOutDevProvider)
+ return rGrf->Draw(mp2ndOutDevProvider->getOutDev(), rPt, rSz, &rAttr);
return true;
}
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index c0ef516d4c0a..b397ffcb7d2e 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -77,10 +77,10 @@ namespace vclcanvas
{
// update return value. This method should return true, if
// at least one of the looped Draws succeeded.
- bRet |= rGraphic.Draw( &rOutDev,
- aCurrPos,
- rTileSize,
- &rAttr );
+ bRet |= rGraphic.Draw(rOutDev,
+ aCurrPos,
+ rTileSize,
+ &rAttr);
aCurrPos.AdjustX(rNextTileX.Width() );
aCurrPos.AdjustY(rNextTileX.Height() );
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 01a5ad0786ac..e5597dae8265 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -57,14 +57,14 @@ void CuiGraphicPreviewWindow::Paint(vcl::RenderContext& rRenderContext, const ::
const Size aGraphicSize(rRenderContext.LogicToPixel(maPreview.GetPrefSize(), maPreview.GetPrefMapMode()));
const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
(aOutputSize.Height() - aGraphicSize.Height() ) >> 1);
- maPreview.StartAnimation(&rRenderContext, aGraphicPosition, aGraphicSize);
+ maPreview.StartAnimation(rRenderContext, aGraphicPosition, aGraphicSize);
}
else
{
const Size aGraphicSize(maPreview.GetSizePixel());
const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width()) >> 1,
(aOutputSize.Height() - aGraphicSize.Height()) >> 1);
- maPreview.Draw(&rRenderContext, aGraphicPosition, aGraphicSize);
+ maPreview.Draw(rRenderContext, aGraphicPosition, aGraphicSize);
}
}
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index ac2def078f5c..02c064d1b2e7 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -148,7 +148,7 @@ void SvxPersonalizationTabPage::LoadDefaultImages()
ScopedVclPtr<VirtualDevice> xVirDev
= m_vDefaultPersonaImages[nIndex]->create_virtual_device();
xVirDev->SetOutputSizePixel(aSize);
- aGraphic.Draw(xVirDev.get(), Point(0, 0));
+ aGraphic.Draw(*xVirDev, Point(0, 0));
m_vDefaultPersonaImages[nIndex]->set_image(xVirDev.get());
xVirDev.disposeAndClear();
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 569329e3a160..beb8bc207ddd 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -719,7 +719,7 @@ void SvxCropExample::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re
::tools::Rectangle aRect(
Point((aWinSize.Width() - m_aFrameSize.Width())/2, (aWinSize.Height() - m_aFrameSize.Height())/2),
m_aFrameSize);
- m_aGrf.Draw(&rRenderContext, aRect.TopLeft(), aRect.GetSize());
+ m_aGrf.Draw(rRenderContext, aRect.TopLeft(), aRect.GetSize());
// Remove one more case that uses XOR paint (RasterOp::Invert).
// Get colors and logic DashLength from settings, use equal to
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index f93ebc8ed497..e03ec1451daa 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2120,7 +2120,7 @@ void SvxNumOptionsTabPage::EditModifyHdl_Impl(const weld::Entry* pEdit)
SetModified();
}
-static tools::Long lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &rFmt, tools::Long nXStart,
+static tools::Long lcl_DrawGraphic(VirtualDevice& rVDev, const SvxNumberFormat &rFmt, tools::Long nXStart,
tools::Long nYMiddle, tools::Long nDivision)
{
const SvxBrushItem* pBrushItem = rFmt.GetBrush();
@@ -2134,8 +2134,8 @@ static tools::Long lcl_DrawGraphic(VirtualDevice* pVDev, const SvxNumberFormat &
aGSize.setWidth( aGSize.Width() / nDivision );
nRet = aGSize.Width();
aGSize.setHeight( aGSize.Height() / nDivision );
- pGrf->Draw( pVDev, Point(nXStart,nYMiddle - ( aGSize.Height() / 2) ),
- pVDev->PixelToLogic( aGSize ) );
+ pGrf->Draw(rVDev, Point(nXStart,nYMiddle - ( aGSize.Height() / 2) ),
+ rVDev.PixelToLogic( aGSize ) );
}
}
return nRet;
@@ -2280,7 +2280,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool
if (SVX_NUM_BITMAP == (rFmt.GetNumberingType() &(~LINK_TOKEN)))
{
tools::Long nYMiddle = nYStart + ( nFontHeight / 2 );
- nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawGraphic(pVDev.get(), rFmt, nNumberXPos, nYMiddle, nWidthRelation) : 0;
+ nBulletWidth = rFmt.IsShowSymbol() ? lcl_DrawGraphic(*pVDev, rFmt, nNumberXPos, nYMiddle, nWidthRelation) : 0;
}
else if (SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType())
{
@@ -2401,7 +2401,7 @@ void SvxNumberingPreview::Paint(vcl::RenderContext& rRenderContext, const ::tool
if (rFmt.IsShowSymbol())
{
tools::Long nYMiddle = nYStart + ( nFontHeight / 2 );
- nTextOffset = lcl_DrawGraphic(pVDev.get(), rFmt, nXStart, nYMiddle, nWidthRelation);
+ nTextOffset = lcl_DrawGraphic(*pVDev, rFmt, nXStart, nYMiddle, nWidthRelation);
nTextOffset = nTextOffset + nXStep;
}
}
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 00ace78497b1..6855edff1644 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1211,9 +1211,9 @@ void OPreviewWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
const Size aSize(m_aPreviewRect.GetSize());
if (m_aGraphicObj.IsAnimated())
- m_aGraphicObj.StartAnimation(&rRenderContext, aPos, aSize);
+ m_aGraphicObj.StartAnimation(rRenderContext, aPos, aSize);
else
- m_aGraphicObj.Draw(&rRenderContext, aPos, aSize);
+ m_aGraphicObj.Draw(rRenderContext, aPos, aSize);
}
}
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index f42b494ab139..60165977fc32 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -200,35 +200,35 @@ const SfxItemSet& EditEngine::GetEmptyItemSet() const
return pImpEditEngine->GetEmptyItemSet();
}
-void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect )
+void EditEngine::Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect )
{
- Draw( pOutDev, rOutRect, Point( 0, 0 ) );
+ Draw( rOutDev, rOutRect, Point( 0, 0 ) );
}
-void EditEngine::Draw( OutputDevice* pOutDev, const Point& rStartPos, Degree10 nOrientation )
+void EditEngine::Draw( OutputDevice& rOutDev, const Point& rStartPos, Degree10 nOrientation )
{
// Create with 2 points, as with positive points it will end up with
// LONGMAX as Size, Bottom and Right in the range > LONGMAX.
tools::Rectangle aBigRect( -0x3FFFFFFF, -0x3FFFFFFF, 0x3FFFFFFF, 0x3FFFFFFF );
- if( pOutDev->GetConnectMetaFile() )
- pOutDev->Push();
+ if( rOutDev.GetConnectMetaFile() )
+ rOutDev.Push();
Point aStartPos( rStartPos );
if ( IsVertical() )
{
aStartPos.AdjustX(GetPaperSize().Width() );
aStartPos = Rotate( aStartPos, nOrientation, rStartPos );
}
- pImpEditEngine->Paint( pOutDev, aBigRect, aStartPos, false, nOrientation );
- if( pOutDev->GetConnectMetaFile() )
- pOutDev->Pop();
+ pImpEditEngine->Paint(rOutDev, aBigRect, aStartPos, false, nOrientation);
+ if( rOutDev.GetConnectMetaFile() )
+ rOutDev.Pop();
}
-void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos )
+void EditEngine::Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos )
{
- Draw( pOutDev, rOutRect, rStartDocPos, true );
+ Draw( rOutDev, rOutRect, rStartDocPos, true );
}
-void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip )
+void EditEngine::Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip )
{
#if defined( DBG_UTIL ) || (OSL_DEBUG_LEVEL > 1)
if ( bDebugPaint )
@@ -237,8 +237,8 @@ void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect,
// Align to the pixel boundary, so that it becomes exactly the same
// as Paint ()
- tools::Rectangle aOutRect( pOutDev->LogicToPixel( rOutRect ) );
- aOutRect = pOutDev->PixelToLogic( aOutRect );
+ tools::Rectangle aOutRect( rOutDev.LogicToPixel( rOutRect ) );
+ aOutRect = rOutDev.PixelToLogic( aOutRect );
Point aStartPos;
if ( !IsVertical() )
@@ -252,14 +252,14 @@ void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect,
aStartPos.setY( aOutRect.Top() - rStartDocPos.X() );
}
- bool bClipRegion = pOutDev->IsClipRegion();
- bool bMetafile = pOutDev->GetConnectMetaFile();
- vcl::Region aOldRegion = pOutDev->GetClipRegion();
+ bool bClipRegion = rOutDev.IsClipRegion();
+ bool bMetafile = rOutDev.GetConnectMetaFile();
+ vcl::Region aOldRegion = rOutDev.GetClipRegion();
// If one existed => intersection!
// Use Push/pop for creating the Meta file
if ( bMetafile )
- pOutDev->Push();
+ rOutDev.Push();
// Always use the Intersect method, it is a must for Metafile!
if ( bClip )
@@ -272,25 +272,25 @@ void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect,
// Some printer drivers cause problems if characters graze the
// ClipRegion, therefore rather add a pixel more ...
tools::Rectangle aClipRect( aOutRect );
- if ( pOutDev->GetOutDevType() == OUTDEV_PRINTER )
+ if ( rOutDev.GetOutDevType() == OUTDEV_PRINTER )
{
Size aPixSz( 1, 0 );
- aPixSz = pOutDev->PixelToLogic( aPixSz );
+ aPixSz = rOutDev.PixelToLogic( aPixSz );
aClipRect.AdjustRight(aPixSz.Width() );
aClipRect.AdjustBottom(aPixSz.Width() );
}
- pOutDev->IntersectClipRegion( aClipRect );
+ rOutDev.IntersectClipRegion( aClipRect );
}
}
- pImpEditEngine->Paint( pOutDev, aOutRect, aStartPos );
+ pImpEditEngine->Paint( rOutDev, aOutRect, aStartPos );
if ( bMetafile )
- pOutDev->Pop();
+ rOutDev.Pop();
else if ( bClipRegion )
- pOutDev->SetClipRegion( aOldRegion );
+ rOutDev.SetClipRegion( aOldRegion );
else
- pOutDev->SetClipRegion();
+ rOutDev.SetClipRegion();
}
void EditEngine::InsertView(EditView* pEditView, size_t nIndex)
@@ -1820,7 +1820,7 @@ void EditEngine::StripPortions()
aBigRect.SetBottom( 0 );
}
}
- pImpEditEngine->Paint( aTmpDev.get(), aBigRect, Point(), true );
+ pImpEditEngine->Paint(*aTmpDev, aBigRect, Point(), true);
}
void EditEngine::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList )
@@ -2475,7 +2475,7 @@ void EditEngine::DrawingTab( const Point& /*rStartPos*/, tools::Long /*nWidth*/,
{
}
-void EditEngine::PaintingFirstLine( sal_Int32, const Point&, tools::Long, const Point&, Degree10, OutputDevice* )
+void EditEngine::PaintingFirstLine(sal_Int32, const Point&, tools::Long, const Point&, Degree10, OutputDevice&)
{
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 473856281e3c..284c55bc029c 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -844,7 +844,7 @@ public:
void FormatFullDoc();
void UpdateViews( EditView* pCurView = nullptr );
void Paint( ImpEditView* pView, const tools::Rectangle& rRect, OutputDevice* pTargetDevice );
- void Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly = false, Degree10 nOrientation = 0_deg10 );
+ void Paint(OutputDevice& rOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly = false, Degree10 nOrientation = 0_deg10);
bool MouseButtonUp( const MouseEvent& rMouseEvent, EditView* pView );
bool MouseButtonDown( const MouseEvent& rMouseEvent, EditView* pView );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index ee9c0bb1a202..efc0e30ea90b 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -150,7 +150,7 @@ AsianCompressionFlags GetCharTypeForCompression( sal_Unicode cChar )
}
}
-static void lcl_DrawRedLines( OutputDevice* pOutDev,
+static void lcl_DrawRedLines( OutputDevice& rOutDev,
tools::Long nFontHeight,
const Point& rPoint,
size_t nIndex,
@@ -163,7 +163,7 @@ static void lcl_DrawRedLines( OutputDevice* pOutDev,
bool bIsRightToLeft )
{
// But only if font is not too small...
- tools::Long nHeight = pOutDev->LogicToPixel(Size(0, nFontHeight)).Height();
+ tools::Long nHeight = rOutDev.LogicToPixel(Size(0, nFontHeight)).Height();
if (WRONG_SHOW_MIN >= nHeight)
return;
@@ -186,7 +186,7 @@ static void lcl_DrawRedLines( OutputDevice* pOutDev,
{
// VCL doesn't know that the text is vertical, and is manipulating
// the positions a little bit in y direction...
- tools::Long nOnePixel = pOutDev->PixelToLogic(Size(0, 1)).Height();
+ tools::Long nOnePixel = rOutDev.PixelToLogic(Size(0, 1)).Height();
tools::Long nCorrect = 2 * nOnePixel;
aPoint1.AdjustY(-nCorrect);
aPoint1.AdjustX(-nCorrect);
@@ -224,8 +224,8 @@ static void lcl_DrawRedLines( OutputDevice* pOutDev,
}
{
- vcl::ScopedAntialiasing a(*pOutDev, true);
- pOutDev->DrawWaveLine(aPoint1, aPoint2);
+ vcl::ScopedAntialiasing a(rOutDev, true);
+ rOutDev.DrawWaveLine(aPoint1, aPoint2);
}
nStart = nEnd + 1;
@@ -3029,7 +3029,7 @@ bool ImpEditEngine::isXOverflowDirectionAware(const Point& pt, const tools::Rect
return pt.Y() < rectMax.Top();
}
-void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly, Degree10 nOrientation )
+void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Point aStartPos, bool bStripOnly, Degree10 nOrientation )
{
if ( !GetUpdateMode() && !bStripOnly )
return;
@@ -3037,12 +3037,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
if ( !IsFormatted() )
FormatDoc();
- tools::Long nFirstVisXPos = - pOutDev->GetMapMode().GetOrigin().X();
- tools::Long nFirstVisYPos = - pOutDev->GetMapMode().GetOrigin().Y();
+ tools::Long nFirstVisXPos = - rOutDev.GetMapMode().GetOrigin().X();
+ tools::Long nFirstVisYPos = - rOutDev.GetMapMode().GetOrigin().Y();
DBG_ASSERT( GetParaPortions().Count(), "No ParaPortion?!" );
SvxFont aTmpFont( GetParaPortions()[0].GetNode()->GetCharAttribs().GetDefFont() );
- vcl::PDFExtOutDevData* const pPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >( pOutDev->GetExtOutDevData() );
+ vcl::PDFExtOutDevData* const pPDFExtOutDevData = dynamic_cast< vcl::PDFExtOutDevData* >( rOutDev.GetExtOutDevData() );
// In the case of rotated text is aStartPos considered TopLeft because
// other information is missing, and since the whole object is shown anyway
@@ -3059,7 +3059,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
// #110496# Added some more optional metafile comments. This
// change: factored out some duplicated code.
- GDIMetaFile* pMtf = pOutDev->GetConnectMetaFile();
+ GDIMetaFile* pMtf = rOutDev.GetConnectMetaFile();
const bool bMetafileValid( pMtf != nullptr );
const tools::Long nVertLineSpacing = CalcVertLineSpacing(aStartPos);
@@ -3127,7 +3127,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
// does, too. No change for not-layouting (painting).
if(0 == nLine) // && !bStripOnly)
{
- GetEditEnginePtr()->PaintingFirstLine( n, aParaStart, aTmpPos.Y(), aOrigin, nOrientation, pOutDev );
+ GetEditEnginePtr()->PaintingFirstLine(n, aParaStart, aTmpPos.Y(), aOrigin, nOrientation, rOutDev);
// Remember whether a bullet was painted.
const SfxBoolItem& rBulletState = pEditEngine->GetParaAttrib(n, EE_PARA_BULLETSTATE);
@@ -3157,17 +3157,17 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
case PortionKind::FIELD:
case PortionKind::HYPHENATOR:
{
- SeekCursor( rPortion.GetNode(), nIndex+1, aTmpFont, pOutDev );
+ SeekCursor( rPortion.GetNode(), nIndex+1, aTmpFont, &rOutDev );
bool bDrawFrame = false;
if ( ( rTextPortion.GetKind() == PortionKind::FIELD ) && !aTmpFont.IsTransparent() &&
( GetBackgroundColor() != COL_AUTO ) && GetBackgroundColor().IsDark() &&
- ( IsAutoColorEnabled() && ( pOutDev->GetOutDevType() != OUTDEV_PRINTER ) ) )
+ ( IsAutoColorEnabled() && ( rOutDev.GetOutDevType() != OUTDEV_PRINTER ) ) )
{
aTmpFont.SetTransparent( true );
- pOutDev->SetFillColor();
- pOutDev->SetLineColor( GetAutoColor() );
+ rOutDev.SetFillColor();
+ rOutDev.SetLineColor( GetAutoColor() );
bDrawFrame = true;
}
@@ -3189,13 +3189,13 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
aTmpFont.SetTransparent( sal_False );
}
#endif
- aTmpFont.SetPhysFont( pOutDev );
+ aTmpFont.SetPhysFont( &rOutDev );
// #114278# Saving both layout mode and language (since I'm
// potentially changing both)
- pOutDev->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
- ImplInitLayoutMode( pOutDev, n, nIndex );
- ImplInitDigitMode(pOutDev, aTmpFont.GetLanguage());
+ rOutDev.Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
+ ImplInitLayoutMode( &rOutDev, n, nIndex );
+ ImplInitDigitMode(&rOutDev, aTmpFont.GetLanguage());
OUString aText;
sal_Int32 nTextStart = 0;
@@ -3229,7 +3229,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
if ( 0x200B == cChar || 0x2060 == cChar )
{
- tools::Long nHalfBlankWidth = aTmpFont.QuickGetTextSize( pOutDev, " ", 0, 1 ).Width() / 2;
+ tools::Long nHalfBlankWidth = aTmpFont.QuickGetTextSize( &rOutDev, " ", 0, 1 ).Width() / 2;
const tools::Long nAdvanceX = ( nTmpIdx == nTmpEnd ?
rTextPortion.GetSize().Width() :
@@ -3244,16 +3244,16 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
adjustXDirectionAware(aBottomRightRectPos, 2 * nHalfBlankWidth);
adjustYDirectionAware(aBottomRightRectPos, pLine->GetHeight());
- pOutDev->Push( PushFlags::FILLCOLOR );
- pOutDev->Push( PushFlags::LINECOLOR );
- pOutDev->SetFillColor( COL_LIGHTGRAY );
- pOutDev->SetLineColor( COL_LIGHTGRAY );
+ rOutDev.Push( PushFlags::FILLCOLOR );
+ rOutDev.Push( PushFlags::LINECOLOR );
+ rOutDev.SetFillColor( COL_LIGHTGRAY );
+ rOutDev.SetLineColor( COL_LIGHTGRAY );
const tools::Rectangle aBackRect( aTopLeftRectPos, aBottomRightRectPos );
- pOutDev->DrawRect( aBackRect );
+ rOutDev.DrawRect( aBackRect );
- pOutDev->Pop();
- pOutDev->Pop();
+ rOutDev.Pop();
+ rOutDev.Pop();
if ( 0x200B == cChar )
{
@@ -3263,19 +3263,19 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
aTmpFont.SetEscapement( -20 );
aTmpFont.SetPropr( 25 );
- aTmpFont.SetPhysFont( pOutDev );
+ aTmpFont.SetPhysFont( &rOutDev );
- const Size aSlashSize = aTmpFont.QuickGetTextSize( pOutDev, aSlash, 0, 1 );
+ const Size aSlashSize = aTmpFont.QuickGetTextSize( &rOutDev, aSlash, 0, 1 );
Point aSlashPos( aTmpPos );
const tools::Long nAddX = nHalfBlankWidth - aSlashSize.Width() / 2;
setXDirectionAware(aSlashPos, getXDirectionAware(aTopLeftRectPos));
adjustXDirectionAware(aSlashPos, nAddX);
- aTmpFont.QuickDrawText( pOutDev, aSlashPos, aSlash, 0, 1 );
+ aTmpFont.QuickDrawText( &rOutDev, aSlashPos, aSlash, 0, 1 );
aTmpFont.SetEscapement( nOldEscapement );
aTmpFont.SetPropr( nOldPropr );
- aTmpFont.SetPhysFont( pOutDev );
+ aTmpFont.SetPhysFont( &rOutDev );
}
}
}
@@ -3445,12 +3445,12 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
const bool bEndOfParagraph(bEndOfLine && nLine + 1 == nLines);
// get Overline color (from ((const SvxOverlineItem*)GetItem())->GetColor() in
- // consequence, but also already set at pOutDev)
- const Color aOverlineColor(pOutDev->GetOverlineColor());
+ // consequence, but also already set at rOutDev)
+ const Color aOverlineColor(rOutDev.GetOverlineColor());
// get TextLine color (from ((const SvxUnderlineItem*)GetItem())->GetColor() in
- // consequence, but also already set at pOutDev)
- const Color aTextLineColor(pOutDev->GetTextLineColor());
+ // consequence, but also already set at rOutDev)
+ const Color aTextLineColor(rOutDev.GetTextLineColor());
// Unicode code points conversion according to ctl text numeral setting
aText = convertDigits(aText, nTextStart, nTextLen,
@@ -3488,7 +3488,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
aOutPos = lcl_ImplCalcRotatedPos( aOutPos, aOrigin, nSin, nCos );
aTmpFont.SetOrientation( aTmpFont.GetOrientation()+nOrientation );
- aTmpFont.SetPhysFont( pOutDev );
+ aTmpFont.SetPhysFont( &rOutDev );
}
@@ -3525,23 +3525,23 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
}
if ( bSpecialUnderline )
{
- Size aSz = aTmpFont.GetPhysTxtSize( pOutDev, aText, nTextStart, nTextLen );
+ Size aSz = aTmpFont.GetPhysTxtSize( &rOutDev, aText, nTextStart, nTextLen );
sal_uInt8 nProp = aTmpFont.GetPropr();
aTmpFont.SetEscapement( 0 );
aTmpFont.SetPropr( 100 );
- aTmpFont.SetPhysFont( pOutDev );
+ aTmpFont.SetPhysFont( &rOutDev );
OUStringBuffer aBlanks;
comphelper::string::padToLength( aBlanks, nTextLen, ' ' );
Point aUnderlinePos( aOutPos );
if ( nOrientation )
aUnderlinePos = lcl_ImplCalcRotatedPos( aTmpPos, aOrigin, nSin, nCos );
- pOutDev->DrawStretchText( aUnderlinePos, aSz.Width(), aBlanks.makeStringAndClear(), 0, nTextLen );
+ rOutDev.DrawStretchText( aUnderlinePos, aSz.Width(), aBlanks.makeStringAndClear(), 0, nTextLen );
aTmpFont.SetUnderline( LINESTYLE_NONE );
if ( !nOrientation )
aTmpFont.SetEscapement( nEsc );
aTmpFont.SetPropr( nProp );
- aTmpFont.SetPhysFont( pOutDev );
+ aTmpFont.SetPhysFont( &rOutDev );
}
}
Point aRealOutPos( aOutPos );
@@ -3561,7 +3561,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
--nTextLen;
// output directly
- aTmpFont.QuickDrawText( pOutDev, aRealOutPos, aText, nTextStart, nTextLen, pDXArray );
+ aTmpFont.QuickDrawText( &rOutDev, aRealOutPos, aText, nTextStart, nTextLen, pDXArray );
if ( bDrawFrame )
{
@@ -3570,7 +3570,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
if ( nOrientation )
aTopLeft = lcl_ImplCalcRotatedPos( aTopLeft, aOrigin, nSin, nCos );
tools::Rectangle aRect( aTopLeft, rTextPortion.GetSize() );
- pOutDev->DrawRect( aRect );
+ rOutDev.DrawRect( aRect );
}
// PDF export:
@@ -3611,14 +3611,14 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
adjustYDirectionAware(aRedLineTmpPos, -nShift);
}
}
- Color aOldColor( pOutDev->GetLineColor() );
- pOutDev->SetLineColor( GetColorConfig().GetColorValue( svtools::SPELL ).nColor );
- lcl_DrawRedLines( pOutDev, aTmpFont.GetFontSize().Height(), aRedLineTmpPos, static_cast<size_t>(nIndex), static_cast<size_t>(nIndex) + rTextPortion.GetLen(), pDXArray, rPortion.GetNode()->GetWrongList(), nOrientation, aOrigin, IsVertical(), rTextPortion.IsRightToLeft() );
- pOutDev->SetLineColor( aOldColor );
+ Color aOldColor( rOutDev.GetLineColor() );
+ rOutDev.SetLineColor( GetColorConfig().GetColorValue( svtools::SPELL ).nColor );
+ lcl_DrawRedLines( rOutDev, aTmpFont.GetFontSize().Height(), aRedLineTmpPos, static_cast<size_t>(nIndex), static_cast<size_t>(nIndex) + rTextPortion.GetLen(), pDXArray, rPortion.GetNode()->GetWrongList(), nOrientation, aOrigin, IsVertical(), rTextPortion.IsRightToLeft() );
+ rOutDev.SetLineColor( aOldColor );
}
}
- pOutDev->Pop();
+ rOutDev.Pop();
pTmpDXArray.reset();
@@ -3649,11 +3649,11 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
{
if ( rTextPortion.GetExtraValue() && ( rTextPortion.GetExtraValue() != ' ' ) )
{
- SeekCursor( rPortion.GetNode(), nIndex+1, aTmpFont, pOutDev );
+ SeekCursor( rPortion.GetNode(), nIndex+1, aTmpFont, &rOutDev );
aTmpFont.SetTransparent( false );
aTmpFont.SetEscapement( 0 );
- aTmpFont.SetPhysFont( pOutDev );
- tools::Long nCharWidth = aTmpFont.QuickGetTextSize( pOutDev,
+ aTmpFont.SetPhysFont( &rOutDev );
+ tools::Long nCharWidth = aTmpFont.QuickGetTextSize( &rOutDev,
OUString(rTextPortion.GetExtraValue()), 0, 1 ).Width();
sal_Int32 nChars = 2;
if( nCharWidth )
@@ -3666,8 +3666,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, nChars, rTextPortion.GetExtraValue());
OUString aText(aBuf.makeStringAndClear());
- aTmpFont.QuickDrawText( pOutDev, aTmpPos, aText, 0, aText.getLength() );
- pOutDev->DrawStretchText( aTmpPos, rTextPortion.GetSize().Width(), aText );
+ aTmpFont.QuickDrawText( &rOutDev, aTmpPos, aText, 0, aText.getLength() );
+ rOutDev.DrawStretchText( aTmpPos, rTextPortion.GetSize().Width(), aText );
if ( bStripOnly )
{
@@ -3675,8 +3675,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
const bool bEndOfLine(nPortion == pLine->GetEndPortion());
const bool bEndOfParagraph(bEndOfLine && nLine + 1 == nLines);
- const Color aOverlineColor(pOutDev->GetOverlineColor());
- const Color aTextLineColor(pOutDev->GetTextLineColor());
+ const Color aOverlineColor(rOutDev.GetOverlineColor());
+ const Color aTextLineColor(rOutDev.GetTextLineColor());
// StripPortions() data callback
GetEditEnginePtr()->DrawingTab( aTmpPos,
@@ -3695,8 +3695,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
const bool bEndOfLine(nPortion == pLine->GetEndPortion());
const bool bEndOfParagraph(bEndOfLine && nLine + 1 == nLines);
- const Color aOverlineColor(pOutDev->GetOverlineColor());
- const Color aTextLineColor(pOutDev->GetTextLineColor());
+ const Color aOverlineColor(rOutDev.GetOverlineColor());
+ const Color aTextLineColor(rOutDev.GetTextLineColor());
GetEditEnginePtr()->DrawingText(
aTmpPos, OUString(), 0, 0, nullptr,
@@ -3744,8 +3744,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
// changes in EditEngine behaviour.
if(!bEndOfParagraphWritten && !bPaintBullet && bStripOnly)
{
- const Color aOverlineColor(pOutDev->GetOverlineColor());
- const Color aTextLineColor(pOutDev->GetTextLineColor());
+ const Color aOverlineColor(rOutDev.GetOverlineColor());
+ const Color aTextLineColor(rOutDev.GetTextLineColor());
GetEditEnginePtr()->DrawingText(
aTmpPos, OUString(), 0, 0, nullptr,
@@ -3815,7 +3815,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const tools::Rectangle& rRect, Ou
vcl::Region aOldRegion = rTarget.GetClipRegion();
rTarget.IntersectClipRegion( aClipRect );
- Paint( &rTarget, aClipRect, aStartPos );
+ Paint(rTarget, aClipRect, aStartPos);
if ( bClipRegion )
rTarget.SetClipRegion( aOldRegion );
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 116fec186fc3..b166c71831ba 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -38,15 +38,15 @@ OutlinerEditEng::~OutlinerEditEng()
{
}
-void OutlinerEditEng::PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long /*nBaseLineY*/, const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev )
+void OutlinerEditEng::PaintingFirstLine(sal_Int32 nPara, const Point& rStartPos, tools::Long /*nBaseLineY*/, const Point& rOrigin, Degree10 nOrientation, OutputDevice& rOutDev)
{
if( GetControlWord() & EEControlBits::OUTLINER )
{
- PaintFirstLineInfo aInfo( nPara, rStartPos, pOutDev );
+ PaintFirstLineInfo aInfo(nPara, rStartPos, &rOutDev);
pOwner->maPaintFirstLineHdl.Call( &aInfo );
}
- pOwner->PaintBullet( nPara, rStartPos, rOrigin, nOrientation, pOutDev );
+ pOwner->PaintBullet(nPara, rStartPos, rOrigin, nOrientation, rOutDev);
}
const SvxNumberFormat* OutlinerEditEng::GetNumberFormat( sal_Int32 nPara ) const
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index fa6ae0da381b..9759ce851f12 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -37,7 +37,7 @@ public:
OutlinerEditEng( Outliner* pOwner, SfxItemPool* pPool );
virtual ~OutlinerEditEng() override;
- virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev ) override;
+ virtual void PaintingFirstLine(sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, Degree10 nOrientation, OutputDevice& rOutDev) override;
virtual void ParagraphInserted( sal_Int32 nNewParagraph ) override;
virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph ) override;
diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx
index b00878c874a0..1acab5ba4d48 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -168,14 +168,14 @@ OUString Outliner::GetWord( sal_Int32 nPara, sal_Int32 nIndex )
return pEditEngine->GetWord( nPara, nIndex );
}
-void Outliner::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect )
+void Outliner::Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect )
{
- pEditEngine->Draw( pOutDev, rOutRect );
+ pEditEngine->Draw( rOutDev, rOutRect );
}
-void Outliner::Draw( OutputDevice* pOutDev, const Point& rStartPos )
+void Outliner::Draw( OutputDevice& rOutDev, const Point& rStartPos )
{
- pEditEngine->Draw( pOutDev, rStartPos );
+ pEditEngine->Draw( rOutDev, rStartPos );
}
void Outliner::SetPaperSize( const Size& rSize )
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index de072f8c96c0..8c74fe883345 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -879,8 +879,8 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
return aBulletFont;
}
-void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
- const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev )
+void Outliner::PaintBullet(sal_Int32 nPara, const Point& rStartPos, const Point& rOrigin,
+ Degree10 nOrientation, OutputDevice& rOutDev)
{
bool bDrawBullet = false;
@@ -916,8 +916,8 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
// Use baseline
bool bSymbol = pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL;
aBulletFont.SetAlignment( bSymbol ? ALIGN_BOTTOM : ALIGN_BASELINE );
- vcl::Font aOldFont = pOutDev->GetFont();
- pOutDev->SetFont( aBulletFont );
+ vcl::Font aOldFont = rOutDev.GetFont();
+ rOutDev.SetFont( aBulletFont );
ParagraphInfos aParaInfos = pEditEngine->GetParagraphInfos( nPara );
Point aTextPos;
@@ -963,26 +963,26 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
aTextPos += rOrigin;
vcl::Font aRotatedFont( aBulletFont );
aRotatedFont.SetOrientation( nOrientation );
- pOutDev->SetFont( aRotatedFont );
+ rOutDev.SetFont( aRotatedFont );
}
// VCL will take care of brackets and so on...
- ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
+ ComplexTextLayoutFlags nLayoutMode = rOutDev.GetLayoutMode();
nLayoutMode &= ~ComplexTextLayoutFlags(ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::BiDiStrong);
if ( bRightToLeftPara )
nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl | ComplexTextLayoutFlags::TextOriginLeft | ComplexTextLayoutFlags::BiDiStrong;
- pOutDev->SetLayoutMode( nLayoutMode );
+ rOutDev.SetLayoutMode( nLayoutMode );
if(bStrippingPortions)
{
- const vcl::Font& aSvxFont(pOutDev->GetFont());
+ const vcl::Font& aSvxFont(rOutDev.GetFont());
std::unique_ptr<tools::Long[]> pBuf(new tools::Long[ pPara->GetText().getLength() ]);
- pOutDev->GetTextArray( pPara->GetText(), pBuf.get() );
+ rOutDev.GetTextArray( pPara->GetText(), pBuf.get() );
if(bSymbol)
{
// aTextPos is Bottom, go to Baseline
- FontMetric aMetric(pOutDev->GetFontMetric());
+ FontMetric aMetric(rOutDev.GetFontMetric());
aTextPos.AdjustY( -(aMetric.GetDescent()) );
}
@@ -991,10 +991,10 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
}
else
{
- pOutDev->DrawText( aTextPos, pPara->GetText() );
+ rOutDev.DrawText( aTextPos, pPara->GetText() );
}
- pOutDev->SetFont( aOldFont );
+ rOutDev.SetFont( aOldFont );
}
else
{
@@ -1042,7 +1042,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
else
{
// Remove CAST when KA made the Draw-Method const
- const_cast<GraphicObject*>(pFmt->GetBrush()->GetGraphicObject())->Draw( pOutDev, aBulletPos, pPara->aBulSize );
+ const_cast<GraphicObject*>(pFmt->GetBrush()->GetGraphicObject())->Draw(rOutDev, aBulletPos, pPara->aBulSize);
}
}
}
@@ -1053,7 +1053,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
bStrippingPortions || nOrientation )
return;
- tools::Long nWidth = pOutDev->PixelToLogic( Size( 10, 0 ) ).Width();
+ tools::Long nWidth = rOutDev.PixelToLogic( Size( 10, 0 ) ).Width();
Point aStartPos, aEndPos;
if ( !bVertical )
@@ -1074,10 +1074,10 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
aEndPos.AdjustY(nWidth );
}
- const Color& rOldLineColor = pOutDev->GetLineColor();
- pOutDev->SetLineColor( COL_BLACK );
- pOutDev->DrawLine( aStartPos, aEndPos );
- pOutDev->SetLineColor( rOldLineColor );
+ const Color& rOldLineColor = rOutDev.GetLineColor();
+ rOutDev.SetLineColor( COL_BLACK );
+ rOutDev.DrawLine( aStartPos, aEndPos );
+ rOutDev.SetLineColor( rOldLineColor );
}
void Outliner::InvalidateBullet(sal_Int32 nPara)
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index eb61fc60a78a..c12ad42a9aa5 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -616,7 +616,7 @@ namespace frm
lcl_inflate( aPlayground, -aOnePixel.Width(), -aOnePixel.Height() );
// actually draw the content
- m_pEngine->Draw( _pDev, aPlayground, Point(), true );
+ m_pEngine->Draw(*_pDev, aPlayground, Point(), true);
_pDev->Pop();
}
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index cc043ec2a897..02bc57484083 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -371,10 +371,10 @@ public:
bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder );
// StartDocPos corresponds to VisArea.TopLeft().
- void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect );
- void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos );
- void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip );
- void Draw( OutputDevice* pOutDev, const Point& rStartPos, Degree10 nOrientation = 0_deg10 );
+ void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect );
+ void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos );
+ void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect, const Point& rStartDocPos, bool bClip );
+ void Draw( OutputDevice& rOutDev, const Point& rStartPos, Degree10 nOrientation = 0_deg10 );
ErrCode Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat, SvKeyValueIterator* pHTTPHeaderAttrs = nullptr );
void Write( SvStream& rOutput, EETextFormat );
@@ -481,7 +481,7 @@ public:
void SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
void SetEndPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink );
- virtual void PaintingFirstLine( sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, Degree10 nOrientation, OutputDevice* pOutDev );
+ virtual void PaintingFirstLine(sal_Int32 nPara, const Point& rStartPos, tools::Long nBaseLineY, const Point& rOrigin, Degree10 nOrientation, OutputDevice& rOutDev);
virtual void ParagraphInserted( sal_Int32 nNewParagraph );
virtual void ParagraphDeleted( sal_Int32 nDeletedParagraph );
virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph );
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 411ab2d891cb..98dd7dc14b00 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -635,9 +635,9 @@ protected:
void StyleSheetChanged( SfxStyleSheet const * pStyle );
void InvalidateBullet(sal_Int32 nPara);
- void PaintBullet( sal_Int32 nPara, const Point& rStartPos,
- const Point& rOrigin, Degree10 nOrientation,
- OutputDevice* pOutDev );
+ void PaintBullet(sal_Int32 nPara, const Point& rStartPos,
+ const Point& rOrigin, Degree10 nOrientation,
+ OutputDevice& rOutDev);
// used by OutlinerEditEng. Allows Outliner objects to provide
// bullet access to the EditEngine.
@@ -771,8 +771,8 @@ public:
void SetStatusEventHdl( const Link<EditStatus&, void>& rLink );
Link<EditStatus&, void> const & GetStatusEventHdl() const;
- void Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect );
- void Draw( OutputDevice* pOutDev, const Point& rStartPos );
+ void Draw( OutputDevice& rOutDev, const tools::Rectangle& rOutRect );
+ void Draw( OutputDevice& rOutDev, const Point& rStartPos );
const Size& GetPaperSize() const;
void SetPaperSize( const Size& rSize );
diff --git a/include/vcl/GraphicObject.hxx b/include/vcl/GraphicObject.hxx
index d10b46b92c4c..27b50455864a 100644
--- a/include/vcl/GraphicObject.hxx
+++ b/include/vcl/GraphicObject.hxx
@@ -59,7 +59,7 @@ private:
std::unique_ptr<GrfSimpleCacheObj> mxSimpleCache;
bool VCL_DLLPRIVATE ImplGetCropParams(
- OutputDevice const * pOut,
+ const OutputDevice& rOut,
Point& rPt,
Size& rSz,
const GraphicAttr* pAttr,
@@ -128,7 +128,7 @@ private:
);
bool VCL_DLLPRIVATE ImplDrawTiled(
- OutputDevice* pOut,
+ OutputDevice& rOut,
const tools::Rectangle& rArea,
const Size& rSizePixel,
const Size& rOffset,
@@ -217,12 +217,10 @@ public:
bool IsAnimated() const;
bool IsEPS() const;
- bool Draw(
- OutputDevice* pOut,
- const Point& rPt,
- const Size& rSz,
- const GraphicAttr* pAttr = nullptr
- );
+ bool Draw(OutputDevice& rOut,
+ const Point& rPt,
+ const Size& rSz,
+ const GraphicAttr* pAttr = nullptr);
/** Draw the graphic repeatedly into the given output rectangle
@@ -253,7 +251,7 @@ public:
bitmap drawings appear on the outdev.
*/
void DrawTiled(
- OutputDevice* pOut,
+ OutputDevice& rOut,
const tools::Rectangle& rArea,
const Size& rSize,
const Size& rOffset,
@@ -261,7 +259,7 @@ public:
);
bool StartAnimation(
- OutputDevice* pOut,
+ OutputDevice& rOut,
const Point& rPt,
const Size& rSz,
tools::Long nExtraData = 0,
diff --git a/include/vcl/animate/Animation.hxx b/include/vcl/animate/Animation.hxx
index e6b55a7c510f..8c187723e78f 100644
--- a/include/vcl/animate/Animation.hxx
+++ b/include/vcl/animate/Animation.hxx
@@ -41,13 +41,13 @@ public:
void Clear();
- bool Start(OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz,
+ bool Start(OutputDevice& rOutDev, const Point& rDestPt, const Size& rDestSz,
tools::Long nExtraData, OutputDevice* pFirstFrameOutDev);
void Stop(const OutputDevice* pOutDev = nullptr, tools::Long nExtraData = 0);
- void Draw(OutputDevice* pOutDev, const Point& rDestPt) const;
- void Draw(OutputDevice* pOutDev, const Point& rDestPt, const Size& rDestSz) const;
+ void Draw(OutputDevice& rOutDev, const Point& rDestPt) const;
+ void Draw(OutputDevice& rOutDev, const Point& rDestPt, const Size& rDestSz) const;
bool IsInAnimation() const { return mbIsInAnimation; }
bool IsTransparent() const;
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 363f15f10842..5293958ddaad 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -97,7 +97,7 @@ private:
const tools::PolyPolygon& rPolyPoly,
const Gradient& rGrad );
- SAL_DLLPRIVATE bool ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rLogicDestSize );
+ SAL_DLLPRIVATE bool ImplPlayWithRenderer(OutputDevice& rOut, const Point& rPos, Size rLogicDestSize);
void Linker( OutputDevice* pOut, bool bLink );
@@ -144,10 +144,9 @@ public:
void Record( OutputDevice* pOutDev );
bool IsRecord() const { return m_bRecord; }
- void Play( GDIMetaFile& rMtf );
- void Play( OutputDevice* pOutDev, size_t nPos = GDI_METAFILE_END );
- void Play( OutputDevice* pOutDev, const Point& rPos,
- const Size& rSize );
+ void Play(GDIMetaFile& rMtf);
+ void Play(OutputDevice& rOutDev, size_t nPos = GDI_METAFILE_END);
+ void Play(OutputDevice& rOutDev, const Point& rPos, const Size& rSize);
void Pause( bool bPause );
bool IsPause() const { return m_bPause; }
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index f74cfe91ae30..abff7521381f 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -147,20 +147,18 @@ public:
sal_uLong GetSizeBytes() const;
- void Draw( OutputDevice* pOutDev,
- const Point& rDestPt ) const;
- void Draw( OutputDevice* pOutDev,
- const Point& rDestPt,
- const Size& rDestSize ) const;
- static void DrawEx( OutputDevice* pOutDev, const OUString& rText,
- vcl::Font& rFont, const BitmapEx& rBitmap,
- const Point& rDestPt, const Size& rDestSize );
-
- void StartAnimation( OutputDevice* pOutDev,
- const Point& rDestPt,
- const Size& rDestSize,
- tools::Long nExtraData = 0,
- OutputDevice* pFirstFrameOutDev = nullptr );
+ void Draw(OutputDevice& rOutDev, const Point& rDestPt) const;
+ void Draw(OutputDevice& rOutDev, const Point& rDestPt,
+ const Size& rDestSize) const;
+ static void DrawEx(OutputDevice& rOutDev, const OUString& rText,
+ vcl::Font& rFont, const BitmapEx& rBitmap,
+ const Point& rDestPt, const Size& rDestSize);
+
+ void StartAnimation(OutputDevice& rOutDev,
+ const Point& rDestPt,
+ const Size& rDestSize,
+ tools::Long nExtraData = 0,
+ OutputDevice* pFirstFrameOutDev = nullptr);
void StopAnimation( const OutputDevice* pOutputDevice,
tools::Long nExtraData );
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 1d05d38f1d3f..29edeba6cf85 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -1130,7 +1130,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const OUString& rText )
{
sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx;
mpEditEngine->SetTextCurrentDefaults( aToken );
- mpEditEngine->Draw( mpBackgrDev.get(), Point( nX, rPos.Y() ) );
+ mpEditEngine->Draw(*mpBackgrDev, Point(nX, rPos.Y()));
}
}
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a32ca723b446..9c1ff475449a 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1797,7 +1797,7 @@ void ScGridWindow::DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
Size aTextSize( pEditEng->CalcTextWidth(), pEditEng->GetTextHeight() );
Point aPos( (aPageStart.X()+aPageEnd.X()-aTextSize.Width())/2,
(aPageStart.Y()+aPageEnd.Y()-aTextSize.Height())/2 );
- pEditEng->Draw( &rRenderContext, aPos );
+ pEditEng->Draw(rRenderContext, aPos);
}
else
{
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index e2726517a874..2d45fa62eaa7 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -3175,11 +3175,11 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
// no hard clip, only draw the affected rows
Point aDocStart = aClip.getRect().TopLeft();
aDocStart -= aLogicStart;
- rParam.mpEngine->Draw( mpDev, aClip.getRect(), aDocStart, false );
+ rParam.mpEngine->Draw(*mpDev, aClip.getRect(), aDocStart, false);
}
else
{
- rParam.mpEngine->Draw(mpDev, aLogicStart);
+ rParam.mpEngine->Draw(*mpDev, aLogicStart);
}
}
@@ -3497,7 +3497,7 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
}
}
- rParam.mpEngine->Draw(mpDev, aLogicStart, 900_deg10);
+ rParam.mpEngine->Draw(*mpDev, aLogicStart, 900_deg10);
}
rParam.adjustForHyperlinkInPDF(aURLStart, mpDev);
@@ -3734,7 +3734,7 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
// bMoveClipped handling has been replaced by complete alignment
// handling (also extending to the left).
- rParam.mpEngine->Draw(mpDev, aLogicStart, 2700_deg10);
+ rParam.mpEngine->Draw(*mpDev, aLogicStart, 2700_deg10);
}
rParam.adjustForHyperlinkInPDF(aURLStart, mpDev);
@@ -4012,11 +4012,11 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
// no hard clip, only draw the affected rows
Point aDocStart = aClip.getRect().TopLeft();
aDocStart -= aLogicStart;
- rParam.mpEngine->Draw( mpDev, aClip.getRect(), aDocStart, false );
+ rParam.mpEngine->Draw(*mpDev, aClip.getRect(), aDocStart, false);
}
else
{
- rParam.mpEngine->Draw( mpDev, aLogicStart );
+ rParam.mpEngine->Draw(*mpDev, aLogicStart);
}
}
@@ -4281,7 +4281,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
// the whole output area, not the text itself
aLogicStart.AdjustX( -(rParam.mpEngine->GetPaperSize().Width()) );
- rParam.mpEngine->Draw(mpDev, aLogicStart);
+ rParam.mpEngine->Draw(*mpDev, aLogicStart);
}
rParam.adjustForHyperlinkInPDF(aURLStart, mpDev);
@@ -5101,7 +5101,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
// bSimClip is not used here (because nOriVal is set)
- pEngine->Draw( mpDev, aLogicStart, nOriVal );
+ pEngine->Draw(*mpDev, aLogicStart, nOriVal);
if (bMetaFile)
mpDev->Pop();
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index f5477989f73f..0ac87b887c08 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -530,7 +530,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
(aWinEnd.X() - pEditEng->CalcTextWidth())/2,
(aWinEnd.Y() - pEditEng->GetTextHeight())/2);
- pEditEng->Draw(GetOutDev(), aCenter);
+ pEditEng->Draw(*GetOutDev(), aCenter);
return;
}
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 128f726d1c76..dc084ec75689 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1114,23 +1114,23 @@ void ScPrintFunc::SetDateTime( const DateTime& rDateTime )
aFieldData.aDateTime = rDateTime;
}
-static void lcl_DrawGraphic( const Graphic &rGraphic, vcl::RenderContext *pOut,
+static void lcl_DrawGraphic( const Graphic &rGraphic, vcl::RenderContext& rOutDev,
const tools::Rectangle &rGrf, const tools::Rectangle &rOut )
{
const bool bNotInside = !rOut.IsInside( rGrf );
if ( bNotInside )
{
- pOut->Push();
- pOut->IntersectClipRegion( rOut );
+ rOutDev.Push();
+ rOutDev.IntersectClipRegion( rOut );
}
- rGraphic.Draw( pOut, rGrf.TopLeft(), rGrf.GetSize() );
+ rGraphic.Draw(rOutDev, rGrf.TopLeft(), rGrf.GetSize());
if ( bNotInside )
- pOut->Pop();
+ rOutDev.Pop();
}
-static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOut, const OutputDevice* pRefDev,
+static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext& rOutDev, const OutputDevice* pRefDev,
const tools::Rectangle &rOrg, const tools::Rectangle &rOut,
OUString const & referer )
{
@@ -1197,7 +1197,7 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu
GraphicObject aObject( *pGraphic );
- if( pOut->GetOutDevType() == OUTDEV_PDF &&
+ if( rOutDev.GetOutDevType() == OUTDEV_PDF &&
(aObject.GetType() == GraphicType::Bitmap || aObject.GetType() == GraphicType::Default) )
{
// For PDF export, every draw
@@ -1227,12 +1227,12 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu
const Size aSize( rOrg.GetSize() );
const double Abitmap( k1/k2 * aSize.Width()*aSize.Height() );
- aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0),
+ aObject.DrawTiled( rOutDev, rOrg, aGrfSize, Size(0,0),
::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) );
}
else
{
- aObject.DrawTiled( pOut, rOrg, aGrfSize, Size(0,0) );
+ aObject.DrawTiled( rOutDev, rOrg, aGrfSize, Size(0,0) );
}
bDraw = false;
@@ -1243,12 +1243,12 @@ static void lcl_DrawGraphic( const SvxBrushItem &rBrush, vcl::RenderContext *pOu
bDraw = false;
break;
- default: OSL_ENSURE( !pOut, "new Graphic position?" );
+ default: OSL_ENSURE( false, "new Graphic position?" );
}
tools::Rectangle aGrf( aPos,aDrawSize );
if ( bDraw && aGrf.IsOver( rOut ) )
{
- lcl_DrawGraphic( *pGraphic, pOut, aGrf, rOut );
+ lcl_DrawGraphic( *pGraphic, rOutDev, aGrf, rOut );
}
}
@@ -1310,7 +1310,7 @@ void ScPrintFunc::DrawBorder( tools::Long nScrX, tools::Long nScrY, tools::Long
if (pDocShell->HasName()) {
referer = pDocShell->GetMedium()->GetName();
}
- lcl_DrawGraphic( *pBackground, pDev, pRefDev, aFrameRect, aFrameRect, referer );
+ lcl_DrawGraphic(*pBackground, *pDev, pRefDev, aFrameRect, aFrameRect, referer);
}
else
{
@@ -1831,7 +1831,7 @@ void ScPrintFunc::PrintHF( tools::Long nPageNo, bool bHeader, tools::Long nStart
tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
if (nDif > 0)
aDraw.AdjustY(nDif / 2 );
- pEditEngine->Draw( pDev, aDraw );
+ pEditEngine->Draw(*pDev, aDraw);
}
// center
@@ -1845,7 +1845,7 @@ void ScPrintFunc::PrintHF( tools::Long nPageNo, bool bHeader, tools::Long nStart
tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
if (nDif > 0)
aDraw.AdjustY(nDif / 2 );
- pEditEngine->Draw( pDev, aDraw );
+ pEditEngine->Draw(*pDev, aDraw);
}
// right
@@ -1859,7 +1859,7 @@ void ScPrintFunc::PrintHF( tools::Long nPageNo, bool bHeader, tools::Long nStart
tools::Long nDif = aPaperSize.Height() - static_cast<tools::Long>(pEditEngine->GetTextHeight());
if (nDif > 0)
aDraw.AdjustY(nDif / 2 );
- pEditEngine->Draw( pDev, aDraw );
+ pEditEngine->Draw(*pDev, aDraw);
}
pDev->SetClipRegion();
@@ -1916,13 +1916,13 @@ tools::Long ScPrintFunc::DoNotes( tools::Long nNoteStart, bool bDoPrint, ScPrevi
{
if (bDoPrint)
{
- pEditEngine->Draw( pDev, Point( nPosX, nPosY ) );
+ pEditEngine->Draw(*pDev, Point(nPosX, nPosY));
OUString aMarkStr(rPos.Format(ScRefFlags::VALID, &rDoc, rDoc.GetAddressConvention()) + ":");
// cell position also via EditEngine, for correct positioning
pEditEngine->SetTextCurrentDefaults(aMarkStr);
- pEditEngine->Draw( pDev, Point( aPageRect.Left(), nPosY ) );
+ pEditEngine->Draw(*pDev, Point(aPageRect.Left(), nPosY));
}
if ( pLocationData )
diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx
index 8f9ec50423a2..ec35118ceb0b 100644
--- a/sd/source/filter/html/buttonset.cxx
+++ b/sd/source/filter/html/buttonset.cxx
@@ -230,7 +230,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton
for( const Graphic& aGraphic : aGraphics )
{
- aGraphic.Draw( pDev, aPos );
+ aGraphic.Draw(*pDev, aPos);
aPos.AdjustX(aGraphic.GetSizePixel().Width() + 3 );
}
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 6f3b9f93b97e..6f40fd36b0d3 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -413,7 +413,7 @@ Reference<rendering::XBitmap> const & PresenterTextView::Implementation::GetBitm
mpEditEngine->SetText(msText);
mpEditEngine->SetPaperSize(maSize);
- mpEditEngine->Draw(mpOutputDevice, aWindowBox, Point(0,mnTop));
+ mpEditEngine->Draw(*mpOutputDevice, aWindowBox, Point(0,mnTop));
const BitmapEx aBitmap (mpOutputDevice->GetBitmapEx(Point(0,0), maSize));
mxBitmap = cppcanvas::VCLFactory::createBitmap(
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index 52597482b5dd..2e961e45e4b2 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -484,9 +484,9 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
std::max( aOutOrg.Y() + aOutSize.Height() - aGrfSize.Height() - aOffset.Height(), aOutOrg.Y() ) );
if( maLogo.IsAnimated() )
- maLogo.StartAnimation( GetOutDev(), aGrfPos, aGrfSize, reinterpret_cast<sal_IntPtr>(this) );
+ maLogo.StartAnimation(*GetOutDev(), aGrfPos, aGrfSize, reinterpret_cast<sal_IntPtr>(this));
else
- maLogo.Draw( GetOutDev(), aGrfPos, aGrfSize );
+ maLogo.Draw(*GetOutDev(), aGrfPos, aGrfSize);
}
if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 7191b3565cc7..20f75eea71d3 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1133,7 +1133,7 @@ namespace {
pOutliner->Clear();
pOutliner->SetText(*mpParaObject);
- pOutliner->Draw(&rPrinter, aOutRect);
+ pOutliner->Draw(rPrinter, aOutRect);
PrintMessage(
rPrinter,
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index a7e9678adcdf..832079218bbb 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -89,7 +89,7 @@ void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFil
rRenderContext.SetFillColor(COL_WHITE);
rRenderContext.DrawRect(tools::Rectangle(aPoint + Point(FRAME, FRAME), bPoint + Point(FRAME, FRAME)));
pFile->WindStart();
- pFile->Play(&rRenderContext, aPoint + Point(FRAME, FRAME), aSize);
+ pFile->Play(rRenderContext, aPoint + Point(FRAME, FRAME), aSize);
}
}
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index 220e047a84aa..315e3764524c 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -271,7 +271,6 @@ void GraphicRendererVCL::_getPropertyValues( const comphelper::PropertyMapEntry*
}
}
-
void SAL_CALL GraphicRendererVCL::render( const uno::Reference< graphic::XGraphic >& rxGraphic )
{
if( mpOutDev && mxDevice.is() && rxGraphic.is() )
@@ -280,7 +279,7 @@ void SAL_CALL GraphicRendererVCL::render( const uno::Reference< graphic::XGraphi
if (!aGraphic.IsNone())
{
GraphicObject aGraphicObject(aGraphic);
- aGraphicObject.Draw( mpOutDev, maDestRect.TopLeft(), maDestRect.GetSize() );
+ aGraphicObject.Draw(*mpOutDev, maDestRect.TopLeft(), maDestRect.GetSize());
}
}
}
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 616f8774050d..c61041949d14 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -147,7 +147,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
if( pVDev->SetOutputSizePixel( aSizePix ) )
{
const Point aPt;
- aTmpGrf.Draw( pVDev, aPt, aSizePix );
+ aTmpGrf.Draw(*pVDev, aPt, aSizePix);
aBmp = pVDev->GetBitmap( aPt, aSizePix );
}
diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx
index 593b459c5e5b..bfc0adb8cd97 100644
--- a/svx/source/dialog/contwnd.cxx
+++ b/svx/source/dialog/contwnd.cxx
@@ -240,7 +240,7 @@ void ContourWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta
rTarget.Pop();
if (rGraphic.GetType() != GraphicType::NONE)
- rGraphic.Draw(&rTarget, Point(), GetGraphicSize());
+ rGraphic.Draw(rTarget, Point(), GetGraphicSize());
if (aWorkRect.Left() != aWorkRect.Right() && aWorkRect.Top() != aWorkRect.Bottom())
{
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index bf5ca03e7747..043ce60afbd5 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1178,7 +1178,7 @@ void SvxXLinePreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
Point aPos( aOutputSize.Width() / 3, aOutputSize.Height() / 2 );
aPos.AdjustX( -(maSymbolSize.Width() / 2) );
aPos.AdjustY( -(maSymbolSize.Height() / 2) );
- mpGraphic->Draw(&getBufferDevice(), aPos, maSymbolSize);
+ mpGraphic->Draw(getBufferDevice(), aPos, maSymbolSize);
}
LocalPostPaint(rRenderContext);
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index f73e316cfa18..f23afd447cf7 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -176,7 +176,7 @@ void GraphCtrl::GraphicToVD()
xVD->Erase();
const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType());
if (bGraphicValid)
- aGraphic.Draw(xVD.get(), Point(), aGraphSize);
+ aGraphic.Draw(*xVD, Point(), aGraphSize);
}
void GraphCtrl::Resize()
diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx
index a1deb9dcaceb..5698c99ba090 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -514,7 +514,7 @@ void SvxBmpNumValueSet::UserDraw(const UserDrawEvent& rUDEvt)
{
sal_uInt16 nY = 11 + i * 33;
aPos.setY( aBLPos.Y() + nRectHeight * nY / 100 );
- aGraphic.Draw( pDev, aPos, aSize );
+ aGraphic.Draw(*pDev, aPos, aSize);
}
}
}
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index 819f115cf3f4..bd17df54b737 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -122,9 +122,9 @@ void GalleryPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
const Size aSize( aPreviewRect.GetSize() );
if( aGraphicObj.IsAnimated() )
- aGraphicObj.StartAnimation(&rRenderContext, aPos, aSize);
+ aGraphicObj.StartAnimation(rRenderContext, aPos, aSize);
else
- aGraphicObj.Draw(&rRenderContext, aPos, aSize);
+ aGraphicObj.Draw(rRenderContext, aPos, aSize);
}
}
@@ -266,9 +266,9 @@ void DialogGalleryPreview::Paint(vcl::RenderContext& rRenderContext, const tools
const Size aSize( aPreviewRect.GetSize() );
if( aGraphicObj.IsAnimated() )
- aGraphicObj.StartAnimation(&rRenderContext, aPos, aSize);
+ aGraphicObj.StartAnimation(rRenderContext, aPos, aSize);
else
- aGraphicObj.Draw(&rRenderContext, aPos, aSize);
+ aGraphicObj.Draw(rRenderContext, aPos, aSize);
}
}
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index c52ef1dff5ce..ef9cedaeedb5 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1818,7 +1818,7 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
pRetval->Record(pBlackHole);
Point aPaintPos = aPaintRect.TopLeft();
- rOutliner.Draw(pBlackHole, aPaintPos);
+ rOutliner.Draw(*pBlackHole, aPaintPos);
pRetval->Stop();
pRetval->WindStart();
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 60e11abdba56..ef2b31716a2f 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -247,13 +247,13 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
pVDev->SetBackground( Wallpaper( COL_BLACK ) );
pVDev->Erase();
- rGraphic.Draw( pVDev.get(), aPt, aSize );
+ rGraphic.Draw(*pVDev, aPt, aSize);
const Bitmap aBitmap( pVDev->GetBitmap( aPt, aSize ) );
pVDev->SetBackground( aWallpaper );
pVDev->Erase();
- rGraphic.Draw( pVDev.get(), aPt, aSize );
+ rGraphic.Draw(*pVDev, aPt, aSize);
pVDev->SetRasterOp( RasterOp::Xor );
pVDev->DrawBitmap( aPt, aSize, aBitmap );
@@ -275,7 +275,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
if( pVDev->SetOutputSizePixel( aSize ) )
{
- rGraphic.Draw( pVDev.get(), Point(), aSize );
+ rGraphic.Draw(*pVDev, Point(), aSize);
aGraphic = BitmapEx(pVDev->GetBitmap(Point(), aSize));
}
else
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index d9fd29e5c2eb..9397156bb078 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -84,7 +84,7 @@ public:
/// wrappers for non-const calls at GraphicObject
void StartGraphicAnimation(OutputDevice* pOut, const Point& rPt, const Size& rSz, tools::Long nExtraData, OutputDevice* pFirstFrameOutDev)
- { maGrfObj.StartAnimation(pOut, rPt, rSz, nExtraData, pFirstFrameOutDev); }
+ { maGrfObj.StartAnimation(*pOut, rPt, rSz, nExtraData, pFirstFrameOutDev); }
void StopGraphicAnimation(const OutputDevice* pOut, tools::Long nExtraData) { maGrfObj.StopAnimation(pOut, nExtraData); }
virtual Size GetTwipSize() const override;
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 738ac7cc9dae..76fe94181f0f 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -141,7 +141,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText,
aFont.SetColor( aCol );
const BitmapEx& rBmp = const_cast<SwViewShell&>(rSh).GetReplacementBitmap(bDefect);
- Graphic::DrawEx( rSh.GetOut(), rText, aFont, rBmp, rRect.Pos(), rRect.SSize() );
+ Graphic::DrawEx(*rSh.GetOut(), rText, aFont, rBmp, rRect.Pos(), rRect.SSize());
}
SwNoTextFrame::SwNoTextFrame(SwNoTextNode * const pNode, SwFrame* pSib )
@@ -200,7 +200,7 @@ static void lcl_ClearArea( const SwFrame &rFrame,
{
for( const auto &rRegion : aRegion )
{
- ::DrawGraphic( pItem, &rOut, aOrigRect, rRegion );
+ ::DrawGraphic(pItem, rOut, aOrigRect, rRegion);
}
}
}
@@ -1380,7 +1380,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr
if ( pGraphic && pGraphic->GetType() != GraphicType::NONE )
{
- pGraphic->Draw( pOut, aPosition, aSize );
+ pGraphic->Draw(*pOut, aPosition, aSize);
// shade the representation if the object is activated outplace
uno::Reference < embed::XEmbeddedObject > xObj = pOLENd->GetOLEObj().GetOleRef();
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 4f16f7df8f1f..bb6aa4a12654 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1246,7 +1246,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf )
GDIMetaFile aMtf;
aMtf.Record( pVirtDev.get() );
- aGrf.Draw( pVirtDev, aPt, aSz );
+ aGrf.Draw(*pVirtDev, aPt, aSz);
aMtf.Stop();
aMtf.SetPrefMapMode( aTmp );
aMtf.SetPrefSize( aSz );
@@ -1270,7 +1270,7 @@ bool SwFEShell::GetDrawObjGraphic( SotClipboardFormatId nFormat, Graphic& rGrf )
pVirtDev->SetMapMode( aTmp );
if( pVirtDev->SetOutputSize( aSz ) )
{
- aGrf.Draw( pVirtDev.get(), Point(), aSz );
+ aGrf.Draw(*pVirtDev, Point(), aSz);
rGrf = pVirtDev->GetBitmapEx( Point(), aSz );
}
else
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index b1cccfd2af4d..6481e6c0be6f 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -79,7 +79,7 @@ void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib);
// transparency, saved in the color of the brush item.
void DrawGraphic(
const SvxBrushItem *,
- vcl::RenderContext *,
+ vcl::RenderContext &,
const SwRect &rOrg,
const SwRect &rOut,
const sal_uInt8 nGrfNum = GRFNUM_NO,
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 1d3d046dee66..8dae637b7700 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1549,11 +1549,11 @@ static void lcl_SubtractFlys( const SwFrame *pFrame, const SwPageFrame *pPage,
gProp.pSRetoucheFly = nullptr;
}
-static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
- vcl::RenderContext* _pOut,
- const SwRect& _rAlignedPaintRect,
- const GraphicObject& _rGraphicObj,
- SwPaintProperties const & properties)
+static void lcl_implDrawGraphicBackgrd(const SvxBrushItem& _rBackgrdBrush,
+ vcl::RenderContext& _rOut,
+ const SwRect& _rAlignedPaintRect,
+ const GraphicObject& _rGraphicObj,
+ SwPaintProperties const & properties)
{
/// determine color of background
/// If color of background brush is not "no fill"/"auto fill" or
@@ -1585,17 +1585,17 @@ static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
if ( bDrawTransparent )
{
/// draw background transparent
- if( _pOut->GetFillColor() != aColor.GetRGBColor() )
- _pOut->SetFillColor( aColor.GetRGBColor() );
+ if( _rOut.GetFillColor() != aColor.GetRGBColor() )
+ _rOut.SetFillColor( aColor.GetRGBColor() );
tools::PolyPolygon aPoly( _rAlignedPaintRect.SVRect() );
- _pOut->DrawTransparent( aPoly, nTransparencyPercent );
+ _rOut.DrawTransparent( aPoly, nTransparencyPercent );
}
else
{
/// draw background opaque
- if ( _pOut->GetFillColor() != aColor )
- _pOut->SetFillColor( aColor );
- _pOut->DrawRect( _rAlignedPaintRect.SVRect() );
+ if ( _rOut.GetFillColor() != aColor )
+ _rOut.SetFillColor( aColor );
+ _rOut.DrawRect( _rAlignedPaintRect.SVRect() );
}
}
@@ -1614,7 +1614,7 @@ static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
* @param _rBackgrdBrush
* background brush contain the color the background has to be drawn.
*
- * @param _pOut
+ * @param _rOut
* output device the background has to be drawn in.
*
* @param _rAlignedPaintRect
@@ -1632,7 +1632,7 @@ static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
* boolean (optional; default: false) indicating, if the background is already drawn.
*/
static void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
- OutputDevice* _pOut,
+ OutputDevice& _rOut,
const SwRect& _rAlignedPaintRect,
const GraphicObject& _rGraphicObj,
bool _bNumberingGraphic,
@@ -1648,7 +1648,7 @@ static void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
( _rGraphicObj.IsTransparent() || _rGraphicObj.GetType() == GraphicType::NONE )
)
{
- lcl_implDrawGraphicBackgrd( _rBackgrdBrush, _pOut, _rAlignedPaintRect, _rGraphicObj, properties );
+ lcl_implDrawGraphicBackgrd( _rBackgrdBrush, _rOut, _rAlignedPaintRect, _rGraphicObj, properties );
}
}
@@ -1667,7 +1667,7 @@ static void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
*
* Also, change type of <bGrfNum> and <bClip> from <bool> to <bool>
*/
-static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOut,
+static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext &rOutDev,
SwViewShell &rSh, const SwRect &rGrf, const SwRect &rOut,
bool bGrfNum,
SwPaintProperties const & properties,
@@ -1678,24 +1678,24 @@ 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, pOut );
+ ::SwAlignRect( aAlignedGrfRect, &rSh, &rOutDev );
// Change type from <bool> to <bool>.
const bool bNotInside = !rOut.IsInside( aAlignedGrfRect );
if ( bNotInside )
{
- pOut->Push( PushFlags::CLIPREGION );
- pOut->IntersectClipRegion( rOut.SVRect() );
+ rOutDev.Push( PushFlags::CLIPREGION );
+ rOutDev.IntersectClipRegion( rOut.SVRect() );
}
GraphicObject *pGrf = const_cast<GraphicObject*>(rBrush.GetGraphicObject());
// Outsource drawing of background with a background color
- ::lcl_DrawGraphicBackgrd( rBrush, pOut, aAlignedGrfRect, *pGrf, bGrfNum, properties, bBackgrdAlreadyDrawn );
+ ::lcl_DrawGraphicBackgrd( rBrush, rOutDev, aAlignedGrfRect, *pGrf, bGrfNum, properties, bBackgrdAlreadyDrawn );
// Because for drawing a graphic left-top-corner and size coordinates are
// used, these coordinates have to be determined on pixel level.
- ::SwAlignGrfRect( &aAlignedGrfRect, *pOut );
+ ::SwAlignGrfRect( &aAlignedGrfRect, rOutDev );
const basegfx::B2DHomMatrix aGraphicTransform(
basegfx::utils::createScaleTranslateB2DHomMatrix(
@@ -1703,7 +1703,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOu
aAlignedGrfRect.Left(), aAlignedGrfRect.Top()));
paintGraphicUsingPrimitivesHelper(
- *pOut,
+ rOutDev,
*pGrf,
pGrf->GetAttr(),
aGraphicTransform,
@@ -1712,7 +1712,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, vcl::RenderContext *pOu
OUString());
if ( bNotInside )
- pOut->Pop();
+ rOutDev.Pop();
}
bool DrawFillAttributes(
@@ -1811,7 +1811,7 @@ bool DrawFillAttributes(
void DrawGraphic(
const SvxBrushItem *pBrush,
- vcl::RenderContext *pOutDev,
+ vcl::RenderContext &rOutDev,
const SwRect &rOrg,
const SwRect &rOut,
const sal_uInt8 nGrfNum,
@@ -1915,16 +1915,16 @@ void DrawGraphic(
GraphicObject* pGraphicObj = const_cast< GraphicObject* >(pBrush->GetGraphicObject());
// calculate aligned paint rectangle
SwRect aAlignedPaintRect = rOut;
- ::SwAlignRect( aAlignedPaintRect, &rSh, pOutDev );
+ ::SwAlignRect( aAlignedPaintRect, &rSh, &rOutDev );
// draw background color for aligned paint rectangle
- lcl_DrawGraphicBackgrd( *pBrush, pOutDev, aAlignedPaintRect, *pGraphicObj, bGrfNum, gProp );
+ lcl_DrawGraphicBackgrd( *pBrush, rOutDev, aAlignedPaintRect, *pGraphicObj, bGrfNum, gProp );
// set left-top-corner of background graphic to left-top-corner of the
// area, from which the background brush is determined.
aGrf.Pos() = rOrg.Pos();
// setup clipping at output device
- pOutDev->Push( PushFlags::CLIPREGION );
- pOutDev->IntersectClipRegion( rOut.SVRect() );
+ rOutDev.Push( PushFlags::CLIPREGION );
+ rOutDev.IntersectClipRegion( rOut.SVRect() );
// use new method <GraphicObject::DrawTiled(::)>
{
// calculate paint offset
@@ -1954,14 +1954,14 @@ void DrawGraphic(
const Size aSize( aAlignedPaintRect.SSize() );
const double Abitmap( k1/k2 * static_cast<double>(aSize.Width())*aSize.Height() );
- pGraphicObj->DrawTiled( pOutDev,
+ pGraphicObj->DrawTiled( rOutDev,
aAlignedPaintRect.SVRect(),
aGrf.SSize(),
Size( aPaintOffset.X(), aPaintOffset.Y() ),
std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) );
}
// reset clipping at output device
- pOutDev->Pop();
+ rOutDev.Pop();
// set <bDraw> and <bRetouche> to false, indicating that background
// graphic and background are already drawn.
bDraw = bRetouche = false;
@@ -1972,7 +1972,7 @@ void DrawGraphic(
bDraw = false;
break;
- default: OSL_ENSURE( !pOutDev, "new Graphic position?" );
+ default: OSL_ENSURE( false, "new Graphic position?" );
}
/// init variable <bGrfBackgrdAlreadDrawn> to indicate, if background of
@@ -1980,8 +1980,8 @@ void DrawGraphic(
bool bGrfBackgrdAlreadyDrawn = false;
if ( bRetouche )
{
- pOutDev->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
- pOutDev->SetLineColor();
+ rOutDev.Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
+ rOutDev.SetLineColor();
// check, if an existing background graphic (not filling the complete
// background) is transparent drawn and the background color is
@@ -2044,11 +2044,11 @@ void DrawGraphic(
}
// #i75614# reset draw mode in high contrast mode in order to get fill color set
- const DrawModeFlags nOldDrawMode = pOutDev->GetDrawMode();
+ const DrawModeFlags nOldDrawMode = rOutDev.GetDrawMode();
if ( gProp.pSGlobalShell->GetWin() &&
Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
{
- pOutDev->SetDrawMode( DrawModeFlags::Default );
+ rOutDev.SetDrawMode( DrawModeFlags::Default );
}
// If background region has to be drawn transparent, set only the RGB values of the background color as
@@ -2057,21 +2057,21 @@ void DrawGraphic(
{
case Transparent:
{
- if( pOutDev->GetFillColor() != aColor.GetRGBColor() )
- pOutDev->SetFillColor( aColor.GetRGBColor() );
+ if( rOutDev.GetFillColor() != aColor.GetRGBColor() )
+ rOutDev.SetFillColor( aColor.GetRGBColor() );
break;
}
default:
{
- if( pOutDev->GetFillColor() != aColor )
- pOutDev->SetFillColor( aColor );
+ if( rOutDev.GetFillColor() != aColor )
+ rOutDev.SetFillColor( aColor );
break;
}
}
// #i75614#
// restore draw mode
- pOutDev->SetDrawMode( nOldDrawMode );
+ rOutDev.SetDrawMode( nOldDrawMode );
switch (eDrawStyle)
{
@@ -2107,7 +2107,7 @@ void DrawGraphic(
(( bTransparentGrfWithNoFillBackgrd ? nGrfTransparency : (255 - aColor.GetAlpha())
)*100 + 0x7F)/0xFF);
// draw poly-polygon transparent
- pOutDev->DrawTransparent( aDrawPoly, nTransparencyPercent );
+ rOutDev.DrawTransparent( aDrawPoly, nTransparencyPercent );
break;
}
@@ -2122,22 +2122,22 @@ void DrawGraphic(
// loop rectangles of background region, which has to be drawn
for( size_t i = 0; i < aRegion.size(); ++i )
{
- pOutDev->DrawRect( aRegion[i].SVRect() );
+ rOutDev.DrawRect( aRegion[i].SVRect() );
}
}
}
- pOutDev ->Pop();
+ rOutDev.Pop();
}
if( bDraw && aGrf.IsOver( rOut ) )
- lcl_DrawGraphic( *pBrush, pOutDev, rSh, aGrf, rOut, bGrfNum, gProp,
+ lcl_DrawGraphic( *pBrush, rOutDev, rSh, aGrf, rOut, bGrfNum, gProp,
bGrfBackgrdAlreadyDrawn );
if( bReplaceGrfNum )
{
const BitmapEx& rBmp = rSh.GetReplacementBitmap(false);
- vcl::Font aTmp( pOutDev->GetFont() );
- Graphic::DrawEx(pOutDev, OUString(), aTmp, rBmp, rOrg.Pos(), rOrg.SSize());
+ vcl::Font aTmp( rOutDev.GetFont() );
+ Graphic::DrawEx(rOutDev, OUString(), aTmp, rBmp, rOrg.Pos(), rOrg.SSize());
}
}
@@ -6445,7 +6445,7 @@ void SwFrame::PaintSwFrameBackground( const SwRect &rRect, const SwPageFrame *pP
// - see declaration in /core/inc/frmtool.hxx.
::DrawGraphic(
pItem,
- pOut,
+ *pOut,
aOrigBackRect,
aRegion[i],
GRFNUM_NO,
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index fdb2e4442916..21ab8eecd351 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -959,8 +959,10 @@ void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
Graphic* pGraph = const_cast<Graphic*>(m_pBrush->GetGraphic());
if (pGraph)
{
+ const OutputDevice* pOut = rInf.GetOut();
+ assert(pOut);
pGraph->StartAnimation(
- const_cast<OutputDevice*>(rInf.GetOut()), aPos, aSize, m_nId );
+ *const_cast<OutputDevice*>(pOut), aPos, aSize, m_nId);
}
}
@@ -993,7 +995,9 @@ void SwGrfNumPortion::Paint( const SwTextPaintInfo &rInf ) const
if( bDraw && aTmp.HasArea() )
{
- DrawGraphic( m_pBrush.get(), const_cast<OutputDevice*>(rInf.GetOut()),
+ const OutputDevice* pOut = rInf.GetOut();
+ assert(pOut);
+ DrawGraphic( m_pBrush.get(), *const_cast<OutputDevice*>(pOut),
aTmp, aRepaint, m_bReplace ? GRFNUM_REPLACE : GRFNUM_YES );
}
}
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index bd243d2e074e..768ad00c8cd8 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -554,7 +554,7 @@ bool SwViewShell::PrintOrPDFExport(
pMetaFile->WindStart();
//play back the scaled page
- pMetaFile->Play(pOutDev);
+ pMetaFile->Play(*pOutDev);
pMetaFile.reset();
}
}
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index d3d9427751e0..e7c6b268ba2e 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2649,7 +2649,7 @@ void BmpWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
}
else if (bGraphic) //draw unmirrored preview graphic
{
- aGraphic.Draw(&rRenderContext, aPntPos, aPntSz);
+ aGraphic.Draw(rRenderContext, aPntPos, aPntSz);
}
else //draw unmirrored stock sample image
{
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 9b65b575fbc4..69e2887c1af2 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -858,7 +858,7 @@ static tools::Long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat&
return nRet;
}
-static tools::Long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
+static tools::Long lcl_DrawGraphic(vcl::RenderContext& rVDev, const SwNumFormat &rFormat, tools::Long nXStart, tools::Long nYStart, tools::Long nDivision)
{
const SvxBrushItem* pBrushItem = rFormat.GetBrush();
tools::Long nRet = 0;
@@ -871,7 +871,7 @@ static tools::Long lcl_DrawGraphic(vcl::RenderContext* pVDev, const SwNumFormat
aGSize.setWidth( aGSize.Width() / nDivision );
nRet = aGSize.Width();
aGSize.setHeight( aGSize.Height() / nDivision );
- pGraphic->Draw(pVDev, Point(nXStart, nYStart), pVDev->PixelToLogic(aGSize));
+ pGraphic->Draw(rVDev, Point(nXStart, nYStart), rVDev.PixelToLogic(aGSize));
}
}
return nRet;
@@ -958,7 +958,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
tools::Long nBulletWidth = 0;
if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
{
- nBulletWidth = lcl_DrawGraphic(pVDev.get(), rFormat, nNumberXPos,
+ nBulletWidth = lcl_DrawGraphic(*pVDev, rFormat, nNumberXPos,
nYStart, nWidthRelation);
}
else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
@@ -1051,7 +1051,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re
tools::Long nTextOffset;
if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
{
- lcl_DrawGraphic(pVDev.get(), rFormat, nXStart, nYStart, nWidthRelation);
+ lcl_DrawGraphic(*pVDev, rFormat, nXStart, nYStart, nWidthRelation);
nTextOffset = nLineHeight + nXStep;
}
else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType())
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index e9ce19243225..342f52086fc8 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -204,7 +204,7 @@ void SidebarTextControl::DrawForPage(OutputDevice* pDev, const Point& rPt)
if (OutlinerView* pOutlinerView = mrSidebarWin.GetOutlinerView())
{
- pOutlinerView->GetOutliner()->Draw(pDev, tools::Rectangle(rPt, aSize));
+ pOutlinerView->GetOutliner()->Draw(*pDev, tools::Rectangle(rPt, aSize));
}
if ( mrSidebarWin.GetLayoutStatus()!=SwPostItHelper::DELETED )
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index acd7abf9bb2e..142627df780d 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -158,17 +158,15 @@ private:
sal_uLong getSizeBytes() const;
- void draw( OutputDevice* pOutDev,
- const Point& rDestPt ) const;
- void draw( OutputDevice* pOutDev,
- const Point& rDestPt,
- const Size& rDestSize ) const;
-
- void startAnimation( OutputDevice* pOutDev,
- const Point& rDestPt,
- const Size& rDestSize,
- tools::Long nExtraData,
- OutputDevice* pFirstFrameOutDev );
+ void draw(OutputDevice& rOutDev, const Point& rDestPt) const;
+ void draw(OutputDevice& rOutDev, const Point& rDestPt,
+ const Size& rDestSize) const;
+
+ void startAnimation(OutputDevice& rOutDev,
+ const Point& rDestPt,
+ const Size& rDestSize,
+ tools::Long nExtraData,
+ OutputDevice* pFirstFrameOutDev);
void stopAnimation( const OutputDevice* pOutputDevice,
tools::Long nExtraData );
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index d9687cb135f1..06ec5841f8f6 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -262,7 +262,7 @@ void SvmTest::checkRendering(ScopedVclPtrInstance<VirtualDevice> const & pVirtua
BitmapEx aSourceBitmapEx = pVirtualDev->GetBitmapEx(Point(), Size(10, 10));
ScopedVclPtrInstance<VirtualDevice> pVirtualDevResult;
pVirtualDevResult->SetOutputSizePixel(Size(10, 10));
- const_cast<GDIMetaFile&>(rMetaFile).Play(pVirtualDevResult.get());
+ const_cast<GDIMetaFile&>(rMetaFile).Play(*pVirtualDevResult);
BitmapEx aResultBitmapEx = pVirtualDevResult->GetBitmapEx(Point(), Size(10, 10));
const bool bWriteCompareBitmap = false;
diff --git a/vcl/source/animate/Animation.cxx b/vcl/source/animate/Animation.cxx
index f4faea88a47d..06de392f584b 100644
--- a/vcl/source/animate/Animation.cxx
+++ b/vcl/source/animate/Animation.cxx
@@ -159,28 +159,28 @@ BitmapChecksum Animation::GetChecksum() const
return nCrc;
}
-bool Animation::Start(OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz,
+bool Animation::Start(OutputDevice& rOut, const Point& rDestPt, const Size& rDestSz,
tools::Long nExtraData, OutputDevice* pFirstFrameOutDev)
{
bool bRet = false;
if (!maList.empty())
{
- if ((pOut->GetOutDevType() == OUTDEV_WINDOW) && !mbLoopTerminated
+ if ((rOut.GetOutDevType() == OUTDEV_WINDOW) && !mbLoopTerminated
&& (ANIMATION_TIMEOUT_ON_CLICK != maList[mnPos]->mnWait))
{
bool differs = true;
auto itAnimView = std::find_if(
maViewList.begin(), maViewList.end(),
- [pOut, nExtraData](const std::unique_ptr<ImplAnimView>& pAnimView) -> bool {
- return pAnimView->matches(pOut, nExtraData);
+ [&rOut, nExtraData](const std::unique_ptr<ImplAnimView>& pAnimView) -> bool {
+ return pAnimView->matches(&rOut, nExtraData);
});
if (itAnimView != maViewList.end())
{
if ((*itAnimView)->getOutPos() == rDestPt
- && (*itAnimView)->getOutSizePix() == pOut->LogicToPixel(rDestSz))
+ && (*itAnimView)->getOutSizePix() == rOut.LogicToPixel(rDestSz))
{
(*itAnimView)->repaint();
differs = false;
@@ -198,7 +198,7 @@ bool Animation::Start(OutputDevice* pOut, const Point& rDestPt, const Size& rDes
if (differs)
maViewList.emplace_back(
- new ImplAnimView(this, pOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev));
+ new ImplAnimView(this, &rOut, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev));
if (!mbIsInAnimation)
{
@@ -207,7 +207,7 @@ bool Animation::Start(OutputDevice* pOut, const Point& rDestPt, const Size& rDes
}
}
else
- Draw(pOut, rDestPt, rDestSz);
+ Draw(rOut, rDestPt, rDestSz);
bRet = true;
}
@@ -230,12 +230,12 @@ void Animation::Stop(const OutputDevice* pOut, tools::Long nExtraData)
}
}
-void Animation::Draw(OutputDevice* pOut, const Point& rDestPt) const
+void Animation::Draw(OutputDevice& rOut, const Point& rDestPt) const
{
- Draw(pOut, rDestPt, pOut->PixelToLogic(maGlobalSize));
+ Draw(rOut, rDestPt, rOut.PixelToLogic(maGlobalSize));
}
-void Animation::Draw(OutputDevice* pOut, const Point& rDestPt, const Size& rDestSz) const
+void Animation::Draw(OutputDevice& rOut, const Point& rDestPt, const Size& rDestSz) const
{
const size_t nCount = maList.size();
@@ -244,10 +244,10 @@ void Animation::Draw(OutputDevice* pOut, const Point& rDestPt, const Size& rDest
AnimationBitmap* pObj = maList[std::min(mnPos, nCount - 1)].get();
- if (pOut->GetConnectMetaFile() || (pOut->GetOutDevType() == OUTDEV_PRINTER))
- maList[0]->maBitmapEx.Draw(pOut, rDestPt, rDestSz);
+ if (rOut.GetConnectMetaFile() || (rOut.GetOutDevType() == OUTDEV_PRINTER))
+ maList[0]->maBitmapEx.Draw(&rOut, rDestPt, rDestSz);
else if (ANIMATION_TIMEOUT_ON_CLICK == pObj->mnWait)
- pObj->maBitmapEx.Draw(pOut, rDestPt, rDestSz);
+ pObj->maBitmapEx.Draw(&rOut, rDestPt, rDestSz);
else
{
const size_t nOldPos = mnPos;
@@ -255,7 +255,7 @@ void Animation::Draw(OutputDevice* pOut, const Point& rDestPt, const Size& rDest
const_cast<Animation*>(this)->mnPos = nCount - 1;
{
- ImplAnimView{ const_cast<Animation*>(this), pOut, rDestPt, rDestSz, 0 };
+ ImplAnimView{ const_cast<Animation*>(this), &rOut, rDestPt, rDestSz, 0 };
}
const_cast<Animation*>(this)->mnPos = nOldPos;
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index b6ebf1d4aace..18e8757adfa7 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -1591,7 +1591,7 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r
aVirDev->SetMapMode(MapMode(MapUnit::MapPixel));
aVirDev->SetOutputSizePixel(aSizePixel);
Graphic aGraphic2=aGraphic;
- aGraphic2.Draw(aVirDev.get(),Point(0,0),aSizePixel); // this changes the MapMode
+ aGraphic2.Draw(*aVirDev, Point(0, 0), aSizePixel); // this changes the MapMode
aVirDev->SetMapMode(MapMode(MapUnit::MapPixel));
aGraphic=Graphic(aVirDev->GetBitmapEx(Point(0,0),aSizePixel));
}
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 0aea5f0513bd..cceaef8b9afd 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -341,14 +341,14 @@ void GDIMetaFile::Play( GDIMetaFile& rMtf )
}
}
-void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
+void GDIMetaFile::Play(OutputDevice& rOut, size_t nPos)
{
if( m_bRecord )
return;
MetaAction* pAction = GetCurAction();
const size_t nObjCount = m_aList.size();
- size_t nSyncCount = pOut->GetSyncCount();
+ size_t nSyncCount = rOut.GetSyncCount();
if( nPos > nObjCount )
nPos = nObjCount;
@@ -357,24 +357,24 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
// This is necessary, since old metafiles don't even know of these
// recent add-ons. Newer metafiles must of course explicitly set
// those states.
- pOut->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
- pOut->SetLayoutMode( ComplexTextLayoutFlags::Default );
- pOut->SetDigitLanguage( LANGUAGE_SYSTEM );
+ rOut.Push(PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE);
+ rOut.SetLayoutMode(ComplexTextLayoutFlags::Default);
+ rOut.SetDigitLanguage(LANGUAGE_SYSTEM);
- SAL_INFO( "vcl.gdi", "GDIMetaFile::Play on device of size: " << pOut->GetOutputSizePixel().Width() << " " << pOut->GetOutputSizePixel().Height());
+ SAL_INFO( "vcl.gdi", "GDIMetaFile::Play on device of size: " << rOut.GetOutputSizePixel().Width() << " " << rOut.GetOutputSizePixel().Height());
- if( !ImplPlayWithRenderer( pOut, Point(0,0), pOut->GetOutputSize() ) ) {
+ if (!ImplPlayWithRenderer(rOut, Point(0,0), rOut.GetOutputSize())) {
size_t i = 0;
for( size_t nCurPos = m_nCurrentActionElement; nCurPos < nPos; nCurPos++ )
{
if( pAction )
{
- pAction->Execute( pOut );
+ pAction->Execute(&rOut);
// flush output from time to time
if( i++ > nSyncCount )
{
- pOut->Flush();
+ rOut.Flush();
i = 0;
}
}
@@ -382,17 +382,17 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos )
pAction = NextAction();
}
}
- pOut->Pop();
+ rOut.Pop();
}
-bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, Size rLogicDestSize )
+bool GDIMetaFile::ImplPlayWithRenderer(OutputDevice& rOut, const Point& rPos, Size rLogicDestSize)
{
if (!m_bUseCanvas)
return false;
- Size rDestSize( pOut->LogicToPixel( rLogicDestSize ) );
+ Size rDestSize(rOut.LogicToPixel(rLogicDestSize));
- const vcl::Window* win = pOut->GetOwnerWindow();
+ const vcl::Window* win = rOut.GetOwnerWindow();
if (!win)
win = Application::GetActiveTopWindow();
@@ -432,10 +432,10 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
BitmapEx aBitmapEx;
if( aBitmapEx.Create( xBitmapCanvas, aSize ) )
{
- if (pOut->GetMapMode().GetMapUnit() == MapUnit::MapPixel)
- pOut->DrawBitmapEx( rPos, aBitmapEx );
+ if (rOut.GetMapMode().GetMapUnit() == MapUnit::MapPixel)
+ rOut.DrawBitmapEx( rPos, aBitmapEx );
else
- pOut->DrawBitmapEx( rPos, rLogicDestSize, aBitmapEx );
+ rOut.DrawBitmapEx( rPos, rLogicDestSize, aBitmapEx );
return true;
}
}
@@ -454,21 +454,21 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
return false;
}
-void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
- const Size& rSize )
+void GDIMetaFile::Play(OutputDevice& rOut, const Point& rPos,
+ const Size& rSize)
{
MapMode aDrawMap( GetPrefMapMode() );
- Size aDestSize( pOut->LogicToPixel( rSize ) );
+ Size aDestSize(rOut.LogicToPixel(rSize));
if( !aDestSize.Width() || !aDestSize.Height() )
return;
- GDIMetaFile* pMtf = pOut->GetConnectMetaFile();
+ GDIMetaFile* pMtf = rOut.GetConnectMetaFile();
- if( ImplPlayWithRenderer( pOut, rPos, rSize ) )
+ if (ImplPlayWithRenderer(rOut, rPos, rSize))
return;
- Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) );
+ Size aTmpPrefSize(rOut.LogicToPixel(GetPrefSize(), aDrawMap));
if( !aTmpPrefSize.Width() )
aTmpPrefSize.setWidth( aDestSize.Width() );
@@ -485,35 +485,34 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos,
// #i47260# Convert logical output position to offset within
// the metafile's mapmode. Therefore, disable pixel offset on
// outdev, it's inverse mnOutOffLogicX/Y is calculated for a
- // different mapmode (the one currently set on pOut, that is)
+ // different mapmode (the one currently set on rOut, that is)
// - thus, aDrawMap's origin would generally be wrong. And
// even _if_ aDrawMap is similar to pOutDev's current mapmode,
// it's _still_ undesirable to have pixel offset unequal zero,
// because one would still get round-off errors (the
// round-trip error for LogicToPixel( PixelToLogic() ) was the
// reason for having pixel offset in the first place).
- const Size& rOldOffset( pOut->GetPixelOffset() );
+ const Size& rOldOffset(rOut.GetPixelOffset());
const Size aEmptySize;
- pOut->SetPixelOffset( aEmptySize );
- aDrawMap.SetOrigin( pOut->PixelToLogic( pOut->LogicToPixel( rPos ), aDrawMap ) );
- pOut->SetPixelOffset( rOldOffset );
+ rOut.SetPixelOffset(aEmptySize);
+ aDrawMap.SetOrigin(rOut.PixelToLogic(rOut.LogicToPixel(rPos), aDrawMap));
+ rOut.SetPixelOffset(rOldOffset);
- pOut->Push();
+ rOut.Push();
bool bIsRecord = (pMtf && pMtf->IsRecord());
- pOut->SetMetafileMapMode(aDrawMap, bIsRecord);
+ rOut.SetMetafileMapMode(aDrawMap, bIsRecord);
// #i23407# Set backwards-compatible text language and layout mode
// This is necessary, since old metafiles don't even know of these
// recent add-ons. Newer metafiles must of course explicitly set
// those states.
- pOut->SetLayoutMode( ComplexTextLayoutFlags::Default );
- pOut->SetDigitLanguage( LANGUAGE_SYSTEM );
+ rOut.SetLayoutMode(ComplexTextLayoutFlags::Default);
+ rOut.SetDigitLanguage(LANGUAGE_SYSTEM);
- Play( pOut );
-
- pOut->Pop();
+ Play(rOut);
+ rOut.Pop();
}
void GDIMetaFile::Pause( bool _bPause )
@@ -2826,7 +2825,7 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConve
// draw metafile into VDev
const_cast<GDIMetaFile *>(this)->WindStart();
- const_cast<GDIMetaFile *>(this)->Play(aVDev.get(), Point(), aAntialias);
+ const_cast<GDIMetaFile *>(this)->Play(*aVDev, Point(), aAntialias);
// get paint bitmap
BitmapEx aBitmap( aVDev->GetBitmapEx( aNullPt, aVDev->GetOutputSizePixel() ) );
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index df961fba47f2..5e71e5d1a0d4 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -34,23 +34,23 @@ using namespace ::com::sun::star;
namespace
{
-void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
- vcl::Font* pFont, const BitmapEx* pBitmapEx,
- const Point& rDestPt, const Size& rDestSize )
+void ImplDrawDefault(OutputDevice& rOutDev, const OUString* pText,
+ vcl::Font* pFont, const BitmapEx* pBitmapEx,
+ const Point& rDestPt, const Size& rDestSize)
{
- sal_uInt16 nPixel = static_cast<sal_uInt16>(pOutDev->PixelToLogic( Size( 1, 1 ) ).Width());
+ sal_uInt16 nPixel = static_cast<sal_uInt16>(rOutDev.PixelToLogic( Size( 1, 1 ) ).Width());
sal_uInt16 nPixelWidth = nPixel;
Point aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
Size aSize( rDestSize.Width() - ( nPixelWidth << 1 ), rDestSize.Height() - ( nPixelWidth << 1 ) );
bool bFilled = ( pBitmapEx != nullptr || pFont != nullptr );
tools::Rectangle aBorderRect( aPoint, aSize );
- pOutDev->Push();
+ rOutDev.Push();
- pOutDev->SetFillColor();
+ rOutDev.SetFillColor();
// On the printer a black rectangle and on the screen one with 3D effect
- pOutDev->DrawBorder(aBorderRect);
+ rOutDev.DrawBorder(aBorderRect);
aPoint.AdjustX(nPixelWidth + 2*nPixel );
aPoint.AdjustY(nPixelWidth + 2*nPixel );
@@ -59,20 +59,20 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
if( !aSize.IsEmpty() && pBitmapEx && !pBitmapEx->IsEmpty() )
{
- Size aBitmapSize( pOutDev->PixelToLogic( pBitmapEx->GetSizePixel() ) );
+ Size aBitmapSize( rOutDev.PixelToLogic( pBitmapEx->GetSizePixel() ) );
if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > aBitmapSize.Width() )
{
- pOutDev->DrawBitmapEx( aPoint, *pBitmapEx );
+ rOutDev.DrawBitmapEx( aPoint, *pBitmapEx );
aPoint.AdjustX(aBitmapSize.Width() + 2*nPixel );
aSize.AdjustWidth( -(aBitmapSize.Width() + 2*nPixel) );
}
}
- if ( !aSize.IsEmpty() && pFont && pText && pText->getLength() && pOutDev->IsOutputEnabled() )
+ if ( !aSize.IsEmpty() && pFont && pText && pText->getLength() && rOutDev.IsOutputEnabled() )
{
MapMode aMapMode( MapUnit::MapPoint );
- Size aSz = pOutDev->LogicToLogic( Size( 0, 12 ), &aMapMode, nullptr );
+ Size aSz = rOutDev.LogicToLogic( Size( 0, 12 ), &aMapMode, nullptr );
tools::Long nThreshold = aSz.Height() / 2;
tools::Long nStep = nThreshold / 3;
@@ -82,10 +82,10 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
for(;; aSz.AdjustHeight( -nStep ) )
{
pFont->SetFontSize( aSz );
- pOutDev->SetFont( *pFont );
+ rOutDev.SetFont( *pFont );
- tools::Long nTextHeight = pOutDev->GetTextHeight();
- tools::Long nTextWidth = pOutDev->GetTextWidth( *pText );
+ tools::Long nTextHeight = rOutDev.GetTextHeight();
+ tools::Long nTextWidth = rOutDev.GetTextWidth( *pText );
if ( nTextHeight )
{
// The approximation does not respect imprecisions caused
@@ -111,7 +111,7 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
nNext++;
while ( nStart+nNext < pText->getLength() && (*pText)[nStart+nNext] != ' ' )
nNext++;
- nTextWidth = pOutDev->GetTextWidth( *pText, nStart, nNext );
+ nTextWidth = rOutDev.GetTextWidth( *pText, nStart, nNext );
if ( nTextWidth > aSize.Width() )
break;
nLen = nNext;
@@ -119,10 +119,10 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
while ( nStart+nNext < pText->getLength() );
sal_Int32 n = nLen;
- nTextWidth = pOutDev->GetTextWidth( *pText, nStart, n );
+ nTextWidth = rOutDev.GetTextWidth( *pText, nStart, n );
while( nTextWidth > aSize.Width() )
- nTextWidth = pOutDev->GetTextWidth( *pText, nStart, --n );
- pOutDev->DrawText( aPoint, *pText, nStart, n );
+ nTextWidth = rOutDev.GetTextWidth( *pText, nStart, --n );
+ rOutDev.DrawText( aPoint, *pText, nStart, n );
aPoint.AdjustY(nTextHeight );
nStart = sal::static_int_cast<sal_uInt16>(nStart + nLen);
@@ -149,12 +149,12 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText,
aBorderRect.AdjustRight( -1 );
aBorderRect.AdjustBottom( -1 );
- pOutDev->SetLineColor( COL_LIGHTRED );
- pOutDev->DrawLine( aBorderRect.TopLeft(), aBorderRect.BottomRight() );
- pOutDev->DrawLine( aBorderRect.TopRight(), aBorderRect.BottomLeft() );
+ rOutDev.SetLineColor( COL_LIGHTRED );
+ rOutDev.DrawLine( aBorderRect.TopLeft(), aBorderRect.BottomRight() );
+ rOutDev.DrawLine( aBorderRect.TopRight(), aBorderRect.BottomLeft() );
}
- pOutDev->Pop();
+ rOutDev.Pop();
}
} // end anonymous namespace
@@ -424,33 +424,33 @@ sal_uLong Graphic::GetSizeBytes() const
return mxImpGraphic->getSizeBytes();
}
-void Graphic::Draw( OutputDevice* pOutDev, const Point& rDestPt ) const
+void Graphic::Draw(OutputDevice& rOutDev, const Point& rDestPt) const
{
- mxImpGraphic->draw( pOutDev, rDestPt );
+ mxImpGraphic->draw(rOutDev, rDestPt);
}
-void Graphic::Draw( OutputDevice* pOutDev,
- const Point& rDestPt, const Size& rDestSz ) const
+void Graphic::Draw(OutputDevice& rOutDev, const Point& rDestPt,
+ const Size& rDestSz) const
{
if( GraphicType::Default == mxImpGraphic->getType() )
- ImplDrawDefault( pOutDev, nullptr, nullptr, nullptr, rDestPt, rDestSz );
+ ImplDrawDefault(rOutDev, nullptr, nullptr, nullptr, rDestPt, rDestSz);
else
- mxImpGraphic->draw( pOutDev, rDestPt, rDestSz );
+ mxImpGraphic->draw(rOutDev, rDestPt, rDestSz);
}
-void Graphic::DrawEx( OutputDevice* pOutDev, const OUString& rText,
- vcl::Font& rFont, const BitmapEx& rBitmap,
- const Point& rDestPt, const Size& rDestSz )
+void Graphic::DrawEx(OutputDevice& rOutDev, const OUString& rText,
+ vcl::Font& rFont, const BitmapEx& rBitmap,
+ const Point& rDestPt, const Size& rDestSz)
{
- ImplDrawDefault( pOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz );
+ ImplDrawDefault(rOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz);
}
-void Graphic::StartAnimation( OutputDevice* pOutDev, const Point& rDestPt,
- const Size& rDestSz, tools::Long nExtraData,
- OutputDevice* pFirstFrameOutDev )
+void Graphic::StartAnimation(OutputDevice& rOutDev, const Point& rDestPt,
+ const Size& rDestSz, tools::Long nExtraData,
+ OutputDevice* pFirstFrameOutDev)
{
ImplTestRefCount();
- mxImpGraphic->startAnimation( pOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev );
+ mxImpGraphic->startAnimation(rOutDev, rDestPt, rDestSz, nExtraData, pFirstFrameOutDev);
}
void Graphic::StopAnimation( const OutputDevice* pOutDev, tools::Long nExtraData )
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 6035771877dd..9d04ab7bde12 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -619,7 +619,7 @@ Bitmap ImpGraphic::getBitmap(const GraphicConversionParameters& rParameters) con
aVDev->SetAntialiasing(aVDev->GetAntialiasing() | AntialiasingFlags::PixelSnapHairline);
}
- draw( aVDev.get(), Point(), aDrawSize );
+ draw(*aVDev, Point(), aDrawSize);
// use maBitmapEx as local buffer for rendered metafile
const_cast< ImpGraphic* >(this)->maBitmapEx = aVDev->GetBitmapEx( Point(), aVDev->GetOutputSizePixel() );
@@ -1001,7 +1001,7 @@ sal_uLong ImpGraphic::getSizeBytes() const
return mnSizeBytes;
}
-void ImpGraphic::draw(OutputDevice* pOutDev, const Point& rDestPt) const
+void ImpGraphic::draw(OutputDevice& rOutDev, const Point& rDestPt) const
{
ensureAvailable();
@@ -1020,18 +1020,18 @@ void ImpGraphic::draw(OutputDevice* pOutDev, const Point& rDestPt) const
if (mpAnimation)
{
- mpAnimation->Draw(pOutDev, rDestPt);
+ mpAnimation->Draw(rOutDev, rDestPt);
}
else
{
- maBitmapEx.Draw(pOutDev, rDestPt);
+ maBitmapEx.Draw(&rOutDev, rDestPt);
}
}
break;
case GraphicType::GdiMetafile:
{
- draw(pOutDev, rDestPt, maMetaFile.GetPrefSize());
+ draw(rOutDev, rDestPt, maMetaFile.GetPrefSize());
}
break;
@@ -1041,8 +1041,8 @@ void ImpGraphic::draw(OutputDevice* pOutDev, const Point& rDestPt) const
}
}
-void ImpGraphic::draw(OutputDevice* pOutDev,
- const Point& rDestPt, const Size& rDestSize) const
+void ImpGraphic::draw(OutputDevice& rOutDev,
+ const Point& rDestPt, const Size& rDestSize) const
{
ensureAvailable();
@@ -1061,11 +1061,11 @@ void ImpGraphic::draw(OutputDevice* pOutDev,
if (mpAnimation)
{
- mpAnimation->Draw(pOutDev, rDestPt, rDestSize);
+ mpAnimation->Draw(rOutDev, rDestPt, rDestSize);
}
else
{
- maBitmapEx.Draw(pOutDev, rDestPt, rDestSize);
+ maBitmapEx.Draw(&rOutDev, rDestPt, rDestSize);
}
}
break;
@@ -1073,7 +1073,7 @@ void ImpGraphic::draw(OutputDevice* pOutDev,
case GraphicType::GdiMetafile:
{
const_cast<ImpGraphic*>(this)->maMetaFile.WindStart();
- const_cast<ImpGraphic*>(this)->maMetaFile.Play(pOutDev, rDestPt, rDestSize);
+ const_cast<ImpGraphic*>(this)->maMetaFile.Play(rOutDev, rDestPt, rDestSize);
const_cast<ImpGraphic*>(this)->maMetaFile.WindStart();
}
break;
@@ -1084,14 +1084,14 @@ void ImpGraphic::draw(OutputDevice* pOutDev,
}
}
-void ImpGraphic::startAnimation( OutputDevice* pOutDev, const Point& rDestPt,
- const Size& rDestSize, tools::Long nExtraData,
- OutputDevice* pFirstFrameOutDev )
+void ImpGraphic::startAnimation(OutputDevice& rOutDev, const Point& rDestPt,
+ const Size& rDestSize, tools::Long nExtraData,
+ OutputDevice* pFirstFrameOutDev )
{
ensureAvailable();
if( isSupportedGraphic() && !isSwappedOut() && mpAnimation )
- mpAnimation->Start( pOutDev, rDestPt, rDestSize, nExtraData, pFirstFrameOutDev );
+ mpAnimation->Start(rOutDev, rDestPt, rDestSize, nExtraData, pFirstFrameOutDev);
}
void ImpGraphic::stopAnimation( const OutputDevice* pOutDev, tools::Long nExtraData )
diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx
index 05a6f9bbee2e..8423bbb1e37f 100644
--- a/vcl/source/gdi/oldprintadaptor.cxx
+++ b/vcl/source/gdi/oldprintadaptor.cxx
@@ -105,7 +105,7 @@ void OldStylePrintAdaptor::printPage( int i_nPage ) const
if( i_nPage < int(mpData->maPages.size()) )
{
mpData->maPages[ i_nPage ].maPage.WindStart();
- mpData->maPages[ i_nPage ].maPage.Play( getPrinter().get() );
+ mpData->maPages[ i_nPage ].maPage.Play(*getPrinter());
}
}
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 878915e650c7..9d486e1aaa4f 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -485,7 +485,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
// create paint bitmap
aTmpMtf.WindStart();
- aTmpMtf.Play( xVDev.get(), aPoint, aDstSize );
+ aTmpMtf.Play(*xVDev, aPoint, aDstSize);
aTmpMtf.WindStart();
xVDev->EnableMapMode( false );
@@ -499,7 +499,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa
xVDev->SetDrawMode( DrawModeFlags::WhiteLine | DrawModeFlags::WhiteFill | DrawModeFlags::WhiteText |
DrawModeFlags::WhiteBitmap | DrawModeFlags::WhiteGradient );
aTmpMtf.WindStart();
- aTmpMtf.Play( xVDev.get(), aPoint, aDstSize );
+ aTmpMtf.Play(*xVDev, aPoint, aDstSize);
aTmpMtf.WindStart();
xVDev->EnableMapMode( false );
aMask = xVDev->GetBitmap( aPoint, aDstSizePixel );
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 1cc0ce8c1c93..fbbde7b5d770 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1345,7 +1345,7 @@ void PrinterController::printFilteredPage( int i_nPage )
mpImplData->mxPrinter->Push();
aCleanedFile.WindStart();
- aCleanedFile.Play( mpImplData->mxPrinter.get() );
+ aCleanedFile.Play(*mpImplData->mxPrinter);
mpImplData->mxPrinter->Pop();
mpImplData->mxPrinter->ImplEndPage();
diff --git a/vcl/source/graphic/GraphicObject.cxx b/vcl/source/graphic/GraphicObject.cxx
index b127b2d03c3d..c8230fd02555 100644
--- a/vcl/source/graphic/GraphicObject.cxx
+++ b/vcl/source/graphic/GraphicObject.cxx
@@ -96,8 +96,8 @@ void SearchForGraphics(uno::Reference<uno::XInterface> const & xInterface,
namespace
{
-bool lclDrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- GraphicObject const & rObj, const GraphicAttr& rAttr)
+bool lclDrawObj(OutputDevice& rOut, const Point& rPt, const Size& rSz,
+ GraphicObject const & rObj, const GraphicAttr& rAttr)
{
Point aPt( rPt );
Size aSz( rSz );
@@ -122,7 +122,7 @@ bool lclDrawObj( OutputDevice* pOut, const Point& rPt, const Size& rSz,
aSz = aRotBoundRect.GetSize();
}
- aGraphic.Draw( pOut, aPt, aSz );
+ aGraphic.Draw(rOut, aPt, aSz);
}
bRet = true;
@@ -345,8 +345,8 @@ bool GraphicObject::IsEPS() const
return maGraphic.IsEPS();
}
-bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
- tools::PolyPolygon& rClipPolyPoly, bool& bRectClipRegion ) const
+bool GraphicObject::ImplGetCropParams(const OutputDevice& rOut, Point& rPt, Size& rSz, const GraphicAttr* pAttr,
+ tools::PolyPolygon& rClipPolyPoly, bool& bRectClipRegion) const
{
bool bRet = false;
@@ -374,7 +374,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si
else
{
MapMode m(maGraphic.GetPrefMapMode());
- aSize100 = pOut->LogicToLogic( maGraphic.GetPrefSize(), &m, &aMap100 );
+ aSize100 = rOut.LogicToLogic( maGraphic.GetPrefSize(), &m, &aMap100 );
}
nTotalWidth = aSize100.Width() - pAttr->GetLeftCrop() - pAttr->GetRightCrop();
@@ -456,17 +456,17 @@ void GraphicObject::SetUserData( const OUString& rUserData )
maUserData = rUserData;
}
-bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- const GraphicAttr* pAttr )
+bool GraphicObject::Draw(OutputDevice& rOut, const Point& rPt, const Size& rSz,
+ const GraphicAttr* pAttr)
{
GraphicAttr aAttr( pAttr ? *pAttr : GetAttr() );
Point aPt( rPt );
Size aSz( rSz );
- const DrawModeFlags nOldDrawMode = pOut->GetDrawMode();
+ const DrawModeFlags nOldDrawMode = rOut.GetDrawMode();
bool bCropped = aAttr.IsCropped();
bool bRet;
- pOut->SetDrawMode( nOldDrawMode & ~DrawModeFlags( DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill | DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient ) );
+ rOut.SetDrawMode(nOldDrawMode & ~DrawModeFlags( DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill | DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient ));
// mirrored horizontally
if( aSz.Width() < 0 )
@@ -488,9 +488,9 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
{
tools::PolyPolygon aClipPolyPoly;
bool bRectClip;
- const bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
+ const bool bCrop = ImplGetCropParams(rOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip);
- pOut->Push( PushFlags::CLIPREGION );
+ rOut.Push(PushFlags::CLIPREGION);
if( bCrop )
{
@@ -499,36 +499,36 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
// #i29534# Store crop rect for later forwarding to
// PDF writer
tools::Rectangle aCropRect = aClipPolyPoly.GetBoundRect();
- pOut->IntersectClipRegion( aCropRect );
+ rOut.IntersectClipRegion(aCropRect);
}
else
{
- pOut->IntersectClipRegion(vcl::Region(aClipPolyPoly));
+ rOut.IntersectClipRegion(vcl::Region(aClipPolyPoly));
}
}
}
- bRet = lclDrawObj(pOut, aPt, aSz, *this, aAttr);
+ bRet = lclDrawObj(rOut, aPt, aSz, *this, aAttr);
if( bCropped )
- pOut->Pop();
+ rOut.Pop();
- pOut->SetDrawMode( nOldDrawMode );
+ rOut.SetDrawMode( nOldDrawMode );
return bRet;
}
-void GraphicObject::DrawTiled( OutputDevice* pOut, const tools::Rectangle& rArea, const Size& rSize,
- const Size& rOffset, int nTileCacheSize1D )
+void GraphicObject::DrawTiled(OutputDevice& rOut, const tools::Rectangle& rArea, const Size& rSize,
+ const Size& rOffset, int nTileCacheSize1D)
{
- if( pOut == nullptr || rSize.IsEmpty() )
+ if (rSize.IsEmpty())
return;
- const MapMode aOutMapMode( pOut->GetMapMode() );
+ const MapMode aOutMapMode(rOut.GetMapMode());
// #106258# Clamp size to 1 for zero values. This is okay, since
// logical size of zero is handled above already
- const Size aOutTileSize( ::std::max( tools::Long(1), pOut->LogicToPixel( rSize, aOutMapMode ).Width() ),
- ::std::max( tools::Long(1), pOut->LogicToPixel( rSize, aOutMapMode ).Height() ) );
+ const Size aOutTileSize( ::std::max( tools::Long(1), rOut.LogicToPixel( rSize, aOutMapMode ).Width() ),
+ ::std::max( tools::Long(1), rOut.LogicToPixel( rSize, aOutMapMode ).Height() ) );
//#i69780 clip final tile size to a sane max size
while ((static_cast<sal_Int64>(rSize.Width()) * nTileCacheSize1D) > SAL_MAX_UINT16)
@@ -536,12 +536,12 @@ void GraphicObject::DrawTiled( OutputDevice* pOut, const tools::Rectangle& rArea
while ((static_cast<sal_Int64>(rSize.Height()) * nTileCacheSize1D) > SAL_MAX_UINT16)
nTileCacheSize1D /= 2;
- ImplDrawTiled( pOut, rArea, aOutTileSize, rOffset, nullptr, nTileCacheSize1D );
+ ImplDrawTiled(rOut, rArea, aOutTileSize, rOffset, nullptr, nTileCacheSize1D);
}
-bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const Size& rSz,
- tools::Long nExtraData,
- OutputDevice* pFirstFrameOutDev )
+bool GraphicObject::StartAnimation(OutputDevice& rOut, const Point& rPt, const Size& rSz,
+ tools::Long nExtraData,
+ OutputDevice* pFirstFrameOutDev)
{
bool bRet = false;
@@ -559,16 +559,16 @@ bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const
{
tools::PolyPolygon aClipPolyPoly;
bool bRectClip;
- const bool bCrop = ImplGetCropParams( pOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip );
+ const bool bCrop = ImplGetCropParams(rOut, aPt, aSz, &aAttr, aClipPolyPoly, bRectClip);
- pOut->Push( PushFlags::CLIPREGION );
+ rOut.Push(PushFlags::CLIPREGION);
if( bCrop )
{
if( bRectClip )
- pOut->IntersectClipRegion( aClipPolyPoly.GetBoundRect() );
+ rOut.IntersectClipRegion(aClipPolyPoly.GetBoundRect());
else
- pOut->IntersectClipRegion(vcl::Region(aClipPolyPoly));
+ rOut.IntersectClipRegion(vcl::Region(aClipPolyPoly));
}
}
@@ -578,15 +578,15 @@ bool GraphicObject::StartAnimation( OutputDevice* pOut, const Point& rPt, const
mxSimpleCache->maGraphic.SetAnimationNotifyHdl(GetGraphic().GetAnimationNotifyHdl());
}
- mxSimpleCache->maGraphic.StartAnimation(pOut, aPt, aSz, nExtraData, pFirstFrameOutDev);
+ mxSimpleCache->maGraphic.StartAnimation(rOut, aPt, aSz, nExtraData, pFirstFrameOutDev);
if( bCropped )
- pOut->Pop();
+ rOut.Pop();
bRet = true;
}
else
- bRet = Draw( pOut, rPt, rSz, &aAttr );
+ bRet = Draw(rOut, rPt, rSz, &aAttr);
return bRet;
}
diff --git a/vcl/source/graphic/GraphicObject2.cxx b/vcl/source/graphic/GraphicObject2.cxx
index e5b994f72b83..b19fc5e10f02 100644
--- a/vcl/source/graphic/GraphicObject2.cxx
+++ b/vcl/source/graphic/GraphicObject2.cxx
@@ -169,7 +169,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
Point aCurrPos(aTileInfo.aNextTileTopLeft.X(), aTileInfo.aTileTopLeft.Y());
for (int nX=0; nX < aTileInfo.nTilesEmptyX; nX += nMSBFactor)
{
- if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr))
+ if (!pTileGraphic->Draw(rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr))
return false;
aCurrPos.AdjustX(aTileInfo.aTileSizePixel.Width() );
@@ -190,7 +190,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
aCurrPos.setY( aTileInfo.aNextTileTopLeft.Y() );
for (int nY=0; nY < aTileInfo.nTilesEmptyY; nY += nMSBFactor)
{
- if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr))
+ if (!pTileGraphic->Draw(rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr))
return false;
aCurrPos.AdjustY(aTileInfo.aTileSizePixel.Height() );
@@ -250,7 +250,7 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
{
if( bNoFirstTileDraw )
bNoFirstTileDraw = false; // don't draw first tile position
- else if (!pTileGraphic->Draw(&rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr))
+ else if (!pTileGraphic->Draw(rVDev, aCurrPos, aTileInfo.aTileSizePixel, pAttr))
return false;
aCurrPos.AdjustX(aTileInfo.aTileSizePixel.Width() );
@@ -272,10 +272,10 @@ bool GraphicObject::ImplRenderTileRecursive( VirtualDevice& rVDev, int nExponent
return true;
}
-bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const tools::Rectangle& rArea, const Size& rSizePixel,
- const Size& rOffset, const GraphicAttr* pAttr, int nTileCacheSize1D )
+bool GraphicObject::ImplDrawTiled(OutputDevice& rOut, const tools::Rectangle& rArea, const Size& rSizePixel,
+ const Size& rOffset, const GraphicAttr* pAttr, int nTileCacheSize1D)
{
- const MapMode aOutMapMode( pOut->GetMapMode() );
+ const MapMode aOutMapMode(rOut.GetMapMode());
const MapMode aMapMode( aOutMapMode.GetMapUnit(), Point(), aOutMapMode.GetScaleX(), aOutMapMode.GetScaleY() );
bool bRet( false );
@@ -327,15 +327,15 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const tools::Rectangle& r
// paint generated tile
GraphicObject aTmpGraphic( aTileBitmap );
- bRet = aTmpGraphic.ImplDrawTiled( pOut, rArea,
- aTileBitmap.GetSizePixel(),
- rOffset, pAttr, nTileCacheSize1D );
+ bRet = aTmpGraphic.ImplDrawTiled(rOut, rArea,
+ aTileBitmap.GetSizePixel(),
+ rOffset, pAttr, nTileCacheSize1D);
}
}
else
{
- const Size aOutOffset( pOut->LogicToPixel( rOffset, aOutMapMode ) );
- const tools::Rectangle aOutArea( pOut->LogicToPixel( rArea, aOutMapMode ) );
+ const Size aOutOffset( rOut.LogicToPixel( rOffset, aOutMapMode ) );
+ const tools::Rectangle aOutArea( rOut.LogicToPixel( rArea, aOutMapMode ) );
// number of invisible (because out-of-area) tiles
int nInvisibleTilesX;
@@ -354,24 +354,24 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const tools::Rectangle& r
nInvisibleTilesY = aOutOffset.Height() / rSizePixel.Height();
// origin from where to 'virtually' start drawing in pixel
- const Point aOutOrigin( pOut->LogicToPixel( Point( rArea.Left() - rOffset.Width(),
+ const Point aOutOrigin( rOut.LogicToPixel( Point( rArea.Left() - rOffset.Width(),
rArea.Top() - rOffset.Height() ) ) );
// position in pixel from where to really start output
const Point aOutStart( aOutOrigin.X() + nInvisibleTilesX*rSizePixel.Width(),
aOutOrigin.Y() + nInvisibleTilesY*rSizePixel.Height() );
- pOut->Push( PushFlags::CLIPREGION );
- pOut->IntersectClipRegion( rArea );
+ rOut.Push( PushFlags::CLIPREGION );
+ rOut.IntersectClipRegion( rArea );
// Paint all tiles
- bRet = ImplDrawTiled( *pOut, aOutStart,
- (aOutArea.GetWidth() + aOutArea.Left() - aOutStart.X() + rSizePixel.Width() - 1) / rSizePixel.Width(),
- (aOutArea.GetHeight() + aOutArea.Top() - aOutStart.Y() + rSizePixel.Height() - 1) / rSizePixel.Height(),
- rSizePixel, pAttr );
+ bRet = ImplDrawTiled(rOut, aOutStart,
+ (aOutArea.GetWidth() + aOutArea.Left() - aOutStart.X() + rSizePixel.Width() - 1) / rSizePixel.Width(),
+ (aOutArea.GetHeight() + aOutArea.Top() - aOutStart.Y() + rSizePixel.Height() - 1) / rSizePixel.Height(),
+ rSizePixel, pAttr);
- pOut->Pop();
+ rOut.Pop();
}
return bRet;
@@ -408,10 +408,10 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel,
// update return value. This method should return true, if
// at least one of the looped Draws succeeded.
- bRet |= Draw( &rOut,
- bDrawInPixel ? aCurrPos : rOut.PixelToLogic( aCurrPos ),
- bDrawInPixel ? rTileSizePixel : aTileSizeLogic,
- pAttr );
+ bRet |= Draw(rOut,
+ bDrawInPixel ? aCurrPos : rOut.PixelToLogic(aCurrPos),
+ bDrawInPixel ? rTileSizePixel : aTileSizeLogic,
+ pAttr);
aCurrPos.AdjustX(rTileSizePixel.Width() );
}
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index 70ec9616ace7..71ec101f4dd1 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -704,7 +704,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
GDIMetaFile* pOldMetaFile = mpMetaFile;
mpMetaFile = nullptr;
- Graphic( *pSubst ).Draw( this, rPoint, rSize );
+ Graphic(*pSubst).Draw(*this, rPoint, rSize);
mpMetaFile = pOldMetaFile;
}
}
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index 10bfa5592f51..28e70a6f0f49 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -623,7 +623,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
( mnDrawMode & DrawModeFlags::NoTransparency ) )
{
const_cast<GDIMetaFile&>(rMtf).WindStart();
- const_cast<GDIMetaFile&>(rMtf).Play( this, rPos, rSize );
+ const_cast<GDIMetaFile&>(rMtf).Play(*this, rPos, rSize);
const_cast<GDIMetaFile&>(rMtf).WindStart();
}
else
@@ -679,7 +679,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
// draw MetaFile to buffer
xVDev->EnableMapMode(bBufferMapModeEnabled);
const_cast<GDIMetaFile&>(rMtf).WindStart();
- const_cast<GDIMetaFile&>(rMtf).Play(xVDev.get(), rPos, rSize);
+ const_cast<GDIMetaFile&>(rMtf).Play(*xVDev, rPos, rSize);
const_cast<GDIMetaFile&>(rMtf).WindStart();
// get content bitmap from buffer
@@ -714,7 +714,7 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
// create paint bitmap
const_cast<GDIMetaFile&>(rMtf).WindStart();
- const_cast<GDIMetaFile&>(rMtf).Play( xVDev.get(), rPos, rSize );
+ const_cast<GDIMetaFile&>(rMtf).Play(*xVDev, rPos, rSize);
const_cast<GDIMetaFile&>(rMtf).WindStart();
xVDev->EnableMapMode( false );
BitmapEx aPaint = xVDev->GetBitmapEx(Point(), xVDev->GetOutputSizePixel());
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index d132b034dfe5..b18dba870e93 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1511,7 +1511,7 @@ void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rP
pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel() );
pMaskedDevice->EnableRTL( IsRTLEnabled() );
aMtf.WindStart();
- aMtf.Play( pMaskedDevice );
+ aMtf.Play(*pMaskedDevice);
BitmapEx aBmpEx( pMaskedDevice->GetBitmapEx( Point( 0, 0 ), aPaintRect.GetSize() ) );
i_pTargetOutDev->DrawBitmapEx( i_rPos, aBmpEx );
// get rid of virtual device now so they don't pile up during recursive calls
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index f908bbc5f81e..a9b2a03ab627 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -428,7 +428,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap()
aMtf.WindStart();
aMtf.Scale( fScale, fScale );
aMtf.WindStart();
- aMtf.Play( pPrerenderVDev.get(), Point( 0, 0 ), aLogicSize );
+ aMtf.Play(*pPrerenderVDev, Point(0, 0), aLogicSize);
pPrerenderVDev->SetMapMode(MapMode(MapUnit::MapPixel));
maPreviewBitmap = pPrerenderVDev->GetBitmapEx(Point(0, 0), pPrerenderVDev->GetOutputSizePixel());
diff --git a/vcl/workben/mtfdemo.cxx b/vcl/workben/mtfdemo.cxx
index ef5db6a8e5c7..afdb0192f16f 100644
--- a/vcl/workben/mtfdemo.cxx
+++ b/vcl/workben/mtfdemo.cxx
@@ -61,7 +61,7 @@ public:
void DemoMtfWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
{
- maMtf.Play(GetOutDev(), maMtf.GetActionSize());
+ maMtf.Play(*GetOutDev(), maMtf.GetActionSize());
WorkWindow::Paint(rRenderContext, rRect);
}