incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1227772 [1/2] - in /incubator/ooo/branches/alg/linecap/main: basegfx/inc/basegfx/polygon/ basegfx/source/polygon/ canvas/source/vcl/ cppcanvas/source/mtfrenderer/ cui/source/inc/ cui/source/tabpages/ drawinglayer/inc/drawinglayer/attribute...
Date Thu, 05 Jan 2012 19:13:24 GMT
Author: alg
Date: Thu Jan  5 19:13:22 2012
New Revision: 1227772

URL: http://svn.apache.org/viewvc?rev=1227772&view=rev
Log:
linecap: First version of Regina Henschel's LineCap feature implementation (Kudos to Regina). Adapted to AOO codebase, added some adaptions, fixed some errors

Added:
    incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineCap.idl
    incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xlncapit.hxx
Modified:
    incubator/ooo/branches/alg/linecap/main/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx
    incubator/ooo/branches/alg/linecap/main/basegfx/source/polygon/b2dlinegeometry.cxx
    incubator/ooo/branches/alg/linecap/main/canvas/source/vcl/canvashelper.cxx
    incubator/ooo/branches/alg/linecap/main/cppcanvas/source/mtfrenderer/implrenderer.cxx
    incubator/ooo/branches/alg/linecap/main/cui/source/inc/cuitabline.hxx
    incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.hrc
    incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.src
    incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tpline.cxx
    incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
    incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx
    incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/lineattribute.cxx
    incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/sdrlineattribute.cxx
    incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
    incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/canvasprocessor.cxx
    incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
    incubator/ooo/branches/alg/linecap/main/editeng/inc/editeng/unoprnms.hxx
    incubator/ooo/branches/alg/linecap/main/filter/source/graphicfilter/eps/eps.cxx
    incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineProperties.idl
    incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/makefile.mk
    incubator/ooo/branches/alg/linecap/main/svx/Package_inc.mk
    incubator/ooo/branches/alg/linecap/main/svx/inc/svx/dialogs.hrc
    incubator/ooo/branches/alg/linecap/main/svx/inc/svx/unoshprp.hxx
    incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xattr.hxx
    incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xdef.hxx
    incubator/ooo/branches/alg/linecap/main/svx/source/dialog/sdstring.src
    incubator/ooo/branches/alg/linecap/main/svx/source/sdr/attribute/sdrformtextattribute.cxx
    incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrattributecreator.cxx
    incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
    incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xattr2.cxx
    incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xpool.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/lineinfo.hxx
    incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/lineinfo.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/outdev.cxx
    incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/pdfwriter_impl.cxx
    incubator/ooo/branches/alg/linecap/main/xmloff/inc/xmloff/xmltoken.hxx
    incubator/ooo/branches/alg/linecap/main/xmloff/source/core/xmltoken.cxx
    incubator/ooo/branches/alg/linecap/main/xmloff/source/draw/sdpropls.cxx
    incubator/ooo/branches/alg/linecap/main/xmloff/source/draw/sdpropls.hxx

Modified: incubator/ooo/branches/alg/linecap/main/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/basegfx/inc/basegfx/polygon/b2dlinegeometry.hxx Thu Jan  5 19:13:22 2012
@@ -28,6 +28,7 @@
 #include <basegfx/numeric/ftools.hxx>
 #include <basegfx/polygon/b2dpolypolygon.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -101,6 +102,9 @@ namespace basegfx
             The LineJoin if the edges meeting in a point do not have a C1
             or C2 continuity
 
+            @param eCap
+            The kind of cap, which is added to the line.
+
             @param fMaxAllowedAngle
             Allows to hand over the maximum allowed angle between an edge and
             it's control vectors. The smaller, the more subdivisions will be
@@ -128,6 +132,7 @@ namespace basegfx
             const B2DPolygon& rCandidate, 
             double fHalfLineWidth, 
             B2DLineJoin eJoin = B2DLINEJOIN_ROUND, 
+            com::sun::star::drawing::LineCap eCap = com::sun::star::drawing::LineCap_BUTT,
             double fMaxAllowedAngle = (12.5 * F_PI180), 
 			double fMaxPartOfEdge = 0.4,
             double fMiterMinimumAngle = (15.0 * F_PI180));

Modified: incubator/ooo/branches/alg/linecap/main/basegfx/source/polygon/b2dlinegeometry.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/basegfx/source/polygon/b2dlinegeometry.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/basegfx/source/polygon/b2dlinegeometry.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/basegfx/source/polygon/b2dlinegeometry.cxx Thu Jan  5 19:13:22 2012
@@ -34,6 +34,7 @@
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/curve/b2dcubicbezier.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -566,6 +567,82 @@ namespace basegfx
 
             return aEdgePolygon;
         }
+
+        B2DPolygon createAreaGeometryForCap(
+            const B2DVector& rTangent,
+            const B2DPoint& rPoint,
+            double fHalfLineWidth,
+            com::sun::star::drawing::LineCap eCap,
+            bool bIsStart)
+        {
+            OSL_ENSURE(fHalfLineWidth > 0.0, "createAreaGeometryForJoin: LineWidth too small (!)");
+
+            const B2DVector aScaledPerpend(getNormalizedPerpendicular(rTangent)
+                                 * (bIsStart ? fHalfLineWidth : -fHalfLineWidth));
+            // Vector from rPoint towards cap
+            B2DVector aScaledTangent(rTangent);
+            aScaledTangent.normalize();
+            aScaledTangent *= (bIsStart ? -fHalfLineWidth : fHalfLineWidth);
+
+            B2DPolygon aCapPolygon;
+            const B2DPoint aStartPoint(rPoint + aScaledPerpend);
+            const B2DPoint aEndPoint(rPoint - aScaledPerpend);
+
+            switch(eCap)
+            {
+                case com::sun::star::drawing::LineCap_ROUND :
+                {
+                    // use tooling to add needed EllipseSegment
+                    double fAngleStart(atan2(aScaledPerpend.getY(), aScaledPerpend.getX()));
+
+                    // atan2 results are [-PI .. PI], consolidate to [0.0 .. 2PI]
+                    if(fAngleStart < 0.0)
+                    {
+                        fAngleStart += F_2PI;
+                    }
+
+                    double fAngleEnd = fAngleStart + F_PI;
+                    if(fAngleEnd > F_2PI)
+                    {
+                        fAngleEnd -= F_2PI;
+                    }
+
+                    const B2DPolygon aBow(tools::createPolygonFromEllipseSegment(rPoint, fHalfLineWidth, fHalfLineWidth, fAngleStart, fAngleEnd));
+                    // #i101491#
+                    // use the original start/end positions; the ones from bow creation may be numerically
+                    // different due to their different creation. To guarantee good merging quality with edges
+                    // and edge roundings (and to reduce point count)
+                    
+                    // ToDo Are there at least two points in aBow ?
+                    aCapPolygon = aBow;
+                    aCapPolygon.setB2DPoint(0, aStartPoint);
+                    aCapPolygon.setB2DPoint(aBow.count() - 1, aEndPoint);
+                    aCapPolygon.append(rPoint);
+                    break;
+                }
+                case com::sun::star::drawing::LineCap_SQUARE :
+                {
+                    aCapPolygon.append(aStartPoint);
+                    aCapPolygon.append(aStartPoint + aScaledTangent);
+                    aCapPolygon.append(aEndPoint + aScaledTangent);
+                    aCapPolygon.append(aEndPoint);
+                    aCapPolygon.append(rPoint);
+                    break;
+                }
+                default: // com::sun::star::drawing::LineCap_BUTT
+                {
+                    // No cap.
+                    // ToDo. Is actually not called with BUTT. What setting is
+                    // useful to prevend errors, if called with BUTT anyway?
+                    break;
+                }
+            }
+
+            // create last polygon part for cap
+            aCapPolygon.setClosed(true);
+
+            return aCapPolygon;
+        }
     } // end of anonymus namespace
 
 	namespace tools
@@ -574,6 +651,7 @@ namespace basegfx
             const B2DPolygon& rCandidate, 
             double fHalfLineWidth, 
             B2DLineJoin eJoin, 
+            com::sun::star::drawing::LineCap eCap,
             double fMaxAllowedAngle, 
 			double fMaxPartOfEdge,
             double fMiterMinimumAngle)
@@ -619,6 +697,7 @@ namespace basegfx
 				const bool bEventuallyCreateLineJoin(B2DLINEJOIN_NONE != eJoin);
                 const bool bIsClosed(aCandidate.isClosed());
                 const sal_uInt32 nEdgeCount(bIsClosed ? nPointCount : nPointCount - 1);
+                const bool bCreateLineCap(com::sun::star::drawing::LineCap_BUTT != eCap);
 
                 if(nEdgeCount)
                 {
@@ -628,6 +707,18 @@ namespace basegfx
                     // prepare edge
                     aEdge.setStartPoint(aCandidate.getB2DPoint(0));
 
+                    // eventually create start line cap
+                    if (!bIsClosed && bCreateLineCap)
+                    {
+                      aEdge.setControlPointA(aCandidate.getNextControlPoint(0));
+                      aEdge.setControlPointB(aCandidate.getPrevControlPoint(1 % nPointCount));
+                      aEdge.setEndPoint(aCandidate.getB2DPoint(1 % nPointCount ));
+                      const B2DVector aTangentStart(aEdge.getTangent(0.0));
+                      aRetval.append(createAreaGeometryForCap(
+                                    aTangentStart, aEdge.getStartPoint(),
+                                    fHalfLineWidth, eCap, true /*IsStart*/));
+                    }
+
                     if(bIsClosed && bEventuallyCreateLineJoin)
                     {
                         // prepare previous edge
@@ -705,8 +796,21 @@ namespace basegfx
 
                         aEdge.setStartPoint(aEdge.getEndPoint());
                     }
-                }
 
