[Libreoffice-commits] core.git: include/tools tools/source vcl/headless vcl/inc vcl/opengl vcl/quartz vcl/source vcl/unx vcl/win

Stephan Bergmann sbergman at redhat.com
Mon Sep 18 09:34:47 UTC 2017


 include/tools/poly.hxx                   |    1 +
 tools/source/generic/poly.cxx            |    5 +++++
 vcl/headless/svpgdi.cxx                  |    2 +-
 vcl/inc/headless/svpgdi.hxx              |    2 +-
 vcl/inc/openglgdiimpl.hxx                |    2 +-
 vcl/inc/quartz/salgdi.h                  |    2 +-
 vcl/inc/salgdi.hxx                       |    4 ++--
 vcl/inc/salgdiimpl.hxx                   |    2 +-
 vcl/inc/unx/genpspgraphics.h             |    2 +-
 vcl/inc/unx/salgdi.h                     |    2 +-
 vcl/inc/win/salgdi.h                     |    2 +-
 vcl/opengl/gdiimpl.cxx                   |    2 +-
 vcl/quartz/salgdicommon.cxx              |    2 +-
 vcl/source/gdi/salgdilayout.cxx          |    2 +-
 vcl/source/outdev/curvedshapes.cxx       |    8 ++++----
 vcl/source/outdev/line.cxx               |    4 ++--
 vcl/source/outdev/polyline.cxx           |    6 +++---
 vcl/source/outdev/rect.cxx               |    4 ++--
 vcl/unx/generic/gdi/gdiimpl.cxx          |    2 +-
 vcl/unx/generic/gdi/gdiimpl.hxx          |    2 +-
 vcl/unx/generic/gdi/salgdi.cxx           |    2 +-
 vcl/unx/generic/print/genpspgraphics.cxx |    4 ++--
 vcl/win/gdi/gdiimpl.cxx                  |    4 ++--
 vcl/win/gdi/gdiimpl.hxx                  |    2 +-
 vcl/win/gdi/salgdi.cxx                   |    2 +-
 25 files changed, 39 insertions(+), 33 deletions(-)

New commits:
commit 80363950fda5eeef9830f61e57899d1805c91751
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Sep 18 10:37:17 2017 +0200

    Acknowledge that WinSalGraphicsImpl::drawPolyLine modifies pPtAry
    
    Change-Id: Idde44857f8ace883cc759321c71e2ca7a4359334
    Reviewed-on: https://gerrit.libreoffice.org/42406
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx
index 40a129414a38..044bafe3f3e2 100644
--- a/include/tools/poly.hxx
+++ b/include/tools/poly.hxx
@@ -171,6 +171,7 @@ public:
     void                Read( SvStream& rIStream );
     void                Write( SvStream& rOStream ) const;
 
+    Point *             GetPointAry();
     const Point*        GetConstPointAry() const;
     const PolyFlags*    GetConstFlagAry() const;
 
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 0cdc61f91b65..217565a1ae60 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -796,6 +796,11 @@ Polygon::~Polygon()
     }
 }
 
+Point * Polygon::GetPointAry()
+{
+    return mpImplPolygon->mpPointAry;
+}
+
 const Point* Polygon::GetConstPointAry() const
 {
     return mpImplPolygon->mpPointAry;
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index dea4185abea8..08b6ad2522f9 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -577,7 +577,7 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
     m_aLineColor = aOrigLineColor;
 }
 
-void SvpSalGraphics::drawPolyLine(sal_uInt32 nPoints, const SalPoint* pPtAry)
+void SvpSalGraphics::drawPolyLine(sal_uInt32 nPoints, SalPoint* pPtAry)
 {
     basegfx::B2DPolygon aPoly;
     aPoly.append(basegfx::B2DPoint(pPtAry->mnX, pPtAry->mnY), nPoints);
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 56ed365339f2..5879c1bfdf44 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -178,7 +178,7 @@ public:
                                           basegfx::B2DLineJoin,
                                           css::drawing::LineCap,
                                           double fMiterMinimumAngle) override;
-    virtual void            drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void            drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
     virtual void            drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
     virtual void            drawPolyPolygon( sal_uInt32 nPoly,
                                              const sal_uInt32* pPoints,
diff --git a/vcl/inc/openglgdiimpl.hxx b/vcl/inc/openglgdiimpl.hxx
index 7bc6644fdc48..67efca02924e 100644
--- a/vcl/inc/openglgdiimpl.hxx
+++ b/vcl/inc/openglgdiimpl.hxx
@@ -244,7 +244,7 @@ public:
 
     virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) override;
 
