Author: alg
Date: Fri Nov  8 12:44:22 2013
New Revision: 1539999

URL: http://svn.apache.org/r1539999
Log:
i123616 be more flexible regarding the data type for polygon data

Modified:
    openoffice/trunk/main/svx/source/unodraw/unoshape.cxx

Modified: openoffice/trunk/main/svx/source/unodraw/unoshape.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/unodraw/unoshape.cxx?rev=1539999&r1=1539998&r2=1539999&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/unodraw/unoshape.cxx (original)
+++ openoffice/trunk/main/svx/source/unodraw/unoshape.cxx Fri Nov  8 12:44:22 
2013
@@ -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>
 
@@ -2403,12 +2404,26 @@ bool SvxShape::setPropertyValueImpl( con
                                        }
                                        break;
                                }
-                       case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
-                               {
-                                       drawing::PolyPolygonBezierCoords 
aPolyPoly;
-                                       if ( rValue >>= aPolyPoly )
-                                       {
-                                               basegfx::B2DPolyPolygon 
aNewPolyPolygon( SvxConvertPolyPolygonBezierToB2DPolyPolygon( &aPolyPoly ) );
+            case OWN_ATTR_EDGE_POLYPOLYGONBEZIER:
+                {
+                    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())
+                    {
                         // --> OD 2010-02-19 #i108851# - reintroduction of fix 
for issue i59051
                         ForceMetricToItemPoolMetric( aNewPolyPolygon );
                         // <--
@@ -2419,9 +2434,9 @@ bool SvxShape::setPropertyValueImpl( con
                         }
                         pEdgeObj->SetEdgeTrackPath( aNewPolyPolygon );
                         return true;
-                                       }
-                               }
-                       }
+                    }
+                }
+            }
                }
                break;
        }


Reply via email to