diff options
author | Kurt Zenker <kz@openoffice.org> | 2006-01-03 15:09:27 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2006-01-03 15:09:27 +0000 |
commit | 5b7431e13bf3ce4a04c8120b28299c15e975d2f0 (patch) | |
tree | 498ab4ae182bdf5b50c8856ee351f05b71db4c16 | |
parent | f10a96d10deabfd386c5931d3035c0756ba153ec (diff) |
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
-rw-r--r-- | forms/source/component/clickableimage.hxx | 29 |
1 files 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(); @@ -187,6 +192,26 @@ namespace frm }; //================================================================== + // 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 //================================================================== typedef ::cppu::ImplHelper3 < ::com::sun::star::form::XApproveActionBroadcaster |