summaryrefslogtreecommitdiff
path: root/oox/source/ppt/pptshape.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source/ppt/pptshape.cxx')
-rw-r--r--oox/source/ppt/pptshape.cxx83
1 files changed, 82 insertions, 1 deletions
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 5757feaeaa7c..87997f1215a8 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -64,6 +64,61 @@ PPTShape::~PPTShape()
{
}
+static const char* lclDebugSubType( sal_Int32 nType )
+{
+ switch (nType) {
+ case XML_ctrTitle :
+ return "ctrTitle";
+ case XML_title :
+ return "title";
+ case XML_subTitle :
+ return "subTitle";
+ case XML_obj :
+ return "obj";
+ case XML_body :
+ return "body";
+ case XML_dt :
+ return "dt";
+ case XML_hdr :
+ return "hdr";
+ case XML_ftr :
+ return "frt";
+ case XML_sldNum :
+ return "sldNum";
+ case XML_sldImg :
+ return "sldImg";
+ }
+
+ return "unknown - please extend lclDebugSubType";
+}
+
+oox::drawingml::TextListStylePtr PPTShape::getSubTypeTextListStyle( const SlidePersist& rSlidePersist, sal_Int32 nSubType )
+{
+ oox::drawingml::TextListStylePtr pTextListStyle;
+
+ OSL_TRACE( "subtype style: %s", lclDebugSubType( nSubType ) );
+
+ switch( nSubType )
+ {
+ case XML_ctrTitle :
+ case XML_title :
+ case XML_subTitle :
+ pTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle();
+ break;
+ case XML_obj :
+ pTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle();
+ break;
+ case XML_body :
+ if ( rSlidePersist.isNotesPage() )
+ pTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getNotesTextStyle() : rSlidePersist.getNotesTextStyle();
+ else
+ pTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getBodyTextStyle() : rSlidePersist.getBodyTextStyle();
+ break;
+ }
+
+ return pTextListStyle;
+}
+
void PPTShape::addShape(
const oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rSlidePersist,
@@ -72,6 +127,7 @@ void PPTShape::addShape(
const awt::Rectangle* pShapeRect,
::oox::drawingml::ShapeIdMap* pShapeMap )
{
+ OSL_TRACE("add shape id: %s location: %s", rtl::OUStringToOString(msId, RTL_TEXTENCODING_UTF8 ).getStr(), meShapeLocation == Master ? "master" : meShapeLocation == Slide ? "slide" : "other");
// only placeholder from layout are being inserted
if ( mnSubType && ( meShapeLocation == Master ) )
return;
@@ -179,19 +235,44 @@ void PPTShape::addShape(
// use placeholder index if possible
if( mnSubType && getSubTypeIndex() && getSubTypeIndex() != -1 && rSlidePersist.getMasterPersist().get() ) {
oox::drawingml::ShapePtr pPlaceholder = PPTShape::findPlaceholderByIndex( getSubTypeIndex(), rSlidePersist.getMasterPersist()->getShapes()->getChildren() );
+ if( pPlaceholder.get()) {
+ OSL_TRACE("found placeholder with index: %d and type: %s", getSubTypeIndex(), lclDebugSubType( mnSubType ));
+ }
if( pPlaceholder.get() ) {
+ PPTShape* pPPTPlaceholder = dynamic_cast< PPTShape* >( pPlaceholder.get() );
+ TextListStylePtr pNewTextListStyle ( new TextListStyle() );
+
if( pPlaceholder->getTextBody() ) {
- TextListStylePtr pNewTextListStyle ( new TextListStyle() );
pNewTextListStyle->apply( pPlaceholder->getTextBody()->getTextListStyle() );
if( pPlaceholder->getMasterTextListStyle().get() )
pNewTextListStyle->apply( *pPlaceholder->getMasterTextListStyle() );
+ // OSL_TRACE("placeholder body style");
+ // pPlaceholder->getTextBody()->getTextListStyle().dump();
+ // OSL_TRACE("master text list style");
+ // pPlaceholder->getMasterTextListStyle()->dump();
+
aMasterTextListStyle = pNewTextListStyle;
}
+ if( pPPTPlaceholder->mpPlaceholder.get() ) {
+ OSL_TRACE("placeholder has parent placeholder: %s type: %s index: %d",
+ rtl::OUStringToOString( pPPTPlaceholder->mpPlaceholder->getId(), RTL_TEXTENCODING_UTF8 ).getStr(),
+ lclDebugSubType( pPPTPlaceholder->mpPlaceholder->getSubType() ),
+ pPPTPlaceholder->mpPlaceholder->getSubTypeIndex() );
+ OSL_TRACE("has textbody %d", pPPTPlaceholder->mpPlaceholder->getTextBody() != NULL );
+ TextListStylePtr pPlaceholderStyle = getSubTypeTextListStyle( rSlidePersist, pPPTPlaceholder->mpPlaceholder->getSubType() );
+ if( pPPTPlaceholder->mpPlaceholder->getTextBody() )
+ pNewTextListStyle->apply( pPPTPlaceholder->mpPlaceholder->getTextBody()->getTextListStyle() );
+ if( pPlaceholderStyle.get() ) {
+ pNewTextListStyle->apply( *pPlaceholderStyle );
+ //pPlaceholderStyle->dump();
+ }
+ }
} else if( !mpPlaceholder.get() ) {
aMasterTextListStyle.reset();
}
+ OSL_TRACE("placeholder id: %s", pPlaceholder.get() ? rtl::OUStringToOString(pPlaceholder->getId(), RTL_TEXTENCODING_UTF8 ).getStr() : "not found");
}
if ( sServiceName.getLength() )