Index: filter/source/msfilter/msdffimp.cxx =================================================================== --- filter/source/msfilter/msdffimp.cxx (revision 1358696) +++ filter/source/msfilter/msdffimp.cxx (working copy) @@ -4500,6 +4500,7 @@ // before clearing the GeometryItem we have to store the current Coordinates const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); Rectangle aPolyBoundRect; + Point aStartPt( 0,0 ); if ( pAny && ( *pAny >>= seqCoordinates ) && ( seqCoordinates.getLength() >= 4 ) ) { sal_Int32 nPtNum, nNumElemVert = seqCoordinates.getLength(); @@ -4516,6 +4517,11 @@ aXP[ (sal_uInt16)nPtNum ] = aP; } aPolyBoundRect = Rectangle( aXP.GetBoundRect() ); + if ( nNumElemVert >= 4 ) + { // arc first command is always wr -- clockwise arc + // the parameters are : (left,top),(right,bottom),start(x,y),end(x,y) + aStartPt = aXP[2]; + } } else aPolyBoundRect = Rectangle( -21600, 0, 21600, 43200 ); // defaulting @@ -4540,6 +4546,18 @@ else { fNumber = 270.0; + //normal situation:if endAngle != 90,there will be a direct_value,but for damaged curve,the endAngle need to recalculate. + Point cent = aPolyBoundRect.Center(); + if ( aStartPt.Y() == cent.Y() ) + fNumber = ( aStartPt.X() >= cent.X() ) ? 0:180.0; + else if ( aStartPt.X() == cent.X() ) + fNumber = ( aStartPt.Y() >= cent.Y() ) ? 90.0: 270.0; + else + { + fNumber = atan2( double( aStartPt.X() - cent.X() ),double( aStartPt.Y() - cent.Y() ) )+ F_PI; // 0..2PI + fNumber /= F_PI180; // 0..360.0 + } + nEndAngle = NormAngle360( - (sal_Int32)fNumber * 100 ); seqAdjustmentValues[ 0 ].Value <<= fNumber; seqAdjustmentValues[ 0 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; // so this value will properly be stored }