From 5b7431e13bf3ce4a04c8120b28299c15e975d2f0 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Tue, 3 Jan 2006 15:09:27 +0000 Subject: INTEGRATION: CWS dba202c (1.5.32); FILE MERGED 2005/12/09 14:32:23 fs 1.5.32.1: #i59135# don't access GetImageProducer if we're disposed --- forms/source/component/clickableimage.hxx | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/forms/source/component/clickableimage.hxx b/forms/source/component/clickableimage.hxx index f44ed2c39208..32ae30cd7675 100644 --- a/forms/source/component/clickableimage.hxx +++ b/forms/source/component/clickableimage.hxx @@ -4,9 +4,9 @@ * * $RCSfile: clickableimage.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: rt $ $Date: 2005-09-08 22:47:43 $ + * last change: $Author: kz $ $Date: 2006-01-03 16:09:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -179,6 +179,11 @@ namespace frm // XServiceInfo virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + public: + struct GuardAccess { friend class ImageModelMethodGuard; private: GuardAccess() { } }; + ::osl::Mutex& getMutex( GuardAccess ) { return m_aMutex; } + ImageProducer* getImageProducer( GuardAccess ) { return m_pProducer; } + protected: void implConstruct(); @@ -186,6 +191,26 @@ namespace frm void implInitializeImageURL( ); }; + //================================================================== + // ImageModelMethodGuard + //================================================================== + class ImageModelMethodGuard : public ::osl::MutexGuard + { + private: + typedef ::osl::MutexGuard GuardBase; + + public: + ImageModelMethodGuard( OClickableImageBaseModel& _rModel ) + :GuardBase( _rModel.getMutex( OClickableImageBaseModel::GuardAccess() ) ) + { + if ( NULL == _rModel.getImageProducer( OClickableImageBaseModel::GuardAccess() ) ) + throw ::com::sun::star::lang::DisposedException( + ::rtl::OUString(), + static_cast< ::com::sun::star::form::XImageProducerSupplier* >( &_rModel ) + ); + } + }; + //================================================================== // OClickableImageBaseControl //================================================================== -- cgit