diff options
author | sj <sj@openoffice.org> | 2010-03-15 15:02:33 +0100 |
---|---|---|
committer | sj <sj@openoffice.org> | 2010-03-15 15:02:33 +0100 |
commit | b1257430f8d225aa5ccb90e2093e1a47ae7576eb (patch) | |
tree | ce2ae80d664bcbd329032aca6b43c5583b6a9ff2 /oox | |
parent | 550f5d560e638b484549fd64bc17e68a832198b9 (diff) |
impress187: #161665# fixed problem with empty presentation object
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/ppt/pptshape.cxx | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 016857161696..7b8c1ca95d35 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -93,6 +93,12 @@ void PPTShape::addShape( aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getTitleTextStyle() : rSlidePersist.getTitleTextStyle(); } break; + case XML_subTitle : + { + if ( ( meShapeLocation == Master ) || ( meShapeLocation == Layout ) ) + sServiceName = rtl::OUString(); + } + break; case XML_obj : { const rtl::OUString sOutlinerShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.OutlinerShape" ) ); @@ -155,37 +161,42 @@ void PPTShape::addShape( break; } } - if ( !aMasterTextListStyle.get() ) - aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle(); - setMasterTextListStyle( aMasterTextListStyle ); - Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText ) ); - if ( !rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ( (sal_Int32)mnSubType == XML_title ) ) + if ( sServiceName.getLength() ) { - try - { - rtl::OUString aTitleText; - Reference< XTextRange > xText( xShape, UNO_QUERY_THROW ); - aTitleText = xText->getString(); - if ( aTitleText.getLength() && ( aTitleText.getLength() < 64 ) ) // just a magic value, but we don't want to set slide names which are too long + if ( !aMasterTextListStyle.get() ) + aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle(); + setMasterTextListStyle( aMasterTextListStyle ); + + Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText ) ); + if ( !rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ( (sal_Int32)mnSubType == XML_title ) ) + { + try + { + rtl::OUString aTitleText; + Reference< XTextRange > xText( xShape, UNO_QUERY_THROW ); + aTitleText = xText->getString(); + if ( aTitleText.getLength() && ( aTitleText.getLength() < 64 ) ) // just a magic value, but we don't want to set slide names which are too long + { + Reference< container::XNamed > xName( rSlidePersist.getPage(), UNO_QUERY_THROW ); + xName->setName( aTitleText ); + } + } + catch( uno::Exception& ) { - Reference< container::XNamed > xName( rSlidePersist.getPage(), UNO_QUERY_THROW ); - xName->setName( aTitleText ); + } } - catch( uno::Exception& ) + if( pShapeMap && msId.getLength() ) { + (*pShapeMap)[ msId ] = shared_from_this(); } - } - if( pShapeMap && msId.getLength() ) - { - (*pShapeMap)[ msId ] = shared_from_this(); - } - // if this is a group shape, we have to add also each child shape - Reference< XShapes > xShapes( xShape, UNO_QUERY ); - if ( xShapes.is() ) - addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); + // if this is a group shape, we have to add also each child shape + Reference< XShapes > xShapes( xShape, UNO_QUERY ); + if ( xShapes.is() ) + addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); + } } } catch( const Exception& ) |