-    virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
 
     virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
 
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 12356fb57767..9a9626719169 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -228,7 +228,7 @@ public:
     virtual void            drawPixel( long nX, long nY, SalColor nSalColor ) override;
     virtual void            drawLine( long nX1, long nY1, long nX2, long nY2 ) override;
     virtual void            drawRect( long nX, long nY, long nWidth, long nHeight ) override;
-    virtual void            drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void            drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
     virtual void            drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
     virtual void            drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) override;
     virtual bool            drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency ) override;
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index f691fdaedbcc..99249e7ba2f3 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -223,7 +223,7 @@ public:
 
     void                        DrawRect( long nX, long nY, long nWidth, long nHeight, const OutputDevice *pOutDev );
 
-    void                        DrawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
+    void                        DrawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry, const OutputDevice *pOutDev );
 
     void                        DrawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev );
 
@@ -447,7 +447,7 @@ protected:
 
     virtual void                drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
 
-    virtual void                drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
+    virtual void                drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) = 0;
 
     virtual void                drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
 
diff --git a/vcl/inc/salgdiimpl.hxx b/vcl/inc/salgdiimpl.hxx
index 1771afaeaee8..bf81e394976a 100644
--- a/vcl/inc/salgdiimpl.hxx
+++ b/vcl/inc/salgdiimpl.hxx
@@ -94,7 +94,7 @@ public:
 
     virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) = 0;
 
-    virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
+    virtual void drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) = 0;
 
     virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) = 0;
 
diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h
index 01c061c565cc..c3e7c35cc350 100644
--- a/vcl/inc/unx/genpspgraphics.h
+++ b/vcl/inc/unx/genpspgraphics.h
@@ -121,7 +121,7 @@ public:
     virtual void            drawPixel( long nX, long nY, SalColor nSalColor ) override;
     virtual void            drawLine( long nX1, long nY1, long nX2, long nY2 ) override;
     virtual void            drawRect( long nX, long nY, long nWidth, long nHeight ) override;
-    virtual void            drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void            drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
     virtual void            drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
     virtual void            drawPolyPolygon( sal_uInt32 nPoly,
                                              const sal_uInt32* pPoints,
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index 46d2557f1b21..8e5045ff4f01 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -151,7 +151,7 @@ public:
     virtual void                    drawPixel( long nX, long nY, SalColor nSalColor ) override;
     virtual void                    drawLine( long nX1, long nY1, long nX2, long nY2 ) override;
     virtual void                    drawRect( long nX, long nY, long nWidth, long nHeight ) override;
-    virtual void                    drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void                    drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
     virtual void                    drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
 
     virtual void                    drawPolyPolygon(
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 38edc94d0d37..d975b5d70773 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -227,7 +227,7 @@ protected:
     virtual void        drawPixel( long nX, long nY, SalColor nSalColor ) override;
     virtual void        drawLine( long nX1, long nY1, long nX2, long nY2 ) override;
     virtual void        drawRect( long nX, long nY, long nWidth, long nHeight ) override;
-    virtual void        drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void        drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
     virtual void        drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
     virtual void        drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) override;
     virtual bool        drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency ) override;
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index f3d4f6925cef..4a0153caf509 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1544,7 +1544,7 @@ void OpenGLSalGraphicsImpl::drawRect( long nX, long nY, long nWidth, long nHeigh
     PostBatchDraw();
 }
 
-void OpenGLSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry )
+void OpenGLSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry )
 {
     VCL_GL_INFO("::drawPolyLine legacy -> redirecting to drawPolyLine");
     basegfx::B2DPolygon aPoly;
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 227fa09d1b95..099c33e3e817 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -1393,7 +1393,7 @@ void AquaSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
     DBG_DRAW_OPERATION_EXIT("drawRect");
 }
 
-void AquaSalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry )
+void AquaSalGraphics::drawPolyLine( sal_uInt32 nPoints, SalPoint *pPtAry )
 {
     DBG_DRAW_OPERATION("drawPolyLine",);
 
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index ea01dfb1508d..5b61813353a3 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -391,7 +391,7 @@ void SalGraphics::DrawRect( long nX, long nY, long nWidth, long nHeight, const O
     drawRect( nX, nY, nWidth, nHeight );
 }
 
-void SalGraphics::DrawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry, const OutputDevice *pOutDev )
+void SalGraphics::DrawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry, const OutputDevice *pOutDev )
 {
     if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) )
     {
diff --git a/vcl/source/outdev/curvedshapes.cxx b/vcl/source/outdev/curvedshapes.cxx
index 675543f04197..a2d93c922cfa 100644
--- a/vcl/source/outdev/curvedshapes.cxx
+++ b/vcl/source/outdev/curvedshapes.cxx
@@ -57,7 +57,7 @@ void OutputDevice::DrawEllipse( const tools::Rectangle& rRect )
     tools::Polygon aRectPoly( aRect.Center(), aRect.GetWidth() >> 1, aRect.GetHeight() >> 1 );
     if ( aRectPoly.GetSize() >= 2 )
     {
-        const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aRectPoly.GetConstPointAry());
+        SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aRectPoly.GetPointAry());
         if ( !mbFillColor )
             mpGraphics->DrawPolyLine( aRectPoly.GetSize(), pPtAry, this );
         else
