summaryrefslogtreecommitdiff
path: root/dbaccess/source/core/api/query.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/core/api/query.cxx')
-rw-r--r--dbaccess/source/core/api/query.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx
index efd3eb0748c0..d1ade9cc26d5 100644
--- a/dbaccess/source/core/api/query.cxx
+++ b/dbaccess/source/core/api/query.cxx
@@ -170,26 +170,23 @@ void OQuery::rebuildColumns()
throw RuntimeException();
}
- Sequence< OUString> aNames = xColumns->getElementNames();
- const OUString* pIter = aNames.getConstArray();
- const OUString* pEnd = pIter + aNames.getLength();
- for ( sal_Int32 i = 0;pIter != pEnd; ++pIter,++i)
+ for ( const OUString& rName : xColumns->getElementNames() )
{
- Reference<XPropertySet> xSource(xColumns->getByName( *pIter ),UNO_QUERY);
- OUString sLabel = *pIter;
- if ( xColumnDefinitions.is() && xColumnDefinitions->hasByName(*pIter) )
+ Reference<XPropertySet> xSource(xColumns->getByName( rName ),UNO_QUERY);
+ OUString sLabel = rName;
+ if ( xColumnDefinitions.is() && xColumnDefinitions->hasByName(rName) )
{
- Reference<XPropertySet> xCommandColumn(xColumnDefinitions->getByName( *pIter ),UNO_QUERY);
+ Reference<XPropertySet> xCommandColumn(xColumnDefinitions->getByName( rName ),UNO_QUERY);
xCommandColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
}
OQueryColumn* pColumn = new OQueryColumn( xSource, m_xConnection, sLabel);
Reference< XChild > xChild( *pColumn, UNO_QUERY_THROW );
xChild->setParent( *this );
- implAppendColumn( *pIter, pColumn );
+ implAppendColumn( rName, pColumn );
Reference< XPropertySet > xDest( *pColumn, UNO_QUERY_THROW );
if ( m_pColumnMediator.is() )
- m_pColumnMediator->notifyElementCreated( *pIter, xDest );
+ m_pColumnMediator->notifyElementCreated( rName, xDest );
}
}
catch( const SQLContext& e )