diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-11-10 17:34:31 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-11-10 23:11:28 +0100 |
commit | afbfe42e63cdba1a18c292d7eb4875009b0f19c0 (patch) | |
tree | 4d4feec02830008c898cc1cd4eff768f26efda84 /cui | |
parent | 41b09c0ed154aed0caf325a1ab0b7f7ffa688a35 (diff) |
clang-tidy: (WIP) bugprone-too-small-loop-variable findings 2
Change-Id: I1ddf3fe0e5fad265ae14712a23469b684253079d
Reviewed-on: https://gerrit.libreoffice.org/63241
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optcolor.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 16 | ||||
-rw-r--r-- | cui/source/tabpages/border.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/swpossizetabpage.cxx | 9 |
5 files changed, 15 insertions, 16 deletions
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 48b7874f850e..f33c83cf78b0 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -516,7 +516,7 @@ void ColorConfigWindow_Impl::CreateEntries() // creating entries vEntries.reserve(ColorConfigEntryCount); - for (unsigned i = 0; i < SAL_N_ELEMENTS(vEntryInfo); ++i) + for (size_t i = 0; i < SAL_N_ELEMENTS(vEntryInfo); ++i) { vEntries.push_back(std::make_shared<Entry>(*this, i, nCheckBoxLabelOffset, aModulesInstalled[vEntryInfo[i].eGroup])); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index b74830726911..a33079c99989 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1486,7 +1486,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) { setGroupName( "LoadSave", CuiResId(SID_FILTER_DLG_RES[0].first) ); nGroup = AddGroup( CuiResId(SID_FILTER_DLG_RES[0].first), nullptr, nullptr, SID_FILTER_DLG ); - for ( sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_FILTER_DLG_RES); ++i ) + for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_FILTER_DLG_RES); ++i ) { nPageId = static_cast<sal_uInt16>(SID_FILTER_DLG_RES[i].second); if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) @@ -1500,7 +1500,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) { setGroupName("LanguageSettings", CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first)); nGroup = AddGroup(CuiResId(SID_LANGUAGE_OPTIONS_RES[0].first), nullptr, nullptr, SID_LANGUAGE_OPTIONS ); - for (sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_LANGUAGE_OPTIONS_RES); ++i) + for (size_t i = 1; i < SAL_N_ELEMENTS(SID_LANGUAGE_OPTIONS_RES); ++i) { nPageId = static_cast<sal_uInt16>(SID_LANGUAGE_OPTIONS_RES[i].second); if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) @@ -1532,7 +1532,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) else setGroupName( "Writer", CuiResId(SID_SW_EDITOPTIONS_RES[0].first) ); nGroup = AddGroup(CuiResId(SID_SW_EDITOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_EDITOPTIONS ); - for ( sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_SW_EDITOPTIONS_RES); ++i ) + for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SW_EDITOPTIONS_RES); ++i ) { nPageId = static_cast<sal_uInt16>(SID_SW_EDITOPTIONS_RES[i].second); if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) @@ -1551,7 +1551,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) if ( !lcl_isOptionHidden( SID_SW_ONLINEOPTIONS, aOptionsDlgOpt ) ) { nGroup = AddGroup(CuiResId(SID_SW_ONLINEOPTIONS_RES[0].first), pSwMod, pSwMod, SID_SW_ONLINEOPTIONS ); - for( sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_SW_ONLINEOPTIONS_RES); ++i ) + for( size_t i = 1; i < SAL_N_ELEMENTS(SID_SW_ONLINEOPTIONS_RES); ++i ) { nPageId = static_cast<sal_uInt16>(SID_SW_ONLINEOPTIONS_RES[i].second); if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) @@ -1642,7 +1642,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) SfxModule* pSmMod = SfxApplication::GetModule(SfxToolsModule::Math); setGroupName( "Math", CuiResId(SID_SM_EDITOPTIONS_RES[0].first) ); nGroup = AddGroup(CuiResId(SID_SM_EDITOPTIONS_RES[0].first), pSmMod, pSmMod, SID_SM_EDITOPTIONS ); - for ( sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_SM_EDITOPTIONS_RES); ++i ) + for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SM_EDITOPTIONS_RES); ++i ) { nPageId = static_cast<sal_uInt16>(SID_SM_EDITOPTIONS_RES[i].second); if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) @@ -1661,7 +1661,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) { setGroupName( "Base", CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first) ); nGroup = AddGroup( CuiResId(SID_SB_STARBASEOPTIONS_RES[0].first), nullptr, nullptr, SID_SB_STARBASEOPTIONS ); - for ( sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_SB_STARBASEOPTIONS_RES); ++i ) + for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SB_STARBASEOPTIONS_RES); ++i ) { nPageId = static_cast<sal_uInt16>(SID_SB_STARBASEOPTIONS_RES[i].second); if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) @@ -1674,7 +1674,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) { setGroupName( "Charts", CuiResId(SID_SCH_EDITOPTIONS_RES[0].first) ); nGroup = AddGroup( CuiResId(SID_SCH_EDITOPTIONS_RES[0].first), nullptr, nullptr, SID_SCH_EDITOPTIONS ); - for ( sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_SCH_EDITOPTIONS_RES); ++i ) + for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_SCH_EDITOPTIONS_RES); ++i ) { nPageId = static_cast<sal_uInt16>(SID_SCH_EDITOPTIONS_RES[i].second); if ( !lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) @@ -1688,7 +1688,7 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) setGroupName("Internet", CuiResId(SID_INET_DLG_RES[0].first)); nGroup = AddGroup(CuiResId(SID_INET_DLG_RES[0].first), nullptr, nullptr, SID_INET_DLG ); - for ( sal_uInt32 i = 1; i < SAL_N_ELEMENTS(SID_INET_DLG_RES); ++i ) + for ( size_t i = 1; i < SAL_N_ELEMENTS(SID_INET_DLG_RES); ++i ) { nPageId = static_cast<sal_uInt16>(SID_INET_DLG_RES[i].second); if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) ) diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index a9cf96dc1734..ed2c7b4e6991 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -1464,7 +1464,7 @@ void SvxBorderTabPage::UpdateRemoveAdjCellBorderCB( sal_uInt16 nPreset ) // Check if current selection involves deletion of at least one border bool bBorderDeletionReq = false; - for ( sal_uInt32 i=0; i < SAL_N_ELEMENTS( eTypes1 ); ++i ) + for ( size_t i=0; i < SAL_N_ELEMENTS( eTypes1 ); ++i ) { if( pOldBoxItem->GetLine( eTypes2[i] ) || !( pOldBoxInfoItem->IsValid( eTypes1[i].second ) ) ) { diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index d45cc342531b..c9cc5f5dfd64 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -84,7 +84,7 @@ const SvxPageUsage aArr[] = static sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage ) { - for ( sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aArr); ++i ) + for ( size_t i = 0; i < SAL_N_ELEMENTS(aArr); ++i ) if ( aArr[i] == nUsage ) return i; return 3; diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index c67b3f8eddc4..d5c536d4bdc7 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -451,8 +451,7 @@ static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL( {SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT }, {SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT } }; - sal_uInt16 nIndex; - for(nIndex = 0; nIndex < SAL_N_ELEMENTS(aHoriIds); ++nIndex) + for(size_t nIndex = 0; nIndex < SAL_N_ELEMENTS(aHoriIds); ++nIndex) { if(aHoriIds[nIndex].eHori == eStringId) { @@ -460,7 +459,7 @@ static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL( return eStringId; } } - for(nIndex = 0; nIndex < SAL_N_ELEMENTS(aVertIds); ++nIndex) + for(size_t nIndex = 0; nIndex < SAL_N_ELEMENTS(aVertIds); ++nIndex) { if(aVertIds[nIndex].eHori == eStringId) { @@ -1651,7 +1650,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, sal_uInt16 nMapPos, sal_ if (pMap[_nMapPos].eStrId == eStrId) { nLBRelations = pMap[_nMapPos].nLBRelations; - for (sal_uInt16 nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aAsCharRelationMap); nRelPos++) + for (size_t nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aAsCharRelationMap); nRelPos++) { if (nLBRelations & aAsCharRelationMap[nRelPos].nLBRelation) { @@ -1707,7 +1706,7 @@ void SvxSwPosSizeTabPage::FillRelLB(FrmMap const *pMap, sal_uInt16 nMapPos, sal_ { if (nLBRelations & static_cast<LB>(nBit)) { - for (sal_uInt16 nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aRelationMap); nRelPos++) + for (size_t nRelPos = 0; nRelPos < SAL_N_ELEMENTS(aRelationMap); nRelPos++) { if (aRelationMap[nRelPos].nLBRelation == static_cast<LB>(nBit)) { |