From 5aea780bfd46a369ed6c8ef3505dcaeb6f44323d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 11 Nov 2011 11:44:24 +0000 Subject: This global Reference is problematic, especially for unit tests The global reference will be torn down after the typelib infrastructure is gone away. Hopefully a WeakReference is sufficient for the original requirements --- oox/inc/oox/ppt/slidepersist.hxx | 2 +- oox/source/drawingml/textparagraphproperties.cxx | 4 +++- oox/source/ppt/slidepersist.cxx | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'oox') diff --git a/oox/inc/oox/ppt/slidepersist.hxx b/oox/inc/oox/ppt/slidepersist.hxx index 4faf1aaf14a4..1cf9cf735426 100644 --- a/oox/inc/oox/ppt/slidepersist.hxx +++ b/oox/inc/oox/ppt/slidepersist.hxx @@ -72,7 +72,7 @@ public: com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > getPage() const { return mxPage; }; #if OSL_DEBUG_LEVEL > 0 - static com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > mxDebugPage; + static com::sun::star::uno::WeakReference< com::sun::star::drawing::XDrawPage > mxDebugPage; #endif void setMasterPersist( SlidePersistPtr pMasterPersistPtr ){ mpMasterPagePtr = pMasterPersistPtr; } diff --git a/oox/source/drawingml/textparagraphproperties.cxx b/oox/source/drawingml/textparagraphproperties.cxx index b6c9178ad008..eeb8409b8e43 100644 --- a/oox/source/drawingml/textparagraphproperties.cxx +++ b/oox/source/drawingml/textparagraphproperties.cxx @@ -475,7 +475,9 @@ void TextParagraphProperties::dump() const Reference< ::com::sun::star::drawing::XShape > xShape( oox::ppt::PowerPointImport::mpDebugFilterBase->getModelFactory()->createInstance( CREATE_OUSTRING( "com.sun.star.presentation.TitleTextShape" ) ), UNO_QUERY ); Reference< ::com::sun::star::text::XText > xText( xShape, UNO_QUERY ); - ppt::SlidePersist::mxDebugPage->add( xShape ); + Reference< com::sun::star::drawing::XDrawPage > xDebugPage(ppt::SlidePersist::mxDebugPage.get(), UNO_QUERY); + if (xDebugPage.is()) + xDebugPage->add( xShape ); PropertyMap emptyMap; diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index b93ea3c0445c..91f773457a03 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -80,12 +80,11 @@ SlidePersist::SlidePersist( XmlFilterBase& rFilter, sal_Bool bMaster, sal_Bool b } #if OSL_DEBUG_LEVEL > 0 - ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage > SlidePersist::mxDebugPage; +::com::sun::star::uno::WeakReference< ::com::sun::star::drawing::XDrawPage > SlidePersist::mxDebugPage; #endif SlidePersist::~SlidePersist() { - } sal_Int16 SlidePersist::getLayoutFromValueToken() -- cgit