[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.0' - cppcanvas/source

Matúš Kukan matus.kukan at collabora.com
Fri Dec 6 07:22:17 PST 2013


 cppcanvas/source/inc/implrenderer.hxx    |    2 +-
 cppcanvas/source/mtfrenderer/emfplus.cxx |   23 ++++++++++++++++++++---
 2 files changed, 21 insertions(+), 4 deletions(-)

New commits:
commit 7c82f63af7a519a192d9dd0ba5ca463de9e508e8
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Fri Dec 6 14:40:50 2013 +0100

    EMF+: Fill line cap object if EmfPlusCustomLineCapDataFillPath is set.
    
    Change-Id: I7b53a8f18e1fb24b1ae0322bdf0980e431a0725f
    (cherry picked from commit 131f3230d98f24faf57d9404e333cb1fb183345b)

diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index cd9cda0..cebbbab 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -280,7 +280,7 @@ static float GetSwapFloat( SvStream& rSt )
             /// Render LineCap, like the start or end arrow of a polygon.
             /// @return how much we should shorten the original polygon.
             double EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength,
-                    const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart,
+                    const ::basegfx::B2DPolyPolygon& rLineCap, bool isFilled, bool bStart,
                     const com::sun::star::rendering::StrokeAttributes& rAttributes,
                     const ActionFactoryParameters& rParms, OutDevState& rState);
 
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index aeb52af..be0588d 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -621,6 +621,7 @@ namespace cppcanvas
             sal_uInt32 strokeStartCap, strokeEndCap, strokeJoin;
             float miterLimit;
             basegfx::B2DPolyPolygon polygon;
+            bool mbIsFilled;
 
         public:
             EMFPCustomLineCap() : EMFPObject()
@@ -647,7 +648,7 @@ namespace cppcanvas
                 aAttributes.MiterLimit = miterLimit;
             }
 
-            void ReadPath(SvStream& s, ImplRenderer& rR, bool bClosed)
+            void ReadPath(SvStream& s, ImplRenderer& rR, bool bFill)
             {
                 sal_Int32 pathLength;
                 s >> pathLength;
@@ -664,7 +665,7 @@ namespace cppcanvas
                 path.Read(s, pathFlags, rR);
 
                 polygon = path.GetPolygon(rR, false);
-                polygon.setClosed(bClosed);
+                mbIsFilled = bFill;
 
                 // transformation to convert the path to what LibreOffice
                 // expects
@@ -1317,7 +1318,7 @@ namespace cppcanvas
         }
 
         double ImplRenderer::EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength,
-                const ::basegfx::B2DPolyPolygon& rLineCap, bool bStart, const rendering::StrokeAttributes& rAttributes,
+                const ::basegfx::B2DPolyPolygon& rLineCap, bool bIsFilled, bool bStart, const rendering::StrokeAttributes& rAttributes,
                 const ActionFactoryParameters& rParms, OutDevState& rState)
         {
             if (!rLineCap.count())
@@ -1346,6 +1347,20 @@ namespace cppcanvas
                 rParms.mrCurrActionIndex += pAction->getActionCount()-1;
             }
 
+            if (bIsFilled)
+            {
+                bool bWasFillColorSet = rState.isFillColorSet;
+                rState.isFillColorSet = true;
+                rState.fillColor = rState.lineColor;
+                ActionSharedPtr pAction2(internal::PolyPolyActionFactory::createPolyPolyAction(aArrow, rParms.mrCanvas, rState));
+                if (pAction2)
+                {
+                    maActions.push_back(MtfAction(pAction2, rParms.mrCurrActionIndex));
+                    rParms.mrCurrActionIndex += pAction2->getActionCount()-1;
+                }
+                rState.isFillColorSet = bWasFillColorSet;
+            }
+
             return rAttributes.StrokeWidth;
         }
 
@@ -1400,6 +1415,7 @@ namespace cppcanvas
                                 pen->customStartCap->SetAttributes(aAttributes);
 
                                 fStart = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customStartCap->polygon,
+                                        pen->customStartCap->mbIsFilled,
                                         true, aAttributes, rParms, rState);
                             }
 
@@ -1410,6 +1426,7 @@ namespace cppcanvas
                                 pen->customEndCap->SetAttributes(aAttributes);
 
                                 fEnd = EMFPPlusDrawLineCap(aPolygon, fPolyLength, pen->customEndCap->polygon,
+                                        pen->customEndCap->mbIsFilled,
                                         false, aAttributes, rParms, rState);
                             }
 


More information about the Libreoffice-commits mailing list