+                    // eventually create end line cap
+                    if (!bIsClosed && bCreateLineCap)
+                    {
+                        aEdge.setStartPoint(aCandidate.getB2DPoint(nEdgeCount -1));
+                        aEdge.setControlPointA(aCandidate.getNextControlPoint(nEdgeCount -1));
+                        aEdge.setControlPointB(aCandidate.getPrevControlPoint(nEdgeCount % nPointCount));
+                        aEdge.setEndPoint(aCandidate.getB2DPoint(nEdgeCount % nPointCount ));
+                        const B2DVector aTangentEnd(aEdge.getTangent(1.0));
+                        aRetval.append(createAreaGeometryForCap(
+                                    aTangentEnd, aEdge.getEndPoint(),
+                                    fHalfLineWidth, eCap, false /*IsStart*/));
+                    }
+                }
+                // ToDo Returns empty PolyPolygon if rCandidate is a single point?
                 return aRetval;
 			}
             else

Modified: incubator/ooo/branches/alg/linecap/main/canvas/source/vcl/canvashelper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/canvas/source/vcl/canvashelper.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/canvas/source/vcl/canvashelper.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/canvas/source/vcl/canvashelper.cxx Thu Jan  5 19:13:22 2012
@@ -35,6 +35,7 @@
 #include <com/sun/star/rendering/TexturingMode.hpp>
 #include <com/sun/star/rendering/PathCapType.hpp>
 #include <com/sun/star/rendering/PathJoinType.hpp>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 #include <tools/poly.hxx>
 #include <vcl/window.hxx>
@@ -94,6 +95,26 @@ namespace vclcanvas
 
             return basegfx::B2DLINEJOIN_NONE;
         }
+
+        drawing::LineCap unoCapeFromCap( sal_Int8 nCapType)
+        {
+            switch ( nCapType)
+            {
+                case rendering::PathCapType::BUTT:
+                    return drawing::LineCap_BUTT;
+
+                case rendering::PathCapType::ROUND:
+                    return drawing::LineCap_ROUND;
+
+                case rendering::PathCapType::SQUARE:
+                    return drawing::LineCap_SQUARE;
+
+                default:
+                    ENSURE_OR_THROW( false,
+                                      "unoCapeFromCap(): Unexpected cap type" );
+            }
+            return drawing::LineCap_BUTT;
+        }
     }
 
     CanvasHelper::CanvasHelper() :
@@ -384,7 +405,10 @@ namespace vclcanvas
 
                     // AW: New interface, will create bezier polygons now
                     aStrokedPolyPoly.append(basegfx::tools::createAreaGeometry(
-                        aPolyPoly.getB2DPolygon(i), strokeAttributes.StrokeWidth*0.5, b2DJoineFromJoin(strokeAttributes.JoinType)));
+                        aPolyPoly.getB2DPolygon(i), 
+                        strokeAttributes.StrokeWidth*0.5, 
+                        b2DJoineFromJoin(strokeAttributes.JoinType),
+                        unoCapeFromCap(strokeAttributes.StartCapType)));
                     //aStrokedPolyPoly.append( 
                     //    ::basegfx::tools::createAreaGeometryForPolygon( aPolyPoly.getB2DPolygon(i),
                     //                                                    strokeAttributes.StrokeWidth*0.5,

Modified: incubator/ooo/branches/alg/linecap/main/cppcanvas/source/mtfrenderer/implrenderer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/cppcanvas/source/mtfrenderer/implrenderer.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/cppcanvas/source/mtfrenderer/implrenderer.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/cppcanvas/source/mtfrenderer/implrenderer.cxx Thu Jan  5 19:13:22 2012
@@ -289,6 +289,28 @@ namespace
                 break;
         }
 
+        switch(rLineInfo.GetLineCap())
+        {
+            default: /* com::sun::star::drawing::LineCap_BUTT */
+            {
+                o_rStrokeAttributes.StartCapType = rendering::PathCapType::BUTT;
+                o_rStrokeAttributes.EndCapType   = rendering::PathCapType::BUTT;
+                break;
+            }
+            case com::sun::star::drawing::LineCap_ROUND:
+            {
+                o_rStrokeAttributes.StartCapType = rendering::PathCapType::ROUND;
+                o_rStrokeAttributes.EndCapType   = rendering::PathCapType::ROUND;
+                break;
+            }
+            case com::sun::star::drawing::LineCap_SQUARE:
+            {
+                o_rStrokeAttributes.StartCapType = rendering::PathCapType::SQUARE;
+                o_rStrokeAttributes.EndCapType   = rendering::PathCapType::SQUARE;
+                break;
+            }
+        }
+
         if( LINE_DASH == rLineInfo.GetStyle() )
         {
             const ::cppcanvas::internal::OutDevState& rState( getState( rParms.mrStates ) );

Modified: incubator/ooo/branches/alg/linecap/main/cui/source/inc/cuitabline.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/cui/source/inc/cuitabline.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/cui/source/inc/cuitabline.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/cui/source/inc/cuitabline.hxx Thu Jan  5 19:13:22 2012
@@ -127,7 +127,11 @@ private:
 	FixedText           maFTEdgeStyle;
 	LineEndLB           maLBEdgeStyle;
 
-	//#58425# Symbole auf einer Linie (z.B. StarChart) ->
+     // LineCaps
+     FixedText          maFTCapStyle;
+     LineEndLB          maLBCapStyle;
+
+    //#58425# Symbole auf einer Linie (z.B. StarChart) ->
     SdrObjList*         pSymbolList; //a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview. The list position is to be used cyclic.
 	bool				bNewSize;
 	Graphic				aAutoSymbolGraphic; //a graphic to be displayed in the preview in case that an automatic symbol is choosen
@@ -197,6 +201,9 @@ private:
 	// #116827#
 	DECL_LINK( ChangeEdgeStyleHdl_Impl, void * );
 
+     // LineCaps
+     DECL_LINK ( ChangeCapStyleHdl_Impl, void * );
+
 	sal_Bool FillXLSet_Impl();
 #endif
 

Modified: incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.hrc
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.hrc?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.hrc (original)
+++ incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.hrc Thu Jan  5 19:13:22 2012
@@ -97,6 +97,12 @@
 #define FT_EDGE_STYLE 13
 #define LB_EDGE_STYLE 5
 
+// since LO3.6
+#define FT_CAP_STYLE 14
+#define LB_CAP_STYLE 6
+// not sure about IAccessibility2, add it nevertheless
+#define STR_LB_CAP_STYLE 42
+
 //Symbole (fuer StarChart)
 #define FT_SYMBOL_WIDTH		20
 #define FT_SYMBOL_HEIGHT	21

Modified: incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.src
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.src?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.src (original)
+++ incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tabline.src Thu Jan  5 19:13:22 2012
@@ -235,13 +235,13 @@ TabPage RID_SVXPAGE_LINE
 	{
 		Pos = MAP_APPFONT ( 124 , 3 + (16 * 6) - 4 ) ;
 		Size = MAP_APPFONT ( 130 , 8 ) ;
-		Text [ en-US ] = "Corner style" ;
+		Text [ en-US ] = "Corner and cap styles" ;
 	};
 	FixedText FT_EDGE_STYLE
 	{
 		Pos = MAP_APPFONT ( 130 , 14 + (16 * 6) - 4 ) ;
 		Size = MAP_APPFONT ( 118 , 8 ) ;
-		Text [ en-US ] = "Sty~le" ;
+		Text [ en-US ] = "~Corner style" ;
 	};
 	ListBox LB_EDGE_STYLE
 	{
@@ -259,6 +259,27 @@ TabPage RID_SVXPAGE_LINE
 			< "Beveled" ; > ;
 		};
 	};
+    FixedText FT_CAP_STYLE
+    {
+        Pos = MAP_APPFONT ( 191 , 14 + (16 * 6) - 4 ) ;
+        Size = MAP_APPFONT ( 118 , 8 ) ;
+        Text [ en-US ] = "Ca~p style" ;
+    };
+    ListBox LB_CAP_STYLE
+    {
+        HelpID = "cui:ListBox:RID_SVXPAGE_LINE:LB_CAP_STYLE";
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 191 , 25 + (16 * 6) - 4 ) ;
+        Size = MAP_APPFONT ( 57 , 99 ) ;
+        TabStop = TRUE ;
+        DropDown = TRUE ;
+        StringList [ en-US ] =
+        {
+            < "Flat" ; Default ; > ; // Same string as in Excel
+            < "Round" ; > ;
+            < "Square" ; > ;
+        };
+    };
 
 	//////////////////////////////////////////////////////////////////////////////
 

Modified: incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tpline.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tpline.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tpline.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/cui/source/tabpages/tpline.cxx Thu Jan  5 19:13:22 2012
@@ -129,6 +129,10 @@ SvxLineTabPage::SvxLineTabPage
     maFTEdgeStyle       ( this, CUI_RES( FT_EDGE_STYLE ) ),
     maLBEdgeStyle       ( this, CUI_RES( LB_EDGE_STYLE ) ),
     
+    // LineCaps
+    maFTCapStyle        ( this, CUI_RES( FT_CAP_STYLE ) ),
+    maLBCapStyle        ( this, CUI_RES( LB_CAP_STYLE ) ),
+
     pSymbolList(NULL),
     bNewSize(false),
     nNumMenuGalleryItems(0),
@@ -234,6 +238,10 @@ SvxLineTabPage::SvxLineTabPage
 	Link aEdgeStyle = LINK( this, SvxLineTabPage, ChangeEdgeStyleHdl_Impl );
 	maLBEdgeStyle.SetSelectHdl( aEdgeStyle );
 
+    // LineCaps
+    Link aCapStyle = LINK( this, SvxLineTabPage, ChangeCapStyleHdl_Impl );
+    maLBCapStyle.SetSelectHdl( aCapStyle );
+
 	//#58425# Symbole auf einer Linie (z.B. StarChart) , MB-Handler setzen
 	aSymbolMB.SetSelectHdl(LINK(this, SvxLineTabPage, GraphicHdl_Impl));
     aSymbolMB.SetActivateHdl(LINK(this, SvxLineTabPage, MenuCreateHdl_Impl));
@@ -484,6 +492,10 @@ void SvxLineTabPage::ActivatePage( const
 		maFLEdgeStyle.Hide();
 		maFTEdgeStyle.Hide();
 		maLBEdgeStyle.Hide();
+
+        // LineCaps
+        maFTCapStyle.Hide();
+        maLBCapStyle.Hide();
 	}
 }
 
