diff options
Diffstat (limited to 'oox/source/ppt/slidepersist.cxx')
-rw-r--r-- | oox/source/ppt/slidepersist.cxx | 174 |
1 files changed, 87 insertions, 87 deletions
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index ba8fb4ace641..65dc198759ea 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -147,18 +147,18 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) } Reference< XAnimationNodeSupplier > xNodeSupplier( getPage(), UNO_QUERY); - if( xNodeSupplier.is() ) + if( !xNodeSupplier.is() ) + return; + + Reference< XAnimationNode > xNode( xNodeSupplier->getAnimationNode() ); + if( xNode.is() && !maTimeNodeList.empty() ) { - Reference< XAnimationNode > xNode( xNodeSupplier->getAnimationNode() ); - if( xNode.is() && !maTimeNodeList.empty() ) - { - SlidePersistPtr pSlidePtr( shared_from_this() ); - TimeNodePtr pNode(maTimeNodeList.front()); - OSL_ENSURE( pNode, "pNode" ); + SlidePersistPtr pSlidePtr( shared_from_this() ); + TimeNodePtr pNode(maTimeNodeList.front()); + OSL_ENSURE( pNode, "pNode" ); - Reference<XAnimationNode> xDummy; - pNode->setNode(rFilterBase, xNode, pSlidePtr, xDummy); - } + Reference<XAnimationNode> xDummy; + pNode->setNode(rFilterBase, xNode, pSlidePtr, xDummy); } } @@ -197,96 +197,96 @@ static void setTextStyle( Reference< beans::XPropertySet > const & rxPropSet, co void SlidePersist::applyTextStyles( const XmlFilterBase& rFilterBase ) { - if ( mbMaster ) + if ( !mbMaster ) + return; + + try { - try - { - Reference< style::XStyleFamiliesSupplier > aXStyleFamiliesSupplier( rFilterBase.getModel(), UNO_QUERY_THROW ); - Reference< container::XNameAccess > aXNameAccess( aXStyleFamiliesSupplier->getStyleFamilies() ); - Reference< container::XNamed > aXNamed( mxPage, UNO_QUERY_THROW ); + Reference< style::XStyleFamiliesSupplier > aXStyleFamiliesSupplier( rFilterBase.getModel(), UNO_QUERY_THROW ); + Reference< container::XNameAccess > aXNameAccess( aXStyleFamiliesSupplier->getStyleFamilies() ); + Reference< container::XNamed > aXNamed( mxPage, UNO_QUERY_THROW ); - if ( aXNameAccess.is() ) - { - oox::drawingml::TextListStylePtr pTextListStylePtr; - OUString aStyle; - OUString aFamily; + if ( aXNameAccess.is() ) + { + oox::drawingml::TextListStylePtr pTextListStylePtr; + OUString aStyle; + OUString aFamily; - const OUString sOutline( "outline1" ); - const OUString sTitle( "title" ); - const OUString sStandard( "standard" ); - const OUString sSubtitle( "subtitle" ); + const OUString sOutline( "outline1" ); + const OUString sTitle( "title" ); + const OUString sStandard( "standard" ); + const OUString sSubtitle( "subtitle" ); - for( int i = 0; i < 4; i++ ) // todo: aggregation of bodystyle (subtitle) + for( int i = 0; i < 4; i++ ) // todo: aggregation of bodystyle (subtitle) + { + switch( i ) { - switch( i ) + case 0 : // title style { - case 0 : // title style - { - pTextListStylePtr = maTitleTextStylePtr; - aStyle = sTitle; - aFamily= aXNamed->getName(); - break; - } - case 1 : // body style - { - pTextListStylePtr = maBodyTextStylePtr; - aStyle = sOutline; - aFamily= aXNamed->getName(); - break; - } - case 3 : // notes style - { - pTextListStylePtr = maNotesTextStylePtr; - aStyle = sTitle; - aFamily= aXNamed->getName(); - break; - } - case 4 : // standard style - { - pTextListStylePtr = maOtherTextStylePtr; - aStyle = sStandard; - aFamily = "graphics"; - break; - } - case 5 : // subtitle - { - pTextListStylePtr = maBodyTextStylePtr; - aStyle = sSubtitle; - aFamily = aXNamed->getName(); - break; - } + pTextListStylePtr = maTitleTextStylePtr; + aStyle = sTitle; + aFamily= aXNamed->getName(); + break; + } + case 1 : // body style + { + pTextListStylePtr = maBodyTextStylePtr; + aStyle = sOutline; + aFamily= aXNamed->getName(); + break; + } + case 3 : // notes style + { + pTextListStylePtr = maNotesTextStylePtr; + aStyle = sTitle; + aFamily= aXNamed->getName(); + break; + } + case 4 : // standard style + { + pTextListStylePtr = maOtherTextStylePtr; + aStyle = sStandard; + aFamily = "graphics"; + break; } - Reference< container::XNameAccess > xFamilies; - if ( aXNameAccess->hasByName( aFamily ) ) + case 5 : // subtitle { - if( aXNameAccess->getByName( aFamily ) >>= xFamilies ) + pTextListStylePtr = maBodyTextStylePtr; + aStyle = sSubtitle; + aFamily = aXNamed->getName(); + break; + } + } + Reference< container::XNameAccess > xFamilies; + if ( aXNameAccess->hasByName( aFamily ) ) + { + if( aXNameAccess->getByName( aFamily ) >>= xFamilies ) + { + if ( xFamilies->hasByName( aStyle ) ) { - if ( xFamilies->hasByName( aStyle ) ) + Reference< style::XStyle > aXStyle; + if ( xFamilies->getByName( aStyle ) >>= aXStyle ) { - Reference< style::XStyle > aXStyle; - if ( xFamilies->getByName( aStyle ) >>= aXStyle ) + Reference< beans::XPropertySet > xPropSet( aXStyle, UNO_QUERY_THROW ); + setTextStyle( xPropSet, rFilterBase, maDefaultTextStylePtr, 0 ); + setTextStyle( xPropSet, rFilterBase, pTextListStylePtr, 0 ); + if ( i == 1 /* BodyStyle */ ) { - Reference< beans::XPropertySet > xPropSet( aXStyle, UNO_QUERY_THROW ); - setTextStyle( xPropSet, rFilterBase, maDefaultTextStylePtr, 0 ); - setTextStyle( xPropSet, rFilterBase, pTextListStylePtr, 0 ); - if ( i == 1 /* BodyStyle */ ) + for ( int nLevel = 1; nLevel < 5; nLevel++ ) { - for ( int nLevel = 1; nLevel < 5; nLevel++ ) { + char pOutline[ 9 ] = "outline1"; + pOutline[ 7 ] = static_cast< char >( '0' + nLevel ); + OUString sOutlineStyle( OUString::createFromAscii( pOutline ) ); + if ( xFamilies->hasByName( sOutlineStyle ) ) { - char pOutline[ 9 ] = "outline1"; - pOutline[ 7 ] = static_cast< char >( '0' + nLevel ); - OUString sOutlineStyle( OUString::createFromAscii( pOutline ) ); - if ( xFamilies->hasByName( sOutlineStyle ) ) - { - xFamilies->getByName( sOutlineStyle ) >>= aXStyle; - if( aXStyle.is() ) - xPropSet.set( aXStyle, UNO_QUERY_THROW ); - } + xFamilies->getByName( sOutlineStyle ) >>= aXStyle; + if( aXStyle.is() ) + xPropSet.set( aXStyle, UNO_QUERY_THROW ); } - setTextStyle( xPropSet, rFilterBase, maDefaultTextStylePtr, nLevel ); - setTextStyle( xPropSet, rFilterBase, pTextListStylePtr, nLevel ); } + setTextStyle( xPropSet, rFilterBase, maDefaultTextStylePtr, nLevel ); + setTextStyle( xPropSet, rFilterBase, pTextListStylePtr, nLevel ); } } } @@ -295,9 +295,9 @@ void SlidePersist::applyTextStyles( const XmlFilterBase& rFilterBase ) } } } - catch( const Exception& ) - { - } + } + catch( const Exception& ) + { } } |