From 7bcf64c29a0f5d3d2d60fe98afadab6e48dbe8b3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 1 Apr 2015 14:08:04 +0200 Subject: Add isReadOnly() support to simplified configuration access [API CHANGE]: extends the css.configuration.XReadWriteAccess in an incompatible way, but that is unpublished, has been commented as "still unpublished and unstable," and was specifically introduced for internal use by the simplified configuration access, so should not affect 3rd party code. Change-Id: I99ce045f5bd8c598e689d46fb0d3626dfaa6d0a0 --- comphelper/source/misc/configuration.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'comphelper/source/misc/configuration.cxx') diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx index 7468c5592c62..371a515faf81 100644 --- a/comphelper/source/misc/configuration.cxx +++ b/comphelper/source/misc/configuration.cxx @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -116,11 +117,21 @@ comphelper::detail::ConfigurationWrapper::get( comphelper::detail::ConfigurationWrapper::ConfigurationWrapper( css::uno::Reference< css::uno::XComponentContext > const & context): context_(context), - access_(css::configuration::ReadOnlyAccess::create(context, "*")) + access_(css::configuration::ReadWriteAccess::create(context, "*")) {} comphelper::detail::ConfigurationWrapper::~ConfigurationWrapper() {} +bool comphelper::detail::ConfigurationWrapper::isReadOnly(OUString const & path) + const +{ +css::beans::Property SB(access_->getPropertyByHierarchicalName(path)); + return + (access_->getPropertyByHierarchicalName(path).Attributes + & css::beans::PropertyAttribute::READONLY) + != 0; +} + css::uno::Any comphelper::detail::ConfigurationWrapper::getPropertyValue( OUString const & path) const { -- cgit