[Libreoffice-commits] core.git: xmloff/source

Arkadiy Illarionov (via logerrit) logerrit at kemper.freedesktop.org
Wed Jun 19 07:04:41 UTC 2019


 xmloff/source/text/XMLTextCharStyleNamesElementExport.cxx |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

New commits:
commit 1dade9d64dc579e4e68c033a539b3df25dc89f3e
Author:     Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Tue Jun 18 21:46:33 2019 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jun 19 09:04:01 2019 +0200

    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 at collabora.co.uk>

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 );
     }
 }


More information about the Libreoffice-commits mailing list