@@ -751,6 +763,45 @@ sal_Bool SvxLineTabPage::FillItemSet( Sf
 		}
 	}
 
+    // LineCaps
+    nPos = maLBCapStyle.GetSelectEntryPos();
+    if( LISTBOX_ENTRY_NOTFOUND != nPos && nPos != maLBCapStyle.GetSavedValue() )
+    {
+        XLineCapItem* pNew = 0L;
+
+        switch(nPos)
+        {
+            case 0: // Butt (=Flat), default
+            {
+                pNew = new XLineCapItem(com::sun::star::drawing::LineCap_BUTT);
+                break;
+            }
+            case 1: // Round
+            {
+                pNew = new XLineCapItem(com::sun::star::drawing::LineCap_ROUND);
+                break;
+            }
+            case 2: // Square
+            {
+                pNew = new XLineCapItem(com::sun::star::drawing::LineCap_SQUARE);
+                break;
+            }
+        }
+
+        if(pNew)
+        {
+            pOld = GetOldItem( rAttrs, XATTR_LINECAP );
+
+            if(!pOld || !(*(const XLineCapItem*)pOld == *pNew))
+            {
+                rAttrs.Put( *pNew );
+                bModified = sal_True;
+            }
+
+            delete pNew;
+        }
+    }
+
 	if(nSymbolType!=SVX_SYMBOLTYPE_UNKNOWN || bNewSize)
 	{
 		//wurde also per Auswahl gesetzt oder Gr��e ist anders
@@ -866,6 +917,30 @@ sal_Bool SvxLineTabPage::FillXLSet_Impl(
 		}
 	}
 
+    // LineCaps
+    nPos = maLBCapStyle.GetSelectEntryPos();
+    if(LISTBOX_ENTRY_NOTFOUND != nPos)
+    {
+        switch(nPos)
+        {
+            case 0: // Butt (=Flat), default
+            {
+                rXLSet.Put(XLineCapItem(com::sun::star::drawing::LineCap_BUTT));
+                break;
+            }
+            case 1: // Round
+            {
+                rXLSet.Put(XLineCapItem(com::sun::star::drawing::LineCap_ROUND));
+                break;
+            }
+            case 2: // Square
+            {
+                rXLSet.Put(XLineCapItem(com::sun::star::drawing::LineCap_SQUARE));
+                break;
+            }
+        }
+    }
+
 	rXLSet.Put( XLineStartWidthItem( GetCoreValue( aMtrStartWidth, ePoolUnit ) ) );
 	rXLSet.Put( XLineEndWidthItem( GetCoreValue( aMtrEndWidth, ePoolUnit ) ) );
 
@@ -1284,6 +1359,28 @@ void SvxLineTabPage::Reset( const SfxIte
 	}
 	*/
 
+    // fdo#43209
+    if(bObjSelected && SFX_ITEM_DEFAULT == rAttrs.GetItemState(XATTR_LINECAP))
+    {
+        maFTCapStyle.Disable();
+        maLBCapStyle.Disable();
+    }
+    else if(SFX_ITEM_DONTCARE != rAttrs.GetItemState(XATTR_LINECAP))
+    {
+        const com::sun::star::drawing::LineCap eLineCap(((const XLineCapItem&)(rAttrs.Get(XATTR_LINECAP))).GetValue());
+
+        switch(eLineCap)
+        {
+            case com::sun::star::drawing::LineCap_ROUND: maLBCapStyle.SelectEntryPos(1); break;
+            case com::sun::star::drawing::LineCap_SQUARE : maLBCapStyle.SelectEntryPos(2); break;
+            default /*com::sun::star::drawing::LineCap_BUTT*/: maLBCapStyle.SelectEntryPos(0); break;
+        }
+    }
+    else
+    {
+        maLBCapStyle.SetNoSelection();
+    }
+
 	// Werte sichern
 	aLbLineStyle.SaveValue();
 	aMtrLineWidth.SaveValue();
@@ -1299,6 +1396,9 @@ void SvxLineTabPage::Reset( const SfxIte
 	// #116827#
 	maLBEdgeStyle.SaveValue();
 
+    // LineCaps
+    maLBCapStyle.SaveValue();
+
 	ClickInvisibleHdl_Impl( this );
 	//ClickMeasuringHdl_Impl( this );
 	//aCtlPosition.Reset();
@@ -1416,6 +1516,15 @@ IMPL_LINK( SvxLineTabPage, ChangeEdgeSty
 }
 
 //------------------------------------------------------------------------
+// fdo#43209
+
+IMPL_LINK( SvxLineTabPage, ChangeCapStyleHdl_Impl, void *, EMPTYARG )
+{
+    ChangePreviewHdl_Impl( this );
+
+    return( 0L );
+}
+//------------------------------------------------------------------------
 
 IMPL_LINK( SvxLineTabPage, ClickInvisibleHdl_Impl, void *, EMPTYARG )
 {
@@ -1442,6 +1551,10 @@ IMPL_LINK( SvxLineTabPage, ClickInvisibl
 			// #116827#
 			maFTEdgeStyle.Disable();
 			maLBEdgeStyle.Disable();
+
+            // LineCaps
+            maFTCapStyle.Disable();
+            maLBCapStyle.Disable();
 		}
 	}
 	else
@@ -1466,6 +1579,10 @@ IMPL_LINK( SvxLineTabPage, ClickInvisibl
 			// #116827#
 			maFTEdgeStyle.Enable();
 			maLBEdgeStyle.Enable();
+
+            // LineCaps
+            maFTCapStyle.Enable();
+            maLBCapStyle.Enable();
 		}
 	}
 	ChangePreviewHdl_Impl( NULL );

Modified: incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/lineattribute.hxx Thu Jan  5 19:13:22 2012
@@ -26,6 +26,7 @@
 
 #include <drawinglayer/drawinglayerdllapi.h>
 #include <basegfx/vector/b2enums.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 // predefines
@@ -54,7 +55,8 @@ namespace drawinglayer
 			LineAttribute(
 				const basegfx::BColor& rColor,
 				double fWidth = 0.0,
-				basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND);
+				basegfx::B2DLineJoin aB2DLineJoin = basegfx::B2DLINEJOIN_ROUND,
+                com::sun::star::drawing::LineCap aLineCap = com::sun::star::drawing::LineCap_BUTT);
 			LineAttribute();
 			LineAttribute(const LineAttribute& rCandidate);
 			LineAttribute& operator=(const LineAttribute& rCandidate);
@@ -70,6 +72,7 @@ namespace drawinglayer
 			const basegfx::BColor& getColor() const;
 			double getWidth() const;
 			basegfx::B2DLineJoin getLineJoin() const;
+            com::sun::star::drawing::LineCap getLineCap() const;
 		};
 	} // end of namespace attribute
 } // end of namespace drawinglayer

Modified: incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/drawinglayer/inc/drawinglayer/attribute/sdrlineattribute.hxx Thu Jan  5 19:13:22 2012
@@ -38,6 +38,7 @@
 
 #include <drawinglayer/drawinglayerdllapi.h>
 #include <basegfx/vector/b2enums.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 #include <vector>
 
 //////////////////////////////////////////////////////////////////////////////
@@ -68,7 +69,8 @@ namespace drawinglayer
 				basegfx::B2DLineJoin eJoin, 
                 double fWidth, 
                 double fTransparence, 
-                const basegfx::BColor& rColor, 
+                const basegfx::BColor& rColor,
+                com::sun::star::drawing::LineCap eCap,
 				const ::std::vector< double >& rDotDashArray, 
                 double fFullDotDashLen);
             SdrLineAttribute(const basegfx::BColor& rColor);
@@ -90,6 +92,7 @@ namespace drawinglayer
 			const basegfx::BColor& getColor() const;
 			const ::std::vector< double >& getDotDashArray() const;
 			double getFullDotDashLen() const;
+            com::sun::star::drawing::LineCap getCap() const;
 
 			// bool access
 			bool isDashed() const;

Modified: incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/lineattribute.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/lineattribute.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/lineattribute.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/lineattribute.cxx Thu Jan  5 19:13:22 2012
@@ -43,15 +43,18 @@ namespace drawinglayer
 			basegfx::BColor							maColor;				// color
 			double									mfWidth;				// absolute line width
 			basegfx::B2DLineJoin					meLineJoin;				// type of LineJoin
+            com::sun::star::drawing::LineCap        meLineCap;              // BUTT, ROUND, or SQUARE
 
 			ImpLineAttribute(
                 const basegfx::BColor& rColor,
 				double fWidth,
-				basegfx::B2DLineJoin aB2DLineJoin)
+				basegfx::B2DLineJoin aB2DLineJoin,
+                com::sun::star::drawing::LineCap aLineCap)
 			:	mnRefCount(0),
                 maColor(rColor),
                 mfWidth(fWidth),
-                meLineJoin(aB2DLineJoin)
+                meLineJoin(aB2DLineJoin),
+                meLineCap(aLineCap)
 			{
 			}
 
@@ -59,12 +62,14 @@ namespace drawinglayer
 			const basegfx::BColor& getColor() const { return maColor; }
 			double getWidth() const { return mfWidth; }
 			basegfx::B2DLineJoin getLineJoin() const { return meLineJoin; }
+            com::sun::star::drawing::LineCap getLineCap() const { return meLineCap; }
 
 			bool operator==(const ImpLineAttribute& rCandidate) const
 			{
 				return (getColor() == rCandidate.getColor()
 					&& getWidth() == rCandidate.getWidth()
-					&& getLineJoin() == rCandidate.getLineJoin());
+					&& getLineJoin() == rCandidate.getLineJoin()
+                    && getLineCap() == rCandidate.getLineCap());
 			}
 
             static ImpLineAttribute* get_global_default()
@@ -76,7 +81,8 @@ namespace drawinglayer
                     pDefault = new ImpLineAttribute(
                         basegfx::BColor(),
                         0.0,
-                        basegfx::B2DLINEJOIN_ROUND);
+                        basegfx::B2DLINEJOIN_ROUND,
+                        com::sun::star::drawing::LineCap_BUTT);
 
                     // never delete; start with RefCount 1, not 0
     			    pDefault->mnRefCount++;
