summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-07-29 21:43:41 +0200
committerAndras Timar <andras.timar@collabora.com>2017-08-04 12:01:29 +0200
commit72e3148f50af7dd85c489c7bf641963a3194cab6 (patch)
tree0c19693eedd5dac67f5d0edb77c06a49ee9dccad /oox
parent281b2c65b32dfcc312f4e662e33f73a867aa75f0 (diff)
tdf#109223: PPTX: Vertical flip of child shape is not imported correctly
Group shape level vertical flip is not handled well. Recent handling of group shape's transformation makes it hard to import this attribute, but we can import the right text direction at least. Reviewed-on: https://gerrit.libreoffice.org/40554 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit d742c0019435d0bc90c9342492583636099a057f) Change-Id: Ib9e39e3dcb28a95fabc61c13152a3f7296fbd4c3 Reviewed-on: https://gerrit.libreoffice.org/40556 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit c49f2c00067cbe5de714525807290b71aec57ea3)
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index cd564964af35..2090057cb2b1 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -116,6 +116,7 @@ Shape::Shape( const sal_Char* pServiceName, bool bDefaultHeight )
, mnRotation( 0 )
, mbFlipH( false )
, mbFlipV( false )
+, mbInheritedTextFlipV(false)
, mbHidden( false )
, mbHiddenMasterShape( false )
, mbLockedCanvas( false )
@@ -157,6 +158,7 @@ Shape::Shape( const ShapePtr& pSourceShape )
, mnRotation( pSourceShape->mnRotation )
, mbFlipH( pSourceShape->mbFlipH )
, mbFlipV( pSourceShape->mbFlipV )
+, mbInheritedTextFlipV(pSourceShape->mbInheritedTextFlipV)
, mbHidden( pSourceShape->mbHidden )
, mbHiddenMasterShape( pSourceShape->mbHiddenMasterShape )
, mbLockedCanvas( pSourceShape->mbLockedCanvas )
@@ -314,6 +316,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
mnRotation = rReferencedShape.mnRotation;
mbFlipH = rReferencedShape.mbFlipH;
mbFlipV = rReferencedShape.mbFlipV;
+ mbInheritedTextFlipV = rReferencedShape.mbInheritedTextFlipV;
mbHidden = rReferencedShape.mbHidden;
}
@@ -393,6 +396,7 @@ void Shape::addChildren(
std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
while( aIter != rMaster.maChildren.end() ) {
(*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
+ (*aIter)->applyParentTextFlipV(mbInheritedTextFlipV != mbFlipV);
(*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), nullptr, pShapeMap );
}
}
@@ -1079,6 +1083,8 @@ Reference< XShape > const & Shape::createAndInsert(
if( getTextBody() )
{
sal_Int32 nTextRotateAngle = static_cast< sal_Int32 >( getTextBody()->getTextProperties().moRotation.get( 0 ) );
+ if(mbInheritedTextFlipV)
+ nTextRotateAngle -= 180 * 60000;
/* OOX measures text rotation clockwise in 1/60000th degrees,
relative to the containing shape. setTextRotateAngle wants
degrees anticlockwise. */