summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2019-10-03 08:37:00 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2019-10-16 10:44:00 +0200
commitc50e44b270bc3048ff9c1a000c3afed1dab9e0bf (patch)
treed152dc897d7a54e0e01a1b594b1830f9a45f1e19 /oox
parente1b08d46d1861bfca88af5d8c7137419bcc131aa (diff)
tdf#126060 Handle text camera z rotation while pptx import.
Change-Id: Ifa4589fb50affc4c5ffb52288db8533c98ec6dd9 Reviewed-on: https://gerrit.libreoffice.org/80587 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/drawingml/customshapeproperties.hxx2
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx2
-rw-r--r--oox/source/drawingml/shape.cxx4
-rw-r--r--oox/source/drawingml/textbodypropertiescontext.cxx4
-rw-r--r--oox/source/token/properties.txt1
5 files changed, 13 insertions, 0 deletions
diff --git a/oox/inc/drawingml/customshapeproperties.hxx b/oox/inc/drawingml/customshapeproperties.hxx
index 19ec66f624ce..1dc0270614e0 100644
--- a/oox/inc/drawingml/customshapeproperties.hxx
+++ b/oox/inc/drawingml/customshapeproperties.hxx
@@ -118,6 +118,7 @@ public:
void setMirroredX( bool bMirroredX ) { mbMirroredX = bMirroredX; };
void setMirroredY( bool bMirroredY ) { mbMirroredY = bMirroredY; };
void setTextRotateAngle( sal_Int32 nAngle ) { mnTextRotateAngle = nAngle; };
+ void setTextCameraZRotateAngle( sal_Int32 nAngle ) { mnTextCameraZRotateAngle = nAngle; };
static sal_Int32 SetCustomShapeGuideValue( std::vector< CustomShapeGuide >& rGuideList, const CustomShapeGuide& rGuide );
static sal_Int32 GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, const OUString& rFormulaName );
@@ -140,6 +141,7 @@ private:
bool mbMirroredX;
bool mbMirroredY;
sal_Int32 mnTextRotateAngle;
+ sal_Int32 mnTextCameraZRotateAngle;
typedef std::unordered_map< sal_Int32, PropertyMap > PresetDataMap;
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 14c7a777811f..df878d39eec3 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -46,6 +46,7 @@ CustomShapeProperties::CustomShapeProperties()
, mbMirroredX ( false )
, mbMirroredY ( false )
, mnTextRotateAngle ( 0 )
+, mnTextCameraZRotateAngle ( 0 )
, mnArcNum ( 0 )
{
}
@@ -150,6 +151,7 @@ void CustomShapeProperties::pushToPropSet(
aPropertyMap.setProperty( PROP_MirroredX, mbMirroredX );
aPropertyMap.setProperty( PROP_MirroredY, mbMirroredY );
aPropertyMap.setProperty( PROP_TextPreRotateAngle, mnTextRotateAngle );
+ aPropertyMap.setProperty( PROP_TextCameraZRotateAngle, mnTextCameraZRotateAngle );
Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq );
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 25d94efee180..4e574af50869 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1380,7 +1380,11 @@ Reference< XShape > const & Shape::createAndInsert(
mpCustomShapePropertiesPtr->setMirroredY( true );
if( getTextBody() )
{
+ sal_Int32 nTextCameraZRotation = static_cast< sal_Int32 >( get3DProperties().maCameraRotation.mnRevolution.get() );
+ mpCustomShapePropertiesPtr->setTextCameraZRotateAngle( nTextCameraZRotation / 60000 );
+
sal_Int32 nTextRotateAngle = static_cast< sal_Int32 >( getTextBody()->getTextProperties().moRotation.get( 0 ) );
+
nTextRotateAngle -= mnDiagramRotation;
/* OOX measures text rotation clockwise in 1/60000th degrees,
relative to the containing shape. setTextRotateAngle wants
diff --git a/oox/source/drawingml/textbodypropertiescontext.cxx b/oox/source/drawingml/textbodypropertiescontext.cxx
index 48654a0bc4d2..cac8bc10f89e 100644
--- a/oox/source/drawingml/textbodypropertiescontext.cxx
+++ b/oox/source/drawingml/textbodypropertiescontext.cxx
@@ -27,6 +27,7 @@
#include <drawingml/textbodyproperties.hxx>
#include <drawingml/textbody.hxx>
#include <drawingml/customshapegeometry.hxx>
+#include <drawingml/scene3dcontext.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
#include <oox/helper/attributelist.hxx>
#include <oox/helper/propertymap.hxx>
@@ -171,6 +172,9 @@ ContextHandlerRef TextBodyPropertiesContext::onCreateContext( sal_Int32 aElement
break;
case A_TOKEN( scene3d ): // CT_Scene3D
+ return new Scene3DPropertiesContext( *this, mpShapePtr->get3DProperties() );
+ break;
+
// EG_Text3D
case A_TOKEN( sp3d ): // CT_Shape3D
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index a9e031a1ce7c..db44e176ef33 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -510,6 +510,7 @@ Text
TextAutoGrowHeight
TextBox
TextBreak
+TextCameraZRotateAngle
TextColor
TextFitToSize
TextFrames