@@ -89,9 +95,14 @@ namespace drawinglayer
         LineAttribute::LineAttribute(
             const basegfx::BColor& rColor,
 			double fWidth,
-			basegfx::B2DLineJoin aB2DLineJoin)
-		:	mpLineAttribute(new ImpLineAttribute(
-                rColor, fWidth, aB2DLineJoin))
+			basegfx::B2DLineJoin aB2DLineJoin,
+            com::sun::star::drawing::LineCap aLineCap)
+		:	mpLineAttribute(
+                new ImpLineAttribute(
+                    rColor, 
+                    fWidth, 
+                    aB2DLineJoin,
+                    aLineCap))
 		{
 		}
 
@@ -174,6 +185,11 @@ namespace drawinglayer
             return mpLineAttribute->getLineJoin(); 
         }
 
+        com::sun::star::drawing::LineCap LineAttribute::getLineCap() const
+        {
+            return mpLineAttribute->getLineCap();
+        }
+
     } // end of namespace attribute
 } // end of namespace drawinglayer
 

Modified: incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/sdrlineattribute.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/sdrlineattribute.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/sdrlineattribute.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/drawinglayer/source/attribute/sdrlineattribute.cxx Thu Jan  5 19:13:22 2012
@@ -56,6 +56,7 @@ namespace drawinglayer
 			double									mfWidth;			// 1/100th mm, 0.0==hair
 			double									mfTransparence;		// [0.0 .. 1.0], 0.0==no transp.
 			basegfx::BColor							maColor;			// color of line
+            com::sun::star::drawing::LineCap        meCap;              // BUTT, ROUND, or SQUARE
 			::std::vector< double >					maDotDashArray;		// array of double which defines the dot-dash pattern
 			double									mfFullDotDashLen;	// sum of maDotDashArray (for convenience)
 
@@ -64,6 +65,7 @@ namespace drawinglayer
                 double fWidth, 
                 double fTransparence, 
                 const basegfx::BColor& rColor, 
+                com::sun::star::drawing::LineCap eCap,
 				const ::std::vector< double >& rDotDashArray, 
                 double fFullDotDashLen)
 			:	mnRefCount(0),
@@ -71,6 +73,7 @@ namespace drawinglayer
 			    mfWidth(fWidth),
 			    mfTransparence(fTransparence),
 			    maColor(rColor),
+                meCap(eCap),
 			    maDotDashArray(rDotDashArray),
 			    mfFullDotDashLen(fFullDotDashLen)
 		    {
@@ -82,6 +85,7 @@ namespace drawinglayer
 			    mfWidth(0.0),
 			    mfTransparence(0.0),
 			    maColor(rColor),
+                meCap(com::sun::star::drawing::LineCap_BUTT),
 			    maDotDashArray(),
 			    mfFullDotDashLen(0.0)
             {
@@ -92,6 +96,7 @@ namespace drawinglayer
 			double getWidth() const { return mfWidth; }
 			double getTransparence() const { return mfTransparence; }
 			const basegfx::BColor& getColor() const { return maColor; }
+            com::sun::star::drawing::LineCap getCap() const { return meCap; }
 			const ::std::vector< double >& getDotDashArray() const { return maDotDashArray; }
 			double getFullDotDashLen() const { return mfFullDotDashLen; }
 
@@ -101,6 +106,7 @@ namespace drawinglayer
 				    && getWidth() == rCandidate.getWidth()
 				    && getTransparence() == rCandidate.getTransparence()
 				    && getColor() == rCandidate.getColor()
+                    && getCap() == rCandidate.getCap()
 				    && getDotDashArray() == rCandidate.getDotDashArray());
 		    }
 
@@ -115,6 +121,7 @@ namespace drawinglayer
                         0.0, 
                         0.0, 
                         basegfx::BColor(),
+                        com::sun::star::drawing::LineCap_BUTT,
 			            std::vector< double >(), 
                         0.0);
 
@@ -131,16 +138,26 @@ namespace drawinglayer
             double fWidth, 
             double fTransparence, 
             const basegfx::BColor& rColor, 
+            com::sun::star::drawing::LineCap eCap,
 			const ::std::vector< double >& rDotDashArray, 
             double fFullDotDashLen)
-		:	mpSdrLineAttribute(new ImpSdrLineAttribute(
-                eJoin, fWidth, fTransparence, rColor, rDotDashArray, fFullDotDashLen))
+		:	mpSdrLineAttribute(
+                new ImpSdrLineAttribute(
+                    eJoin, 
+                    fWidth, 
+                    fTransparence, 
+                    rColor, 
+                    eCap,
+                    rDotDashArray, 
+                    fFullDotDashLen))
 		{
 		}
 
         SdrLineAttribute::SdrLineAttribute(
             const basegfx::BColor& rColor)
-		:	mpSdrLineAttribute(new ImpSdrLineAttribute(rColor))
+		:	mpSdrLineAttribute(
+                new ImpSdrLineAttribute(
+                    rColor))
         {
         }
 
@@ -243,6 +260,11 @@ namespace drawinglayer
             return (0L != getDotDashArray().size()); 
         }
 
+        com::sun::star::drawing::LineCap SdrLineAttribute::getCap() const
+        {
+            return mpSdrLineAttribute->getCap();
+        }
+
     } // end of namespace attribute
 } // end of namespace drawinglayer
 

Modified: incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/polygonprimitive2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/polygonprimitive2d.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/polygonprimitive2d.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/polygonprimitive2d.cxx Thu Jan  5 19:13:22 2012
@@ -32,6 +32,7 @@
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
 #include <drawinglayer/geometry/viewinformation2d.hxx>
 #include <basegfx/polygon/b2dlinegeometry.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -252,13 +253,17 @@ namespace drawinglayer
                     // create fat line data
 					const double fHalfLineWidth(getLineAttribute().getWidth() / 2.0);
 					const basegfx::B2DLineJoin aLineJoin(getLineAttribute().getLineJoin());
+                    const com::sun::star::drawing::LineCap aLineCap(getLineAttribute().getLineCap());
 					basegfx::B2DPolyPolygon aAreaPolyPolygon;
 
 					for(sal_uInt32 a(0L); a < nCount; a++)
 					{
                         // New version of createAreaGeometry; now creates bezier polygons
                         aAreaPolyPolygon.append(basegfx::tools::createAreaGeometry(
-							aHairLinePolyPolygon.getB2DPolygon(a), fHalfLineWidth, aLineJoin));
+							aHairLinePolyPolygon.getB2DPolygon(a), 
+                            fHalfLineWidth, 
+                            aLineJoin,
+                            aLineCap));
 					}
 
 					// prepare return value
@@ -339,11 +344,29 @@ namespace drawinglayer
 
             if(getLineAttribute().getWidth())
             {
+                bool bUseDecomposition(false);
+
                 if(basegfx::B2DLINEJOIN_MITER == getLineAttribute().getLineJoin())
                 {
                     // if line is mitered, use parent call since mitered line
                     // geometry may use more space than the geometry grown by half line width
-            		aRetval = BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation);
+                    bUseDecomposition = true;
+                }
+
+                if(!bUseDecomposition && com::sun::star::drawing::LineCap_SQUARE == getLineAttribute().getLineCap())
+                {
+                    // when drawing::LineCap_SQUARE is used the below method to grow the polygon
+                    // range by half line width will not work, so use decomposition. Interestingly,
+                    // the grow method below works perfectly for LineCap_ROUND since the grow is in
+                    // all directions and the rounded cap needs the same grow in all directions independent
+                    // from it's orientation. Unfortunately this is not the case for drawing::LineCap_SQUARE
+                    bUseDecomposition = true;
+                }
+
+                if(bUseDecomposition)
+                {
+                    // get correct range by using the decomposition fallback, reasons see above cases
+                    aRetval = BufferedDecompositionPrimitive2D::getB2DRange(rViewInformation);
                 }
                 else
                 {

Modified: incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/canvasprocessor.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/canvasprocessor.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/canvasprocessor.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/canvasprocessor.cxx Thu Jan  5 19:13:22 2012
@@ -57,6 +57,7 @@
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/StrokeAttributes.hpp>
 #include <com/sun/star/rendering/PathJoinType.hpp>
+#include <com/sun/star/rendering/PathCapType.hpp>
 #include <drawinglayer/primitive2d/fillbitmapprimitive2d.hxx>
 #include <com/sun/star/rendering/TexturingMode.hpp>
 #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
@@ -1754,7 +1755,23 @@ namespace drawinglayer
                             aStrokeAttribute.JoinType = rendering::PathJoinType::ROUND;
                             break;
                     }
-            
+
+                    switch(rLineAttribute.getLineCap())
+                    {
+                        case com::sun::star::drawing::LineCap_ROUND:
+                            aStrokeAttribute.StartCapType = rendering::PathCapType::ROUND;
+                            aStrokeAttribute.EndCapType = rendering::PathCapType::ROUND;
+                            break;
+                        case com::sun::star::drawing::LineCap_SQUARE:
+                            aStrokeAttribute.StartCapType = rendering::PathCapType::SQUARE;
+                            aStrokeAttribute.EndCapType = rendering::PathCapType::SQUARE;
+                            break;
+                        default: // com::sun::star::drawing::LineCap_BUTT
+                            aStrokeAttribute.StartCapType = rendering::PathCapType::BUTT;
+                            aStrokeAttribute.EndCapType = rendering::PathCapType::BUTT;
+                            break;
+                    }
+
 			        const basegfx::BColor aHairlineColor(maBColorModifierStack.getModifiedColor(rLineAttribute.getColor()));
                     maRenderState.DeviceColor = aHairlineColor.colorToDoubleSequence(mxCanvas->getDevice());
 					canvas::tools::setRenderStateTransform(maRenderState, getViewInformation2D().getObjectTransformation());

Modified: incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx Thu Jan  5 19:13:22 2012
@@ -421,7 +421,8 @@ namespace drawinglayer
 					}
 				}
 
