summaryrefslogtreecommitdiff
path: root/xmloff/source/xforms/xformsexport.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-12 16:07:58 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-11 20:32:49 +0200
commit79d58ee14da8fbf636fb087453834abb7173d3fc (patch)
tree2eda9470235311bdfaf542ceeaf8237406458015 /xmloff/source/xforms/xformsexport.cxx
parentc88f76035cd1d088cc06067270677618340fd839 (diff)
Simplify Sequence iterations in xmloff/source/{style..xforms}
Use range-based loops or replace with comphelper or STL functions Change-Id: Ie268d80b9c01d38c745c14a81c219d9930860562 Reviewed-on: https://gerrit.libreoffice.org/72189 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/xforms/xformsexport.cxx')
-rw-r--r--xmloff/source/xforms/xformsexport.cxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx
index 5d432ffe6eb5..edd3b1434918 100644
--- a/xmloff/source/xforms/xformsexport.cxx
+++ b/xmloff/source/xforms/xformsexport.cxx
@@ -87,12 +87,10 @@ void exportXForms( SvXMLExport& rExport )
if( xForms.is() )
{
Sequence<OUString> aNames = xForms->getElementNames();
- const OUString* pNames = aNames.getConstArray();
- sal_Int32 nNames = aNames.getLength();
- for( sal_Int32 n = 0; n < nNames; n++ )
+ for( const auto& rName : aNames )
{
- Reference<XPropertySet> xModel( xForms->getByName( pNames[n] ),
+ Reference<XPropertySet> xModel( xForms->getByName( rName ),
UNO_QUERY );
exportXFormsModel( rExport, xModel );
}
@@ -219,12 +217,10 @@ void exportXFormsInstance( SvXMLExport& rExport,
OUString sURL;
Reference<XDocument> xDoc;
- const PropertyValue* pInstance = xInstance.getConstArray();
- sal_Int32 nCount = xInstance.getLength();
- for( sal_Int32 i = 0; i < nCount; i++ )
+ for( const auto& rProp : xInstance )
{
- OUString sName = pInstance[i].Name;
- const Any& rAny = pInstance[i].Value;
+ OUString sName = rProp.Name;
+ const Any& rAny = rProp.Value;
if ( sName == "ID" )
rAny >>= sId;
else if ( sName == "URL" )
@@ -337,11 +333,8 @@ void exportXFormsBinding( SvXMLExport& rExport,
{
// iterate over Prefixes for this binding
Sequence<OUString> aPrefixes = xNamespaces->getElementNames();
- const OUString* pPrefixes = aPrefixes.getConstArray();
- sal_Int32 nPrefixes = aPrefixes.getLength();
- for( sal_Int32 i = 0; i < nPrefixes; i++ )
+ for( const OUString& rPrefix : aPrefixes )
{
- const OUString& rPrefix = pPrefixes[i];
OUString sURI;
xNamespaces->getByName( rPrefix ) >>= sURI;