@@ -108,7 +108,7 @@ void OutputDevice::DrawArc( const tools::Rectangle& rRect,
 
     if ( aArcPoly.GetSize() >= 2 )
     {
-        const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aArcPoly.GetConstPointAry());
+        SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aArcPoly.GetPointAry());
         mpGraphics->DrawPolyLine( aArcPoly.GetSize(), pPtAry, this );
     }
 
@@ -152,7 +152,7 @@ void OutputDevice::DrawPie( const tools::Rectangle& rRect,
 
     if ( aPiePoly.GetSize() >= 2 )
     {
-        const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aPiePoly.GetConstPointAry());
+        SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aPiePoly.GetPointAry());
         if ( !mbFillColor )
             mpGraphics->DrawPolyLine( aPiePoly.GetSize(), pPtAry, this );
         else
@@ -203,7 +203,7 @@ void OutputDevice::DrawChord( const tools::Rectangle& rRect,
 
     if ( aChordPoly.GetSize() >= 2 )
     {
-        const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aChordPoly.GetConstPointAry());
+        SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aChordPoly.GetPointAry());
         if ( !mbFillColor )
             mpGraphics->DrawPolyLine( aChordPoly.GetSize(), pPtAry, this );
         else
diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx
index 83c755893d71..b4a78314afcb 100644
--- a/vcl/source/outdev/line.cxx
+++ b/vcl/source/outdev/line.cxx
@@ -255,8 +255,8 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin
 
             if(!bDone)
             {
-                const tools::Polygon aPolygon(aCandidate);
-                mpGraphics->DrawPolyLine(aPolygon.GetSize(), reinterpret_cast<const SalPoint*>(aPolygon.GetConstPointAry()), this);
+                tools::Polygon aPolygon(aCandidate);
+                mpGraphics->DrawPolyLine(aPolygon.GetSize(), reinterpret_cast<SalPoint*>(aPolygon.GetPointAry()), this);
             }
         }
     }
diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx
index 02d1cb5501d2..b847b8ae17be 100644
--- a/vcl/source/outdev/polyline.cxx
+++ b/vcl/source/outdev/polyline.cxx
@@ -86,7 +86,7 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly )
     }
 
     tools::Polygon aPoly = ImplLogicToDevicePixel( rPoly );
-    const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aPoly.GetConstPointAry());
+    SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aPoly.GetPointAry());
 
     // #100127# Forward beziers to sal, if any
     if( aPoly.HasFlags() )
@@ -95,7 +95,7 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly )
         if( !mpGraphics->DrawPolyLineBezier( nPoints, pPtAry, pFlgAry, this ) )
         {
             aPoly = tools::Polygon::SubdivideBezier(aPoly);
-            pPtAry = reinterpret_cast<const SalPoint*>(aPoly.GetConstPointAry());
+            pPtAry = reinterpret_cast<SalPoint*>(aPoly.GetPointAry());
             mpGraphics->DrawPolyLine( aPoly.GetSize(), pPtAry, this );
         }
     }
@@ -277,7 +277,7 @@ void OutputDevice::drawPolyLine(const tools::Polygon& rPoly, const LineInfo& rLi
             nPoints = aPoly.GetSize();
         }
 
-        mpGraphics->DrawPolyLine(nPoints, reinterpret_cast<const SalPoint*>(aPoly.GetConstPointAry()), this);
+        mpGraphics->DrawPolyLine(nPoints, reinterpret_cast<SalPoint*>(aPoly.GetPointAry()), this);
     }
 
     if( mpAlphaVDev )
