From bdfeef462e3afdb654ad2c83d594ee684031dec9 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 19 Aug 2008 23:28:08 +0000 Subject: INTEGRATION: CWS aw033 (1.81.24); FILE MERGED 2008/07/15 14:28:21 aw 1.81.24.1: #i39532# changes after resync - SW problem with XDrawPage lifetime --- sw/source/core/unocore/unodraw.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 855448dfe098..d4a82a9d7ef6 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: unodraw.cxx,v $ - * $Revision: 1.81 $ + * $Revision: 1.82 $ * * This file is part of OpenOffice.org. * @@ -478,7 +478,16 @@ uno::Any SwXDrawPage::queryInterface( const uno::Type& aType ) uno::Any aRet = SwXDrawPageBaseClass::queryInterface(aType); if(!aRet.hasValue()) { - aRet = GetSvxPage()->queryAggregation(aType); + // secure with checking if page exists. This may not be the case + // either for new SW docs with no yet graphics usage or when + // the doc is closed and someone else still holds a UNO reference + // to the XDrawPage (in that case, pDoc is set to 0) + SwFmDrawPage* pPage = GetSvxPage(); + + if(pPage) + { + aRet = pPage->queryAggregation(aType); + } } return aRet; } @@ -841,6 +850,13 @@ SwFmDrawPage* SwXDrawPage::GetSvxPage() } return pDrawPage; } + +// renamed and outlined to detect where it's called +void SwXDrawPage::InvalidateSwDoc() +{ + pDoc = 0; +} + /**************************************************************************** ****************************************************************************/ -- cgit v1.2.3