summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index c18fd4aad..cbae082c8 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -246,11 +246,13 @@ void PresentationFragmentHandler::endDocument() throw (SAXException, RuntimeExce
}
// importing slide page
- pSlidePersistPtr->setMasterPersist( pMasterPersistPtr );
- pSlidePersistPtr->setTheme( pMasterPersistPtr->getTheme() );
- Reference< drawing::XMasterPageTarget > xMasterPageTarget( pSlidePersistPtr->getPage(), UNO_QUERY );
- if( xMasterPageTarget.is() )
- xMasterPageTarget->setMasterPage( pMasterPersistPtr->getPage() );
+ if (pMasterPersistPtr.get()) {
+ pSlidePersistPtr->setMasterPersist( pMasterPersistPtr );
+ pSlidePersistPtr->setTheme( pMasterPersistPtr->getTheme() );
+ Reference< drawing::XMasterPageTarget > xMasterPageTarget( pSlidePersistPtr->getPage(), UNO_QUERY );
+ if( xMasterPageTarget.is() )
+ xMasterPageTarget->setMasterPage( pMasterPersistPtr->getPage() );
+ }
rFilter.getDrawPages().push_back( pSlidePersistPtr );
rFilter.setActualSlidePersist( pSlidePersistPtr );
importSlide( xSlideFragmentHandler, pSlidePersistPtr );