diff options
-rw-r--r-- | desktop/source/deployment/registry/sfwk/dp_sfwk.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index 9dab56f5af04..4d2e512a14da 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: dp_sfwk.cxx,v $ - * $Revision: 1.15 $ + * $Revision: 1.16 $ * * This file is part of OpenOffice.org. * @@ -65,9 +65,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend { class PackageImpl : public ::dp_registry::backend::Package { - BackendImpl * getMyBackend() const { - return static_cast<BackendImpl *>(m_myBackend.get()); - } + BackendImpl * getMyBackend() const; Reference< container::XNameContainer > m_xNameCntrPkgHandler; OUString m_descr; @@ -110,6 +108,20 @@ public: getSupportedPackageTypes() throw (RuntimeException); }; +BackendImpl * BackendImpl::PackageImpl::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<PackageImpl *>(this))); + } + return pBackend; +} //______________________________________________________________________________ OUString BackendImpl::PackageImpl::getDescription() throw (RuntimeException) { |