diff options
Diffstat (limited to 'stoc/source/simpleregistry/simpleregistry.cxx')
-rw-r--r-- | stoc/source/simpleregistry/simpleregistry.cxx | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index e08aba30593a..4783625c5cc6 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -20,7 +20,6 @@ #include "sal/config.h" #include <cstdlib> -#include <memory> #include <vector> #include "com/sun/star/lang/XServiceInfo.hpp" @@ -53,8 +52,6 @@ #include "bootstrapservices.hxx" -#include "textualservices.hxx" - extern rtl_StandardModuleCount g_moduleCount; namespace { @@ -113,7 +110,6 @@ private: { return stoc_bootstrap::simreg_getSupportedServiceNames(); } Registry registry_; - std::auto_ptr< stoc::simpleregistry::TextualServices > textual_; }; class Key: public cppu::WeakImplHelper1< css::registry::XRegistryKey > { @@ -1121,7 +1117,7 @@ rtl::OUString Key::getResolvedName(rtl::OUString const & aKeyName) rtl::OUString SimpleRegistry::getURL() throw (css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - return textual_.get() == 0 ? registry_.getName() : textual_->getUri(); + return registry_.getName(); } void SimpleRegistry::open( @@ -1129,33 +1125,13 @@ void SimpleRegistry::open( throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - if (textual_.get() != 0) { - throw css::registry::InvalidRegistryException( - (rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.registry.SimpleRegistry.open(")) + - rURL + - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "): instance already open"))), - static_cast< OWeakObject * >(this)); - } RegError err = (rURL.isEmpty() && bCreate) ? REG_REGISTRY_NOT_EXISTS : registry_.open(rURL, bReadOnly ? REG_READONLY : REG_READWRITE); if (err == REG_REGISTRY_NOT_EXISTS && bCreate) { err = registry_.create(rURL); } - switch (err) { - case REG_NO_ERROR: - break; - case REG_INVALID_REGISTRY: - if (bReadOnly && !bCreate) { - textual_.reset(new stoc::simpleregistry::TextualServices(rURL)); - break; - } - // fall through - default: + if (err != REG_NO_ERROR) { throw css::registry::InvalidRegistryException( (rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -1171,17 +1147,13 @@ void SimpleRegistry::open( sal_Bool SimpleRegistry::isValid() throw (css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - return textual_.get() != 0 || registry_.isValid(); + return registry_.isValid(); } void SimpleRegistry::close() throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - if (textual_.get() != 0) { - textual_.reset(); - return; - } RegError err = registry_.close(); if (err != REG_NO_ERROR) { throw css::registry::InvalidRegistryException( @@ -1198,10 +1170,6 @@ void SimpleRegistry::destroy() throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - if (textual_.get() != 0) { - textual_.reset(); - return; - } RegError err = registry_.destroy(rtl::OUString()); if (err != REG_NO_ERROR) { throw css::registry::InvalidRegistryException( @@ -1218,9 +1186,6 @@ css::uno::Reference< css::registry::XRegistryKey > SimpleRegistry::getRootKey() throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - if (textual_.get() != 0) { - return textual_->getRootKey(); - } RegistryKey root; RegError err = registry_.openRootKey(root); if (err != REG_NO_ERROR) { @@ -1239,7 +1204,7 @@ sal_Bool SimpleRegistry::isReadOnly() throw (css::registry::InvalidRegistryException, css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - return textual_.get() != 0 || registry_.isReadOnly(); + return registry_.isReadOnly(); } void SimpleRegistry::mergeKey( @@ -1249,14 +1214,6 @@ void SimpleRegistry::mergeKey( css::registry::MergeConflictException, css::uno::RuntimeException) { osl::MutexGuard guard(mutex_); - if (textual_.get() != 0) { - throw css::uno::RuntimeException( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.registry.SimpleRegistry.mergeKey: not" - " supported for textual representation")), - static_cast< cppu::OWeakObject * >(this)); - } RegistryKey root; RegError err = registry_.openRootKey(root); if (err == REG_NO_ERROR) { |