File bsc1172941.diff of Package libreoffice
From 3bbf11e4d8b2e7ffff068bc5ae1770ee2f255798 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCl=C5=9Fah=20K=C3=B6se?= <gulsah.kose@collabora.com>
Date: Sat, 1 Aug 2020 01:39:26 +0300
Subject: [PATCH] bsc1172941.diff
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100097
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
---
oox/source/ppt/pptshapecontext.cxx | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index c0c81effba0c..44dbac4d8994 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -77,10 +77,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() );
@@ -137,7 +155,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.get() )
{
pPlaceholder = PPTShape::findPlaceholder( nFirstPlaceholder, nSecondPlaceholder,
--
2.26.2