diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-29 01:31:19 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-30 06:20:50 +0200 |
commit | ea9367037232054a576f1e6aabffeb3a62ffa44b (patch) | |
tree | ea5c755830b87fc140e9c3ce027b4957956fae48 /stoc | |
parent | e82c9633e4f9bc4590bd6cd8d2a82a974ddaf00f (diff) |
Drop some uses of css::uno::Sequence::getConstArray ...
where it was obsoleted by commits 2484de6728bd11bb7949003d112f1ece2223c7a1
(Remove non-const Sequence::begin()/end() in internal code, 2021-10-15) and
fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const Sequence::operator[]
in internal code 2021-11-05).
Change-Id: I4ccc647bb794515c8c11f8dfd9a26563f4aa094b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166819
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 32 | ||||
-rw-r--r-- | stoc/source/implementationregistration/mergekeys.cxx | 5 | ||||
-rw-r--r-- | stoc/source/security/permissions.cxx | 3 | ||||
-rw-r--r-- | stoc/source/servicemanager/servicemanager.cxx | 7 |
4 files changed, 21 insertions, 26 deletions
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 14c5c8e65a51..98df49d93338 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -508,7 +508,7 @@ void prepareUserKeys(const Reference < XSimpleRegistry >& xDest, OUString relativKey; if (keyNames.hasElements()) - relativKey = keyNames.getConstArray()[0].copy(xKey->getKeyName().getLength()+1); + relativKey = keyNames[0].copy(xKey->getKeyName().getLength()+1); if (keyNames.getLength() == 1 && xKey->getKeyType(relativKey) == RegistryKeyType_LINK) @@ -656,10 +656,9 @@ void delete_all_singleton_entries( // throw (InvalidRegistryException, RuntimeException) { Sequence< Reference< registry::XRegistryKey > > singletons( xSingletons_section->openKeys() ); - Reference< registry::XRegistryKey > const * subkeys = singletons.getConstArray(); for ( sal_Int32 nPos = singletons.getLength(); nPos--; ) { - Reference< registry::XRegistryKey > const & xSingleton = subkeys[ nPos ]; + Reference<registry::XRegistryKey> const& xSingleton = singletons[nPos]; Reference< registry::XRegistryKey > xRegisteredImplNames( xSingleton->openKey( "REGISTERED_BY" ) ); if (xRegisteredImplNames.is() && xRegisteredImplNames->isValid()) @@ -801,10 +800,9 @@ void insert_singletons( OUString implname( xImplKey->getKeyName().copy( sizeof ("/IMPLEMENTATIONS/") -1 ) ); // singleton entries Sequence< Reference< registry::XRegistryKey > > xSingletons_section( xKey->openKeys() ); - Reference< registry::XRegistryKey > const * p = xSingletons_section.getConstArray(); for ( sal_Int32 nPos = xSingletons_section.getLength(); nPos--; ) { - Reference< registry::XRegistryKey > const & xSingleton = p[ nPos ]; + Reference<registry::XRegistryKey> const& xSingleton = xSingletons_section[nPos]; OUString singleton_name( xSingleton->getKeyName().copy( implname.getLength() + sizeof ("/IMPLEMENTATIONS//UNO/SINGLETONS/") -1 ) ); @@ -1175,42 +1173,42 @@ void ImplementationRegistration::initialize( Reference< XSimpleRegistry > rReg; // 1st argument : An instance of an implementation loader - if( aArgs.getConstArray()[0].getValueType().getTypeClass() == TypeClass_INTERFACE ) { - aArgs.getConstArray()[0] >>= rLoader; + if( aArgs[0].getValueType().getTypeClass() == TypeClass_INTERFACE ) { + aArgs[0] >>= rLoader; } if( !rLoader.is()) { throw IllegalArgumentException( "ImplementationRegistration::initialize() invalid first parameter," "expected " + cppu::UnoType<decltype(rLoader)>::get().getTypeName() + - ", got " + aArgs.getConstArray()[0].getValueTypeName(), + ", got " + aArgs[0].getValueTypeName(), Reference< XInterface > (), 0 ); } // 2nd argument : The service name of the loader. This name is written into the registry - if( aArgs.getConstArray()[1].getValueType().getTypeClass() == TypeClass_STRING ) { - aArgs.getConstArray()[1] >>= loaderServiceName; + if( aArgs[1].getValueType().getTypeClass() == TypeClass_STRING ) { + aArgs[1] >>= loaderServiceName; } if( loaderServiceName.isEmpty() ) { throw IllegalArgumentException( "ImplementationRegistration::initialize() invalid second parameter," - "expected string, got " + aArgs.getConstArray()[1].getValueTypeName(), + "expected string, got " + aArgs[1].getValueTypeName(), Reference< XInterface > (), 0 ); } // 3rd argument : The file name of the dll, that contains the loader - if( aArgs.getConstArray()[2].getValueType().getTypeClass() == TypeClass_STRING ) { - aArgs.getConstArray()[2] >>= locationUrl; + if( aArgs[2].getValueType().getTypeClass() == TypeClass_STRING ) { + aArgs[2] >>= locationUrl; } if( locationUrl.isEmpty() ) { throw IllegalArgumentException( "ImplementationRegistration::initialize() invalid third parameter," - "expected string, got " + aArgs.getConstArray()[2].getValueTypeName(), + "expected string, got " + aArgs[2].getValueTypeName(), Reference< XInterface > (), 0 ); } // 4th argument : The registry, the service should be written to - if( aArgs.getConstArray()[3].getValueType().getTypeClass() == TypeClass_INTERFACE ) { - aArgs.getConstArray()[3] >>= rReg; + if( aArgs[3].getValueType().getTypeClass() == TypeClass_INTERFACE ) { + aArgs[3] >>= rReg; } if( !rReg.is() ) { @@ -1219,7 +1217,7 @@ void ImplementationRegistration::initialize( throw IllegalArgumentException( "ImplementationRegistration::initialize() invalid fourth parameter," "expected " + cppu::UnoType<decltype(rReg)>::get().getTypeName() + - ", got " + aArgs.getConstArray()[3].getValueTypeName(), + ", got " + aArgs[3].getValueTypeName(), Reference< XInterface > (), 0 ); } } diff --git a/stoc/source/implementationregistration/mergekeys.cxx b/stoc/source/implementationregistration/mergekeys.cxx index fe052bb1f7f8..fe979540d839 100644 --- a/stoc/source/implementationregistration/mergekeys.cxx +++ b/stoc/source/implementationregistration/mergekeys.cxx @@ -99,11 +99,10 @@ static void mergeKeys( // sub keys Sequence< OUString > sourceKeys( xSource->getKeyNames() ); - OUString const * pSourceKeys = sourceKeys.getConstArray(); for ( sal_Int32 nPos = sourceKeys.getLength(); nPos--; ) { // key name - OUString name( pSourceKeys[ nPos ] ); + OUString name( sourceKeys[ nPos ] ); sal_Int32 nSlash = name.lastIndexOf( '/' ); if (nSlash >= 0) { @@ -137,7 +136,7 @@ static void mergeKeys( } links.push_back( Link( - pSourceKeys[ nPos ], // abs path + sourceKeys[ nPos ], // abs path xSource->getResolvedName( name ) // abs resolved name ) ); } diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 48a1f907f01c..033d608e90b0 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -452,10 +452,9 @@ PermissionCollection::PermissionCollection( Sequence< Any > const & permissions, PermissionCollection const & addition ) : m_head( addition.m_head ) { - Any const * perms = permissions.getConstArray(); for ( sal_Int32 nPos = permissions.getLength(); nPos--; ) { - Any const & perm = perms[ nPos ]; + Any const& perm = permissions[nPos]; Type const & perm_type = perm.getValueType(); // supported permission types diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 96fa0a988518..a17b9c1d9f43 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -157,7 +157,7 @@ Any ServiceEnumeration_Impl::nextElement() if( nIt == aFactories.getLength() ) throw NoSuchElementException("no more elements"); - return Any( &aFactories.getConstArray()[nIt++], cppu::UnoType<XInterface>::get()); + return Any( &aFactories[nIt++], cppu::UnoType<XInterface>::get()); } @@ -183,11 +183,10 @@ Sequence< beans::Property > PropertySetInfo_Impl::getProperties() beans::Property PropertySetInfo_Impl::getPropertyByName( OUString const & name ) { - beans::Property const * p = m_properties.getConstArray(); for ( sal_Int32 nPos = m_properties.getLength(); nPos--; ) { - if (p[ nPos ].Name == name) - return p[ nPos ]; + if (m_properties[nPos].Name == name) + return m_properties[nPos]; } throw beans::UnknownPropertyException( "unknown property: " + name ); |