[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Nov 28 19:33:10 UTC 2020
include/vcl/outdev.hxx | 8 -
include/vcl/window.hxx | 4
vcl/inc/salgdi.hxx | 75 +++++-----
vcl/source/gdi/salgdilayout.cxx | 244 +++++++++++++++++------------------
vcl/source/gdi/virdev.cxx | 2
vcl/source/outdev/bitmap.cxx | 14 +-
vcl/source/outdev/clipping.cxx | 2
vcl/source/outdev/curvedshapes.cxx | 14 +-
vcl/source/outdev/hatch.cxx | 2
vcl/source/outdev/line.cxx | 8 -
vcl/source/outdev/mask.cxx | 4
vcl/source/outdev/nativecontrols.cxx | 6
vcl/source/outdev/outdev.cxx | 33 ++--
vcl/source/outdev/pixel.cxx | 6
vcl/source/outdev/polygon.cxx | 24 +--
vcl/source/outdev/polyline.cxx | 8 -
vcl/source/outdev/rect.cxx | 18 +-
vcl/source/outdev/text.cxx | 2
vcl/source/outdev/textline.cxx | 18 +-
vcl/source/outdev/transparent.cxx | 2
vcl/source/window/mouse.cxx | 2
vcl/source/window/paint.cxx | 2
vcl/source/window/window.cxx | 22 +--
vcl/source/window/window2.cxx | 12 -
24 files changed, 265 insertions(+), 267 deletions(-)
New commits:
commit 0820920e994cd2281cda34afa2235ee9aa1dd2c2
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Nov 27 12:47:27 2020 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Nov 28 20:32:29 2020 +0100
drawOutDevDirect always passed a non-null OutputDevice*
likewise:
DrawOutDevDirectProcess
ImplDrawWavePixel
DrawOutDevDirectCheck
and various members of SalGraphics dropping redundant nullptr checks
Change-Id: Iaa1ab7c8a605361a7c9cce0aeee974eec9ff246e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106788
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 1b29dddf532b..c11d1abc1875 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -565,11 +565,11 @@ protected:
virtual tools::Rectangle GetBackgroundComponentBounds() const;
- virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice* pSrcDev) const;
+ virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const;
- virtual void DrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics );
+ virtual void DrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics);
- SAL_DLLPRIVATE void drawOutDevDirect ( const OutputDevice* pSrcDev, SalTwoRect& rPosAry );
+ SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice& rSrcDev, SalTwoRect& rPosAry);
SAL_DLLPRIVATE bool is_double_buffered_window() const;
@@ -1206,7 +1206,7 @@ private:
SAL_DLLPRIVATE void ImplDrawSpecialText( SalLayout& );
SAL_DLLPRIVATE void ImplDrawTextRect( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight );
- SAL_DLLPRIVATE static void ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY, tools::Long nCurX, tools::Long nCurY, Degree10 nOrientation, SalGraphics* pGraphics, OutputDevice const * pOutDev,
+ SAL_DLLPRIVATE static void ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY, tools::Long nCurX, tools::Long nCurY, Degree10 nOrientation, SalGraphics* pGraphics, const OutputDevice& rOutDev,
bool bDrawPixAsRect, tools::Long nPixWidth, tools::Long nPixHeight );
SAL_DLLPRIVATE void ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nStartX, tools::Long nStartY, tools::Long nWidth, tools::Long nHeight, tools::Long nLineWidth, Degree10 nOrientation, const Color& rColor );
SAL_DLLPRIVATE void ImplDrawWaveTextLine( tools::Long nBaseX, tools::Long nBaseY, tools::Long nX, tools::Long nY, tools::Long nWidth, FontLineStyle eTextLine, Color aColor, bool bIsAbove );
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 0a378a11f65e..b88f565fcc88 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -760,8 +760,8 @@ protected:
virtual void ImplAdjustNWFSizes();
virtual void CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate) override;
- virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice* pSrcDev) const override;
- virtual void DrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) override;
+ virtual const OutputDevice* DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const override;
+ virtual void DrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics) override;
virtual void ClipToPaintRegion( tools::Rectangle& rDstRect ) override;
virtual bool UsePolyPolygonForComplexGradient() override;
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index 6ed360105d24..89951dc116cf 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -202,39 +202,38 @@ public:
SalLayoutFlags GetLayout() const { return m_nLayout; }
void SetLayout( SalLayoutFlags aLayout ) { m_nLayout = aLayout;}
- void mirror( tools::Long& nX, const OutputDevice *pOutDev ) const;
+ void mirror( tools::Long& nX, const OutputDevice& rOutDev ) const;
// only called mirror2 to avoid ambiguity
- [[nodiscard]]
- tools::Long mirror2( tools::Long nX, const OutputDevice *pOutDev ) const;
+ [[nodiscard]] tools::Long mirror2( tools::Long nX, const OutputDevice& rOutDev ) const;
void mirror( tools::Long& nX, tools::Long nWidth, const OutputDevice *pOutDev, bool bBack = false ) const;
- bool mirror( sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry2, const OutputDevice *pOutDev ) const;
- void mirror( tools::Rectangle& rRect, const OutputDevice*, bool bBack = false ) const;
- void mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const;
- void mirror( ImplControlValue&, const OutputDevice* ) const;
- basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice *pOutDev ) const;
+ bool mirror( sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry2, const OutputDevice& rOutDev ) const;
+ void mirror( tools::Rectangle& rRect, const OutputDevice&, bool bBack = false ) const;
+ void mirror( vcl::Region& rRgn, const OutputDevice& rOutDev ) const;
+ void mirror( ImplControlValue&, const OutputDevice& ) const;
+ basegfx::B2DPolyPolygon mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice& rOutDev ) const;
const basegfx::B2DHomMatrix& getMirror( const OutputDevice *pOutDev ) const;
// non virtual methods; these do possible coordinate mirroring and
// then delegate to protected virtual methods
- bool SetClipRegion( const vcl::Region&, const OutputDevice *pOutDev );
+ bool SetClipRegion( const vcl::Region&, const OutputDevice& rOutDev );
// draw --> LineColor and FillColor and RasterOp and ClipRegion
- void DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice *pOutDev );
- void DrawPixel( tools::Long nX, tools::Long nY, Color nColor, const OutputDevice *pOutDev );
+ void DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice& rOutDev );
+ void DrawPixel( tools::Long nX, tools::Long nY, Color nColor, const OutputDevice& rOutDev );
- void DrawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice *pOutDev );
+ void DrawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice& rOutDev );
- void DrawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice *pOutDev );
+ void DrawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice& rOutDev );
- void DrawPolyLine( sal_uInt32 nPoints, Point const * pPtAry, const OutputDevice *pOutDev );
+ void DrawPolyLine( sal_uInt32 nPoints, Point const * pPtAry, const OutputDevice& rOutDev );
- void DrawPolygon( sal_uInt32 nPoints, const Point* pPtAry, const OutputDevice *pOutDev );
+ void DrawPolygon( sal_uInt32 nPoints, const Point* pPtAry, const OutputDevice& rOutDev );
void DrawPolyPolygon(
sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const Point** pPtAry,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool DrawPolyPolygon(
const basegfx::B2DHomMatrix& rObjectToDevice,
@@ -258,20 +257,20 @@ public:
sal_uInt32 nPoints,
const Point* pPtAry,
const PolyFlags* pFlgAry,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool DrawPolygonBezier(
sal_uInt32 nPoints,
const Point* pPtAry,
const PolyFlags* pFlgAry,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool DrawPolyPolygonBezier(
sal_uInt32 nPoly,
const sal_uInt32* pPoints,
const Point* const* pPtAry,
const PolyFlags* const* pFlgAry,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool DrawGradient(
const tools::PolyPolygon& rPolyPoly,
@@ -285,61 +284,61 @@ public:
tools::Long nDestX, tools::Long nDestY,
tools::Long nSrcX, tools::Long nSrcY,
tools::Long nSrcWidth, tools::Long nSrcHeight,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
// CopyBits and DrawBitmap --> RasterOp and ClipRegion
- // CopyBits() --> pSrcGraphics == NULL, then CopyBits on same Graphics
+ // CopyBits() --> pSrcGraphics == nullptr, then CopyBits on same Graphics
void CopyBits(
const SalTwoRect& rPosAry,
SalGraphics* pSrcGraphics,
- const OutputDevice *pOutDev,
+ const OutputDevice& rOutDev,
const OutputDevice *pSrcOutDev );
void DrawBitmap(
const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
- const OutputDevice *pOutDev );
+ const OutputDevice* pOutDev );
void DrawBitmap(
const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap,
- const OutputDevice *pOutDev );
+ const OutputDevice* pOutDev );
void DrawMask(
const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
Color nMaskColor,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
std::shared_ptr<SalBitmap> GetBitmap(
tools::Long nX, tools::Long nY,
tools::Long nWidth, tools::Long nHeight,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
Color GetPixel(
tools::Long nX, tools::Long nY,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
// invert --> ClipRegion (only Windows)
void Invert(
tools::Long nX, tools::Long nY,
tools::Long nWidth, tools::Long nHeight,
SalInvert nFlags,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
void Invert(
sal_uInt32 nPoints,
const Point* pPtAry,
SalInvert nFlags,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool DrawEPS(
tools::Long nX, tools::Long nY,
tools::Long nWidth, tools::Long nHeight,
void* pPtr,
sal_uInt32 nSize,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
// native widget rendering functions
@@ -356,7 +355,7 @@ public:
const tools::Rectangle& rControlRegion,
const Point& aPos,
bool& rIsInside,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev);
/**
* @see WidgetDrawInterface::drawNativeControl
@@ -368,7 +367,7 @@ public:
ControlState nState,
const ImplControlValue& aValue,
const OUString& aCaption,
- const OutputDevice *pOutDev,
+ const OutputDevice& rOutDev,
const Color& rBackgroundColor = COL_AUTO );
/**
@@ -382,7 +381,7 @@ public:
const ImplControlValue& aValue,
tools::Rectangle &rNativeBoundingRegion,
tools::Rectangle &rNativeContentRegion,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
/**
* @see WidgetDrawInterface::updateSettings
@@ -392,20 +391,20 @@ public:
bool BlendBitmap(
const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool BlendAlphaBitmap(
const SalTwoRect& rPosAry,
const SalBitmap& rSalSrcBitmap,
const SalBitmap& rSalMaskBitmap,
const SalBitmap& rSalAlphaBitmap,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool DrawAlphaBitmap(
const SalTwoRect&,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
bool DrawTransformedBitmap(
const basegfx::B2DPoint& rNull,
@@ -413,13 +412,13 @@ public:
const basegfx::B2DPoint& rY,
const SalBitmap& rSourceBitmap,
const SalBitmap* pAlphaBitmap,
- const OutputDevice* pOutDev );
+ const OutputDevice& rOutDev );
bool DrawAlphaRect(
tools::Long nX, tools::Long nY,
tools::Long nWidth, tools::Long nHeight,
sal_uInt8 nTransparency,
- const OutputDevice *pOutDev );
+ const OutputDevice& rOutDev );
virtual OUString getRenderBackendName() const;
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index 27ce37096c24..37cec5085015 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -136,9 +136,9 @@ bool SalGraphics::drawTransformedBitmap(
return false;
}
-tools::Long SalGraphics::mirror2( tools::Long x, const OutputDevice *pOutDev ) const
+tools::Long SalGraphics::mirror2( tools::Long x, const OutputDevice& rOutDev ) const
{
- mirror(x, pOutDev);
+ mirror(x, rOutDev);
return x;
}
@@ -148,24 +148,24 @@ inline tools::Long SalGraphics::GetDeviceWidth(const OutputDevice* pOutDev) cons
? pOutDev->GetOutputWidthPixel() : GetGraphicsWidth();
}
-void SalGraphics::mirror( tools::Long& x, const OutputDevice *pOutDev ) const
+void SalGraphics::mirror( tools::Long& x, const OutputDevice& rOutDev ) const
{
- const tools::Long w = GetDeviceWidth(pOutDev);
+ const tools::Long w = GetDeviceWidth(&rOutDev);
if( !w )
return;
- if( pOutDev && pOutDev->ImplIsAntiparallel() )
+ if (rOutDev.ImplIsAntiparallel() )
{
// mirror this window back
if( m_nLayout & SalLayoutFlags::BiDiRtl )
{
- tools::Long devX = w - pOutDev->GetOutputWidthPixel() - pOutDev->GetOutOffXPixel(); // re-mirrored mnOutOffX
- x = devX + (x - pOutDev->GetOutOffXPixel());
+ tools::Long devX = w - rOutDev.GetOutputWidthPixel() - rOutDev.GetOutOffXPixel(); // re-mirrored mnOutOffX
+ x = devX + (x - rOutDev.GetOutOffXPixel());
}
else
{
- tools::Long devX = pOutDev->GetOutOffXPixel(); // re-mirrored mnOutOffX
- x = pOutDev->GetOutputWidthPixel() - (x - devX) + pOutDev->GetOutOffXPixel() - 1;
+ tools::Long devX = rOutDev.GetOutOffXPixel(); // re-mirrored mnOutOffX
+ x = rOutDev.GetOutputWidthPixel() - (x - devX) + rOutDev.GetOutOffXPixel() - 1;
}
}
else if( m_nLayout & SalLayoutFlags::BiDiRtl )
@@ -202,31 +202,31 @@ void SalGraphics::mirror( tools::Long& x, tools::Long nWidth, const OutputDevice
x = w-nWidth-x;
}
-bool SalGraphics::mirror( sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry2, const OutputDevice *pOutDev ) const
+bool SalGraphics::mirror( sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry2, const OutputDevice& rOutDev ) const
{
- const tools::Long w = GetDeviceWidth(pOutDev);
+ const tools::Long w = GetDeviceWidth(&rOutDev);
if( w )
{
sal_uInt32 i, j;
- if( pOutDev && pOutDev->ImplIsAntiparallel() )
+ if (rOutDev.ImplIsAntiparallel())
{
// mirror this window back
if( m_nLayout & SalLayoutFlags::BiDiRtl )
{
- tools::Long devX = w - pOutDev->GetOutputWidthPixel() - pOutDev->GetOutOffXPixel(); // re-mirrored mnOutOffX
+ tools::Long devX = w - rOutDev.GetOutputWidthPixel() - rOutDev.GetOutOffXPixel(); // re-mirrored mnOutOffX
for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
{
- pPtAry2[j].setX( devX + (pPtAry[i].getX() - pOutDev->GetOutOffXPixel()) );
+ pPtAry2[j].setX( devX + (pPtAry[i].getX() - rOutDev.GetOutOffXPixel()) );
pPtAry2[j].setY( pPtAry[i].getY() );
}
}
else
{
- tools::Long devX = pOutDev->GetOutOffXPixel(); // re-mirrored mnOutOffX
+ tools::Long devX = rOutDev.GetOutOffXPixel(); // re-mirrored mnOutOffX
for( i=0, j=nPoints-1; i<nPoints; i++,j-- )
{
- pPtAry2[j].setX( pOutDev->GetOutputWidthPixel() - (pPtAry[i].getX() - devX) + pOutDev->GetOutOffXPixel() - 1 );
+ pPtAry2[j].setX( rOutDev.GetOutputWidthPixel() - (pPtAry[i].getX() - devX) + rOutDev.GetOutOffXPixel() - 1 );
pPtAry2[j].setY( pPtAry[i].getY() );
}
}
@@ -245,11 +245,11 @@ bool SalGraphics::mirror( sal_uInt32 nPoints, const Point *pPtAry, Point *pPtAry
return false;
}
-void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const
+void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice& rOutDev ) const
{
if( rRgn.HasPolyPolygonOrB2DPolyPolygon() )
{
- const basegfx::B2DPolyPolygon aPolyPoly(mirror(rRgn.GetAsB2DPolyPolygon(), pOutDev));
+ const basegfx::B2DPolyPolygon aPolyPoly(mirror(rRgn.GetAsB2DPolyPolygon(), rOutDev));
rRgn = vcl::Region(aPolyPoly);
}
@@ -261,7 +261,7 @@ void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const
for (auto & rectangle : aRectangles)
{
- mirror(rectangle, pOutDev);
+ mirror(rectangle, rOutDev);
rRgn.Union(rectangle);
}
@@ -274,7 +274,7 @@ void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const
//while ( bRegionRect )
//{
// Rectangle aRect( Point(nX, nY), Size(nWidth, nHeight) );
- // mirror( aRect, pOutDev, bBack );
+ // mirror( aRect, rOutDev, bBack );
// aMirroredRegion.Union( aRect );
// bRegionRect = rRgn.ImplGetNextRect( aInfo, nX, nY, nWidth, nHeight );
//}
@@ -282,19 +282,19 @@ void SalGraphics::mirror( vcl::Region& rRgn, const OutputDevice *pOutDev ) const
}
}
-void SalGraphics::mirror( tools::Rectangle& rRect, const OutputDevice *pOutDev, bool bBack ) const
+void SalGraphics::mirror( tools::Rectangle& rRect, const OutputDevice& rOutDev, bool bBack ) const
{
tools::Long nWidth = rRect.GetWidth();
tools::Long x = rRect.Left();
tools::Long x_org = x;
- mirror( x, nWidth, pOutDev, bBack );
+ mirror( x, nWidth, &rOutDev, bBack );
rRect.Move( x - x_org, 0 );
}
-basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice* i_pOutDev ) const
+basegfx::B2DPolyPolygon SalGraphics::mirror( const basegfx::B2DPolyPolygon& i_rPoly, const OutputDevice& i_rOutDev ) const
{
- const basegfx::B2DHomMatrix& rMirror(getMirror(i_pOutDev));
+ const basegfx::B2DHomMatrix& rMirror(getMirror(&i_rOutDev));
if(rMirror.isIdentity())
{
@@ -375,75 +375,75 @@ const basegfx::B2DHomMatrix& SalGraphics::getMirror( const OutputDevice* i_pOutD
return m_aLastMirror;
}
-bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice *pOutDev )
+bool SalGraphics::SetClipRegion( const vcl::Region& i_rClip, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
vcl::Region aMirror( i_rClip );
- mirror( aMirror, pOutDev );
+ mirror( aMirror, rOutDev );
return setClipRegion( aMirror );
}
return setClipRegion( i_rClip );
}
-void SalGraphics::DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice *pOutDev )
+void SalGraphics::DrawPixel( tools::Long nX, tools::Long nY, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, rOutDev );
drawPixel( nX, nY );
}
-void SalGraphics::DrawPixel( tools::Long nX, tools::Long nY, Color nColor, const OutputDevice *pOutDev )
+void SalGraphics::DrawPixel( tools::Long nX, tools::Long nY, Color nColor, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, rOutDev );
drawPixel( nX, nY, nColor );
}
-void SalGraphics::DrawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice *pOutDev )
+void SalGraphics::DrawLine( tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
- mirror( nX1, pOutDev );
- mirror( nX2, pOutDev );
+ mirror( nX1, rOutDev );
+ mirror( nX2, rOutDev );
}
drawLine( nX1, nY1, nX2, nY2 );
}
-void SalGraphics::DrawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice *pOutDev )
+void SalGraphics::DrawRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, nWidth, &rOutDev );
drawRect( nX, nY, nWidth, nHeight );
}
-void SalGraphics::DrawPolyLine( sal_uInt32 nPoints, Point const * pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolyLine( sal_uInt32 nPoints, Point const * pPtAry, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
std::unique_ptr<Point[]> pPtAry2(new Point[nPoints]);
- bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
+ bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
drawPolyLine( nPoints, bCopied ? pPtAry2.get() : pPtAry );
}
else
drawPolyLine( nPoints, pPtAry );
}
-void SalGraphics::DrawPolygon( sal_uInt32 nPoints, const Point* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolygon( sal_uInt32 nPoints, const Point* pPtAry, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
std::unique_ptr<Point[]> pPtAry2(new Point[nPoints]);
- bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
+ bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
drawPolygon( nPoints, bCopied ? pPtAry2.get() : pPtAry );
}
else
drawPolygon( nPoints, pPtAry );
}
-void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, const Point** pPtAry, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
// TODO: optimize, reduce new/delete calls
std::unique_ptr<Point*[]> pPtAry2( new Point*[nPoly] );
@@ -452,7 +452,7 @@ void SalGraphics::DrawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints,
{
sal_uLong nPoints = pPoints[i];
pPtAry2[i] = new Point[ nPoints ];
- mirror( nPoints, pPtAry[i], pPtAry2[i], pOutDev );
+ mirror( nPoints, pPtAry[i], pPtAry2[i], rOutDev );
}
drawPolyPolygon( nPoly, pPoints, const_cast<const Point**>(pPtAry2.get()) );
@@ -499,13 +499,13 @@ bool SalGraphics::DrawPolyPolygon(
i_fTransparency);
}
-bool SalGraphics::DrawPolyLineBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry, const OutputDevice* pOutDev )
+bool SalGraphics::DrawPolyLineBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry, const OutputDevice& rOutDev )
{
bool bResult = false;
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
std::unique_ptr<Point[]> pPtAry2(new Point[nPoints]);
- bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
+ bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
bResult = drawPolyLineBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry );
}
else
@@ -513,13 +513,13 @@ bool SalGraphics::DrawPolyLineBezier( sal_uInt32 nPoints, const Point* pPtAry, c
return bResult;
}
-bool SalGraphics::DrawPolygonBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry, const OutputDevice* pOutDev )
+bool SalGraphics::DrawPolygonBezier( sal_uInt32 nPoints, const Point* pPtAry, const PolyFlags* pFlgAry, const OutputDevice& rOutDev )
{
bool bResult = false;
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
std::unique_ptr<Point[]> pPtAry2(new Point[nPoints]);
- bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
+ bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
bResult = drawPolygonBezier( nPoints, bCopied ? pPtAry2.get() : pPtAry, pFlgAry );
}
else
@@ -528,10 +528,10 @@ bool SalGraphics::DrawPolygonBezier( sal_uInt32 nPoints, const Point* pPtAry, co
}
bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i_pPoints,
- const Point* const* i_pPtAry, const PolyFlags* const* i_pFlgAry, const OutputDevice* i_pOutDev )
+ const Point* const* i_pPtAry, const PolyFlags* const* i_pFlgAry, const OutputDevice& i_rOutDev )
{
bool bRet = false;
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (i_pOutDev && i_pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || i_rOutDev.IsRTLEnabled() )
{
// TODO: optimize, reduce new/delete calls
std::unique_ptr<Point*[]> pPtAry2( new Point*[i_nPoly] );
@@ -540,7 +540,7 @@ bool SalGraphics::DrawPolyPolygonBezier( sal_uInt32 i_nPoly, const sal_uInt32* i
{
sal_uLong nPoints = i_pPoints[i];
pPtAry2[i] = new Point[ nPoints ];
- mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_pOutDev );
+ mirror( nPoints, i_pPtAry[i], pPtAry2[i], i_rOutDev );
}
bRet = drawPolyPolygonBezier( i_nPoly, i_pPoints, const_cast<const Point* const *>(pPtAry2.get()), i_pFlgAry );
@@ -610,27 +610,27 @@ bool SalGraphics::DrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon, Sal
void SalGraphics::CopyArea( tools::Long nDestX, tools::Long nDestY,
tools::Long nSrcX, tools::Long nSrcY,
tools::Long nSrcWidth, tools::Long nSrcHeight,
- const OutputDevice *pOutDev )
+ const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
- mirror( nDestX, nSrcWidth, pOutDev );
- mirror( nSrcX, nSrcWidth, pOutDev );
+ mirror( nDestX, nSrcWidth, &rOutDev );
+ mirror( nSrcX, nSrcWidth, &rOutDev );
}
copyArea( nDestX, nDestY, nSrcX, nSrcY, nSrcWidth, nSrcHeight, true/*bWindowInvalidate*/ );
}
void SalGraphics::CopyBits( const SalTwoRect& rPosAry,
- SalGraphics* pSrcGraphics, const OutputDevice *pOutDev, const OutputDevice *pSrcOutDev )
+ SalGraphics* pSrcGraphics, const OutputDevice& rOutDev, const OutputDevice *pSrcOutDev )
{
- if( ( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) ||
+ if( ( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() ) ||
(pSrcGraphics && ( (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) ) ) )
{
SalTwoRect aPosAry2 = rPosAry;
if( (pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl)) || (pSrcOutDev && pSrcOutDev->IsRTLEnabled()) )
mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, pSrcOutDev );
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, &rOutDev );
copyBits( aPosAry2, pSrcGraphics );
}
else
@@ -666,103 +666,103 @@ void SalGraphics::DrawBitmap( const SalTwoRect& rPosAry,
void SalGraphics::DrawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap,
- Color nMaskColor, const OutputDevice *pOutDev )
+ Color nMaskColor, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
SalTwoRect aPosAry2 = rPosAry;
- mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
+ mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, &rOutDev );
drawMask( aPosAry2, rSalBitmap, nMaskColor );
}
else
drawMask( rPosAry, rSalBitmap, nMaskColor );
}
-std::shared_ptr<SalBitmap> SalGraphics::GetBitmap( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice *pOutDev )
+std::shared_ptr<SalBitmap> SalGraphics::GetBitmap( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, nWidth, &rOutDev );
return getBitmap( nX, nY, nWidth, nHeight );
}
-Color SalGraphics::GetPixel( tools::Long nX, tools::Long nY, const OutputDevice *pOutDev )
+Color SalGraphics::GetPixel( tools::Long nX, tools::Long nY, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, rOutDev );
return getPixel( nX, nY );
}
-void SalGraphics::Invert( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags, const OutputDevice *pOutDev )
+void SalGraphics::Invert( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, SalInvert nFlags, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, nWidth, &rOutDev );
invert( nX, nY, nWidth, nHeight, nFlags );
}
-void SalGraphics::Invert( sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags, const OutputDevice *pOutDev )
+void SalGraphics::Invert( sal_uInt32 nPoints, const Point* pPtAry, SalInvert nFlags, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
std::unique_ptr<Point[]> pPtAry2(new Point[nPoints]);
- bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), pOutDev );
+ bool bCopied = mirror( nPoints, pPtAry, pPtAry2.get(), rOutDev );
invert( nPoints, bCopied ? pPtAry2.get() : pPtAry, nFlags );
}
else
invert( nPoints, pPtAry, nFlags );
}
-bool SalGraphics::DrawEPS( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void* pPtr, sal_uInt32 nSize, const OutputDevice *pOutDev )
+bool SalGraphics::DrawEPS( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, void* pPtr, sal_uInt32 nSize, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, nWidth, &rOutDev );
return drawEPS( nX, nY, nWidth, nHeight, pPtr, nSize );
}
-bool SalGraphics::HitTestNativeScrollbar( ControlPart nPart, const tools::Rectangle& rControlRegion,
- const Point& aPos, bool& rIsInside, const OutputDevice *pOutDev )
+bool SalGraphics::HitTestNativeScrollbar(ControlPart nPart, const tools::Rectangle& rControlRegion,
+ const Point& aPos, bool& rIsInside, const OutputDevice& rOutDev)
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
Point pt( aPos );
tools::Rectangle rgn( rControlRegion );
- pt.setX( mirror2( pt.X(), pOutDev ) );
- mirror( rgn, pOutDev );
+ pt.setX( mirror2( pt.X(), rOutDev ) );
+ mirror( rgn, rOutDev );
return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rgn, pt, rIsInside );
}
else
return forWidget()->hitTestNativeControl( ControlType::Scrollbar, nPart, rControlRegion, aPos, rIsInside );
}
-void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev ) const
+void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice& rOutDev ) const
{
switch( rVal.getType() )
{
case ControlType::Slider:
{
SliderValue* pSlVal = static_cast<SliderValue*>(&rVal);
- mirror(pSlVal->maThumbRect,pOutDev);
+ mirror(pSlVal->maThumbRect, rOutDev);
}
break;
case ControlType::Scrollbar:
{
ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(&rVal);
- mirror(pScVal->maThumbRect,pOutDev);
- mirror(pScVal->maButton1Rect,pOutDev);
- mirror(pScVal->maButton2Rect,pOutDev);
+ mirror(pScVal->maThumbRect, rOutDev);
+ mirror(pScVal->maButton1Rect, rOutDev);
+ mirror(pScVal->maButton2Rect, rOutDev);
}
break;
case ControlType::Spinbox:
case ControlType::SpinButtons:
{
SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(&rVal);
- mirror(pSpVal->maUpperRect,pOutDev);
- mirror(pSpVal->maLowerRect,pOutDev);
+ mirror(pSpVal->maUpperRect, rOutDev);
+ mirror(pSpVal->maLowerRect, rOutDev);
}
break;
case ControlType::Toolbar:
{
ToolbarValue* pTVal = static_cast<ToolbarValue*>(&rVal);
- mirror(pTVal->maGripRect,pOutDev);
+ mirror(pTVal->maGripRect, rOutDev);
}
break;
default: break;
@@ -771,7 +771,7 @@ void SalGraphics::mirror( ImplControlValue& rVal, const OutputDevice* pOutDev )
bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue,
- const OUString& aCaption, const OutputDevice *pOutDev,
+ const OUString& aCaption, const OutputDevice& rOutDev,
const Color& rBackgroundColor)
{
bool bRet = false;
@@ -779,11 +779,11 @@ bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
if (aControlRegion.IsEmpty() || aControlRegion.GetWidth() <= 0 || aControlRegion.GetHeight() <= 0)
return bRet;
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
- mirror(aControlRegion, pOutDev);
+ mirror(aControlRegion, rOutDev);
std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
- mirror( *mirrorValue, pOutDev );
+ mirror( *mirrorValue, rOutDev );
bRet = forWidget()->drawNativeControl(nType, nPart, aControlRegion, nState, *mirrorValue, aCaption, rBackgroundColor);
}
else
@@ -796,18 +796,18 @@ bool SalGraphics::DrawNativeControl( ControlType nType, ControlPart nPart, const
bool SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue,
- tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice *pOutDev )
+ tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
tools::Rectangle rgn( rControlRegion );
- mirror( rgn, pOutDev );
+ mirror( rgn, rOutDev );
std::unique_ptr< ImplControlValue > mirrorValue( aValue.clone());
- mirror( *mirrorValue, pOutDev );
+ mirror( *mirrorValue, rOutDev );
if (forWidget()->getNativeControlRegion(nType, nPart, rgn, nState, *mirrorValue, OUString(), rNativeBoundingRegion, rNativeContentRegion))
{
- mirror( rNativeBoundingRegion, pOutDev, true );
- mirror( rNativeContentRegion, pOutDev, true );
+ mirror( rNativeBoundingRegion, rOutDev, true );
+ mirror( rNativeContentRegion, rOutDev, true );
return true;
}
return false;
@@ -818,12 +818,12 @@ bool SalGraphics::GetNativeControlRegion( ControlType nType, ControlPart nPart,
bool SalGraphics::BlendBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rBitmap,
- const OutputDevice *pOutDev )
+ const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
SalTwoRect aPosAry2 = rPosAry;
- mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
+ mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, &rOutDev );
return blendBitmap( aPosAry2, rBitmap );
}
else
@@ -834,12 +834,12 @@ bool SalGraphics::BlendAlphaBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSrcBitmap,
const SalBitmap& rMaskBitmap,
const SalBitmap& rAlphaBitmap,
- const OutputDevice *pOutDev )
+ const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
SalTwoRect aPosAry2 = rPosAry;
- mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
+ mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, &rOutDev );
return blendAlphaBitmap( aPosAry2, rSrcBitmap, rMaskBitmap, rAlphaBitmap );
}
else
@@ -849,12 +849,12 @@ bool SalGraphics::BlendAlphaBitmap( const SalTwoRect& rPosAry,
bool SalGraphics::DrawAlphaBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap,
- const OutputDevice *pOutDev )
+ const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
SalTwoRect aPosAry2 = rPosAry;
- mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, pOutDev );
+ mirror( aPosAry2.mnDestX, aPosAry2.mnDestWidth, &rOutDev );
return drawAlphaBitmap( aPosAry2, rSourceBitmap, rAlphaBitmap );
}
else
@@ -867,12 +867,12 @@ bool SalGraphics::DrawTransformedBitmap(
const basegfx::B2DPoint& rY,
const SalBitmap& rSourceBitmap,
const SalBitmap* pAlphaBitmap,
- const OutputDevice* pOutDev)
+ const OutputDevice& rOutDev)
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
{
// mirroring set
- const basegfx::B2DHomMatrix& rMirror(getMirror(pOutDev));
+ const basegfx::B2DHomMatrix& rMirror(getMirror(&rOutDev));
if (!rMirror.isIdentity())
{
basegfx::B2DPolygon aPoints({rNull, rX, rY});
@@ -891,10 +891,10 @@ bool SalGraphics::DrawTransformedBitmap(
}
bool SalGraphics::DrawAlphaRect( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight,
- sal_uInt8 nTransparency, const OutputDevice *pOutDev )
+ sal_uInt8 nTransparency, const OutputDevice& rOutDev )
{
- if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
- mirror( nX, nWidth, pOutDev );
+ if( (m_nLayout & SalLayoutFlags::BiDiRtl) || rOutDev.IsRTLEnabled() )
+ mirror( nX, nWidth, &rOutDev );
return drawAlphaRect( nX, nY, nWidth, nHeight, nTransparency );
}
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index b6e0787b8b60..3ae5b8c783b5 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -311,7 +311,7 @@ bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bEra
else
nHeight = nNewHeight;
SalTwoRect aPosAry(0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight);
- pGraphics->CopyBits( aPosAry, mpGraphics, this, this );
+ pGraphics->CopyBits( aPosAry, mpGraphics, *this, this );
pNewVirDev->ReleaseGraphics( pGraphics );
ReleaseGraphics();
mpVirDev = std::move(pNewVirDev);
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 519f975a0f12..1efe45e5ea92 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -442,7 +442,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
(aRect.Left() < mnOutOffX) ? (mnOutOffX - aRect.Left()) : 0L,
(aRect.Top() < mnOutOffY) ? (mnOutOffY - aRect.Top()) : 0L,
nWidth, nHeight);
- aVDev->mpGraphics->CopyBits( aPosAry, mpGraphics, this, this );
+ aVDev->mpGraphics->CopyBits( aPosAry, mpGraphics, *this, this );
}
else
{
@@ -460,7 +460,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
if ( !bClipped )
{
- std::shared_ptr<SalBitmap> pSalBmp = mpGraphics->GetBitmap( nX, nY, nWidth, nHeight, this );
+ std::shared_ptr<SalBitmap> pSalBmp = mpGraphics->GetBitmap( nX, nY, nWidth, nHeight, *this );
if( pSalBmp )
{
@@ -523,7 +523,7 @@ void OutputDevice::DrawDeviceBitmap( const Point& rDestPt, const Size& rDestSize
{
bool bTryDirectPaint(pSalSrcBmp);
- if (bTryDirectPaint && mpGraphics->DrawAlphaBitmap(aPosAry, *pSalSrcBmp, *xMaskBmp, this))
+ if (bTryDirectPaint && mpGraphics->DrawAlphaBitmap(aPosAry, *pSalSrcBmp, *xMaskBmp, *this))
{
// tried to paint as alpha directly. If this worked, we are done (except
// alpha, see below)
@@ -682,7 +682,7 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
Bitmap aAlphaBitmap( mpAlphaVDev->GetBitmap( aRelPt, aOutSz ) );
if (SalBitmap* pSalAlphaBmp2 = aAlphaBitmap.ImplGetSalBitmap().get())
{
- if (mpGraphics->BlendAlphaBitmap(aTR, *pSalSrcBmp, *pSalAlphaBmp, *pSalAlphaBmp2, this))
+ if (mpGraphics->BlendAlphaBitmap(aTR, *pSalSrcBmp, *pSalAlphaBmp, *pSalAlphaBmp2, *this))
{
mpAlphaVDev->BlendBitmap(aTR, rAlpha);
return;
@@ -691,7 +691,7 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r
}
else
{
- if (mpGraphics->DrawAlphaBitmap(aTR, *pSalSrcBmp, *pSalAlphaBmp, this))
+ if (mpGraphics->DrawAlphaBitmap(aTR, *pSalSrcBmp, *pSalAlphaBmp, *this))
return;
}
@@ -1097,7 +1097,7 @@ bool OutputDevice::DrawTransformBitmapExDirect(
aTopY,
*pSalSrcBmp,
pSalAlphaBmp,
- this);
+ *this);
if (mpAlphaVDev)
{
@@ -1553,7 +1553,7 @@ void OutputDevice::BlendBitmap(
const SalTwoRect& rPosAry,
const Bitmap& rBmp )
{
- mpGraphics->BlendBitmap( rPosAry, *rBmp.ImplGetSalBitmap(), this );
+ mpGraphics->BlendBitmap( rPosAry, *rBmp.ImplGetSalBitmap(), *this );
}
Bitmap OutputDevice::BlendBitmapWithAlpha(
diff --git a/vcl/source/outdev/clipping.cxx b/vcl/source/outdev/clipping.cxx
index 3823d2505fa5..b1c116bb31f4 100644
--- a/vcl/source/outdev/clipping.cxx
+++ b/vcl/source/outdev/clipping.cxx
@@ -83,7 +83,7 @@ bool OutputDevice::SelectClipRegion( const vcl::Region& rRegion, SalGraphics* pG
pGraphics = mpGraphics;
}
- bool bClipRegion = pGraphics->SetClipRegion( rRegion, this );
+ bool bClipRegion = pGraphics->SetClipRegion( rRegion, *this );
OSL_ENSURE( bClipRegion, "OutputDevice::SelectClipRegion() - can't create region" );
return bClipRegion;
}
diff --git a/vcl/source/outdev/curvedshapes.cxx b/vcl/source/outdev/curvedshapes.cxx
index a02abfb6e69e..ef2ccc72f756 100644
--- a/vcl/source/outdev/curvedshapes.cxx
+++ b/vcl/source/outdev/curvedshapes.cxx
@@ -57,12 +57,12 @@ void OutputDevice::DrawEllipse( const tools::Rectangle& rRect )
{
Point* pPtAry = aRectPoly.GetPointAry();
if ( !mbFillColor )
- mpGraphics->DrawPolyLine( aRectPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolyLine( aRectPoly.GetSize(), pPtAry, *this );
else
{
if ( mbInitFillColor )
InitFillColor();
- mpGraphics->DrawPolygon( aRectPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolygon( aRectPoly.GetSize(), pPtAry, *this );
}
}
@@ -104,7 +104,7 @@ void OutputDevice::DrawArc( const tools::Rectangle& rRect,
if ( aArcPoly.GetSize() >= 2 )
{
Point* pPtAry = aArcPoly.GetPointAry();
- mpGraphics->DrawPolyLine( aArcPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolyLine( aArcPoly.GetSize(), pPtAry, *this );
}
if( mpAlphaVDev )
@@ -146,12 +146,12 @@ void OutputDevice::DrawPie( const tools::Rectangle& rRect,
{
Point* pPtAry = aPiePoly.GetPointAry();
if ( !mbFillColor )
- mpGraphics->DrawPolyLine( aPiePoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolyLine( aPiePoly.GetSize(), pPtAry, *this );
else
{
if ( mbInitFillColor )
InitFillColor();
- mpGraphics->DrawPolygon( aPiePoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolygon( aPiePoly.GetSize(), pPtAry, *this );
}
}
@@ -194,12 +194,12 @@ void OutputDevice::DrawChord( const tools::Rectangle& rRect,
{
Point* pPtAry = aChordPoly.GetPointAry();
if ( !mbFillColor )
- mpGraphics->DrawPolyLine( aChordPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolyLine( aChordPoly.GetSize(), pPtAry, *this );
else
{
if ( mbInitFillColor )
InitFillColor();
- mpGraphics->DrawPolygon( aChordPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolygon( aChordPoly.GetSize(), pPtAry, *this );
}
}
diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx
index 374282c374df..f2d234677331 100644
--- a/vcl/source/outdev/hatch.cxx
+++ b/vcl/source/outdev/hatch.cxx
@@ -404,7 +404,7 @@ void OutputDevice::DrawHatchLine( const tools::Line& rLine, const tools::PolyPol
void OutputDevice::DrawHatchLine_DrawLine(const Point& rStartPoint, const Point& rEndPoint)
{
Point aPt1{ImplLogicToDevicePixel(rStartPoint)}, aPt2{ImplLogicToDevicePixel(rEndPoint)};
- mpGraphics->DrawLine(aPt1.X(), aPt1.Y(), aPt2.X(), aPt2.Y(), this);
+ mpGraphics->DrawLine(aPt1.X(), aPt1.Y(), aPt2.X(), aPt2.Y(), *this);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx
index 95d2c44458d7..4a51ef68f120 100644
--- a/vcl/source/outdev/line.cxx
+++ b/vcl/source/outdev/line.cxx
@@ -78,7 +78,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt,
}
else
{
- mpGraphics->DrawLine( aStartPt.X(), aStartPt.Y(), aEndPt.X(), aEndPt.Y(), this );
+ mpGraphics->DrawLine( aStartPt.X(), aStartPt.Y(), aEndPt.X(), aEndPt.Y(), *this );
}
if( mpAlphaVDev )
@@ -141,7 +141,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt )
{
const Point aStartPt(ImplLogicToDevicePixel(rStartPt));
const Point aEndPt(ImplLogicToDevicePixel(rEndPt));
- mpGraphics->DrawLine( aStartPt.X(), aStartPt.Y(), aEndPt.X(), aEndPt.Y(), this );
+ mpGraphics->DrawLine( aStartPt.X(), aStartPt.Y(), aEndPt.X(), aEndPt.Y(), *this );
}
if( mpAlphaVDev )
@@ -253,7 +253,7 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin
mpGraphics->DrawPolyLine(
aPolygon.GetSize(),
aPolygon.GetPointAry(),
- this);
+ *this);
}
}
}
@@ -287,7 +287,7 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin
// need to subdivide, mpGraphics->DrawPolygon ignores curves
aPolygon.AdaptiveSubdivide(aPolygon);
- mpGraphics->DrawPolygon(aPolygon.GetSize(), aPolygon.GetConstPointAry(), this);
+ mpGraphics->DrawPolygon(aPolygon.GetSize(), aPolygon.GetConstPointAry(), *this);
}
}
diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx
index 90b3cbc1b0e5..77e59f02ec0d 100644
--- a/vcl/source/outdev/mask.cxx
+++ b/vcl/source/outdev/mask.cxx
@@ -125,10 +125,10 @@ void OutputDevice::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor,
Bitmap aTmp( rMask );
aTmp.Mirror( nMirrFlags );
mpGraphics->DrawMask( aPosAry, *aTmp.ImplGetSalBitmap(),
- rMaskColor, this);
+ rMaskColor, *this);
}
else
- mpGraphics->DrawMask( aPosAry, *xImpBmp, rMaskColor, this );
+ mpGraphics->DrawMask( aPosAry, *xImpBmp, rMaskColor, *this );
}
}
diff --git a/vcl/source/outdev/nativecontrols.cxx b/vcl/source/outdev/nativecontrols.cxx
index 14ad647db5ad..85b0b58c45d1 100644
--- a/vcl/source/outdev/nativecontrols.cxx
+++ b/vcl/source/outdev/nativecontrols.cxx
@@ -193,7 +193,7 @@ bool OutputDevice::HitTestNativeScrollbar(
screenRegion.Move( aWinOffs.X(), aWinOffs.Y());
return mpGraphics->HitTestNativeScrollbar( nPart, screenRegion, Point( aPos.X() + mnOutOffX, aPos.Y() + mnOutOffY ),
- rIsInside, this );
+ rIsInside, *this );
}
static std::shared_ptr< ImplControlValue > TransformControlValue( const ImplControlValue& rVal, const OutputDevice& rDev )
@@ -316,7 +316,7 @@ bool OutputDevice::DrawNativeControl( ControlType nType,
std::shared_ptr< ImplControlValue > aScreenCtrlValue( TransformControlValue( aValue, *this ) );
tools::Rectangle screenRegion( ImplLogicToDevicePixel( rControlRegion ) );
- bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, this, rBackgroundColor );
+ bool bRet = mpGraphics->DrawNativeControl(nType, nPart, screenRegion, nState, *aScreenCtrlValue, aCaption, *this, rBackgroundColor);
return bRet;
}
@@ -342,7 +342,7 @@ bool OutputDevice::GetNativeControlRegion( ControlType nType,
bool bRet = mpGraphics->GetNativeControlRegion(nType, nPart, screenRegion, nState, *aScreenCtrlValue,
rNativeBoundingRegion,
- rNativeContentRegion, this );
+ rNativeContentRegion, *this );
if( bRet )
{
// transform back native regions
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx
index e5bf4c4d21c6..c443044f7a99 100644
--- a/vcl/source/outdev/outdev.cxx
+++ b/vcl/source/outdev/outdev.cxx
@@ -388,7 +388,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
AdjustTwoRect( aPosAry, aSrcOutRect );
if ( aPosAry.mnSrcWidth && aPosAry.mnSrcHeight && aPosAry.mnDestWidth && aPosAry.mnDestHeight )
- mpGraphics->CopyBits( aPosAry, nullptr, this, nullptr );
+ mpGraphics->CopyBits( aPosAry, nullptr, *this, nullptr );
}
if( mpAlphaVDev )
@@ -450,7 +450,7 @@ void OutputDevice::DrawOutDev( const Point& rDestPt, const Size& rDestSize,
ImplLogicWidthToDevicePixel(rDestSize.Width()),
ImplLogicHeightToDevicePixel(rDestSize.Height()));
- drawOutDevDirect(&rOutDev, aPosAry);
+ drawOutDevDirect(rOutDev, aPosAry);
// #i32109#: make destination rectangle opaque - source has no alpha
if (mpAlphaVDev)
@@ -512,15 +512,14 @@ void OutputDevice::CopyDeviceArea( SalTwoRect& aPosAry, bool /*bWindowInvalidate
aPosAry.mnDestWidth = aPosAry.mnSrcWidth;
aPosAry.mnDestHeight = aPosAry.mnSrcHeight;
- mpGraphics->CopyBits(aPosAry, nullptr, this, nullptr);
+ mpGraphics->CopyBits(aPosAry, nullptr, *this, nullptr);
}
// Direct OutputDevice drawing private function
-
-void OutputDevice::drawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rPosAry )
+void OutputDevice::drawOutDevDirect(const OutputDevice& rSrcDev, SalTwoRect& rPosAry)
{
SalGraphics* pSrcGraphics;
- if (const OutputDevice* pCheckedSrc = DrawOutDevDirectCheck(pSrcDev))
+ if (const OutputDevice* pCheckedSrc = DrawOutDevDirectCheck(rSrcDev))
{
if (!pCheckedSrc->mpGraphics && !pCheckedSrc->AcquireGraphics())
return;
@@ -533,36 +532,36 @@ void OutputDevice::drawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rP
return;
// #102532# Offset only has to be pseudo window offset
- const tools::Rectangle aSrcOutRect( Point( pSrcDev->mnOutOffX, pSrcDev->mnOutOffY ),
- Size( pSrcDev->mnOutWidth, pSrcDev->mnOutHeight ) );
+ const tools::Rectangle aSrcOutRect(Point(rSrcDev.mnOutOffX, rSrcDev.mnOutOffY),
+ Size(rSrcDev.mnOutWidth, rSrcDev.mnOutHeight));
AdjustTwoRect( rPosAry, aSrcOutRect );
if ( rPosAry.mnSrcWidth && rPosAry.mnSrcHeight && rPosAry.mnDestWidth && rPosAry.mnDestHeight )
{
- // if this is no window, but pSrcDev is a window
+ // if this is no window, but rSrcDev is a window
// mirroring may be required
// because only windows have a SalGraphicsLayout
// mirroring is performed here
- DrawOutDevDirectProcess( pSrcDev, rPosAry, pSrcGraphics);
+ DrawOutDevDirectProcess(rSrcDev, rPosAry, pSrcGraphics);
}
}
-const OutputDevice* OutputDevice::DrawOutDevDirectCheck(const OutputDevice* pSrcDev) const
+const OutputDevice* OutputDevice::DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const
{
- return this == pSrcDev ? nullptr : pSrcDev;
+ return this == &rSrcDev ? nullptr : &rSrcDev;
}
-void OutputDevice::DrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )
+void OutputDevice::DrawOutDevDirectProcess(const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics)
{
if( pSrcGraphics && (pSrcGraphics->GetLayout() & SalLayoutFlags::BiDiRtl) )
{
SalTwoRect aPosAry2 = rPosAry;
- pSrcGraphics->mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, pSrcDev );
- mpGraphics->CopyBits( aPosAry2, pSrcGraphics, this, pSrcDev );
+ pSrcGraphics->mirror( aPosAry2.mnSrcX, aPosAry2.mnSrcWidth, &rSrcDev );
+ mpGraphics->CopyBits( aPosAry2, pSrcGraphics, *this, &rSrcDev );
}
else
- mpGraphics->CopyBits( rPosAry, pSrcGraphics, this, pSrcDev );
+ mpGraphics->CopyBits( rPosAry, pSrcGraphics, *this, &rSrcDev );
}
tools::Rectangle OutputDevice::GetBackgroundComponentBounds() const
@@ -679,7 +678,7 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
aRect.Justify();
bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
- const_cast<sal_uInt8*>(rGfxLink.GetData()), rGfxLink.GetDataSize(), this );
+ const_cast<sal_uInt8*>(rGfxLink.GetData()), rGfxLink.GetDataSize(), *this );
}
// else draw the substitution graphics
diff --git a/vcl/source/outdev/pixel.cxx b/vcl/source/outdev/pixel.cxx
index 09a6ffb93a57..9238c7a394d8 100644
--- a/vcl/source/outdev/pixel.cxx
+++ b/vcl/source/outdev/pixel.cxx
@@ -39,7 +39,7 @@ Color OutputDevice::GetPixel(const Point& rPoint) const
{
const tools::Long nX = ImplLogicXToDevicePixel(rPoint.X());
const tools::Long nY = ImplLogicYToDevicePixel(rPoint.Y());
- aColor = mpGraphics->GetPixel(nX, nY, this);
+ aColor = mpGraphics->GetPixel(nX, nY, *this);
if (mpAlphaVDev)
{
@@ -75,7 +75,7 @@ void OutputDevice::DrawPixel( const Point& rPt )
if ( mbInitLineColor )
InitLineColor();
- mpGraphics->DrawPixel( aPt.X(), aPt.Y(), this );
+ mpGraphics->DrawPixel( aPt.X(), aPt.Y(), *this );
if( mpAlphaVDev )
mpAlphaVDev->DrawPixel( rPt );
@@ -104,7 +104,7 @@ void OutputDevice::DrawPixel( const Point& rPt, const Color& rColor )
if ( mbOutputClipped )
return;
- mpGraphics->DrawPixel( aPt.X(), aPt.Y(), aColor, this );
+ mpGraphics->DrawPixel( aPt.X(), aPt.Y(), aColor, *this );
if (mpAlphaVDev)
{
diff --git a/vcl/source/outdev/polygon.cxx b/vcl/source/outdev/polygon.cxx
index 208858fc381b..7bc768121367 100644
--- a/vcl/source/outdev/polygon.cxx
+++ b/vcl/source/outdev/polygon.cxx
@@ -236,16 +236,16 @@ void OutputDevice::DrawPolygon( const tools::Polygon& rPoly )
if( aPoly.HasFlags() )
{
const PolyFlags* pFlgAry = aPoly.GetConstFlagAry();
- if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, this ) )
+ if( !mpGraphics->DrawPolygonBezier( nPoints, pPtAry, pFlgAry, *this ) )
{
aPoly = tools::Polygon::SubdivideBezier(aPoly);
pPtAry = aPoly.GetConstPointAry();
- mpGraphics->DrawPolygon( aPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolygon( aPoly.GetSize(), pPtAry, *this );
}
}
else
{
- mpGraphics->DrawPolygon( nPoints, pPtAry, this );
+ mpGraphics->DrawPolygon( nPoints, pPtAry, *this );
}
if( mpAlphaVDev )
mpAlphaVDev->DrawPolygon( rPoly );
@@ -403,15 +403,15 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const tools::PolyPolyg
// #100127# Forward beziers to sal, if any
if( bHaveBezier )
{
- if( !mpGraphics->DrawPolygonBezier( *pPointAry, *pPointAryAry, *pFlagAryAry, this ) )
+ if( !mpGraphics->DrawPolygonBezier( *pPointAry, *pPointAryAry, *pFlagAryAry, *this ) )
{
tools::Polygon aPoly = tools::Polygon::SubdivideBezier( rPolyPoly.GetObject( last ) );
- mpGraphics->DrawPolygon( aPoly.GetSize(), aPoly.GetConstPointAry(), this );
+ mpGraphics->DrawPolygon( aPoly.GetSize(), aPoly.GetConstPointAry(), *this );
}
}
else
{
- mpGraphics->DrawPolygon( *pPointAry, *pPointAryAry, this );
+ mpGraphics->DrawPolygon( *pPointAry, *pPointAryAry, *this );
}
}
else
@@ -419,7 +419,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const tools::PolyPolyg
// #100127# Forward beziers to sal, if any
if( bHaveBezier )
{
- if( !mpGraphics->DrawPolyPolygonBezier( j, pPointAry, pPointAryAry, pFlagAryAry, this ) )
+ if (!mpGraphics->DrawPolyPolygonBezier(j, pPointAry, pPointAryAry, pFlagAryAry, *this))
{
tools::PolyPolygon aPolyPoly = tools::PolyPolygon::SubdivideBezier( rPolyPoly );
ImplDrawPolyPolygon( aPolyPoly.Count(), aPolyPoly );
@@ -427,7 +427,7 @@ void OutputDevice::ImplDrawPolyPolygon( sal_uInt16 nPoly, const tools::PolyPolyg
}
else
{
- mpGraphics->DrawPolyPolygon( j, pPointAry, pPointAryAry, this );
+ mpGraphics->DrawPolyPolygon( j, pPointAry, pPointAryAry, *this );
}
}
@@ -453,7 +453,7 @@ void OutputDevice::ImplDrawPolygon( const tools::Polygon& rPoly, const tools::Po
return;
const Point* pPtAry = rPoly.GetConstPointAry();
- mpGraphics->DrawPolygon( nPoints, pPtAry, this );
+ mpGraphics->DrawPolygon( nPoints, pPtAry, *this );
}
}
@@ -478,7 +478,7 @@ void OutputDevice::ImplDrawPolyPolygon( const tools::PolyPolygon& rPolyPoly, con
if( nSize >= 2 )
{
const Point* pPtAry = rPoly.GetConstPointAry();
- mpGraphics->DrawPolygon( nSize, pPtAry, this );
+ mpGraphics->DrawPolygon( nSize, pPtAry, *this );
}
}
else if( pPolyPoly->Count() )
@@ -503,9 +503,9 @@ void OutputDevice::ImplDrawPolyPolygon( const tools::PolyPolygon& rPolyPoly, con
while( i < nCount );
if( nCount == 1 )
- mpGraphics->DrawPolygon( pPointAry[0], pPointAryAry[0], this );
+ mpGraphics->DrawPolygon( pPointAry[0], pPointAryAry[0], *this );
else
- mpGraphics->DrawPolyPolygon( nCount, pPointAry.get(), pPointAryAry.get(), this );
+ mpGraphics->DrawPolyPolygon( nCount, pPointAry.get(), pPointAryAry.get(), *this );
}
if( pClipPolyPoly )
diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx
index a79ebf74ab6f..31b15c50f2ac 100644
--- a/vcl/source/outdev/polyline.cxx
+++ b/vcl/source/outdev/polyline.cxx
@@ -88,16 +88,16 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly )
if( aPoly.HasFlags() )
{
const PolyFlags* pFlgAry = aPoly.GetConstFlagAry();
- if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) )
+ if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, *this ) )
{
aPoly = tools::Polygon::SubdivideBezier(aPoly);
pPtAry = aPoly.GetPointAry();
- mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, *this );
}
}
else
{
- mpGraphics->DrawPolyLine( nPoints, pPtAry, this );
+ mpGraphics->DrawPolyLine( nPoints, pPtAry, *this );
}
}
@@ -280,7 +280,7 @@ void OutputDevice::drawPolyLine(const tools::Polygon& rPoly, const LineInfo& rLi
nPoints = aPoly.GetSize();
}
- mpGraphics->DrawPolyLine(nPoints, aPoly.GetPointAry(), this);
+ mpGraphics->DrawPolyLine(nPoints, aPoly.GetPointAry(), *this);
}
if( mpAlphaVDev )
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index c6a53fbee3c0..b768025f57cb 100644
--- a/vcl/source/outdev/rect.cxx
+++ b/vcl/source/outdev/rect.cxx
@@ -80,7 +80,7 @@ void OutputDevice::DrawRect( const tools::Rectangle& rRect )
if ( mbInitFillColor )
InitFillColor();
- mpGraphics->DrawRect( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), this );
+ mpGraphics->DrawRect( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), *this );
if( mpAlphaVDev )
mpAlphaVDev->DrawRect( rRect );
@@ -123,7 +123,7 @@ void OutputDevice::DrawRect( const tools::Rectangle& rRect,
if ( !nHorzRound && !nVertRound )
{
- mpGraphics->DrawRect( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), this );
+ mpGraphics->DrawRect( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), *this );
}
else
{
@@ -134,9 +134,9 @@ void OutputDevice::DrawRect( const tools::Rectangle& rRect,
Point* pPtAry = aRoundRectPoly.GetPointAry();
if ( !mbFillColor )
- mpGraphics->DrawPolyLine( aRoundRectPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolyLine( aRoundRectPoly.GetSize(), pPtAry, *this );
else
- mpGraphics->DrawPolygon( aRoundRectPoly.GetSize(), pPtAry, this );
+ mpGraphics->DrawPolygon( aRoundRectPoly.GetSize(), pPtAry, *this );
}
}
@@ -171,7 +171,7 @@ void OutputDevice::Invert( const tools::Rectangle& rRect, InvertFlags nFlags )
nSalFlags |= SalInvert::N50;
if ( nFlags & InvertFlags::TrackFrame )
nSalFlags |= SalInvert::TrackFrame;
- mpGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), nSalFlags, this );
+ mpGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), nSalFlags, *this );
}
void OutputDevice::Invert( const tools::Polygon& rPoly, InvertFlags nFlags )
@@ -203,7 +203,7 @@ void OutputDevice::Invert( const tools::Polygon& rPoly, InvertFlags nFlags )
if ( nFlags & InvertFlags::TrackFrame )
nSalFlags |= SalInvert::TrackFrame;
const Point* pPtAry = aPoly.GetConstPointAry();
- mpGraphics->Invert( nPoints, pPtAry, nSalFlags, this );
+ mpGraphics->Invert( nPoints, pPtAry, nSalFlags, *this );
}
void OutputDevice::DrawCheckered(const Point& rPos, const Size& rSize, sal_uInt32 nLen, Color aStart, Color aEnd)
@@ -302,7 +302,7 @@ void OutputDevice::DrawGrid( const tools::Rectangle& rRect, const Size& rDist, D
{
for( tools::Long j = 0, Y = aVertBuf[ i ]; j < nHorzCount; j++ )
{
- mpGraphics->DrawPixel( aHorzBuf[ j ], Y, this );
+ mpGraphics->DrawPixel( aHorzBuf[ j ], Y, *this );
}
}
}
@@ -313,7 +313,7 @@ void OutputDevice::DrawGrid( const tools::Rectangle& rRect, const Size& rDist, D
for( tools::Long i = 0; i < nVertCount; i++ )
{
nY = aVertBuf[ i ];
- mpGraphics->DrawLine( nStartX, nY, nEndX, nY, this );
+ mpGraphics->DrawLine( nStartX, nY, nEndX, nY, *this );
}
}
@@ -322,7 +322,7 @@ void OutputDevice::DrawGrid( const tools::Rectangle& rRect, const Size& rDist, D
for( tools::Long i = 0; i < nHorzCount; i++ )
{
nX = aHorzBuf[ i ];
- mpGraphics->DrawLine( nX, nStartY, nX, nEndY, this );
+ mpGraphics->DrawLine( nX, nStartY, nX, nEndY, *this );
}
}
}
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index adfcefbcd316..48a04b3b122f 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -138,7 +138,7 @@ void OutputDevice::ImplDrawTextRect( tools::Long nBaseX, tools::Long nBaseY,
nX += nBaseX;
nY += nBaseY;
- mpGraphics->DrawRect( nX, nY, nWidth, nHeight, this ); // original code
+ mpGraphics->DrawRect( nX, nY, nWidth, nHeight, *this ); // original code
}
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 09ee52f6339a..641765270444 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -51,7 +51,7 @@ void OutputDevice::ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY
tools::Long nCurX, tools::Long nCurY,
Degree10 nOrientation,
SalGraphics* pGraphics,
- OutputDevice const * pOutDev,
+ const OutputDevice& rOutDev,
bool bDrawPixAsRect,
tools::Long nPixWidth, tools::Long nPixHeight )
{
@@ -64,11 +64,11 @@ void OutputDevice::ImplDrawWavePixel( tools::Long nOriginX, tools::Long nOriginY
if ( bDrawPixAsRect )
{
- pGraphics->DrawRect( nCurX, nCurY, nPixWidth, nPixHeight, pOutDev );
+ pGraphics->DrawRect( nCurX, nCurY, nPixWidth, nPixHeight, rOutDev );
}
else
{
- pGraphics->DrawPixel( nCurX, nCurY, pOutDev );
+ pGraphics->DrawPixel( nCurX, nCurY, rOutDev );
}
}
@@ -98,7 +98,7 @@ void OutputDevice::ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY,
aOriginPt.RotateAround( nStartX, nStartY, nOrientation );
aOriginPt.RotateAround( nEndX, nEndY, nOrientation );
}
- mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, this );
+ mpGraphics->DrawLine( nStartX, nStartY, nEndX, nEndY, *this );
}
else
{
@@ -139,7 +139,7 @@ void OutputDevice::ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY,
while ( nWidth )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
- mpGraphics, this,
+ mpGraphics, *this,
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
nWidth--;
@@ -154,7 +154,7 @@ void OutputDevice::ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY,
for( tools::Long i = nDiffY; i; --i )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
- mpGraphics, this,
+ mpGraphics, *this,
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
nCurY += nOffY;
@@ -162,7 +162,7 @@ void OutputDevice::ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY,
for( tools::Long i = nDiffX; i; --i )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
- mpGraphics, this,
+ mpGraphics, *this,
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
}
@@ -174,7 +174,7 @@ void OutputDevice::ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY,
for( tools::Long i = nDiffY; i && nFreq; --i, --nFreq )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
- mpGraphics, this,
+ mpGraphics, *this,
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
nCurY += nOffY;
@@ -183,7 +183,7 @@ void OutputDevice::ImplDrawWaveLine( tools::Long nBaseX, tools::Long nBaseY,
for( tools::Long i = nDiffX; i && nFreq; --i, --nFreq )
{
ImplDrawWavePixel( nBaseX, nBaseY, nCurX, nCurY, nOrientation,
- mpGraphics, this,
+ mpGraphics, *this,
bDrawPixAsRect, nPixWidth, nPixHeight );
nCurX++;
}
diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx
index 55423fdb6385..08cb57e06505 100644
--- a/vcl/source/outdev/transparent.cxx
+++ b/vcl/source/outdev/transparent.cxx
@@ -470,7 +470,7 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly,
// rectangle, too.
aPixelRect.getWidth(), aPixelRect.getHeight(),
sal::static_int_cast<sal_uInt8>(nTransparencePercent),
- this );
+ *this );
}
else
{
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index fbe81aed7499..43702367408a 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -529,7 +529,7 @@ void Window::SetPointerPosPixel( const Point& rPos )
pOutDev->ReMirror( aPos );
}
// mirroring is required here, SetPointerPos bypasses SalGraphics
- aPos.setX( mpGraphics->mirror2( aPos.X(), this ) );
+ aPos.setX( mpGraphics->mirror2( aPos.X(), *this ) );
}
else if( ImplIsAntiparallel() )
{
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 034eef555d6a..4976d5c892e1 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1759,7 +1759,7 @@ void Window::ImplScroll( const tools::Rectangle& rRect,
pGraphics->CopyArea( rRect.Left()+nHorzScroll, rRect.Top()+nVertScroll,
rRect.Left(), rRect.Top(),
rRect.GetWidth(), rRect.GetHeight(),
- this );
+ *this );
}
#endif
if ( mpWindowImpl->mpWinData )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 5e079161e492..7224dd138168 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1240,7 +1240,7 @@ void Window::CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate )
mpGraphics->CopyArea(aPosAry.mnDestX, aPosAry.mnDestY,
aPosAry.mnSrcX, aPosAry.mnSrcY,
aPosAry.mnSrcWidth, aPosAry.mnSrcHeight,
- this);
+ *this);
return;
}
@@ -1248,24 +1248,24 @@ void Window::CopyDeviceArea( SalTwoRect& aPosAry, bool bWindowInvalidate )
OutputDevice::CopyDeviceArea(aPosAry, bWindowInvalidate);
}
-const OutputDevice* Window::DrawOutDevDirectCheck(const OutputDevice* pSrcDev) const
+const OutputDevice* Window::DrawOutDevDirectCheck(const OutputDevice& rSrcDev) const
{
const OutputDevice* pSrcDevChecked;
- if ( this == pSrcDev )
+ if ( this == &rSrcDev )
pSrcDevChecked = nullptr;
- else if (GetOutDevType() != pSrcDev->GetOutDevType())
- pSrcDevChecked = pSrcDev;
- else if (this->mpWindowImpl->mpFrameWindow == static_cast<const vcl::Window*>(pSrcDev)->mpWindowImpl->mpFrameWindow)
+ else if (GetOutDevType() != rSrcDev.GetOutDevType())
+ pSrcDevChecked = &rSrcDev;
+ else if (this->mpWindowImpl->mpFrameWindow == static_cast<const vcl::Window&>(rSrcDev).mpWindowImpl->mpFrameWindow)
pSrcDevChecked = nullptr;
else
- pSrcDevChecked = pSrcDev;
+ pSrcDevChecked = &rSrcDev;
return pSrcDevChecked;
}
-void Window::DrawOutDevDirectProcess( const OutputDevice* pSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )
+void Window::DrawOutDevDirectProcess( const OutputDevice& rSrcDev, SalTwoRect& rPosAry, SalGraphics* pSrcGraphics )
{
- mpGraphics->CopyBits( rPosAry, pSrcGraphics, this, pSrcDev );
+ mpGraphics->CopyBits( rPosAry, pSrcGraphics, *this, &rSrcDev );
}
SalGraphics* Window::ImplGetFrameGraphics() const
@@ -1505,7 +1505,7 @@ void Window::ImplPosSizeWindow( tools::Long nX, tools::Long nY,
OutputDevice *pOutDev = GetOutDev();
if( pOutDev->HasMirroredGraphics() )
{
- aPtDev.setX( mpGraphics->mirror2( aPtDev.X(), this ) );
+ aPtDev.setX( mpGraphics->mirror2( aPtDev.X(), *this ) );
// #106948# always mirror our pos if our parent is not mirroring, even
// if we are also not mirroring
@@ -1671,7 +1671,7 @@ void Window::ImplPosSizeWindow( tools::Long nX, tools::Long nY,
pGraphics->CopyArea( mnOutOffX, mnOutOffY,
nOldOutOffX, nOldOutOffY,
nOldOutWidth, nOldOutHeight,
- this );
+ *this );
}
else
bInvalidate = true;
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index a729f655a93d..9773ca2f8b53 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -202,18 +202,18 @@ void Window::InvertTracking( const tools::Rectangle& rRect, ShowTrackFlags nFlag
ShowTrackFlags nStyle = nFlags & ShowTrackFlags::StyleMask;
if ( nStyle == ShowTrackFlags::Object )
- pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SalInvert::TrackFrame, this );
+ pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SalInvert::TrackFrame, *this );
else if ( nStyle == ShowTrackFlags::Split )
- pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SalInvert::N50, this );
+ pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SalInvert::N50, *this );
else
{
tools::Long nBorder = 1;
if ( nStyle == ShowTrackFlags::Big )
nBorder = 5;
- pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), nBorder, SalInvert::N50, this );
- pGraphics->Invert( aRect.Left(), aRect.Bottom()-nBorder+1, aRect.GetWidth(), nBorder, SalInvert::N50, this );
- pGraphics->Invert( aRect.Left(), aRect.Top()+nBorder, nBorder, aRect.GetHeight()-(nBorder*2), SalInvert::N50, this );
- pGraphics->Invert( aRect.Right()-nBorder+1, aRect.Top()+nBorder, nBorder, aRect.GetHeight()-(nBorder*2), SalInvert::N50, this );
+ pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), nBorder, SalInvert::N50, *this );
+ pGraphics->Invert( aRect.Left(), aRect.Bottom()-nBorder+1, aRect.GetWidth(), nBorder, SalInvert::N50, *this );
+ pGraphics->Invert( aRect.Left(), aRect.Top()+nBorder, nBorder, aRect.GetHeight()-(nBorder*2), SalInvert::N50, *this );
+ pGraphics->Invert( aRect.Right()-nBorder+1, aRect.Top()+nBorder, nBorder, aRect.GetHeight()-(nBorder*2), SalInvert::N50, *this );
}
}
More information about the Libreoffice-commits
mailing list