diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-01-25 18:17:08 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-01-25 18:18:52 +0100 |
commit | d70aa23c2d3af951c8846b4aea83c87c06a37a35 (patch) | |
tree | 4669966eef4aef87b3da1d818884cd0d7f04c4f9 /unotools/source/config/configuration.cxx | |
parent | typo (diff) | |
download | core-d70aa23c2d3af951c8846b4aea83c87c06a37a35.tar.gz core-d70aa23c2d3af951c8846b4aea83c87c06a37a35.zip |
Add configuration wrappers for groups, too (to add listeners etc.).
Diffstat (limited to 'unotools/source/config/configuration.cxx')
-rw-r--r-- | unotools/source/config/configuration.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/unotools/source/config/configuration.cxx b/unotools/source/config/configuration.cxx index a4b30ed360fa..a8c818c124dd 100644 --- a/unotools/source/config/configuration.cxx +++ b/unotools/source/config/configuration.cxx @@ -37,6 +37,7 @@ #include "com/sun/star/configuration/XReadWriteAccess.hpp" #include "com/sun/star/configuration/theDefaultProvider.hpp" #include "com/sun/star/container/XHierarchicalNameAccess.hpp" +#include "com/sun/star/container/XHierarchicalNameReplace.hpp" #include "com/sun/star/container/XNameAccess.hpp" #include "com/sun/star/container/XNameContainer.hpp" #include "com/sun/star/lang/Locale.hpp" @@ -90,6 +91,13 @@ void unotools::ConfigurationChanges::setPropertyValue( access_->replaceByHierarchicalName(path, value); } +css::uno::Reference< css::container::XHierarchicalNameReplace > +unotools::ConfigurationChanges::getGroup(rtl::OUString const & path) const +{ + return css::uno::Reference< css::container::XHierarchicalNameReplace >( + access_->getByHierarchicalName(path), css::uno::UNO_QUERY_THROW); +} + css::uno::Reference< css::container::XNameContainer > unotools::ConfigurationChanges::getSet(rtl::OUString const & path) const { @@ -139,6 +147,23 @@ void unotools::detail::ConfigurationWrapper::setLocalizedPropertyValue( batch->setPropertyValue(extendLocalizedPath(path), value); } +css::uno::Reference< css::container::XHierarchicalNameAccess > +unotools::detail::ConfigurationWrapper::getGroupReadOnly( + rtl::OUString const & path) const +{ + return css::uno::Reference< css::container::XHierarchicalNameAccess >( + access_->getByHierarchicalName(path), css::uno::UNO_QUERY_THROW); +} + +css::uno::Reference< css::container::XHierarchicalNameReplace > +unotools::detail::ConfigurationWrapper::getGroupReadWrite( + boost::shared_ptr< ConfigurationChanges > const & batch, + rtl::OUString const & path) const +{ + assert(batch.get() != 0); + return batch->getGroup(path); +} + css::uno::Reference< css::container::XNameAccess > unotools::detail::ConfigurationWrapper::getSetReadOnly( rtl::OUString const & path) const |