Author: alg
Date: Mon Jan  9 13:04:05 2012
New Revision: 1229133

URL: http://svn.apache.org/viewvc?rev=1229133&view=rev
Log:
Linecaps: Adapted Vcl LineInfo handling methods to take care of LineCaps

Modified:
    incubator/ooo/branches/alg/linecap/main/vcl/aqua/source/gdi/salgdi.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/inc/aqua/salgdi.h
    incubator/ooo/branches/alg/linecap/main/vcl/inc/os2/salgdi.h
    incubator/ooo/branches/alg/linecap/main/vcl/inc/salgdi.hxx
    incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/pspgraphics.h
    incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/salgdi.h
    incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/outdev.hxx
    incubator/ooo/branches/alg/linecap/main/vcl/inc/win/salgdi.h
    incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev6.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/salgdilayout.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/pspgraphics.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/salgdi.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.hxx
    incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.hxx
    
incubator/ooo/branches/alg/linecap/main/vcl/win/source/gdi/salgdi_gdiplus.cxx

Modified: incubator/ooo/branches/alg/linecap/main/vcl/aqua/source/gdi/salgdi.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/aqua/source/gdi/salgdi.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/aqua/source/gdi/salgdi.cxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/aqua/source/gdi/salgdi.cxx Mon 
Jan  9 13:04:05 2012
@@ -980,10 +980,12 @@ bool AquaSalGraphics::drawPolyPolygon( c
 
 // -----------------------------------------------------------------------
 
-bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine,
+bool AquaSalGraphics::drawPolyLine( 
+    const ::basegfx::B2DPolygon& rPolyLine,
        double fTransparency,
        const ::basegfx::B2DVector& rLineWidths,
-       basegfx::B2DLineJoin eLineJoin )
+       basegfx::B2DLineJoin eLineJoin,
+    com::sun::star::drawing::LineCap eLineCap)
 {
        // short circuit if there is nothing to do
        const int nPointCount = rPolyLine.count();

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/aqua/salgdi.h
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/aqua/salgdi.h?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/aqua/salgdi.h (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/aqua/salgdi.h Mon Jan  9 
13:04:05 2012
@@ -190,7 +190,12 @@ public:
     virtual sal_Bool   drawPolyLineBezier( sal_uLong nPoints, const SalPoint* 
pPtAry, const sal_uInt8* pFlgAry );
     virtual sal_Bool   drawPolygonBezier( sal_uLong nPoints, const SalPoint* 
pPtAry, const sal_uInt8* pFlgAry );
     virtual sal_Bool   drawPolyPolygonBezier( sal_uLong nPoly, const 
sal_uLong* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* 
pFlgAry );
-    virtual bool        drawPolyLine( const ::basegfx::B2DPolygon&, double 
fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
+    virtual bool        drawPolyLine( 
+        const ::basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const ::basegfx::B2DVector& rLineWidths, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap eLineCap);
 
     // CopyArea --> No RasterOp, but ClipRegion
     virtual void               copyArea( long nDestX, long nDestY, long nSrcX, 
long nSrcY, long nSrcWidth,

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/os2/salgdi.h
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/os2/salgdi.h?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/os2/salgdi.h (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/os2/salgdi.h Mon Jan  9 
13:04:05 2012
@@ -170,7 +170,12 @@ protected:
     virtual void               drawPolygon( ULONG nPoints, const SalPoint* 
pPtAry );
     virtual void               drawPolyPolygon( ULONG nPoly, const ULONG* 
pPoints, PCONSTSALPOINT* pPtAry );
     virtual bool        drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, 
double fTransparency );
-    virtual bool        drawPolyLine( const ::basegfx::B2DPolygon&, double 
fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin );
+    virtual bool        drawPolyLine( 
+        const ::basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const ::basegfx::B2DVector& rLineWidth, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap);
     virtual sal_Bool   drawPolyLineBezier( sal_uIntPtr nPoints, const 
SalPoint* pPtAry, const sal_uInt8* pFlgAry );
     virtual sal_Bool   drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* 
pPtAry, const sal_uInt8* pFlgAry );
     virtual sal_Bool   drawPolyPolygonBezier( sal_uInt32 nPoly, const 
sal_uInt32* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* 
pFlgAry );

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/salgdi.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/salgdi.hxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/salgdi.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/salgdi.hxx Mon Jan  9 
13:04:05 2012
@@ -123,7 +123,12 @@ protected:
     virtual void               drawPolygon( sal_uLong nPoints, const SalPoint* 
pPtAry ) = 0;
     virtual void               drawPolyPolygon( sal_uInt32 nPoly, const 
sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) = 0;
     virtual bool        drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, 
double fTransparency ) = 0;
-    virtual bool        drawPolyLine( const ::basegfx::B2DPolygon&, double 
fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin ) 
= 0;
+    virtual bool        drawPolyLine( 
+        const ::basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const ::basegfx::B2DVector& rLineWidths, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap) = 0;
     virtual sal_Bool   drawPolyLineBezier( sal_uLong nPoints, const SalPoint* 
pPtAry, const sal_uInt8* pFlgAry ) = 0;
     virtual sal_Bool   drawPolygonBezier( sal_uLong nPoints, const SalPoint* 
pPtAry, const sal_uInt8* pFlgAry ) = 0;
     virtual sal_Bool   drawPolyPolygonBezier( sal_uInt32 nPoly, const 
sal_uInt32* pPoints, const SalPoint* const* pPtAry, const sal_uInt8* const* 
pFlgAry ) = 0;
@@ -365,7 +370,15 @@ public:
                                              PCONSTSALPOINT* pPtAry,
                                              const OutputDevice *pOutDev );
     bool                    DrawPolyPolygon( const ::basegfx::B2DPolyPolygon&, 
double fTransparency, const OutputDevice* );
-    bool                    DrawPolyLine( const basegfx::B2DPolygon&, double 
fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, 
const OutputDevice* );
+    
+    bool DrawPolyLine( 
+        const basegfx::B2DPolygon& i_rPolygon, 
+        double i_fTransparency, 
+        const basegfx::B2DVector& i_rLineWidth, 
+        basegfx::B2DLineJoin i_eLineJoin, 
+        com::sun::star::drawing::LineCap i_eLineCap,
+        const OutputDevice* i_pOutDev);
+
     sal_Bool                DrawPolyLineBezier( sal_uLong nPoints,
                                                 const SalPoint* pPtAry,
                                                 const sal_uInt8* pFlgAry,

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/pspgraphics.h
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/pspgraphics.h?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/pspgraphics.h (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/pspgraphics.h Mon Jan  
9 13:04:05 2012
@@ -140,7 +140,12 @@ public:
                                              const sal_uInt32* pPoints,
                                              PCONSTSALPOINT* pPtAry );
     virtual bool                       drawPolyPolygon( const 
::basegfx::B2DPolyPolygon&, double fTransparency );
-    virtual bool            drawPolyLine( const basegfx::B2DPolygon&, double 
fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin);
+    virtual bool            drawPolyLine( 
+        const basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const basegfx::B2DVector& rLineWidths, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap);
     virtual sal_Bool           drawPolyLineBezier( sal_uIntPtr nPoints,
                                                 const SalPoint* pPtAry,
                                                 const sal_uInt8* pFlgAry );

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/salgdi.h
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/salgdi.h?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/salgdi.h (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/unx/salgdi.h Mon Jan  9 
13:04:05 2012
@@ -288,7 +288,12 @@ public:
                                              const sal_uInt32* pPoints,
                                              PCONSTSALPOINT* pPtAry );
     virtual bool                       drawPolyPolygon( const 
::basegfx::B2DPolyPolygon&, double fTransparency );
-    virtual bool                       drawPolyLine( const 
::basegfx::B2DPolygon&, double fTransparency, const ::basegfx::B2DVector& 
rLineWidth, basegfx::B2DLineJoin );
+    virtual bool                       drawPolyLine( 
+        const ::basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const ::basegfx::B2DVector& rLineWidth, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap);
     virtual bool                       drawFilledTrapezoids( const 
::basegfx::B2DTrapezoid*, int nTrapCount, double fTransparency );
 
 #if 1 // TODO: remove these obselete methods

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/outdev.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/outdev.hxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/outdev.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/outdev.hxx Mon Jan  9 
13:04:05 2012
@@ -41,7 +41,7 @@
 #include <com/sun/star/uno/Reference.h>
 #include <unotools/fontdefs.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
-
+#include <com/sun/star/drawing/LineCap.hpp>
 #include <vector>
 
 struct ImplOutDevData;
@@ -556,7 +556,11 @@ public:
 
        // #i101491#
        // Helper who tries to use SalGDI's DrawPolyLine direct and returns 
it's bool. Contains no AA check.
-       SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect(const basegfx::B2DPolygon& 
rB2DPolygon, double fLineWidth, basegfx::B2DLineJoin eLineJoin);
+       SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect(
+        const basegfx::B2DPolygon& rB2DPolygon, 
+        double fLineWidth = 0.0, 
+        basegfx::B2DLineJoin eLineJoin = basegfx::B2DLINEJOIN_NONE,
+        com::sun::star::drawing::LineCap eLineCap = 
com::sun::star::drawing::LineCap_BUTT);
 
        // Helper for line geometry paint with support for graphic expansion 
(pattern and fat_to_area)
     void impPaintLineGeometryWithEvtlExpand(const LineInfo& rInfo, 
basegfx::B2DPolyPolygon aLinePolyPolygon);
@@ -687,7 +691,11 @@ public:
         @see DrawPolyPolygon
      */
     void                DrawPolyLine( const Polygon& rPoly );
-    void                DrawPolyLine( const basegfx::B2DPolygon&, double 
fLineWidth = 0.0, basegfx::B2DLineJoin = basegfx::B2DLINEJOIN_ROUND );
+    void DrawPolyLine( 
+        const basegfx::B2DPolygon&, 
+        double fLineWidth = 0.0, 
+        basegfx::B2DLineJoin = basegfx::B2DLINEJOIN_ROUND,
+        com::sun::star::drawing::LineCap = 
com::sun::star::drawing::LineCap_BUTT);
 
     /** Render the given polygon as a line stroke
 

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/win/salgdi.h
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/win/salgdi.h?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/win/salgdi.h (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/win/salgdi.h Mon Jan  9 
13:04:05 2012
@@ -190,7 +190,12 @@ protected:
     virtual void               drawPolygon( sal_uIntPtr nPoints, const 
SalPoint* pPtAry );
     virtual void               drawPolyPolygon( sal_uInt32 nPoly, const 
sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry );
     virtual bool        drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, 
double fTransparency );
-    virtual bool        drawPolyLine( const ::basegfx::B2DPolygon&, double 
fTransparency, const ::basegfx::B2DVector& rLineWidth, basegfx::B2DLineJoin );
+    virtual bool        drawPolyLine( 
+        const ::basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const ::basegfx::B2DVector& rLineWidth, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap);
     virtual sal_Bool   drawPolyLineBezier( sal_uIntPtr nPoints, const 
SalPoint* pPtAry, const sal_uInt8* pFlgAry );
     virtual sal_Bool   drawPolygonBezier( sal_uIntPtr nPoints, const SalPoint* 
pPtAry, const sal_uInt8* pFlgAry );
     virtual sal_Bool   drawPolyPolygonBezier( sal_uInt32 nPoly, const 
sal_uInt32* pPoints, const SalPoint* const* pPtAry, const BYTE* const* pFlgAry 
);

Modified: incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev.cxx Mon Jan  
9 13:04:05 2012
@@ -1509,7 +1509,7 @@ void OutputDevice::DrawLine( const Point
             aB2DPolyLine = 
basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine);
         }
 
-               if( mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, 
basegfx::B2DLINEJOIN_NONE, this))
+               if( mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, 
basegfx::B2DLINEJOIN_NONE, com::sun::star::drawing::LineCap_BUTT, this))
                {
                        return;
                }
@@ -1615,7 +1615,7 @@ void OutputDevice::impPaintLineGeometryW
 
             if(bTryAA)
             {
-                bDone = mpGraphics->DrawPolyLine( aCandidate, 0.0, 
basegfx::B2DVector(1.0,1.0), basegfx::B2DLINEJOIN_NONE, this);
+                bDone = mpGraphics->DrawPolyLine( aCandidate, 0.0, 
basegfx::B2DVector(1.0,1.0), basegfx::B2DLINEJOIN_NONE, 
com::sun::star::drawing::LineCap_BUTT, this);
             }
 
             if(!bDone)
@@ -1793,7 +1793,7 @@ void OutputDevice::DrawPolyLine( const P
         && IsLineColor());
 
        // use b2dpolygon drawing if possible
-       if(bTryAA && ImpTryDrawPolyLineDirect(rPoly.getB2DPolygon(), 0.0, 
basegfx::B2DLINEJOIN_NONE))
+       if(bTryAA && ImpTryDrawPolyLineDirect(rPoly.getB2DPolygon()))
        {
                basegfx::B2DPolygon aB2DPolyLine(rPoly.getB2DPolygon());
                const ::basegfx::B2DHomMatrix aTransform = 
ImplGetDeviceTransformation();
@@ -1807,7 +1807,7 @@ void OutputDevice::DrawPolyLine( const P
             aB2DPolyLine = 
basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolyLine);
         }
 
-               if(mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, 
basegfx::B2DLINEJOIN_NONE, this))
+               if(mpGraphics->DrawPolyLine( aB2DPolyLine, 0.0, aB2DLineWidth, 
basegfx::B2DLINEJOIN_NONE, com::sun::star::drawing::LineCap_BUTT, this))
                {
                        return;
                }
@@ -1855,7 +1855,7 @@ void OutputDevice::DrawPolyLine( const P
     if((mnAntialiasing & ANTIALIASING_ENABLE_B2DDRAW) 
         && LINE_SOLID == rLineInfo.GetStyle())
     {
-               DrawPolyLine( rPoly.getB2DPolygon(), 
(double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin());
+               DrawPolyLine( rPoly.getB2DPolygon(), 
(double)rLineInfo.GetWidth(), rLineInfo.GetLineJoin(), rLineInfo.GetLineCap());
                return;
     }
 
@@ -1987,7 +1987,13 @@ void OutputDevice::DrawPolygon( const Po
                                aB2DPolygon = 
basegfx::tools::snapPointsOfHorizontalOrVerticalEdges(aB2DPolygon);
                        }
 
-                       bSuccess = mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, 
aB2DLineWidth, basegfx::B2DLINEJOIN_NONE, this);
+                       bSuccess = mpGraphics->DrawPolyLine( 
+                aB2DPolygon, 
+                0.0, 
+                aB2DLineWidth, 
+                basegfx::B2DLINEJOIN_NONE, 
+                com::sun::star::drawing::LineCap_BUTT,
+                this);
                }
 
                if(bSuccess)
@@ -2079,7 +2085,13 @@ void OutputDevice::DrawPolyPolygon( cons
 
                        for(sal_uInt32 a(0); bSuccess && a < 
aB2DPolyPolygon.count(); a++)
                        {
-                               bSuccess = mpGraphics->DrawPolyLine( 
aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, 
basegfx::B2DLINEJOIN_NONE, this);
+                               bSuccess = mpGraphics->DrawPolyLine( 
+                    aB2DPolyPolygon.getB2DPolygon(a), 
+                    0.0, 
+                    aB2DLineWidth, 
+                    basegfx::B2DLINEJOIN_NONE, 
+                    com::sun::star::drawing::LineCap_BUTT,
+                    this);
                        }
                }
 
@@ -2202,7 +2214,13 @@ void OutputDevice::ImpDrawPolyPolygonWit
 
                        for(sal_uInt32 a(0);bSuccess && a < 
aB2DPolyPolygon.count(); a++)
                        {
-                               bSuccess = mpGraphics->DrawPolyLine( 
aB2DPolyPolygon.getB2DPolygon(a), 0.0, aB2DLineWidth, 
basegfx::B2DLINEJOIN_NONE, this);
+                               bSuccess = mpGraphics->DrawPolyLine( 
+                    aB2DPolyPolygon.getB2DPolygon(a), 
+                    0.0, 
+                    aB2DLineWidth, 
+                    basegfx::B2DLINEJOIN_NONE, 
+                    com::sun::star::drawing::LineCap_BUTT,
+                    this);
                        }
                }
 
@@ -2223,7 +2241,8 @@ void OutputDevice::ImpDrawPolyPolygonWit
 bool OutputDevice::ImpTryDrawPolyLineDirect(
        const basegfx::B2DPolygon& rB2DPolygon,
     double fLineWidth,
-    basegfx::B2DLineJoin eLineJoin)
+    basegfx::B2DLineJoin eLineJoin,
+    com::sun::star::drawing::LineCap eLineCap)
 {
     const basegfx::B2DHomMatrix aTransform = ImplGetDeviceTransformation();
     basegfx::B2DVector aB2DLineWidth(1.0, 1.0);
@@ -2249,17 +2268,25 @@ bool OutputDevice::ImpTryDrawPolyLineDir
     }
 
     // draw the polyline
-    return mpGraphics->DrawPolyLine( aB2DPolygon, 0.0, aB2DLineWidth, 
eLineJoin, this);
+    return mpGraphics->DrawPolyLine( 
+        aB2DPolygon, 
+        0.0, 
+        aB2DLineWidth, 
+        eLineJoin, 
+        eLineCap,
+        this);
 }
 
 void OutputDevice::DrawPolyLine(
     const basegfx::B2DPolygon& rB2DPolygon,
     double fLineWidth,
-    basegfx::B2DLineJoin eLineJoin)
+    basegfx::B2DLineJoin eLineJoin,
+    com::sun::star::drawing::LineCap eLineCap)
 {
        DBG_TRACE( "OutputDevice::DrawPolyLine(B2D&)" );
        DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
     (void)eLineJoin; // ATM used in UNX, but not in WNT, access it for 
warning-free
+    (void)eLineCap;
 
 #if 0 // MetaB2DPolyLineAction is not implemented yet:
       // according to AW adding it is very dangerous since there is a lot
@@ -2301,7 +2328,7 @@ void OutputDevice::DrawPolyLine(
         && IsLineColor());
 
        // use b2dpolygon drawing if possible
-       if(bTryAA && ImpTryDrawPolyLineDirect(rB2DPolygon, fLineWidth, 
eLineJoin))
+       if(bTryAA && ImpTryDrawPolyLineDirect(rB2DPolygon, fLineWidth, 
eLineJoin, eLineCap))
        {
                return;
        }
@@ -2315,9 +2342,12 @@ void OutputDevice::DrawPolyLine(
                && rB2DPolygon.count() <= 1000)
        {
                const double fHalfLineWidth((fLineWidth * 0.5) + 0.5);
-               const basegfx::B2DPolyPolygon 
aAreaPolyPolygon(basegfx::tools::createAreaGeometry(
-                       rB2DPolygon, fHalfLineWidth, eLineJoin));
-
+               const basegfx::B2DPolyPolygon aAreaPolyPolygon(
+            basegfx::tools::createAreaGeometry(
+                           rB2DPolygon, 
+                fHalfLineWidth, 
+                eLineJoin,
+                eLineCap));
                const Color aOldLineColor(maLineColor);
                const Color aOldFillColor(maFillColor);
 
@@ -2344,7 +2374,7 @@ void OutputDevice::DrawPolyLine(
                        // to avoid optical gaps
                        for(sal_uInt32 a(0); a < aAreaPolyPolygon.count(); a++)
                        {
-                               
ImpTryDrawPolyLineDirect(aAreaPolyPolygon.getB2DPolygon(a), 0.0, 
basegfx::B2DLINEJOIN_NONE);
+                               
ImpTryDrawPolyLineDirect(aAreaPolyPolygon.getB2DPolygon(a));
                        }
                }
        }

Modified: incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev6.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev6.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev6.cxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev6.cxx Mon Jan  
9 13:04:05 2012
@@ -200,7 +200,7 @@ void OutputDevice::DrawTransparent( cons
                        for( int nPolyIdx = 0; nPolyIdx < nPolyCount; 
++nPolyIdx )
                        {
                                const ::basegfx::B2DPolygon aOnePoly = 
aB2DPolyPolygon.getB2DPolygon( nPolyIdx );
-                               mpGraphics->DrawPolyLine( aOnePoly, 
fTransparency, aHairlineWidth, ::basegfx::B2DLINEJOIN_NONE, this );
+                               mpGraphics->DrawPolyLine( aOnePoly, 
fTransparency, aHairlineWidth, ::basegfx::B2DLINEJOIN_NONE, 
com::sun::star::drawing::LineCap_BUTT, this );
                        }
                }
 
@@ -317,7 +317,7 @@ void OutputDevice::DrawTransparent( cons
                        for( int nPolyIdx = 0; nPolyIdx < nPolyCount; 
++nPolyIdx )
                        {
                                const ::basegfx::B2DPolygon& rPolygon = 
aB2DPolyPolygon.getB2DPolygon( nPolyIdx );
-                               bDrawn = mpGraphics->DrawPolyLine( rPolygon, 
fTransparency, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, this );
+                               bDrawn = mpGraphics->DrawPolyLine( rPolygon, 
fTransparency, aLineWidths, ::basegfx::B2DLINEJOIN_NONE, 
com::sun::star::drawing::LineCap_BUTT, this );
                        }
                        // prepare to restore the fill color
                        mbInitFillColor = mbFillColor;

Modified: 
incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/salgdilayout.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/salgdilayout.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/salgdilayout.cxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/salgdilayout.cxx Mon 
Jan  9 13:04:05 2012
@@ -412,7 +412,8 @@ bool SalGraphics::drawPolyLine( 
     const basegfx::B2DPolygon& /*rPolyPolygon*/,
     double /*fTransparency*/,
     const basegfx::B2DVector& /*rLineWidths*/, 
-    basegfx::B2DLineJoin /*eLineJoin*/)
+    basegfx::B2DLineJoin /*eLineJoin*/,
+    com::sun::star::drawing::LineCap /*eLineCap*/)
 {
     return false;
 }
