sw/source/uibase/app/docstyle.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 067f16627844588b18aba29c2577cd7007134aff
Author:     Simon Chenery <simon_chen...@yahoo.com>
AuthorDate: Sat Mar 1 22:31:01 2025 +0100
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Tue Mar 18 17:40:49 2025 +0100

    tdf#145538: Use range based for loop in docstyle.cxx
    
    Change-Id: I3dc9a319f525e2a22edb125065e9c5dd4e1e0bd4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182398
    Tested-by: Jenkins
    Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index e29206ca1e00..5e98b555750c 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -3096,7 +3096,7 @@ SfxStyleSheetBase*  SwStyleSheetIterator::First()
             if( !bAll )
             {
                 // then also the ones, that we are mapping:
-                static sal_uInt16 aPoolIds[] = {
+                static constexpr sal_uInt16 aPoolIds[] = {
                     RES_POOLCOLL_SEND_ADDRESS, //  --> ADDRESS
                     RES_POOLCOLL_TABLE_HDLN,    //  --> TH
                     RES_POOLCOLL_TABLE,     //  --> TD
@@ -3110,20 +3110,17 @@ SfxStyleSheetBase*  SwStyleSheetIterator::First()
                     RES_POOLCOLL_HEADLINE5, //  --> H5
                     RES_POOLCOLL_HEADLINE6, //  --> H6
                     RES_POOLCOLL_FOOTNOTE,
-                    RES_POOLCOLL_ENDNOTE,
-                    0
+                    RES_POOLCOLL_ENDNOTE
                     };
 
-                sal_uInt16* pPoolIds = aPoolIds;
                 OUString s;
-                while( *pPoolIds )
+                for( const sal_uInt16 nPoolId : aPoolIds )
                 {
-                    if( !bIsSearchUsed || 
rDoc.getIDocumentStylePoolAccess().IsPoolTextCollUsed( *pPoolIds ) )
+                    if( !bIsSearchUsed || 
rDoc.getIDocumentStylePoolAccess().IsPoolTextCollUsed( nPoolId ) )
                     {
-                        s = SwStyleNameMapper::GetUIName( *pPoolIds, 
ProgName(s) );
+                        s = SwStyleNameMapper::GetUIName( nPoolId, ProgName(s) 
);
                         m_aLst.Append( SfxStyleFamily::Para, s);
                     }
-                    ++pPoolIds;
                 }
             }
         }

Reply via email to