diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2019-04-18 16:51:13 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2019-04-24 00:27:17 +0200 |
commit | 951282a27a9dd4c64fc206fcbdd805b4cb602816 (patch) | |
tree | fd3d533a493b86ad358c1c3215edfb5cf2f6745d | |
parent | 9c8aa1c217f016fae9a57c6a4feca43551e5068e (diff) |
tdf#124787 mso-spt143 (RingOutside) has angles in degree
When reworking command U the shape 'RingOutside' was not considered.
Although it is a 'mso-' shape, it has angles in degree and not in
fixed-point number in its defaults. The patch removes in addition the
changes introduced by Symphony, which erroneously used total width
and height instead of radii for the ellipse size.
Change-Id: Iede8e346681796fb3e147dbcfaaa08ed8fe87c54
Reviewed-on: https://gerrit.libreoffice.org/70941
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 12 | ||||
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 15 |
2 files changed, 14 insertions, 13 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 339973707bdd..0e38216c1cd1 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -1660,10 +1660,14 @@ void EnhancedCustomShape2d::CreateSubPath( // The following implementation generates such rendering. It is only for rendering legacy // MS shapes and independent of the meaning of commands U and T in ODF specification. - // Convert from fixedfloat to double - double fSwingAngle; - fStartAngle /= 65536.0; - fSwingAngle = fEndAngle / 65536.0; + // The WordArt shape 'RingOutside' has already angles in degree, all other need + // convertion from fixed-point number. + double fSwingAngle = fEndAngle; + if (sShpType != "mso-spt143") + { + fStartAngle /= 65536.0; + fSwingAngle = fEndAngle / 65536.0; + } // Convert orientation fStartAngle = -fStartAngle; fSwingAngle = -fSwingAngle; diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index ab6d19bcfa07..ce4223582ff1 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -6499,20 +6499,17 @@ static const mso_CustomShape msoTextRingInside = const_cast<SvxMSDffHandle*>(mso_sptTextRingInsideHandle), SAL_N_ELEMENTS( mso_sptTextRingInsideHandle ) }; //mso_sptTextRingOutside -//path = U 10800 ?f0 21600 ?f2 180 539 N U 10800 ?f1 21600 ?f2 180 539 N +//path = U 10800 ?f0 10800 ?f2 180 539 N U 10800 ?f1 10800 ?f2 180 539 N +// MSO binary format has swing angle, not end angle, therefore 359 instead of 539. static const SvxMSDffVertPair mso_sptTextRingOutsideVert[] = { - { 10800, 0 MSO_I }, { 21600, 2 MSO_I }, { 180, 539},//U - { 10800, 1 MSO_I }, { 21600, 2 MSO_I }, { 180, 539 }//U - //{ 10800, 0 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 }, - //{ 10800, 1 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 } + { 10800, 0 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 }, + { 10800, 1 MSO_I }, { 10800, 0 MSO_I }, { 180, 359 } }; static const SvxMSDffCalculationData mso_sptTextRingOutsideCalc[] = // adjustment1 : 6629 - 14971 { { 0x2001, { DFF_Prop_adjustValue, 1, 2 } }, - { 0x8000, { 21600, 0, 0x400 } }, - { 0x2000, { DFF_Prop_adjustValue, 0, 0 } }, //$0 - { 0x8000, { 21600, 0, DFF_Prop_adjustValue } }//21600-$0 + { 0x8000, { 21600, 0, 0x400 } } }; static const sal_uInt16 mso_sptTextRingOutsideSegm[] = { @@ -6521,7 +6518,7 @@ static const sal_uInt16 mso_sptTextRingOutsideSegm[] = }; static const SvxMSDffHandle mso_sptTextRingOutsideHandle[] = { - { SvxMSDffHandleFlags::RANGE | SvxMSDffHandleFlags::RANGE_Y_MAX_IS_SPECIAL | SvxMSDffHandleFlags::RANGE_Y_MIN_IS_SPECIAL, + { SvxMSDffHandleFlags::RANGE, 10800, 0x100, 10800, 10800, MIN_INT32, 0x7fffffff, 10800, 21600 } }; static const mso_CustomShape msoTextRingOutside = |