summaryrefslogtreecommitdiff
path: root/comphelper/source/property/property.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-12-17 23:00:24 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-18 07:36:32 +0100
commit4e144751f12a06e358e4f7efa7c8f13954e6cfd7 (patch)
treec6df66d58d02ecaf5caa437a944665fe83959402 /comphelper/source/property/property.cxx
parent39c618caf5aa19da95285bec6cab7108bee3984c (diff)
loplugin:unusedindex
Change-Id: I256a807dd2a4c81126b5a76f3d472e31b8224146 Reviewed-on: https://gerrit.libreoffice.org/46652 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper/source/property/property.cxx')
-rw-r--r--comphelper/source/property/property.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx
index f5e369808d2a..8f222f56f8de 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -71,20 +71,19 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
Reference< XPropertySetInfo > xDestProps = _rxDest->getPropertySetInfo();
Sequence< Property > aSourceProps = xSourceProps->getProperties();
- const Property* pSourceProps = aSourceProps.getConstArray();
Property aDestProp;
- for (sal_Int32 i=0; i<aSourceProps.getLength(); ++i, ++pSourceProps)
+ for (const Property& rSourceProp : aSourceProps)
{
- if ( xDestProps->hasPropertyByName(pSourceProps->Name) )
+ if ( xDestProps->hasPropertyByName(rSourceProp.Name) )
{
try
{
- aDestProp = xDestProps->getPropertyByName(pSourceProps->Name);
+ aDestProp = xDestProps->getPropertyByName(rSourceProp.Name);
if (0 == (aDestProp.Attributes & PropertyAttribute::READONLY) )
{
- const Any aSourceValue = _rxSource->getPropertyValue(pSourceProps->Name);
+ const Any aSourceValue = _rxSource->getPropertyValue(rSourceProp.Name);
if ( 0 != (aDestProp.Attributes & PropertyAttribute::MAYBEVOID) || aSourceValue.hasValue() )
- _rxDest->setPropertyValue(pSourceProps->Name, aSourceValue);
+ _rxDest->setPropertyValue(rSourceProp.Name, aSourceValue);
}
}
catch (Exception&)
@@ -92,7 +91,7 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
#if OSL_DEBUG_LEVEL > 0
OUStringBuffer aBuffer;
aBuffer.append( "::comphelper::copyProperties: could not copy property '" );
- aBuffer.append( pSourceProps->Name );
+ aBuffer.append(rSourceProp.Name );
aBuffer.append( "' to the destination set (a '" );
Reference< XServiceInfo > xSI( _rxDest, UNO_QUERY );