summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-11 11:44:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-11 11:55:05 +0000
commit5aea780bfd46a369ed6c8ef3505dcaeb6f44323d (patch)
treeebf59df0ae15ba21752d7bfe77f1a5b446b4bd85 /oox
parent2bb0386ecbb6aeebbe7a9390df94ce73457e2fe3 (diff)
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
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/ppt/slidepersist.hxx2
-rw-r--r--oox/source/drawingml/textparagraphproperties.cxx4
-rw-r--r--oox/source/ppt/slidepersist.cxx3
3 files changed, 5 insertions, 4 deletions
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()