@@ -542,18 +543,22 @@ sal_Bool SalGraphics::DrawPolyPolygonBez
     return bRet;
 }
 
-bool SalGraphics::DrawPolyLine( const ::basegfx::B2DPolygon& i_rPolygon, 
double fTransparency,
-    const ::basegfx::B2DVector& i_rLineWidth, basegfx::B2DLineJoin i_eLineJoin,
+bool SalGraphics::DrawPolyLine( 
+    const ::basegfx::B2DPolygon& i_rPolygon, 
+    double i_fTransparency,
+    const ::basegfx::B2DVector& i_rLineWidth, 
+    basegfx::B2DLineJoin i_eLineJoin,
+    com::sun::star::drawing::LineCap i_eLineCap,
     const OutputDevice* i_pOutDev )
 {
     bool bRet = false;
        if( (m_nLayout & SAL_LAYOUT_BIDI_RTL) || (i_pOutDev && 
i_pOutDev->IsRTLEnabled()) ) 
        {
         basegfx::B2DPolygon aMirror( mirror( i_rPolygon, i_pOutDev ) );
-        bRet = drawPolyLine( aMirror, fTransparency, i_rLineWidth, i_eLineJoin 
);
+        bRet = drawPolyLine( aMirror, i_fTransparency, i_rLineWidth, 
i_eLineJoin, i_eLineCap );
     }
     else
-        bRet = drawPolyLine( i_rPolygon, fTransparency, i_rLineWidth, 
i_eLineJoin );
+        bRet = drawPolyLine( i_rPolygon, i_fTransparency, i_rLineWidth, 
i_eLineJoin, i_eLineCap );
     return bRet;
 }
 

Modified: 
incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/pspgraphics.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/pspgraphics.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/pspgraphics.cxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/pspgraphics.cxx 
Mon Jan  9 13:04:05 2012
@@ -405,7 +405,12 @@ bool PspGraphics::drawPolyPolygon( const
         return false;
 }
 
-bool PspGraphics::drawPolyLine( const basegfx::B2DPolygon&, double 
/*fTranspareny*/, const basegfx::B2DVector& /*rLineWidths*/, 
basegfx::B2DLineJoin /*eJoin*/)
+bool PspGraphics::drawPolyLine( 
+    const basegfx::B2DPolygon&, 
+    double /*fTranspareny*/, 
+    const basegfx::B2DVector& /*rLineWidths*/, 
+    basegfx::B2DLineJoin /*eJoin*/,
+    com::sun::star::drawing::LineCap /*eLineCap*/)
 {
     // TODO: a PS printer can draw B2DPolyLines almost directly
     return false;

Modified: incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/salgdi.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/salgdi.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/salgdi.cxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/unx/generic/gdi/salgdi.cxx Mon 
Jan  9 13:04:05 2012
@@ -1190,7 +1190,12 @@ bool X11SalGraphics::drawFilledTrapezoid
 
 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, 
double fTransparency, const ::basegfx::B2DVector& rLineWidth, 
basegfx::B2DLineJoin eLineJoin)
+bool X11SalGraphics::drawPolyLine(
+    const ::basegfx::B2DPolygon& rPolygon, 
+    double fTransparency, 
+    const ::basegfx::B2DVector& rLineWidth, 
+    basegfx::B2DLineJoin eLineJoin,
+    com::sun::star::drawing::LineCap eLineCap)
 {
     const bool bIsHairline = (rLineWidth.getX() == rLineWidth.getY()) && 
(rLineWidth.getX() <= 1.2);
 
@@ -1244,7 +1249,7 @@ bool X11SalGraphics::drawPolyLine(const 
     }
 
     // create the area-polygon for the line
-    const basegfx::B2DPolyPolygon aAreaPolyPoly( 
basegfx::tools::createAreaGeometry(aPolygon, fHalfWidth, eLineJoin) );
+    const basegfx::B2DPolyPolygon aAreaPolyPoly( 
basegfx::tools::createAreaGeometry(aPolygon, fHalfWidth, eLineJoin, eLineCap) );
 
     if( (rLineWidth.getX() != rLineWidth.getY())
     && !basegfx::fTools::equalZero( rLineWidth.getX() ) )

Modified: incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.cxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.cxx Mon Jan 
 9 13:04:05 2012
@@ -372,7 +372,12 @@ void SvpSalGraphics::drawPolyPolygon( sa
     dbgOut( m_aDevice );
 }
 
-bool SvpSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double 
/*fTransparency*/, const ::basegfx::B2DVector& /*rLineWidths*/, 
basegfx::B2DLineJoin /*eJoin*/ )
+bool SvpSalGraphics::drawPolyLine( 
+    const ::basegfx::B2DPolygon&, 
+    double /*fTransparency*/, 
+    const ::basegfx::B2DVector& /*rLineWidths*/, 
+    basegfx::B2DLineJoin /*eJoin*/,
+    com::sun::star::drawing::LineCap /*eLineCap*/)
 {
         // TODO: implement and advertise OutDevSupport_B2DDraw support
         return false;

Modified: incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.hxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.hxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svpgdi.hxx Mon Jan 
 9 13:04:05 2012
@@ -115,7 +115,12 @@ public:
     virtual void                       drawLine( long nX1, long nY1, long nX2, 
long nY2 );
     virtual void                       drawRect( long nX, long nY, long 
nWidth, long nHeight );
     virtual bool            drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, 
double fTransparency );
-    virtual bool            drawPolyLine( const ::basegfx::B2DPolygon&, double 
fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
+    virtual bool            drawPolyLine( 
+        const ::basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const ::basegfx::B2DVector& rLineWidths, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap);
     virtual void                       drawPolyLine( sal_uLong nPoints, const 
SalPoint* pPtAry );
     virtual void                       drawPolygon( sal_uLong nPoints, const 
SalPoint* pPtAry );
     virtual void                       drawPolyPolygon( sal_uInt32 nPoly,

Modified: 
incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.cxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.cxx 
Mon Jan  9 13:04:05 2012
@@ -320,7 +320,12 @@ void PspGraphics::drawPolyPolygon( sal_u
     m_pPrinterGfx->DrawPolyPolygon (nPoly, pPoints, (const Point**)pPtAry);
 }
 
-bool PspGraphics::drawPolyLine( const ::basegfx::B2DPolygon&, double 
/*fTransparency*/, const ::basegfx::B2DVector& /*rLineWidths*/, 
basegfx::B2DLineJoin /*eJoin*/ )
+bool PspGraphics::drawPolyLine( 
+    const ::basegfx::B2DPolygon&, 
+    double /*fTransparency*/, 
+    const ::basegfx::B2DVector& /*rLineWidths*/, 
+    basegfx::B2DLineJoin /*eJoin*/,
+    com::sun::star::drawing::LineCap /*eLineCap*/)
 {
         // TODO: implement and advertise OutDevSupport_B2DDraw support
         return false;

Modified: 
incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.hxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.hxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.hxx 
(original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/unx/headless/svppspgraphics.hxx 
Mon Jan  9 13:04:05 2012
@@ -136,7 +136,12 @@ public:
     virtual void                       drawPolyLine( sal_uLong nPoints, const 
SalPoint* pPtAry );
     virtual void                       drawPolygon( sal_uLong nPoints, const 
SalPoint* pPtAry );
     virtual bool            drawPolyPolygon( const ::basegfx::B2DPolyPolygon&, 
double fTransparency );
-    virtual bool            drawPolyLine( const ::basegfx::B2DPolygon&, double 
fTransparency, const ::basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin );
+    virtual bool            drawPolyLine( 
+        const ::basegfx::B2DPolygon&, 
+        double fTransparency, 
+        const ::basegfx::B2DVector& rLineWidths, 
+        basegfx::B2DLineJoin,
+        com::sun::star::drawing::LineCap);
     virtual void                       drawPolyPolygon( sal_uInt32 nPoly,
                                              const sal_uInt32* pPoints,
                                              PCONSTSALPOINT* pPtAry );

Modified: 
incubator/ooo/branches/alg/linecap/main/vcl/win/source/gdi/salgdi_gdiplus.cxx
URL: 
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/win/source/gdi/salgdi_gdiplus.cxx?rev=1229133&r1=1229132&r2=1229133&view=diff
==============================================================================
--- 
incubator/ooo/branches/alg/linecap/main/vcl/win/source/gdi/salgdi_gdiplus.cxx 
(original)
+++ 
incubator/ooo/branches/alg/linecap/main/vcl/win/source/gdi/salgdi_gdiplus.cxx 
Mon Jan  9 13:04:05 2012
@@ -187,7 +187,12 @@ bool WinSalGraphics::drawPolyPolygon( co
        return true;
 }
 
-bool WinSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolygon, double 
fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin 
eLineJoin )
+bool WinSalGraphics::drawPolyLine( 
+    const basegfx::B2DPolygon& rPolygon, 
+    double fTransparency, 
+    const basegfx::B2DVector& rLineWidths, 
+    basegfx::B2DLineJoin eLineJoin,
+    com::sun::star::drawing::LineCap eLineCap)
 {
     const sal_uInt32 nCount(rPolygon.count());
 
@@ -230,6 +235,27 @@ bool WinSalGraphics::drawPolyLine( const
                        }
                }
 
+        switch(eLineCap)
+        {
+            default: /*com::sun::star::drawing::LineCap_BUTT*/
+            {
+                // nothing to do
+                break;
+            }
+            case com::sun::star::drawing::LineCap_ROUND:
+            {
+                aTestPen.SetStartCap(Gdiplus::LineCapRound);
+                aTestPen.SetEndCap(Gdiplus::LineCapRound);
+                break;
+            }
+            case com::sun::star::drawing::LineCap_SQUARE:
+            {
+                aTestPen.SetStartCap(Gdiplus::LineCapSquare);
+                aTestPen.SetEndCap(Gdiplus::LineCapSquare);
+                break;
+            }
+        }
+
                if(nCount > 250 && basegfx::fTools::more(rLineWidths.getX(), 
1.5))
         {
                impAddB2DPolygonToGDIPlusGraphicsPathInteger(aPath, rPolygon, 
bNoLineJoin);


Reply via email to