28#include <oox/token/namespaces.hxx>
29#include <oox/token/tokens.hxx>
30#include <oox/token/properties.hxx>
42:
oox::drawingml::GraphicShapeContext( rParent, pMasterShapePtr, pShapePtr )
43, mpSlidePersistPtr(
std::move( pSlidePersistPtr ))
49 switch( aElementToken )
54 case PPT_TOKEN(cNvPr):
63 bool bHasIdx = !sIdx.isEmpty();
64 sal_Int32 nIdx = sIdx.toInt32();
68 if ( nSubType || bHasIdx )
76 if ( bHasIdx && eShapeLocation ==
Slide )
80 if ( pMasterPersist && rAttribs.
hasAttribute( XML_idx ) )
83 if ( !pPlaceholder && ( ( eShapeLocation ==
Slide ) || ( eShapeLocation ==
Layout ) ) )
87 sal_Int32 nFirstPlaceholder = 0;
88 sal_Int32 nSecondPlaceholder = 0;
92 nFirstPlaceholder = XML_ctrTitle;
93 nSecondPlaceholder = XML_title;
96 nFirstPlaceholder = XML_subTitle;
97 nSecondPlaceholder = XML_title;
100 nFirstPlaceholder = XML_body;
115 nFirstPlaceholder = nSubType;
120 if ( nFirstPlaceholder )
122 if ( eShapeLocation ==
Layout )
125 else if ( eShapeLocation ==
Slide )
128 if ( pMasterPersist )
130 pPPTShapePtr->
getSubTypeIndex(), pMasterPersist->getShapes()->getChildren() );
136 bool bUseText =
true;
137 switch( pPlaceholder->getSubType() )
157 pPlaceholder->getShapeProperties().setAnyProperty(
158 PROP_URL,
mpShapePtr->getShapeProperties().getProperty(PROP_URL));
159 mpShapePtr->applyShapeReference( *pPlaceholder, bUseText );
171 case PPT_TOKEN(spPr):
174 case PPT_TOKEN(style):
177 case PPT_TOKEN(txBody):
185 return GraphicShapeContext::onCreateContext( aElementToken, rAttribs );
Provides access to attribute values of an element.
OUString getStringDefaulted(sal_Int32 nAttrToken) const
Returns the string value of the specified attribute, returns an empty string if attribute not present...
bool hasAttribute(sal_Int32 nAttrToken) const
Returns true, if the specified attribute is present.
std::optional< sal_Int32 > getToken(sal_Int32 nAttrToken) const
Returns the token identifier of the value of the specified attribute.
const std::optional< sal_Int32 > & getSubTypeIndex() const
PPTGraphicShapeContext(::oox::core::ContextHandler2Helper const &rParent, SlidePersistPtr xSlidePersistPtr, const oox::drawingml::ShapePtr &pMasterShapePtr, const oox::drawingml::ShapePtr &pShapePtr)
virtual ::oox::core::ContextHandlerRef onCreateContext(::sal_Int32 Element, const ::oox::AttributeList &rAttribs) override
SlidePersistPtr mpSlidePersistPtr
static oox::drawingml::ShapePtr findPlaceholder(const sal_Int32 nFirstSubType, const sal_Int32 nSecondSubType, const std::optional< sal_Int32 > &oSubTypeIndex, std::vector< oox::drawingml::ShapePtr > &rShapes, bool bMasterOnly=false)
ShapeLocation getShapeLocation() const
void setReferenced(bool bReferenced)
void setPlaceholder(oox::drawingml::ShapePtr pPlaceholder)
static oox::drawingml::ShapePtr findPlaceholderByIndex(const sal_Int32 nIdx, std::vector< oox::drawingml::ShapePtr > &rShapes, bool bMasterOnly=false)
std::shared_ptr< Shape > ShapePtr
std::shared_ptr< TextBody > TextBodyPtr
std::shared_ptr< SlidePersist > SlidePersistPtr