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