-	            SvtGraphicStroke::JoinType eJoin(SvtGraphicStroke::joinNone);
+                SvtGraphicStroke::JoinType eJoin(SvtGraphicStroke::joinNone);
+                SvtGraphicStroke::CapType eCap(SvtGraphicStroke::capButt);
 				double fLineWidth(0.0);
 				double fMiterLength(0.0);
 				SvtGraphicStroke::DashArray aDashArray;
@@ -461,6 +462,26 @@ namespace drawinglayer
 							break;
 						}
 					}
+
+                    // get stroke
+                    switch(pLineAttribute->getLineCap())
+                    {
+                        default: /* com::sun::star::drawing::LineCap_BUTT */
+                        {
+                            eCap = SvtGraphicStroke::capButt;
+                            break;
+                        }
+                        case com::sun::star::drawing::LineCap_ROUND:
+                        {
+                            eCap = SvtGraphicStroke::capRound;
+                            break;
+                        }
+                        case com::sun::star::drawing::LineCap_SQUARE:
+                        {
+                            eCap = SvtGraphicStroke::capSquare;
+                            break;
+                        }
+                    }
                 }
 
 				if(pStrokeAttribute)
@@ -488,7 +509,7 @@ namespace drawinglayer
 					PolyPolygon(aEndArrow),
 					mfCurrentUnifiedTransparence,
 					fLineWidth,
-					SvtGraphicStroke::capButt,
+					eCap,
 					eJoin,
 					fMiterLength,
 					aDashArray);
@@ -1209,6 +1230,7 @@ namespace drawinglayer
 
 							LineInfo aLineInfo(LINE_SOLID, basegfx::fround(fDiscreteLineWidth));
 						    aLineInfo.SetLineJoin(rLine.getLineJoin());
