21#include <com/sun/star/drawing/XDrawPage.hpp>
22#include <com/sun/star/drawing/XShapes.hpp>
23#include <com/sun/star/frame/XModel.hpp>
32#include <oox/token/properties.hxx>
33#include <oox/token/tokens.hxx>
38#include <osl/diagnose.h>
40#include <com/sun/star/style/XStyle.hpp>
41#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
42#include <com/sun/star/container/XNamed.hpp>
43#include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
44#include <com/sun/star/drawing/XGluePointsSupplier.hpp>
45#include <com/sun/star/container/XIdentifierContainer.hpp>
46#include <com/sun/star/drawing/EnhancedCustomShapeGluePointType.hpp>
60 const css::uno::Reference< css::drawing::XDrawPage >& rxPage,
64, maShapesPtr(
std::move( pShapesPtr ))
65, mnLayoutValueToken( 0 )
68, maDefaultTextStylePtr(
std::move( pDefaultTextStyle ))
74#if OSL_DEBUG_LEVEL > 0
79#if OSL_DEBUG_LEVEL > 0
89 sal_Int16 nLayout = 20;
92 case XML_blank: nLayout = 20;
break;
93 case XML_chart: nLayout = 2;
break;
94 case XML_chartAndTx: nLayout = 7;
break;
95 case XML_clipArtAndTx: nLayout = 9;
break;
96 case XML_clipArtAndVertTx: nLayout = 24;
break;
97 case XML_fourObj: nLayout = 18;
break;
98 case XML_obj: nLayout = 11;
break;
99 case XML_objAndTx: nLayout = 13;
break;
100 case XML_objOverTx: nLayout = 14;
break;
101 case XML_tbl: nLayout = 8;
break;
102 case XML_title: nLayout = 0;
break;
103 case XML_titleOnly: nLayout = 19;
break;
105 case XML_twoColTx: nLayout = 3;
break;
106 case XML_twoObjAndTx: nLayout = 15;
break;
107 case XML_twoObjOverTx: nLayout = 16;
break;
108 case XML_tx: nLayout = 1;
break;
109 case XML_txAndChart: nLayout = 4;
break;
110 case XML_txAndClipArt: nLayout = 6;
break;
111 case XML_txAndMedia: nLayout = 6;
break;
112 case XML_txAndObj: nLayout = 10;
break;
113 case XML_txAndTwoObj: nLayout = 12;
break;
114 case XML_txOverObj: nLayout = 17;
break;
115 case XML_vertTitleAndTx: nLayout = 22;
break;
116 case XML_vertTitleAndTxOverChart: nLayout = 21;
break;
117 case XML_vertTx: nLayout = 23;
break;
119 case XML_twoTxTwoObj:
120 case XML_twoObjAndObj:
125 case XML_objAndTwoObj:
139 Reference< XShapes > xShapes(
getPage() );
140 std::vector< oox::drawingml::ShapePtr >& rShapes(
maShapesPtr->getChildren() );
142 for (
auto const& shape : rShapes)
144 std::vector< oox::drawingml::ShapePtr >& rChildren( shape->getChildren() );
145 for (
auto const& child : rChildren)
173 Reference< XAnimationNodeSupplier > xNodeSupplier(
getPage(), UNO_QUERY);
174 if( !xNodeSupplier.is() )
177 Reference< XAnimationNode > xNode( xNodeSupplier->getAnimationNode() );
182 OSL_ENSURE( pNode,
"pNode" );
184 Reference<XAnimationNode> xDummy;
185 pNode->setNode(rFilterBase, xNode, pSlidePtr, xDummy);
205static void setTextStyle( Reference< beans::XPropertySet >
const & rxPropSet,
const XmlFilterBase& rFilter,
209 if( pTextParagraphPropertiesPtr ==
nullptr )
229 Reference< style::XStyleFamiliesSupplier > aXStyleFamiliesSupplier( rFilterBase.getModel(), UNO_QUERY_THROW );
230 Reference< container::XNameAccess > aXNameAccess( aXStyleFamiliesSupplier->getStyleFamilies() );
231 Reference< container::XNamed > aXNamed(
mxPage, UNO_QUERY_THROW );
233 if ( aXNameAccess.is() )
239 static const OUStringLiteral sOutline(
u"outline1" );
240 static const OUStringLiteral sTitle(
u"title" );
241 static const OUStringLiteral sStandard(
u"standard" );
242 static const OUStringLiteral sSubtitle(
u"subtitle" );
244 for(
int i = 0;
i < 4;
i++ )
252 aFamily= aXNamed->getName();
259 aFamily= aXNamed->getName();
266 aFamily= aXNamed->getName();
273 aFamily =
"graphics";
280 aFamily = aXNamed->getName();
284 Reference< container::XNameAccess > xFamilies;
285 if ( aXNameAccess->hasByName( aFamily ) )
287 if( aXNameAccess->getByName( aFamily ) >>= xFamilies )
289 if ( xFamilies->hasByName( aStyle ) )
291 Reference< style::XStyle > aXStyle;
292 if ( xFamilies->getByName( aStyle ) >>= aXStyle )
294 Reference< beans::XPropertySet > xPropSet( aXStyle, UNO_QUERY_THROW );
296 setTextStyle( xPropSet, rFilterBase, pTextListStylePtr, 0 );
299 for (
int nLevel = 1; nLevel < 5; nLevel++ )
302 char pOutline[ 9 ] =
"outline1";
303 pOutline[ 7 ] =
static_cast< char >(
'0' + nLevel );
304 OUString sOutlineStyle( OUString::createFromAscii( pOutline ) );
305 if ( xFamilies->hasByName( sOutlineStyle ) )
307 xFamilies->getByName( sOutlineStyle ) >>= aXStyle;
309 xPropSet.set( aXStyle, UNO_QUERY_THROW );
313 setTextStyle( xPropSet, rFilterBase, pTextListStylePtr, nLevel );
330 std::vector< oox::drawingml::ShapePtr >& rShapes(
maShapesPtr->getChildren() );
331 for (
auto const& shape : rShapes)
333 std::vector< oox::drawingml::ShapePtr >& rChildren( shape->getChildren() );
334 for (
auto const& child : rChildren)
348 return pIter->second;
350 Reference<XAnimationNode> aResult;
358 for (sal_Int32
i = 0;
i < nConnectorShapeCount;
i++)
364 = pIt->second->getConnectorShapeProperties();
365 uno::Reference<drawing::XShape> xConnector(pIt->second->getXShape(), uno::UNO_QUERY);
366 uno::Reference<beans::XPropertySet> xPropertySet(xConnector, uno::UNO_QUERY);
370 sal_Int32
nCount = aConnectorShapeProperties.size();
371 for (sal_Int32 j = 0; j <
nCount; j++)
373 OUString aDestShapeId = aConnectorShapeProperties[j].maDestShapeId;
374 const auto& pShape =
maShapeMap.find(aDestShapeId);
377 uno::Reference<drawing::XShape> xShape(pShape->second->getXShape(), uno::UNO_QUERY);
380 uno::Reference<drawing::XGluePointsSupplier> xSupplier(xShape, uno::UNO_QUERY);
381 css::uno::Reference<css::container::XIdentifierContainer> xGluePoints(
382 xSupplier->getGluePoints(), uno::UNO_QUERY);
384 sal_Int32 nCountGluePoints = xGluePoints->getIdentifiers().getLength();
385 sal_Int32 nGlueId = aConnectorShapeProperties[j].mnDestGlueId;
388 if (nCountGluePoints > 4)
395 else if (nGlueId == 3)
399 bool bStart = aConnectorShapeProperties[j].mbStartShape;
402 xPropertySet->setPropertyValue(
"StartShape",
uno::Any(xShape));
403 xPropertySet->setPropertyValue(
"StartGluePointIndex",
uno::Any(nGlueId));
407 xPropertySet->setPropertyValue(
"EndShape",
uno::Any(xShape));
408 xPropertySet->setPropertyValue(
"EndGluePointIndex",
uno::Any(nGlueId));
A helper that maps property identifiers to property values.
css::uno::Reference< css::beans::XPropertySet > makePropertySet() const
Creates a property set supporting the XPropertySet interface and inserts all properties.
A wrapper for a UNO property set.
void setProperties(const css::uno::Sequence< OUString > &rPropNames, const css::uno::Sequence< css::uno::Any > &rValues)
Puts the passed properties into the property set.
bool setProperty(sal_Int32 nPropId, const Type &rValue)
Puts the passed value into the property set.
bool isUsed() const
Returns true, if the color is initialized.
::Color getColor(const GraphicHelper &rGraphicHelper, ::Color nPhClr=API_RGB_TRANSPARENT) const
Returns the final RGB color value.
std::vector< ShapePtr > & getChildren()
const OUString & getId() const
void setHiddenMasterShape(bool bHiddenMasterShape)
bool isConnectorShape() const
TextCharacterProperties & getTextCharacterProperties()
PropertyMap & getTextParagraphPropertyMap()
void addShape(oox::core::XmlFilterBase &rFilterBase, const SlidePersist &rPersist, const oox::drawingml::Theme *pTheme, const css::uno::Reference< css::drawing::XShapes > &rxShapes, basegfx::B2DHomMatrix &aTransformation, ::oox::drawingml::ShapeIdMap *pShapeMap)
void createConnectorShapeConnection()
::oox::drawingml::ShapeIdMap & getShapeMap()
oox::drawingml::TextListStylePtr maOtherTextStylePtr
std::map< OUString, ::oox::drawingml::ShapePtr > maShapeMap
void createBackground(const oox::core::XmlFilterBase &rFilterBase)
oox::drawingml::TextListStylePtr maBodyTextStylePtr
oox::drawingml::TextListStylePtr maTitleTextStylePtr
const css::uno::Reference< css::drawing::XDrawPage > & getPage() const
sal_Int32 mnLayoutValueToken
oox::drawingml::ShapePtr maShapesPtr
void createXShapes(oox::core::XmlFilterBase &rFilterBase)
static css::uno::WeakReference< css::drawing::XDrawPage > mxDebugPage
std::vector< OUString > maConnectorShapeId
const oox::drawingml::ThemePtr & getTheme() const
css::uno::Reference< css::drawing::XDrawPage > mxPage
void addURLShapeId(const OUString &rShapeId)
oox::drawingml::TextListStylePtr maDefaultTextStylePtr
css::uno::Reference< css::animations::XAnimationNode > getAnimationNode(const OUString &sId) const
oox::drawingml::TextListStylePtr maNotesTextStylePtr
void applyTextStyles(const oox::core::XmlFilterBase &rFilterBase)
std::map< OUString, css::uno::Reference< css::animations::XAnimationNode > > maAnimNodesMap
SlidePersist(oox::core::XmlFilterBase &rFilter, bool bMaster, bool bNotes, const css::uno::Reference< css::drawing::XDrawPage > &, oox::drawingml::ShapePtr pShapesPtr, ::oox::drawingml::TextListStylePtr)
oox::drawingml::Color maBackgroundColor
::std::vector< std::shared_ptr< TimeNode > > maTimeNodeList
void hideShapesAsMasterShapes()
oox::drawingml::FillPropertiesPtr mpBackgroundPropertiesPtr
sal_Int16 getLayoutFromValueToken() const
std::shared_ptr< T > make_shared(Args &&... args)
@ FillGradient
Explicit fill gradient or name of a fill gradient stored in a global container.
std::shared_ptr< Shape > ShapePtr
std::vector< ConnectorShapeProperties > ConnectorShapePropertiesList
std::shared_ptr< TextListStyle > TextListStylePtr
std::shared_ptr< TimeNode > TimeNodePtr
std::shared_ptr< SlidePersist > SlidePersistPtr
static void setTextStyle(Reference< beans::XPropertySet > const &rxPropSet, const XmlFilterBase &rFilter, oox::drawingml::TextListStylePtr const &pTextListStylePtr, int nLevel)
@ VMLDRAWING_POWERPOINT
PowerPoint: OLE objects are part of DrawingML.
const ::Color API_RGB_TRANSPARENT(ColorTransparency, 0xffffffff)
Transparent color for API calls.
const ShapePropertyIds & mrPropertyIds
static ShapePropertyInfo DEFAULT
True = use named fill hatch instead of explicit fill hatch.
void pushToPropSet(PropertySet &rPropSet, const ::oox::core::XmlFilterBase &rFilter) const
Writes the properties to the passed property set.