diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2020-11-17 12:43:12 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.kose@collabora.com> | 2020-11-18 10:36:07 +0100 |
commit | 72998fc859a83f063698c287d035f3fdc8b4481c (patch) | |
tree | 98563e4ba8e354aab4fd6cd0f6b0cb0aef1741ea /oox/source/drawingml/shape.cxx | |
parent | 6fa1161d3113d43f38acdf9207627659fbc137c8 (diff) |
tdf#128213 Fix text camera z rotation import and export.
Text3DProperties is added to distinguish shape and text 3D effects.
Before there was implementation error about text camera z rotation
support. We were using shape effects for text. We already have not
support shape 3D rotation but we have text camera z rotation. This
patch includes import and export filter changes about text camera z
rotation.
Change-Id: I623392b82edf4585888d2f15ad91ffb2109d8f96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106033
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'oox/source/drawingml/shape.cxx')
-rw-r--r-- | oox/source/drawingml/shape.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 95b608eadcc6..a7ffe9655f1c 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1377,6 +1377,24 @@ Reference< XShape > const & Shape::createAndInsert( putPropertyToGrabBag( "3DEffectProperties", Any( a3DEffectsGrabBag ) ); } + if( bIsCustomShape && getTextBody()) + { + + Sequence< PropertyValue > aTextCamera3DEffects = getTextBody()->get3DProperties().getCameraAttributes(); + Sequence< PropertyValue > aTextLightRig3DEffects = getTextBody()->get3DProperties().getLightRigAttributes(); + Sequence< PropertyValue > aTextShape3DEffects = getTextBody()->get3DProperties().getShape3DAttributes( rGraphicHelper, nFillPhClr ); + if( aTextCamera3DEffects.hasElements() || aTextLightRig3DEffects.hasElements() || aTextShape3DEffects.hasElements() ) + { + uno::Sequence<beans::PropertyValue> aText3DEffectsGrabBag = comphelper::InitPropertySequence( + { + {"Camera", uno::makeAny(aTextCamera3DEffects)}, + {"LightRig", uno::makeAny(aTextLightRig3DEffects)}, + {"Shape3D", uno::makeAny(aTextShape3DEffects)} + }); + putPropertyToGrabBag( "Text3DEffectProperties", Any( aText3DEffectsGrabBag ) ); + } + } + // store bitmap artistic effects in the grab bag if( !mpGraphicPropertiesPtr->maBlipProps.maEffect.isEmpty() ) putPropertyToGrabBag( "ArtisticEffectProperties", @@ -1403,7 +1421,7 @@ Reference< XShape > const & Shape::createAndInsert( mpCustomShapePropertiesPtr->setMirroredY( true ); if( getTextBody() ) { - sal_Int32 nTextCameraZRotation = static_cast< sal_Int32 >( get3DProperties().maCameraRotation.mnRevolution.get() ); + sal_Int32 nTextCameraZRotation = static_cast< sal_Int32 >( getTextBody()->get3DProperties().maCameraRotation.mnRevolution.get() ); mpCustomShapePropertiesPtr->setTextCameraZRotateAngle( nTextCameraZRotation / 60000 ); sal_Int32 nTextRotateAngle = static_cast< sal_Int32 >( getTextBody()->getTextProperties().moRotation.get( 0 ) ); |