[Libreoffice-commits] core.git: Branch 'aoo/trunk' - svx/source

Armin Le Grand alg at apache.org
Fri Nov 8 06:08:53 PST 2013


 svx/source/unodraw/unoshape.cxx |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

New commits:
commit 66c81c1a26d6d09c75c8b8ced44e4a0cf43819ee
Author: Armin Le Grand <alg at apache.org>
Date:   Fri Nov 8 12:44:22 2013 +0000

    i123616 be more flexible regarding the data type for polygon data

diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index e2bb6c3..582929c 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -92,6 +92,7 @@
 #include <editeng/outlobj.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
 
 #include <vector>
 
@@ -2405,10 +2406,24 @@ bool SvxShape::setPropertyValueImpl( const ::rtl::OUString&, const SfxItemProper
                 }
             case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
                 {
-                    drawing::PolyPolygonBezierCoords aPolyPoly;
-                    if ( rValue >>= aPolyPoly )
+                    basegfx::B2DPolyPolygon aNewPolyPolygon;
+
+                    // #123616# be a little bit more flexible regardin gthe data type used
+                    if( rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0))
+                    {
+                        // get polygpon data from PointSequenceSequence
+                        aNewPolyPolygon = basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon(
+                            *(const drawing::PointSequenceSequence*)rValue.getValue());
+                    }
+                    else if( rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0))
+                    {
+                        // get polygpon data from PolyPolygonBezierCoords
+                        aNewPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(
+                            *(const drawing::PolyPolygonBezierCoords*)rValue.getValue());
+                    }
+
+                    if(aNewPolyPolygon.count())
                     {
-                        basegfx::B2DPolyPolygon aNewPolyPolygon( SvxConvertPolyPolygonBezierToB2DPolyPolygon( &aPolyPoly ) );
                         // --> OD 2010-02-19 #i108851# - reintroduction of fix for issue i59051
                         ForceMetricToItemPoolMetric( aNewPolyPolygon );
                         // <--


More information about the Libreoffice-commits mailing list