diff --git a/vcl/source/outdev/rect.cxx b/vcl/source/outdev/rect.cxx
index 11633591d084..f59669361a70 100644
--- a/vcl/source/outdev/rect.cxx
+++ b/vcl/source/outdev/rect.cxx
@@ -112,11 +112,11 @@ void OutputDevice::DrawRect( const tools::Rectangle& rRect,
     }
     else
     {
-        const tools::Polygon aRoundRectPoly( aRect, nHorzRound, nVertRound );
+        tools::Polygon aRoundRectPoly( aRect, nHorzRound, nVertRound );
 
         if ( aRoundRectPoly.GetSize() >= 2 )
         {
-            const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aRoundRectPoly.GetConstPointAry());
+            SalPoint* pPtAry = reinterpret_cast<SalPoint*>(aRoundRectPoly.GetPointAry());
 
             if ( !mbFillColor )
                 mpGraphics->DrawPolyLine( aRoundRectPoly.GetSize(), pPtAry, this );
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index 649315473132..efd25790f00e 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -1240,7 +1240,7 @@ void X11SalGraphicsImpl::drawRect( long nX, long nY, long nDX, long nDY )
                         nX, nY, nDX-1, nDY-1 );
 }
 
-void X11SalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry )
+void X11SalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, SalPoint *pPtAry )
 {
     drawPolyLine( nPoints, pPtAry, false );
 }
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx
index 9f404d16acc0..953ea731141f 100644
--- a/vcl/unx/generic/gdi/gdiimpl.hxx
+++ b/vcl/unx/generic/gdi/gdiimpl.hxx
@@ -152,7 +152,7 @@ public:
 
     virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) override;
 
-    virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
 
     virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
 
diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx
index 8f39d1b407a6..01f39b0a5ddc 100644
--- a/vcl/unx/generic/gdi/salgdi.cxx
+++ b/vcl/unx/generic/gdi/salgdi.cxx
@@ -431,7 +431,7 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY )
     mxImpl->drawRect( nX, nY, nDX, nDY );
 }
 
-void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry )
+void X11SalGraphics::drawPolyLine( sal_uInt32 nPoints, SalPoint *pPtAry )
 {
     mxImpl->drawPolyLine( nPoints, pPtAry );
 }
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index 1ebf35aefca0..8cae10af2997 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -396,9 +396,9 @@ void GenPspGraphics::drawRect( long nX, long nY, long nDX, long nDY )
     m_pPrinterGfx->DrawRect (tools::Rectangle(Point(nX, nY), Size(nDX, nDY)));
 }
 
-void GenPspGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint *pPtAry )
+void GenPspGraphics::drawPolyLine( sal_uInt32 nPoints, SalPoint *pPtAry )
 {
-    m_pPrinterGfx->DrawPolyLine (nPoints, reinterpret_cast<Point const *>(pPtAry));
+    m_pPrinterGfx->DrawPolyLine (nPoints, reinterpret_cast<Point *>(pPtAry));
 }
 
 void GenPspGraphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry )
diff --git a/vcl/win/gdi/gdiimpl.cxx b/vcl/win/gdi/gdiimpl.cxx
index 30a9c3488b98..6eb6782c9154 100644
--- a/vcl/win/gdi/gdiimpl.cxx
+++ b/vcl/win/gdi/gdiimpl.cxx
@@ -1663,12 +1663,12 @@ void WinSalGraphicsImpl::drawRect( long nX, long nY, long nWidth, long nHeight )
         Rectangle( mrParent.getHDC(), (int)nX, (int)nY, (int)(nX+nWidth), (int)(nY+nHeight) );
 }
 
-void WinSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry )
+void WinSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry )
 {
     // for NT, we can handover the array directly
     static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
 
-    POINT* pWinPtAry = reinterpret_cast<POINT*>(const_cast<SalPoint *>(pPtAry));
+    POINT* pWinPtAry = reinterpret_cast<POINT*>(pPtAry);
 
     // we assume there are at least 2 points (Polyline requires at least 2 point, see MSDN)
     // we must paint the endpoint for last line
diff --git a/vcl/win/gdi/gdiimpl.hxx b/vcl/win/gdi/gdiimpl.hxx
index 962ce09fabc9..5eb63a21d1ae 100644
--- a/vcl/win/gdi/gdiimpl.hxx
+++ b/vcl/win/gdi/gdiimpl.hxx
@@ -100,7 +100,7 @@ public:
 
     virtual void drawRect( long nX, long nY, long nWidth, long nHeight ) override;
 
-    virtual void drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
+    virtual void drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry ) override;
 
     virtual void drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) override;
 
diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx
index ef9732c7f9fc..587b3c62bd3e 100644
--- a/vcl/win/gdi/salgdi.cxx
+++ b/vcl/win/gdi/salgdi.cxx
@@ -780,7 +780,7 @@ void WinSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight )
     mpImpl->drawRect( nX, nY, nWidth, nHeight );
 }
 
-void WinSalGraphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry )
+void WinSalGraphics::drawPolyLine( sal_uInt32 nPoints, SalPoint* pPtAry )
 {
     mpImpl->drawPolyLine( nPoints, pPtAry );
 }


More information about the Libreoffice-commits mailing list