+                            aLineInfo.SetLineCap(rLine.getLineCap());
 
 						    for(sal_uInt32 a(0); a < aHairLinePolyPolygon.count(); a++)
 						    {

Modified: incubator/ooo/branches/alg/linecap/main/editeng/inc/editeng/unoprnms.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/editeng/inc/editeng/unoprnms.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/editeng/inc/editeng/unoprnms.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/editeng/inc/editeng/unoprnms.hxx Thu Jan  5 19:13:22 2012
@@ -92,6 +92,7 @@
 #define	UNO_NAME_LINESTARTCENTER				"LineStartCenter"
 #define	UNO_NAME_LINEENDCENTER					"LineEndCenter"
 #define	UNO_NAME_LINETRANSPARENCE				"LineTransparence"
+#define UNO_NAME_LINECAP                        "LineCap"
 
 #define	UNO_NAME_SHADOW							"Shadow"
 #define	UNO_NAME_SHADOWCOLOR					"ShadowColor"

Modified: incubator/ooo/branches/alg/linecap/main/filter/source/graphicfilter/eps/eps.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/filter/source/graphicfilter/eps/eps.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/filter/source/graphicfilter/eps/eps.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/filter/source/graphicfilter/eps/eps.cxx Thu Jan  5 19:13:22 2012
@@ -2370,6 +2370,7 @@ void PSWriter::ImplWriteLineInfo( const 
 		l_aDashArray.push_back( 2 );
 	const double fLWidth(( ( rLineInfo.GetWidth() + 1 ) + ( rLineInfo.GetWidth() + 1 ) ) * 0.5);
     SvtGraphicStroke::JoinType aJoinType(SvtGraphicStroke::joinMiter);
+    SvtGraphicStroke::CapType aCapType(SvtGraphicStroke::capButt);
 
     switch(rLineInfo.GetLineJoin())
     {
@@ -2389,7 +2390,26 @@ void PSWriter::ImplWriteLineInfo( const 
             break;
     }
 
-	ImplWriteLineInfo( fLWidth, fMiterLimit, SvtGraphicStroke::capButt, aJoinType, l_aDashArray );
+    switch(rLineInfo.GetLineCap())
+    {
+        default: /* com::sun::star::drawing::LineCap_BUTT */
+        {
+            aCapType = SvtGraphicStroke::capButt;
+            break;
+        }
+        case com::sun::star::drawing::LineCap_ROUND:
+        {
+            aCapType = SvtGraphicStroke::capRound;
+            break;
+        }
+        case com::sun::star::drawing::LineCap_SQUARE:
+        {
+            aCapType = SvtGraphicStroke::capSquare;
+            break;
+        }
+    }
+
+	ImplWriteLineInfo( fLWidth, fMiterLimit, aCapType, aJoinType, l_aDashArray );
 }
 
 //---------------------------------------------------------------------------------

Added: incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineCap.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineCap.idl?rev=1227772&view=auto
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineCap.idl (added)
+++ incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineCap.idl Thu Jan  5 19:13:22 2012
@@ -0,0 +1,58 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef __com_sun_star_drawing_LineCap_idl__
+#define __com_sun_star_drawing_LineCap_idl__
+
+//=============================================================================
+
+ module com {  module sun {  module star {  module drawing {
+
+//=============================================================================
+
+// DocMerge from xml: enum com::sun::star::drawing::LineCap
+/** The <type>LineCap</type> defines rendering of ends of thick lines
+ */
+published enum LineCap
+{
+
+    // DocMerge from xml: value com::sun::star::drawing::LineCap::BUTT
+    /** the line will end without any additional shape
+     */
+    BUTT,
+
+    // DocMerge from xml: value com::sun::star::drawing::LineCap::ROUND
+    /** the line will get a half cirle as additional cap
+     */
+    ROUND,
+
+    // DocMerge from xml: value com::sun::star::drawing::LineCap::SQUARE
+    /** the line will get a half square as additional cap
+     */
+    SQUARE
+};
+
+//=============================================================================
+
+}; }; }; };
+
+#endif
+

Modified: incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineProperties.idl
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineProperties.idl?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineProperties.idl (original)
+++ incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/LineProperties.idl Thu Jan  5 19:13:22 2012
@@ -23,26 +23,12 @@
 #ifndef __com_sun_star_drawing_LineProperties_idl__
 #define __com_sun_star_drawing_LineProperties_idl__
 
-#ifndef __com_sun_star_drawing_LineStyle_idl__
 #include <com/sun/star/drawing/LineStyle.idl>
-#endif
-
-#ifndef __com_sun_star_util_Color_idl__
 #include <com/sun/star/util/Color.idl>
-#endif
-
-#ifndef __com_sun_star_drawing_LineDash_idl__
 #include <com/sun/star/drawing/LineDash.idl>
-#endif
-
-#ifndef __com_sun_star_drawing_PolyPolygonBezierCoords_idl__
 #include <com/sun/star/drawing/PolyPolygonBezierCoords.idl>
-#endif
-
-#ifndef __com_sun_star_drawing_LineJoint_idl__
 #include <com/sun/star/drawing/LineJoint.idl>
-#endif
-
+#include <com/sun/star/drawing/LineCap.idl>
 
 //=============================================================================
 
@@ -98,6 +84,12 @@ published service LineProperties
 
 	//-------------------------------------------------------------------------
 
+    /** This property defines the rendering of ends of thick lines
+     */
+    [optional, property] com::sun::star::drawing::LineCap LineCap;
+
+    //-------------------------------------------------------------------------
+
 	/** This property contains the name of the line start poly polygon bezier.
 		<p>If this string is empty, no line start polygon is rendered.
 	 */

Modified: incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/makefile.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/makefile.mk?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/makefile.mk (original)
+++ incubator/ooo/branches/alg/linecap/main/offapi/com/sun/star/drawing/makefile.mk Thu Jan  5 19:13:22 2012
@@ -124,6 +124,7 @@ IDLFILES=\
 	Layer.idl\
 	LayerManager.idl\
 	LayerType.idl\
+	LineCap.idl\
 	LineDash.idl\
 	LineEndType.idl\
 	LineJoint.idl\

Modified: incubator/ooo/branches/alg/linecap/main/svx/Package_inc.mk
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/Package_inc.mk?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/Package_inc.mk (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/Package_inc.mk Thu Jan  5 19:13:22 2012
@@ -175,6 +175,7 @@ $(eval $(call gb_Package_add_file,svx_in
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/unomaster.hxx,svx/unomaster.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdedtv.hxx,svx/svdedtv.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlinjoit.hxx,svx/xlinjoit.hxx))
+$(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlncapit.hxx,svx/xlncapit.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sxmbritm.hxx,svx/sxmbritm.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/AccessibleGraphicShape.hxx,svx/AccessibleGraphicShape.hxx))
 $(eval $(call gb_Package_add_file,svx_inc,inc/svx/xlnstit.hxx,svx/xlnstit.hxx))

Modified: incubator/ooo/branches/alg/linecap/main/svx/inc/svx/dialogs.hrc
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/inc/svx/dialogs.hrc?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/inc/svx/dialogs.hrc (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/inc/svx/dialogs.hrc Thu Jan  5 19:13:22 2012
@@ -633,6 +633,11 @@
 #define RID_SVXSTR_TBLAFMT_YELLOW			(RID_SVX_START + 575)
 #define RID_SVXSTR_TBLAFMT_END  			(RID_SVX_START + 576)
 
+// string resources for XLineCap item
+#define RID_SVXSTR_LINECAP_BUTT             (RID_SVX_START + 586 )
+#define RID_SVXSTR_LINECAP_ROUND            (RID_SVX_START + 587 )
+#define RID_SVXSTR_LINECAP_SQUARE           (RID_SVX_START + 588 )
+
 // string resources for XLineJoint item
 #define	RID_SVXSTR_LINEJOINT_NONE			RID_SVXSTR_NONE
 #define RID_SVXSTR_LINEJOINT_MIDDLE			(RID_SVX_START + 589 )

Modified: incubator/ooo/branches/alg/linecap/main/svx/inc/svx/unoshprp.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/inc/svx/unoshprp.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/inc/svx/unoshprp.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/inc/svx/unoshprp.hxx Thu Jan  5 19:13:22 2012
@@ -32,6 +32,7 @@
 #include <com/sun/star/awt/Gradient.hpp>
 #include <com/sun/star/drawing/Hatch.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/LineCap.hpp>
 #include <com/sun/star/drawing/LineDash.hpp>
 #include <com/sun/star/drawing/LineJoint.hpp>
 #include <com/sun/star/drawing/LineStyle.hpp>
@@ -211,6 +212,7 @@
 	{ MAP_CHAR_LEN(UNO_NAME_SHADOWYDIST),		SDRATTR_SHADOWYDIST,		&::getCppuType((const sal_Int32*)0),	0,		SFX_METRIC_ITEM},
 
 #define LINE_PROPERTIES_DEFAULTS\
+    { MAP_CHAR_LEN(UNO_NAME_LINECAP),           XATTR_LINECAP,          &::getCppuType((const ::com::sun::star::drawing::LineCap*)0),     0,     0}, \
 	{ MAP_CHAR_LEN(UNO_NAME_LINECOLOR),			XATTR_LINECOLOR,		&::getCppuType((const sal_Int32*)0) , 			0,     0}, \
 	{ MAP_CHAR_LEN(UNO_NAME_LINEENDCENTER),		XATTR_LINEENDCENTER,	&::getBooleanCppuType() , 			0,     0}, \
 	{ MAP_CHAR_LEN(UNO_NAME_LINEENDWIDTH),		XATTR_LINEENDWIDTH,		&::getCppuType((const sal_Int32*)0) , 			0,     SFX_METRIC_ITEM}, \

Modified: incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xattr.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xattr.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xattr.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xattr.hxx Thu Jan  5 19:13:22 2012
@@ -57,6 +57,7 @@ class XGradientTable;
 #include <svx/xtextit0.hxx>
 #include <svx/xsetit.hxx>
 #include <svx/xlinjoit.hxx>
+#include <svx/xlncapit.hxx>
 
 
 #endif      // _XATTR_HXX

Modified: incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xdef.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xdef.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xdef.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xdef.hxx Thu Jan  5 19:13:22 2012
@@ -50,7 +50,8 @@
 #define XATTR_LINEENDCENTER     (XATTR_LINE_FIRST + 9)   		/* V3: 1009  V2: 1009 */
 #define XATTR_LINETRANSPARENCE  (XATTR_LINE_FIRST + 10)  		/* V3: 1010  V2: 1010 */
 #define XATTR_LINEJOINT		    (XATTR_LINE_FIRST + 11)			/* V3: 1011  V2: 1011 */
-#define XATTR_LINE_LAST         XATTR_LINEJOINT
+#define XATTR_LINECAP           (XATTR_LINE_FIRST + 12)         /* V3: 1012 */
+#define XATTR_LINE_LAST         XATTR_LINECAP
 #define XATTRSET_LINE           (XATTR_LINE_LAST + 1)    		/* V3: 1017  V2: 1017 */
 
 #define XATTR_FILL_FIRST        	(XATTRSET_LINE + 1)      	/* V3: 1018  V2: 1018 */

Added: incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xlncapit.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xlncapit.hxx?rev=1227772&view=auto
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xlncapit.hxx (added)
+++ incubator/ooo/branches/alg/linecap/main/svx/inc/svx/xlncapit.hxx Thu Jan  5 19:13:22 2012
@@ -0,0 +1,57 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef _SVX_XLNCAPIT_HXX
+#define _SVX_XLNCAPIT_HXX
+
+#include <svx/svxdllapi.h>
+#include <svl/eitem.hxx>
+#include <svx/xenum.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
+
+//---------------------
+// class LineStyleItem
+//---------------------
+
+class SVX_DLLPUBLIC XLineCapItem : public SfxEnumItem
+{
+public:
+    TYPEINFO();
+    XLineCapItem(com::sun::star::drawing::LineCap eLineCap = com::sun::star::drawing::LineCap_BUTT);
+    XLineCapItem(SvStream& rIn);
+
+    virtual sal_uInt16      GetVersion( sal_uInt16 nFileFormatVersion ) const;
+    virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
+    virtual SfxPoolItem*    Create( SvStream& rIn, sal_uInt16 nVer ) const;
+
+    virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
+    virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
+    virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+                                    SfxMapUnit eCoreMetric, SfxMapUnit ePresMetric,
+                                    String &rText, const IntlWrapper * = 0 ) const;
+
+    virtual sal_uInt16          GetValueCount() const;
+    com::sun::star::drawing::LineCap GetValue() const;
+};
+
+#endif // _SVX_XLNCAPIT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Modified: incubator/ooo/branches/alg/linecap/main/svx/source/dialog/sdstring.src
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/dialog/sdstring.src?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/dialog/sdstring.src (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/dialog/sdstring.src Thu Jan  5 19:13:22 2012
@@ -359,6 +359,19 @@ String RID_SVXSTR_LINEJOINT_ROUND
 {
 	Text [ en-US ] = "Line joint round";
 };
+String RID_SVXSTR_LINECAP_BUTT
+{
+    Text [ en-US ] = "Line cap flat";  // string as in Excel
+};
+String RID_SVXSTR_LINECAP_ROUND
+{
+    Text [ en-US ] = "Line cap round";
+};
+String RID_SVXSTR_LINECAP_SQUARE
+{
+    Text [ en-US ] = "Line cap square";
+};
+
 
 ///////////////////////////////////////////////////////////////////////////////
 //

Modified: incubator/ooo/branches/alg/linecap/main/svx/source/sdr/attribute/sdrformtextattribute.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/sdr/attribute/sdrformtextattribute.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/sdr/attribute/sdrformtextattribute.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/sdr/attribute/sdrformtextattribute.cxx Thu Jan  5 19:13:22 2012
@@ -42,12 +42,14 @@
 #include <svx/xlnclit.hxx>
 #include <svx/xlnwtit.hxx>
 #include <svx/xlinjoit.hxx>
+#include <svx/xlncapit.hxx>
 #include <svx/xlineit0.hxx>
 #include <svx/xdash.hxx>
 #include <svx/xlndsit.hxx>
 #include <drawinglayer/attribute/lineattribute.hxx>
 #include <drawinglayer/attribute/strokeattribute.hxx>
 #include <svx/sdr/attribute/sdrformtextoutlineattribute.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 // helper to get line, stroke and transparence attributes from SfxItemSet
@@ -114,8 +116,13 @@ namespace
 
 		const sal_uInt32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue();
 		const XLineJoint eLineJoint = ((const XLineJointItem&)(rSet.Get(XATTR_LINEJOINT))).GetValue();
+		const com::sun::star::drawing::LineCap eLineCap = ((const XLineCapItem&)(rSet.Get(XATTR_LINECAP))).GetValue();
 
-		return drawinglayer::attribute::LineAttribute(aColorAttribute, (double)nLineWidth, impGetB2DLineJoin(eLineJoint));
+		return drawinglayer::attribute::LineAttribute(
+            aColorAttribute, 
+            (double)nLineWidth, 
+            impGetB2DLineJoin(eLineJoint),
+            eLineCap);
 	}
 
     drawinglayer::attribute::StrokeAttribute impGetStrokeAttribute(const SfxItemSet& rSet)

Modified: incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrattributecreator.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrattributecreator.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrattributecreator.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrattributecreator.cxx Thu Jan  5 19:13:22 2012
@@ -31,6 +31,7 @@
 #include <svx/xlntrit.hxx>
 #include <svx/xlnwtit.hxx>
 #include <svx/xlinjoit.hxx>
+#include <svx/xlncapit.hxx>
 #include <svx/xlnclit.hxx>
 #include <svx/xlnstwit.hxx>
 #include <svx/xlnedwit.hxx>
@@ -78,6 +79,7 @@
 #include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
 #include <drawinglayer/attribute/sdrlightattribute3d.hxx>
 #include <svx/sdr/attribute/sdrfilltextattribute.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -237,6 +239,7 @@ namespace drawinglayer
 					const sal_uInt32 nWidth(((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue());
 					const Color aColor(((const XLineColorItem&)(rSet.Get(XATTR_LINECOLOR))).GetColorValue());
 					const XLineJoint eJoint(((const XLineJointItem&)(rSet.Get(XATTR_LINEJOINT))).GetValue());
+					const com::sun::star::drawing::LineCap eCap(((const XLineCapItem&)(rSet.Get(XATTR_LINECAP))).GetValue());
 					::std::vector< double > aDotDashArray;
 					double fFullDotDashLen(0.0);
 
@@ -255,6 +258,7 @@ namespace drawinglayer
 						(double)nWidth,
 						(double)nTransparence * 0.01,
 						aColor.getBColor(),
+                        eCap,
 						aDotDashArray,
 						fFullDotDashLen);
 				}

Modified: incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx Thu Jan  5 19:13:22 2012
@@ -129,7 +129,7 @@ namespace drawinglayer
 			aScaledPolygon.transform(rObjectTransform);
 
 			// create line and stroke attribute
-			const attribute::LineAttribute aLineAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin());
+			const attribute::LineAttribute aLineAttribute(rLine.getColor(), rLine.getWidth(), rLine.getJoin(), rLine.getCap());
 			const attribute::StrokeAttribute aStrokeAttribute(rLine.getDotDashArray(), rLine.getFullDotDashLen());
 			BasePrimitive2D* pNewLinePrimitive = 0L;
 

Modified: incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xattr2.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xattr2.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xattr2.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xattr2.cxx Thu Jan  5 19:13:22 2012
@@ -28,6 +28,7 @@
 
 
 #include <com/sun/star/drawing/LineJoint.hpp>
+#include <com/sun/star/drawing/LineCap.hpp>
 #include <com/sun/star/uno/Any.hxx>
 
 #include <svx/dialogs.hrc>
@@ -309,6 +310,150 @@ sal_uInt16 XLineJointItem::GetValueCount
 	return 5;
 }
 
