diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-18 21:46:33 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-19 09:04:01 +0200 |
commit | 1dade9d64dc579e4e68c033a539b3df25dc89f3e (patch) | |
tree | 8381e3c762b820fb48e658a56b2cfa5acf615e64 | |
parent | 2ed168b6c15244916b8298d4f8739254315d7a5a (diff) |
Use for loop with explicit number of iterations
96be3821f7dad19004a43696555eaa4fa2e1aef5 follow-up
Change-Id: I1e585a1f4bcd68757cce7b6327757cd7e9ee660f
Reviewed-on: https://gerrit.libreoffice.org/74306
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx b/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx index 55beb5f027f3..a9a22991eac7 100644 --- a/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx +++ b/xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx @@ -54,14 +54,11 @@ XMLTextCharStyleNamesElementExport::XMLTextCharStyleNamesElementExport( { aName = rExport.GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_TEXT, GetXMLToken(XML_SPAN) ); - sal_Int32 i = nCount; - const OUString *pName = aNames.getConstArray(); - while( --i ) + for( sal_Int32 i = 1; i < nCount; ++i ) { rExport.AddAttribute( XML_NAMESPACE_TEXT, XML_STYLE_NAME, - rExport.EncodeStyleName( *pName ) ); + rExport.EncodeStyleName( aNames[i - 1] ) ); rExport.StartElement( aName, false ); - ++pName; } } } @@ -72,8 +69,7 @@ XMLTextCharStyleNamesElementExport::~XMLTextCharStyleNamesElementExport() { if( nCount > 1 ) { - sal_Int32 i = nCount; - while( --i ) + for( sal_Int32 i = 1; i < nCount; ++i ) rExport.EndElement( aName, false ); } } |