diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-05-20 13:33:31 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-05-20 13:33:31 +0000 |
commit | de9a309ec9ee44529f56ce50e9b2eaa04ea96a06 (patch) | |
tree | 6476ab8cb84641a01c9fc98a3a5f7160605187aa /desktop | |
parent | 3be6c92bb713e474e0273b25a5224b5d95367c19 (diff) |
INTEGRATION: CWS jl100_DEV300 (1.20.48.1.6); FILE MERGED
2008/05/13 15:08:19 jl 1.20.48.1.6.1: #156271# The package::getMyBackend functions now throw a DisposedException
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/registry/component/dp_component.cxx | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 1cfe5c6b7a7e..24ec385db0d7 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dp_component.cxx,v $ - * $Revision: 1.23 $ + * $Revision: 1.24 $ * * This file is part of OpenOffice.org. * @@ -119,9 +119,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend { class ComponentPackageImpl : public ::dp_registry::backend::Package { - BackendImpl * getMyBackend() const { - return static_cast<BackendImpl *>(m_myBackend.get()); - } + BackendImpl * getMyBackend() const; const OUString m_loader; Reference<XComponentContext> m_xRemoteContext; @@ -165,9 +163,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend class TypelibraryPackageImpl : public ::dp_registry::backend::Package { - BackendImpl * getMyBackend() const { - return static_cast<BackendImpl *>(m_myBackend.get()); - } + BackendImpl * getMyBackend() const; const bool m_jarFile; Reference<container::XHierarchicalNameAccess> m_xTDprov; @@ -267,6 +263,22 @@ BackendImpl::ComponentPackageImpl::getRDB() const return that->m_xCommonRDB; } +BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const +{ + BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); + if (NULL == pBackend) + { + //Throws a DisposedException + check(); + //We should never get here... + throw RuntimeException( + OUSTR("Failed to get the BackendImpl"), + static_cast<OWeakObject*>(const_cast<ComponentPackageImpl *>(this))); + } + return pBackend; +} + + //______________________________________________________________________________ void BackendImpl::ComponentPackageImpl::disposing() { @@ -1217,6 +1229,20 @@ void BackendImpl::ComponentPackageImpl::processPackage_( //############################################################################## // Package +BackendImpl * BackendImpl::TypelibraryPackageImpl::getMyBackend() const +{ + BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); + if (NULL == pBackend) + { + //May throw a DisposedException + check(); + //We should never get here... + throw RuntimeException( + OUSTR("Failed to get the BackendImpl"), + static_cast<OWeakObject*>(const_cast<TypelibraryPackageImpl *>(this))); + } + return pBackend; +} //______________________________________________________________________________ beans::Optional< beans::Ambiguous<sal_Bool> > BackendImpl::TypelibraryPackageImpl::isRegistered_( |