+//-----------------------
+// class XLineCapItem -
+//-----------------------
+
+TYPEINIT1_AUTOFACTORY(XLineCapItem, SfxEnumItem);
+
+// -----------------------------------------------------------------------------
+
+XLineCapItem::XLineCapItem(com::sun::star::drawing::LineCap eLineCap) 
+:   SfxEnumItem(XATTR_LINECAP, sal::static_int_cast< sal_uInt16 >(eLineCap))
+{
+}
+
+// -----------------------------------------------------------------------------
+
+XLineCapItem::XLineCapItem( SvStream& rIn )
+:   SfxEnumItem(XATTR_LINECAP, rIn)
+{
+}
+
+// -----------------------------------------------------------------------------
+
+sal_uInt16 XLineCapItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/) const
+{
+    return 1;
+}
+
+// -----------------------------------------------------------------------------
+
+SfxPoolItem* XLineCapItem::Create( SvStream& rIn, sal_uInt16 nVer ) const
+{
+    XLineCapItem* pRet = new XLineCapItem( rIn );
+
+    if(nVer < 1)
+        pRet->SetValue(com::sun::star::drawing::LineCap_BUTT);
+
+    return pRet;
+}
+
+// -----------------------------------------------------------------------------
+
+SfxPoolItem* XLineCapItem::Clone(SfxItemPool* /*pPool*/) const
+{
+    return new XLineCapItem( *this );
+}
+
+// -----------------------------------------------------------------------------
+
+SfxItemPresentation XLineCapItem::GetPresentation( SfxItemPresentation ePres, SfxMapUnit /*eCoreUnit*/,
+                                                     SfxMapUnit /*ePresUnit*/, XubString& rText, const IntlWrapper*) const
+{
+    rText.Erase();
+
+    switch( ePres )
+    {
+        case SFX_ITEM_PRESENTATION_NONE: return ePres;
+
+        case SFX_ITEM_PRESENTATION_COMPLETE:
+        case SFX_ITEM_PRESENTATION_NAMELESS:
+        {
+            sal_uInt16 nId = 0;
+
+            switch( GetValue() )
+            {
+                default: /*com::sun::star::drawing::LineCap_BUTT*/
+                    nId = RID_SVXSTR_LINECAP_BUTT;
+                break;
+
+                case(com::sun::star::drawing::LineCap_ROUND):
+                    nId = RID_SVXSTR_LINECAP_ROUND;
+                break;
+
+                case(com::sun::star::drawing::LineCap_SQUARE):
+                    nId = RID_SVXSTR_LINECAP_SQUARE;
+                break;
+            }
+
+            if( nId )
+                rText = SVX_RESSTR( nId );
+
+            return ePres;
+        }
+        default:
+            return SFX_ITEM_PRESENTATION_NONE;
+    }
+}
+
+// -----------------------------------------------------------------------------
+
+sal_Bool XLineCapItem::QueryValue( ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
+{
+    const com::sun::star::drawing::LineCap eCap(GetValue());
+    rVal <<= eCap;
+    return true;
+}
+
+// -----------------------------------------------------------------------------
+
+sal_Bool XLineCapItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/)
+{
+    com::sun::star::drawing::LineCap eUnoCap;
+
+    if(!(rVal >>= eUnoCap))
+    {
+        // also try an int (for Basic)
+        sal_Int32 nLJ(0);
+        
+        if(!(rVal >>= nLJ))
+        {
+            return false;
+        }
+
+        eUnoCap = (com::sun::star::drawing::LineCap)nLJ;
+    }
+
+    OSL_ENSURE(com::sun::star::drawing::LineCap_BUTT == eUnoCap
+        || com::sun::star::drawing::LineCap_ROUND == eUnoCap
+        || com::sun::star::drawing::LineCap_SQUARE == eUnoCap, "Unknown enum value in XATTR_LINECAP (!)");
+
+    SetValue(sal::static_int_cast< sal_uInt16 >(eUnoCap));
+
+    return true;
+}
+
+// -----------------------------------------------------------------------------
+
+sal_uInt16 XLineCapItem::GetValueCount() const
+{
+    // don't forget to update the api interface also
+    return 3;
+}
+
+// -----------------------------------------------------------------------------
+
+com::sun::star::drawing::LineCap XLineCapItem::GetValue() const 
+{ 
+    const com::sun::star::drawing::LineCap eRetval((com::sun::star::drawing::LineCap)SfxEnumItem::GetValue());
+    OSL_ENSURE(com::sun::star::drawing::LineCap_BUTT == eRetval
+        || com::sun::star::drawing::LineCap_ROUND == eRetval
+        || com::sun::star::drawing::LineCap_SQUARE == eRetval, "Unknown enum value in XATTR_LINECAP (!)");
+
+    return (com::sun::star::drawing::LineCap)SfxEnumItem::GetValue(); 
+}
+
 //------------------------------
 // class XFillTransparenceItem
 //------------------------------

Modified: incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xpool.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xpool.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xpool.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/xoutdev/xpool.cxx Thu Jan  5 19:13:22 2012
@@ -87,6 +87,7 @@ XOutdevItemPool::XOutdevItemPool(
 	mppLocalPoolDefaults[XATTR_LINEENDCENTER      -XATTR_START] = new XLineEndCenterItem;
 	mppLocalPoolDefaults[XATTR_LINETRANSPARENCE   -XATTR_START] = new XLineTransparenceItem;
 	mppLocalPoolDefaults[XATTR_LINEJOINT	        -XATTR_START] = new XLineJointItem;
+    mppLocalPoolDefaults[XATTR_LINECAP            -XATTR_START] = new XLineCapItem;
 	mppLocalPoolDefaults[XATTR_FILLSTYLE				-XATTR_START] = new XFillStyleItem;
 	mppLocalPoolDefaults[XATTR_FILLCOLOR				-XATTR_START] = new XFillColorItem   (aNullStr,aNullFillCol);
 	mppLocalPoolDefaults[XATTR_FILLGRADIENT			-XATTR_START] = new XFillGradientItem(this,aNullGrad);

Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/lineinfo.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/lineinfo.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/lineinfo.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/lineinfo.hxx Thu Jan  5 19:13:22 2012
@@ -28,6 +28,7 @@
 #include <tools/gen.hxx>
 #include <vcl/vclenum.hxx>
 #include <basegfx/vector/b2enums.hxx>
+#include <com/sun/star/drawing/LineCap.hpp>
 
 // ----------------
 // - ImplLineInfo -
@@ -48,6 +49,7 @@ struct ImplLineInfo
 	long				    mnDistance;
     
     basegfx::B2DLineJoin    meLineJoin;
+    com::sun::star::drawing::LineCap meLineCap;
 
 						ImplLineInfo();
 						ImplLineInfo( const ImplLineInfo& rImplLineInfo );
@@ -108,7 +110,10 @@ public:
     void SetLineJoin(basegfx::B2DLineJoin eLineJoin);
     basegfx::B2DLineJoin GetLineJoin() const { return mpImplLineInfo->meLineJoin; }
 
-	sal_Bool			IsDefault() const { return( !mpImplLineInfo->mnWidth && ( LINE_SOLID == mpImplLineInfo->meStyle ) ); }
+    void SetLineCap(com::sun::star::drawing::LineCap eLineCap);
+    com::sun::star::drawing::LineCap GetLineCap() const { return mpImplLineInfo->meLineCap; }
+
+    sal_Bool			IsDefault() const;
 
     friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, LineInfo& rLineInfo );
     friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const LineInfo& rLineInfo );

Modified: incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/lineinfo.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/lineinfo.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/lineinfo.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/lineinfo.cxx Thu Jan  5 19:13:22 2012
@@ -47,7 +47,8 @@ ImplLineInfo::ImplLineInfo() :
 	mnDotCount	( 0 ),
 	mnDotLen	( 0 ),
 	mnDistance	( 0 ),
-    meLineJoin  ( basegfx::B2DLINEJOIN_ROUND )
+    meLineJoin  ( basegfx::B2DLINEJOIN_ROUND ),
+    meLineCap   ( com::sun::star::drawing::LineCap_BUTT )
 {
 }
 
@@ -62,7 +63,8 @@ ImplLineInfo::ImplLineInfo( const ImplLi
 	mnDotCount	( rImplLineInfo.mnDotCount ),
 	mnDotLen	( rImplLineInfo.mnDotLen ),
 	mnDistance	( rImplLineInfo.mnDistance ),
-    meLineJoin  ( rImplLineInfo.meLineJoin )
+    meLineJoin  ( rImplLineInfo.meLineJoin ),
+    meLineCap   ( rImplLineInfo.meLineCap )
 {
 }
 
@@ -77,7 +79,8 @@ inline bool ImplLineInfo::operator==( co
 		&& mnDotCount == rB.mnDotCount
 		&& mnDotLen == rB.mnDotLen
 		&& mnDistance == rB.mnDistance
-		&& meLineJoin == rB.meLineJoin);
+		&& meLineJoin == rB.meLineJoin
+        && meLineCap == rB.meLineCap);
 }
 
 // ------------
