From ed87a79ebafce971f91017ffb3adff55d9f34b42 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 7 Feb 2011 18:52:27 +0100 Subject: fdo#33994: Fixed several crashes around config UNO API cherry picked from 21427f17e1f6901ac9a7148d5d8ac13e0aad958e Signed-off-by: Noel Power --- configmgr/source/access.cxx | 10 ++++------ configmgr/source/rootaccess.cxx | 8 ++++++++ configmgr/source/rootaccess.hxx | 5 +++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 0382054533..7fcd7a1c34 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -912,11 +912,7 @@ rtl::OUString Access::getImplementationName() throw (css::uno::RuntimeException) OSL_ASSERT(thisIs(IS_ANY)); osl::MutexGuard g(*lock_); checkLocalizedPropertyAccess(); - throw css::uno::RuntimeException( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "configmgr Access has no service implementation name")), - static_cast< cppu::OWeakObject * >(this)); + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "configmgr.Access" ) ); } sal_Bool Access::supportsService(rtl::OUString const & ServiceName) @@ -2095,7 +2091,9 @@ css::beans::Property Access::asProperty() { default: type = cppu::UnoType< css::uno::XInterface >::get(); //TODO: correct? nillable = false; - removable = getParentNode()->kind() == Node::KIND_SET; + removable = false; + if ( getParentNode() != NULL ) + removable = getParentNode()->kind() == Node::KIND_SET; break; } return css::beans::Property( diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx index 27f3884f2f..ef5982e3a5 100644 --- a/configmgr/source/rootaccess.cxx +++ b/configmgr/source/rootaccess.cxx @@ -327,6 +327,14 @@ css::util::ChangesSet RootAccess::getPendingChanges() return changes.getAsConstList(); } +rtl::OUString RootAccess::getImplementationName() throw (css::uno::RuntimeException) +{ + OSL_ASSERT(thisIs(IS_ANY)); + osl::MutexGuard g(*lock_); + checkLocalizedPropertyAccess(); + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "configmgr.RootAccess" ) ); +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/rootaccess.hxx b/configmgr/source/rootaccess.hxx index 4d74167c85..c1751210c5 100644 --- a/configmgr/source/rootaccess.hxx +++ b/configmgr/source/rootaccess.hxx @@ -86,6 +86,11 @@ public: bool isUpdate() const; +protected: + + virtual rtl::OUString SAL_CALL getImplementationName() + throw (com::sun::star::uno::RuntimeException); + private: virtual ~RootAccess(); -- cgit v1.2.3