diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2020-08-01 01:39:26 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-08-05 10:23:32 +0200 |
commit | 802fa332fc05a119c525f20a46ac3aaea7900602 (patch) | |
tree | 4072f07a10a24dcb2a711b662575846d64421595 /oox | |
parent | 0fa151a50cd9a0013aedb4010d32a25b0fe1e0cf (diff) |
tdf#133687 Fix the placeholders priority order.
When we don't have type attribute on slide but have on
slidelayout we have to use it instead of default type.
Change-Id: Ibb874b5ee39c48641484fe1a8686f66c31695f76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99904
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
(cherry picked from commit e0018be102edd6e376e0622e0a9384176d2f119c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100052
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/ppt/pptshapecontext.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx index 25bcc9200bef..72c96dd8d9c2 100644 --- a/oox/source/ppt/pptshapecontext.cxx +++ b/oox/source/ppt/pptshapecontext.cxx @@ -65,10 +65,28 @@ ContextHandlerRef PPTShapeContext::onCreateContext( sal_Int32 aElementToken, con } case PPT_TOKEN( ph ): { + SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() ); + OptValue< sal_Int32 > oSubType( rAttribs.getToken( XML_type) ); sal_Int32 nSubType( rAttribs.getToken( XML_type, XML_obj ) ); + sal_Int32 nSubTypeIndex; + oox::drawingml::ShapePtr pTmpPlaceholder; + mpShapePtr->setSubType( nSubType ); + if( rAttribs.hasAttribute( XML_idx ) ) - mpShapePtr->setSubTypeIndex( rAttribs.getString( XML_idx ).get().toInt32() ); + { + nSubTypeIndex = rAttribs.getString( XML_idx ).get().toInt32(); + mpShapePtr->setSubTypeIndex( nSubTypeIndex ); + + if(!oSubType.has() && pMasterPersist) + { + pTmpPlaceholder = PPTShape::findPlaceholderByIndex( nSubTypeIndex, pMasterPersist->getShapes()->getChildren() ); + + if(pTmpPlaceholder) + nSubType = pTmpPlaceholder->getSubType(); // When we don't have type attribute on slide but have on slidelayout we have to use it instead of default type + } + } + if ( nSubType ) { PPTShape* pPPTShapePtr = dynamic_cast< PPTShape* >( mpShapePtr.get() ); @@ -125,7 +143,6 @@ ContextHandlerRef PPTShapeContext::onCreateContext( sal_Int32 aElementToken, con } else if ( eShapeLocation == Slide ) // normal slide shapes have to search within the corresponding master tree for referenced objects { - SlidePersistPtr pMasterPersist( mpSlidePersistPtr->getMasterPersist() ); if ( pMasterPersist ) { pPlaceholder = PPTShape::findPlaceholder( nFirstPlaceholder, nSecondPlaceholder, |