@@ -229,6 +232,28 @@ void LineInfo::SetLineJoin(basegfx::B2DL
 
 // -----------------------------------------------------------------------
 
+void LineInfo::SetLineCap(com::sun::star::drawing::LineCap eLineCap)
+{
+    DBG_CHKTHIS( LineInfo, NULL );
+
+    if(eLineCap != mpImplLineInfo->meLineCap)
+    {
+        ImplMakeUnique();
+        mpImplLineInfo->meLineCap = eLineCap;
+    }
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool LineInfo::IsDefault() const 
+{ 
+    return( !mpImplLineInfo->mnWidth 
+        && ( LINE_SOLID == mpImplLineInfo->meStyle ) 
+        && ( com::sun::star::drawing::LineCap_BUTT == mpImplLineInfo->meLineCap)); 
+}
+
+// -----------------------------------------------------------------------
+
 SvStream& operator>>( SvStream& rIStm, ImplLineInfo& rImplLineInfo )
 {
     VersionCompat	aCompat( rIStm, STREAM_READ );
@@ -251,6 +276,12 @@ SvStream& operator>>( SvStream& rIStm, I
         rIStm >> nTmp16; rImplLineInfo.meLineJoin = (basegfx::B2DLineJoin) nTmp16;
     }
 
+    if( aCompat.GetVersion() >= 4 )
+    {
+        // version 4
+        rIStm >> nTmp16; rImplLineInfo.meLineCap = (com::sun::star::drawing::LineCap) nTmp16;
+    }
+
     return rIStm;
 }
 
@@ -258,7 +289,7 @@ SvStream& operator>>( SvStream& rIStm, I
 
 SvStream& operator<<( SvStream& rOStm, const ImplLineInfo& rImplLineInfo )
 {
-    VersionCompat aCompat( rOStm, STREAM_WRITE, 3 );
+    VersionCompat aCompat( rOStm, STREAM_WRITE, 4 );
 
     // version 1
 	rOStm << (sal_uInt16) rImplLineInfo.meStyle << rImplLineInfo.mnWidth;
@@ -271,6 +302,9 @@ SvStream& operator<<( SvStream& rOStm, c
 	// since version3
 	rOStm << (sal_uInt16) rImplLineInfo.meLineJoin;
 
+    // since version4
+    rOStm << (sal_uInt16) rImplLineInfo.meLineCap;
+
     return rOStm;
 }
 
@@ -354,7 +388,8 @@ void LineInfo::applyToB2DPolyPolygon(
 				o_rFillPolyPolygon.append(basegfx::tools::createAreaGeometry(
 					io_rLinePolyPolygon.getB2DPolygon(a), 
 					fHalfLineWidth, 
-					GetLineJoin()));
+					GetLineJoin(),
+                    GetLineCap()));
 			}
 	        
 			io_rLinePolyPolygon.clear();

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=1227772&r1=1227771&r2=1227772&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 Thu Jan  5 19:13:22 2012
@@ -1596,7 +1596,8 @@ void OutputDevice::impPaintLineGeometryW
 	        aFillPolyPolygon.append(basegfx::tools::createAreaGeometry(
                 aLinePolyPolygon.getB2DPolygon(a), 
                 fHalfLineWidth, 
-                rInfo.GetLineJoin()));
+                rInfo.GetLineJoin(),
+                rInfo.GetLineCap()));
         }
         
         aLinePolyPolygon.clear();
@@ -1646,7 +1647,10 @@ void OutputDevice::impPaintLineGeometryW
         {
             for(sal_uInt32 a(0); a < aFillPolyPolygon.count(); a++)
             {
-                const Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a));
+                Polygon aPolygon(aFillPolyPolygon.getB2DPolygon(a));
+
+                // need to subdivide, mpGraphics->DrawPolygon ignores curves
+                aPolygon.AdaptiveSubdivide(aPolygon);
 			    mpGraphics->DrawPolygon(aPolygon.GetSize(), (const SalPoint*)aPolygon.GetConstPointAry(), this);
             }
         }

Modified: incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/pdfwriter_impl.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/pdfwriter_impl.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/pdfwriter_impl.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/pdfwriter_impl.cxx Thu Jan  5 19:13:22 2012
@@ -1624,7 +1624,28 @@ void PDFWriterImpl::PDFPage::appendMappe
 
 bool PDFWriterImpl::PDFPage::appendLineInfo( const LineInfo& rInfo, OStringBuffer& rBuffer ) const
 {
-    bool bRet = true;
+    if(LINE_DASH == rInfo.GetStyle() && rInfo.GetDashLen() != rInfo.GetDotLen())
+    {
+        // dashed and non-degraded case, check for implementation limits of dash array
+        // in PDF reader apps (e.g. acroread)
+        if(2 * (rInfo.GetDashCount() + rInfo.GetDotCount()) > 10)
+        {
+            return false;
+        }
+    }
+
+    if(basegfx::B2DLINEJOIN_NONE != rInfo.GetLineJoin())
+    {
+        // LineJoin used, ExtLineInfo required
+        return false;
+    }
+
+    if(com::sun::star::drawing::LineCap_BUTT != rInfo.GetLineCap())
+    {
+        // LineCap used, ExtLineInfo required
+        return false;
+    }
+
     if( rInfo.GetStyle() == LINE_DASH )
     {
         rBuffer.append( "[ " );
@@ -1637,10 +1658,6 @@ bool PDFWriterImpl::PDFPage::appendLineI
         }
         else
         {
-            // check for implementation limits of dash array
-            // in PDF reader apps (e.g. acroread)
-            if( 2*(rInfo.GetDashCount() + rInfo.GetDotCount()) > 10 )
-                bRet = false;
             for( int n = 0; n < rInfo.GetDashCount(); n++ )
             {
                 appendMappedLength( (sal_Int32)rInfo.GetDashLen(), rBuffer );
@@ -1658,6 +1675,7 @@ bool PDFWriterImpl::PDFPage::appendLineI
         }
         rBuffer.append( "] 0 d\n" );
     }
+
     if( rInfo.GetWidth() > 1 )
     {
         appendMappedLength( (sal_Int32)rInfo.GetWidth(), rBuffer );
@@ -1669,7 +1687,8 @@ bool PDFWriterImpl::PDFPage::appendLineI
         appendDouble( 72.0/double(m_pWriter->getReferenceDevice()->ImplGetDPIX()), rBuffer );
         rBuffer.append( " w\n" );
     }
-    return bRet;
+
+    return true;
 }
 
 void PDFWriterImpl::PDFPage::appendWaveLine( sal_Int32 nWidth, sal_Int32 nY, sal_Int32 nDelta, OStringBuffer& rBuffer ) const
@@ -9045,21 +9064,68 @@ void PDFWriterImpl::convertLineInfoToExt
     rOut.m_fMiterLimit          = 10;
     rOut.m_aDashArray.clear();
 
-    int nDashes     = rIn.GetDashCount();
-    int nDashLen    = rIn.GetDashLen();
-    int nDistance   = rIn.GetDistance();
+    // add DashDot to DashArray
+    const int nDashes     = rIn.GetDashCount();
+    const int nDashLen    = rIn.GetDashLen();
+    const int nDistance   = rIn.GetDistance();
+
     for( int n  = 0; n < nDashes; n++ )
     {
         rOut.m_aDashArray.push_back( nDashLen );
         rOut.m_aDashArray.push_back( nDistance );
     }
-    int nDots       = rIn.GetDotCount();
-    int nDotLen     = rIn.GetDotLen();
+
+    const int nDots       = rIn.GetDotCount();
+    const int nDotLen     = rIn.GetDotLen();
+
     for( int n  = 0; n < nDots; n++ )
     {
         rOut.m_aDashArray.push_back( nDotLen );
         rOut.m_aDashArray.push_back( nDistance );
     }
+
+    // add LineJoin
+    switch(rIn.GetLineJoin())
+    {
+        case basegfx::B2DLINEJOIN_BEVEL :
+        {
+            rOut.m_eJoin = PDFWriter::joinBevel;
+            break;
+        }
+        default : // basegfx::B2DLINEJOIN_NONE :
+        // Pdf has no 'none' lineJoin, default is miter
+        case basegfx::B2DLINEJOIN_MIDDLE :
+        case basegfx::B2DLINEJOIN_MITER :
+        {
+            rOut.m_eJoin = PDFWriter::joinMiter;
+            break;
+        }
+        case basegfx::B2DLINEJOIN_ROUND :
+        {
+            rOut.m_eJoin = PDFWriter::joinRound;
+            break;
+        }
+    }
+
+    // add LineCap
+    switch(rIn.GetLineCap())
+    {
+        default: /* com::sun::star::drawing::LineCap_BUTT */
+        {
+            rOut.m_eCap = PDFWriter::capButt;
+            break;
+        }
+        case com::sun::star::drawing::LineCap_ROUND:
+        {
+            rOut.m_eCap = PDFWriter::capRound;
+            break;
+        }
+        case com::sun::star::drawing::LineCap_SQUARE:
+        {
+            rOut.m_eCap = PDFWriter::capSquare;
+            break;
+        }
+    }
 }
 
 void PDFWriterImpl::drawPolyLine( const Polygon& rPoly, const PDFWriter::ExtLineInfo& rInfo )

Modified: incubator/ooo/branches/alg/linecap/main/xmloff/inc/xmloff/xmltoken.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/xmloff/inc/xmloff/xmltoken.hxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/xmloff/inc/xmloff/xmltoken.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/xmloff/inc/xmloff/xmltoken.hxx Thu Jan  5 19:13:22 2012
@@ -340,6 +340,7 @@ namespace xmloff { namespace token {
         XML_BUBBLE,
         XML_BULLET_CHAR,
         XML_BULLET_RELATIVE_SIZE,
+        XML_BUTT,
         XML_BUTTON1,
         XML_BUTTON2,
         XML_BUTTON3,
@@ -1681,6 +1682,7 @@ namespace xmloff { namespace token {
         XML_STROKE,
         XML_STROKE_COLOR,
         XML_STROKE_DASH,
+        XML_STROKE_LINECAP,
         XML_STROKE_LINEJOIN,
         XML_STROKE_OPACITY,
         XML_STROKE_WIDTH,

Modified: incubator/ooo/branches/alg/linecap/main/xmloff/source/core/xmltoken.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/xmloff/source/core/xmltoken.cxx?rev=1227772&r1=1227771&r2=1227772&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/xmloff/source/core/xmltoken.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/xmloff/source/core/xmltoken.cxx Thu Jan  5 19:13:22 2012
@@ -348,6 +348,7 @@ namespace xmloff { namespace token {
         TOKEN( "bubble",                          XML_BUBBLE ),
         TOKEN( "bullet-char",                     XML_BULLET_CHAR ),
         TOKEN( "bullet-relative-size",            XML_BULLET_RELATIVE_SIZE ),
+        TOKEN( "butt",                            XML_BUTT ),
         TOKEN( "button1",                         XML_BUTTON1 ),
         TOKEN( "button2",                         XML_BUTTON2 ),
         TOKEN( "button3",                         XML_BUTTON3 ),
@@ -1689,6 +1690,7 @@ namespace xmloff { namespace token {
         TOKEN( "stroke",                          XML_STROKE ),
         TOKEN( "stroke-color",                    XML_STROKE_COLOR ),
         TOKEN( "stroke-dash",                     XML_STROKE_DASH ),
+        TOKEN( "stroke-linecap",                  XML_STROKE_LINECAP ),
         TOKEN( "stroke-linejoin",                 XML_STROKE_LINEJOIN ),
         TOKEN( "stroke-opacity",                  XML_STROKE_OPACITY ),
         TOKEN( "stroke-width",                    XML_STROKE_WIDTH ),



Mime
View raw message