summaryrefslogtreecommitdiff
path: root/connectivity/source/commontools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-18 09:18:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-18 13:18:38 +0200
commit454eb3bc05f861712bff0f7593f9aa9809e4ee7c (patch)
treeea5ca6dbd4efe716bcdcb9ae196849053235c8af /connectivity/source/commontools
parentbc8cefd025d89e7f981f07814a16030f92413a8b (diff)
use for-range on Sequence in cli_ure..connectivity
Change-Id: Ic5254e402d153a13c29928b59738cbe1603d0139 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94399 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r--connectivity/source/commontools/dbtools.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index a16549ba3b50..419cd26e7c07 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -946,11 +946,10 @@ try
Reference< XPropertySetInfo> xOldInfo( xOldProps->getPropertySetInfo());
Reference< XPropertySetInfo> xNewInfo( xNewProps->getPropertySetInfo());
- Sequence< Property> aOldProperties = xOldInfo->getProperties();
+ const Sequence< Property> aOldProperties = xOldInfo->getProperties();
Sequence< Property> aNewProperties = xNewInfo->getProperties();
int nNewLen = aNewProperties.getLength();
- Property* pOldProps = aOldProperties.getArray();
Property* pNewProps = aNewProperties.getArray();
OUString sPropFormatsSupplier("FormatsSupplier");
@@ -968,18 +967,18 @@ try
OUString sPropClassId("ClassId");
OUString sFormattedServiceName( "com.sun.star.form.component.FormattedField" );
- for (sal_Int32 i=0; i<aOldProperties.getLength(); ++i)
+ for (const Property& rOldProp : aOldProperties)
{
- if ( pOldProps[i].Name != "DefaultControl" && pOldProps[i].Name != "LabelControl" )
+ if ( rOldProp.Name != "DefaultControl" && rOldProp.Name != "LabelControl" )
{
// binary search
Property* pResult = std::lower_bound(
- pNewProps, pNewProps + nNewLen, pOldProps[i], ::comphelper::PropertyCompareByName());
+ pNewProps, pNewProps + nNewLen, rOldProp, ::comphelper::PropertyCompareByName());
if ( ( pResult != aNewProperties.end() )
- && ( pResult->Name == pOldProps[i].Name )
+ && ( pResult->Name == rOldProp.Name )
&& ( (pResult->Attributes & PropertyAttribute::READONLY) == 0 )
- && ( pResult->Type.equals(pOldProps[i].Type)) )
+ && ( pResult->Type.equals(rOldProp.Type)) )
{ // Attributes match and the property is not read-only
try
{