Lines 4500-4505
Link Here
|
4500 |
// before clearing the GeometryItem we have to store the current Coordinates |
4500 |
// before clearing the GeometryItem we have to store the current Coordinates |
4501 |
const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); |
4501 |
const uno::Any* pAny = ((SdrCustomShapeGeometryItem&)aGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); |
4502 |
Rectangle aPolyBoundRect; |
4502 |
Rectangle aPolyBoundRect; |
|
|
4503 |
Point aStartPt( 0,0 ); |
4503 |
if ( pAny && ( *pAny >>= seqCoordinates ) && ( seqCoordinates.getLength() >= 4 ) ) |
4504 |
if ( pAny && ( *pAny >>= seqCoordinates ) && ( seqCoordinates.getLength() >= 4 ) ) |
4504 |
{ |
4505 |
{ |
4505 |
sal_Int32 nPtNum, nNumElemVert = seqCoordinates.getLength(); |
4506 |
sal_Int32 nPtNum, nNumElemVert = seqCoordinates.getLength(); |
Lines 4516-4521
Link Here
|
4516 |
aXP[ (sal_uInt16)nPtNum ] = aP; |
4517 |
aXP[ (sal_uInt16)nPtNum ] = aP; |
4517 |
} |
4518 |
} |
4518 |
aPolyBoundRect = Rectangle( aXP.GetBoundRect() ); |
4519 |
aPolyBoundRect = Rectangle( aXP.GetBoundRect() ); |
|
|
4520 |
if ( nNumElemVert >= 4 ) |
4521 |
{ // arc first command is always wr -- clockwise arc |
4522 |
// the parameters are : (left,top),(right,bottom),start(x,y),end(x,y) |
4523 |
aStartPt = aXP[2]; |
4524 |
} |
4519 |
} |
4525 |
} |
4520 |
else |
4526 |
else |
4521 |
aPolyBoundRect = Rectangle( -21600, 0, 21600, 43200 ); // defaulting |
4527 |
aPolyBoundRect = Rectangle( -21600, 0, 21600, 43200 ); // defaulting |
Lines 4540-4545
Link Here
|
4540 |
else |
4546 |
else |
4541 |
{ |
4547 |
{ |
4542 |
fNumber = 270.0; |
4548 |
fNumber = 270.0; |
|
|
4549 |
//normal situation:if endAngle != 90,there will be a direct_value,but for damaged curve,the endAngle need to recalculate. |
4550 |
Point cent = aPolyBoundRect.Center(); |
4551 |
if ( aStartPt.Y() == cent.Y() ) |
4552 |
fNumber = ( aStartPt.X() >= cent.X() ) ? 0:180.0; |
4553 |
else if ( aStartPt.X() == cent.X() ) |
4554 |
fNumber = ( aStartPt.Y() >= cent.Y() ) ? 90.0: 270.0; |
4555 |
else |
4556 |
{ |
4557 |
fNumber = atan2( double( aStartPt.X() - cent.X() ),double( aStartPt.Y() - cent.Y() ) )+ F_PI; // 0..2PI |
4558 |
fNumber /= F_PI180; // 0..360.0 |
4559 |
} |
4560 |
nEndAngle = NormAngle360( - (sal_Int32)fNumber * 100 ); |
4543 |
seqAdjustmentValues[ 0 ].Value <<= fNumber; |
4561 |
seqAdjustmentValues[ 0 ].Value <<= fNumber; |
4544 |
seqAdjustmentValues[ 0 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; // so this value will properly be stored |
4562 |
seqAdjustmentValues[ 0 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; // so this value will properly be stored |
4545 |
} |
4563 |
} |