diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-28 21:14:47 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:33:14 +0200 |
commit | 0787aeac2428bf6a2e372ed5f2eac2f079c28ba6 (patch) | |
tree | 65d036b4a4cbe7536d33baab40a0722d2a170b35 /configmgr | |
parent | 089dbfda13bbc43ef2bc4b4c6f2cb06163545c2d (diff) |
Prepare for removal of non-const operator[] from Sequence in configmgr
Change-Id: Ia349292783b81f0b4eebe64ae672ea5cb6d6cd59
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124352
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/access.cxx | 16 | ||||
-rw-r--r-- | configmgr/source/configurationregistry.cxx | 4 | ||||
-rw-r--r-- | configmgr/source/valueparser.cxx | 3 |
3 files changed, 13 insertions, 10 deletions
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index dc16b0211ade..95c5de4ed47a 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -856,10 +856,10 @@ css::uno::Sequence< css::uno::Any > Access::getPropertyValues( assert(thisIs(IS_GROUP)); osl::MutexGuard g(*lock_); css::uno::Sequence< css::uno::Any > vals(aPropertyNames.getLength()); - + auto aValsRange = asNonConstRange(vals); for (sal_Int32 i = 0; i < aPropertyNames.getLength(); ++i) { - if (!getByNameFast(aPropertyNames[i], vals[i])) + if (!getByNameFast(aPropertyNames[i], aValsRange[i])) throw css::uno::RuntimeException( "configmgr getPropertyValues inappropriate property name", static_cast< cppu::OWeakObject * >(this)); @@ -912,11 +912,12 @@ void Access::firePropertiesChangeEvent( assert(thisIs(IS_GROUP)); css::uno::Sequence< css::beans::PropertyChangeEvent > events( aPropertyNames.getLength()); + auto aEventsRange = asNonConstRange(events); for (sal_Int32 i = 0; i < events.getLength(); ++i) { - events[i].Source = static_cast< cppu::OWeakObject * >(this); - events[i].PropertyName = aPropertyNames[i]; - events[i].Further = false; - events[i].PropertyHandle = -1; + aEventsRange[i].Source = static_cast< cppu::OWeakObject * >(this); + aEventsRange[i].PropertyName = aPropertyNames[i]; + aEventsRange[i].Further = false; + aEventsRange[i].PropertyHandle = -1; } xListener->propertiesChange(events); } @@ -1013,6 +1014,7 @@ css::uno::Sequence< css::uno::Any > Access::getHierarchicalPropertyValues( osl::MutexGuard g(*lock_); css::uno::Sequence< css::uno::Any > vals( aHierarchicalPropertyNames.getLength()); + auto aValsRange = asNonConstRange(vals); for (sal_Int32 i = 0; i < aHierarchicalPropertyNames.getLength(); ++i) { rtl::Reference< ChildAccess > child( getSubChild(aHierarchicalPropertyNames[i])); @@ -1022,7 +1024,7 @@ css::uno::Sequence< css::uno::Any > Access::getHierarchicalPropertyValues( " hierarchical property name"), static_cast< cppu::OWeakObject * >(this), -1); } - vals[i] = child->asValue(); + aValsRange[i] = child->asValue(); } return vals; } diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx index c0e945ffc622..e4d86c46e9f2 100644 --- a/configmgr/source/configurationregistry.cxx +++ b/configmgr/source/configurationregistry.cxx @@ -246,8 +246,8 @@ void Service::open(OUString const & rURL, sal_Bool bReadOnly, sal_Bool) if (access_.is()) { doClose(); } - css::uno::Sequence< css::uno::Any > args(1); - args[0] <<= css::beans::NamedValue("nodepath", css::uno::Any(rURL)); + css::uno::Sequence< css::uno::Any > args{ css::uno::Any( + css::beans::NamedValue("nodepath", css::uno::Any(rURL))) }; try { access_ = provider_->createInstanceWithArguments( (bReadOnly diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx index 6245cb11b654..a70c3231b702 100644 --- a/configmgr/source/valueparser.cxx +++ b/configmgr/source/valueparser.cxx @@ -439,8 +439,9 @@ void ValueParser::start( template< typename T > css::uno::Any ValueParser::convertItems() { css::uno::Sequence< T > seq(items_.size()); + auto seqRange = asNonConstRange(seq); for (sal_Int32 i = 0; i < seq.getLength(); ++i) { - bool ok = (items_[i] >>= seq[i]); + bool ok = (items_[i] >>= seqRange[i]); assert(ok); (void) ok; // avoid warnings } |