Kaydet (Commit) afbfe42e authored tarafından Tamás Zolnai's avatar Tamás Zolnai

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: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 41b09c0e
......@@ -148,7 +148,7 @@ void VBATest::testMiscVBAFunctions()
SvtSysLocaleOptions aLocalOptions;
aLocalOptions.SetLocaleConfigString( aLocale.getBcp47() );
for ( sal_uInt32 i=0; i<SAL_N_ELEMENTS( macroSource ); ++i )
for ( size_t i=0; i<SAL_N_ELEMENTS( macroSource ); ++i )
{
OUString sMacroURL = sMacroPathURL
+ OUString::createFromAscii( macroSource[ i ] );
......
......@@ -317,7 +317,7 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs)
const SfxPoolItem *pPoolItem = nullptr;
if( rInAttrs.GetItemState(SCHATTR_DATADESCR_SEPARATOR, true, &pPoolItem) == SfxItemState::SET )
for(sal_uInt32 i=0; i < SAL_N_ELEMENTS(our_aLBEntryMap); ++i )
for(size_t i=0; i < SAL_N_ELEMENTS(our_aLBEntryMap); ++i )
{
if( our_aLBEntryMap[i] == static_cast<const SfxStringItem*>(pPoolItem)->GetValue())
m_xLB_Separator->set_active( i );
......
......@@ -446,7 +446,7 @@ Reference< XResultSet > SAL_CALL java_sql_DatabaseMetaData::getTablePrivileges(
for (sal_Int32 i = 1 ; i <= nCount ; ++i)
{
sColumnName = xMeta->getColumnName(i);
for (sal_uInt32 j = 0 ; j < SAL_N_ELEMENTS(sPrivs); ++j)
for (size_t j = 0 ; j < SAL_N_ELEMENTS(sPrivs); ++j)
{
if ( sPrivs[j] == sColumnName )
{
......
......@@ -70,7 +70,7 @@ namespace cppu_unourl
{ "abc,def=%22", true },
{ "abc,def=\"", true },
{ "abc,def=%ed%a0%80", true } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
try
......@@ -120,7 +120,7 @@ namespace cppu_unourl
{ "abc,def=%22", "abc,def=%22" },
{ "abc,def=\"", "abc,def=\"" },
{ "abc,def=%ed%a0%80", "abc,def=%ed%a0%80" } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
OUString aDescriptor;
......@@ -168,7 +168,7 @@ namespace cppu_unourl
{ "abc,def=%22", "abc" },
{ "abc,def=\"", "abc" },
{ "abc,def=%ed%a0%80", "abc" } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
OUString aName;
......@@ -213,7 +213,7 @@ namespace cppu_unourl
{ "abc,def=xxx,ghi=xxx", "def", true },
{ "abc,def=xxx,ghi=xxx", "ghi", true },
{ "abc,def=xxx,ghi=xxx", "jkl", false } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
bool bPresent = false;
......@@ -283,7 +283,7 @@ namespace cppu_unourl
{ "abc,abc=,def=Abc", "def", "Abc" },
{ "abc,abc=,def=aBC", "def", "aBC" },
{ "abc,abc=,def=ABC", "def", "ABC" } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
OUString aValue;
......@@ -326,7 +326,7 @@ namespace cppu_unourl
{ "uno:abc;def;1", true },
{ "uno:abc;def;$&+,/:=?@", true },
{ "uno:abc;def;%24&+,/:=?@", false } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
try
......@@ -364,7 +364,7 @@ namespace cppu_unourl
{ "uno:ABC;def;ghi", "ABC" },
{ "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi",
"abc,def=xxx,ghi=xxx" } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
OUString aConnection;
......@@ -398,7 +398,7 @@ namespace cppu_unourl
{ "uno:abc;DEF;ghi", "DEF" },
{ "uno:abc,def=xxx,ghi=xxx;def,ghi=xxx,jkl=xxx;ghi",
"def,ghi=xxx,jkl=xxx" } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
OUString aProtocol;
......@@ -435,7 +435,7 @@ namespace cppu_unourl
{ "uno:abc;def;A", "A" },
{ "uno:abc;def;1", "1" },
{ "uno:abc;def;$&+,/:=?@", "$&+,/:=?@" } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
{
bool bValid = false;
OUString aObjectName;
......
......@@ -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]));
......
......@@ -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 ) )
......
......@@ -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 ) ) )
{
......
......@@ -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;
......
......@@ -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))
{
......
......@@ -387,7 +387,7 @@ void OFieldDescControl::ScrollAllAggregates()
, m_pTypeText, m_pAutoIncrementValueText};
OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
for (size_t i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
ScrollAggregate(ppAggregatesText[i],ppAggregates[i],nullptr,nDeltaX, nDeltaY);
ScrollAggregate(pFormatText,pFormatSample,pFormat,nDeltaX, nDeltaY);
......@@ -439,7 +439,7 @@ void OFieldDescControl::SetReadOnly( bool bReadOnly )
OSL_ENSURE(SAL_N_ELEMENTS(ppAggregates) == SAL_N_ELEMENTS(ppAggregatesText),"Lists are not identical!");
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
for (size_t i=0; i<SAL_N_ELEMENTS(ppAggregates); ++i)
{
if ( ppAggregatesText[i] )
ppAggregatesText[i]->Enable( !bReadOnly );
......
......@@ -526,7 +526,7 @@ IMPL_LINK( ParaWin, GetFxHdl, ArgInput&, rPtr, void )
{
sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
for (sal_uInt16 nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
for (size_t nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
{
if(&rPtr == &aArgInput[nPos])
{
......@@ -547,7 +547,7 @@ IMPL_LINK( ParaWin, GetFxFocusHdl, ArgInput&, rPtr, void )
{
sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
for (sal_uInt16 nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
for (size_t nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
{
if(&rPtr == &aArgInput[nPos])
{
......@@ -569,7 +569,7 @@ IMPL_LINK( ParaWin, GetEdFocusHdl, ArgInput&, rPtr, void )
{
sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
for (sal_uInt16 nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
for (size_t nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
{
if(&rPtr == &aArgInput[nPos])
{
......@@ -598,7 +598,7 @@ IMPL_LINK( ParaWin, ModifyHdl, ArgInput&, rPtr, void )
{
sal_uInt16 nOffset = GetSliderPos();
nEdFocus=NOT_FOUND;
for (sal_uInt16 nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
for (size_t nPos=0; nPos < SAL_N_ELEMENTS(aArgInput); ++nPos)
{
if(&rPtr == &aArgInput[nPos])
{
......
......@@ -176,7 +176,7 @@ ControlMenuController::ControlMenuController(const css::uno::Reference< css::uno
// private function
void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu )
{
for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(aCommands); ++i)
for (size_t i=0; i < SAL_N_ELEMENTS(aCommands); ++i)
{
//ident is .uno:Command without .uno:
OString sIdent = OString(aCommands[i]).copy(5);
......@@ -226,7 +226,7 @@ void SAL_CALL ControlMenuController::statusChanged( const FeatureStateEvent& Eve
osl::ResettableMutexGuard aLock( m_aMutex );
OString sIdent;
for (sal_uInt32 i=0; i < SAL_N_ELEMENTS(aCommands); ++i)
for (size_t i=0; i < SAL_N_ELEMENTS(aCommands); ++i)
{
if ( Event.FeatureURL.Complete.equalsAscii( aCommands[i] ))
{
......
......@@ -565,9 +565,7 @@ static int is_jaso(hchar hh)
static hchar jaso2ks(hchar hh)
{
unsigned int i;
for (i = 0; i < SAL_N_ELEMENTS(jaso_hh_code); i++)
for (size_t i = 0; i < SAL_N_ELEMENTS(jaso_hh_code); i++)
if (hh == jaso_hh_code[i])
{
return sal::static_int_cast<hchar>(0xa4a1 + i);
......
......@@ -99,7 +99,7 @@ static sal_Int16 checkScriptType(sal_Unicode c)
};
UBlockCode block=ublock_getCode(static_cast<sal_uInt32>(c));
sal_uInt16 i;
size_t i;
for ( i = 0; i < SAL_N_ELEMENTS(scriptList); i++) {
if (block <= scriptList[i].to) break;
}
......
......@@ -330,7 +330,7 @@ void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
if ( strcmp(sName, "zoom-in-symbolic") == 0)
{
for ( unsigned int i = 0; i < SAL_N_ELEMENTS( fZooms ); i++ )
for ( size_t i = 0; i < SAL_N_ELEMENTS( fZooms ); i++ )
{
if ( fCurrentZoom < fZooms[i] )
{
......@@ -345,7 +345,7 @@ void changeZoom( GtkWidget* pButton, gpointer /* pItem */ )
}
else if ( strcmp(sName, "zoom-out-symbolic") == 0)
{
for ( unsigned int i = 0; i < SAL_N_ELEMENTS( fZooms ); i++ )
for ( size_t i = 0; i < SAL_N_ELEMENTS( fZooms ); i++ )
{
if ( fCurrentZoom > fZooms[i] )
{
......
......@@ -1116,7 +1116,7 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x
case sdbc::DataType::TIMESTAMP:
{
const char* aIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE };
for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aIds); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aIds); ++i)
{
m_pGroupOnLst->InsertEntry(RptResId(aIds[i]));
m_pGroupOnLst->SetEntryData(i+1,reinterpret_cast<void*>(i+2));
......
......@@ -170,7 +170,7 @@ void test::oustring::Convert::convertToString()
OUSTRING_TO_OSTRING_CVTFLAGS,
"A?B",
"A?B" } };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); ++i)
testConvertToString(aTests[i]);
}
......
......@@ -295,7 +295,7 @@ Sequence< sal_Int8 > DummyTokenHandler::getUTF8Identifier( sal_Int32 nToken )
}
else //element or attribute
{
sal_uInt32 nElementToken = nToken & 0xffff;
size_t nElementToken = nToken & 0xffff;
if ( nElementToken < SAL_N_ELEMENTS(tokens) )
aUtf8Token = tokens[ nElementToken ];
}
......@@ -313,7 +313,7 @@ sal_Int32 DummyTokenHandler::getTokenFromUTF8( const uno::Sequence< sal_Int8 >&
sal_Int32 DummyTokenHandler::getTokenDirect( const char* pToken, sal_Int32 nLength ) const
{
OString sToken( pToken, nLength );
for( sal_uInt16 i = 0; i < SAL_N_ELEMENTS(tokens); i++ )
for( size_t i = 0; i < SAL_N_ELEMENTS(tokens); i++ )
{
if ( tokens[i] == sToken )
return static_cast<sal_Int32>(i);
......@@ -384,7 +384,7 @@ void XMLImportTest::parse()
"multiplens.xml", "multiplepfx.xml",
"nstoattributes.xml", "nestedns.xml", "testthreading.xml"};
for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS( fileNames ); i++)
for (size_t i = 0; i < SAL_N_ELEMENTS( fileNames ); i++)
{
InputSource source;
source.sSystemId = "internal";
......
......@@ -298,7 +298,7 @@ void ScMacrosTest::testVba()
sTempDir += OUStringLiteral1(SAL_PATHDELIMITER);
OUString sTestFileName("My Test WorkBook.xls");
Sequence< uno::Any > aParams;
for ( sal_uInt32 i=0; i<SAL_N_ELEMENTS( testInfo ); ++i )
for ( size_t i=0; i<SAL_N_ELEMENTS( testInfo ); ++i )
{
OUString aFileName;
createFileURL(testInfo[i].sFileBaseName + "xls", aFileName);
......
......@@ -1654,7 +1654,7 @@ void Test::testCSV()
{ "+,123", English, false, 0.0 },
{ "-,123", English, false, 0.0 }
};
for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(aTests); i++) {
for (size_t i = 0; i < SAL_N_ELEMENTS(aTests); i++) {
OUString aStr(aTests[i].pStr, strlen (aTests[i].pStr), RTL_TEXTENCODING_UTF8);
double nValue = 0.0;
bool bResult = ScStringUtil::parseSimpleNumber
......
......@@ -160,7 +160,7 @@ void ScEditUtil::RemoveCharAttribs( EditTextObject& rEditText, const ScPatternAt
const SfxItemSet& rSet = rAttr.GetItemSet();
const SfxPoolItem* pItem;
for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(AttrTypeMap); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(AttrTypeMap); ++i)
{
if ( rSet.GetItemState(AttrTypeMap[i].nAttrType, false, &pItem) == SfxItemState::SET )
rEditText.RemoveCharAttribs(AttrTypeMap[i].nCharType);
......
......@@ -1377,7 +1377,7 @@ void SdImportTest::testTdf99729()
{
const OUString filenames[] = { "/sd/qa/unit/data/odp/tdf99729-new.odp", "/sd/qa/unit/data/odp/tdf99729-legacy.odp" };
int nonwhitecounts[] = { 0, 0 };
for (unsigned int i = 0; i < SAL_N_ELEMENTS(filenames); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(filenames); ++i)
{
// 1st check for new behaviour - having AnchoredTextOverflowLegacy compatibility flag set to false in settings.xml
uno::Reference<lang::XComponent> xComponent
......
......@@ -94,7 +94,7 @@ static BitmapEx* getButtonImage( int index, bool large )
if( !gSmallButtonImages[0].get() )
{
for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(aSmallPlaceHolders); i++ )
for (size_t i = 0; i < SAL_N_ELEMENTS(aSmallPlaceHolders); i++ )
{
gSmallButtonImages[i].set(o3tl::make_unique<BitmapEx>(aSmallPlaceHolders[i]));
gLargeButtonImages[i].set(o3tl::make_unique<BitmapEx>(aBigPlaceHolders[i]));
......
......@@ -1596,7 +1596,7 @@ void FmXGridPeer::addColumnListeners(const Reference< XPropertySet >& xCol)
// as not all properties have to be supported by all columns we have to check this
// before adding a listener
Reference< XPropertySetInfo > xInfo = xCol->getPropertySetInfo();
for (unsigned i=0; i<SAL_N_ELEMENTS(aPropsListenedTo); ++i)
for (size_t i=0; i<SAL_N_ELEMENTS(aPropsListenedTo); ++i)
{
if ( xInfo->hasPropertyByName( aPropsListenedTo[i] ) )
{
......
......@@ -195,7 +195,7 @@ namespace svx
{ OUString("Selection"), DataAccessDescriptorProperty::Selection, }
};
for (unsigned i=0; i<SAL_N_ELEMENTS(s_aDescriptorProperties); ++i)
for (size_t i=0; i<SAL_N_ELEMENTS(s_aDescriptorProperties); ++i)
s_aProperties[ s_aDescriptorProperties[i].maName ] = &s_aDescriptorProperties[i];
}
......
......@@ -160,7 +160,7 @@ void SwMacrosTest::testVba()
OUString("vnd.sun.Star.script:Project.NewMacros.Macro1?language=Basic&location=document")
}
};
for ( sal_uInt32 i=0; i<SAL_N_ELEMENTS( testInfo ); ++i )
for ( size_t i=0; i<SAL_N_ELEMENTS( testInfo ); ++i )
{
OUString aFileName;
createFileURL(testInfo[i].sFileBaseName, "doc", aFileName);
......
......@@ -1962,7 +1962,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt")
uno::Any aHu = uno::makeAny(OUString("Hu"));
uno::Any ahu = uno::makeAny(OUString("hu"));
for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(aFieldTexts); i++)
for (size_t i = 0; i < SAL_N_ELEMENTS(aFieldTexts); i++)
{
uno::Any aField = xFields->nextElement();
uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY);
......@@ -2030,7 +2030,7 @@ DECLARE_ODFEXPORT_TEST(testSpellOutNumberingTypes, "spellout-numberingtypes.odt"
uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(aFieldTexts); i++)
for (size_t i = 0; i < SAL_N_ELEMENTS(aFieldTexts); i++)
{
uno::Any aField = xFields->nextElement();
uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY);
......
......@@ -193,7 +193,7 @@ static const ServiceIdResId aServiceToRes[] =
static SwFieldIds lcl_ServiceIdToResId(SwServiceType nServiceId)
{
for (unsigned i=0; i<SAL_N_ELEMENTS(aServiceToRes); ++i)
for (size_t i=0; i<SAL_N_ELEMENTS(aServiceToRes); ++i)
if (aServiceToRes[i].nServiceId == nServiceId)
return aServiceToRes[i].nResId;
#if OSL_DEBUG_LEVEL > 0
......
......@@ -312,7 +312,7 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >&
m_pToolBox = VclPtr<SwScrollNaviToolBox>::Create(get<vcl::Window>("box"), this, 0);
get(m_pInfoField, "label");
sal_uInt16 i;
size_t i;
m_pToolBox->SetHelpId(HID_NAVI_VS);
m_pToolBox->SetLineCount( 2 );
......@@ -773,8 +773,7 @@ void NavElementBox_Impl::Select()
void NavElementBox_Impl::Update()
{
sal_uInt16 nMoveType = SwView::GetMoveType();
sal_uInt16 i;
for ( i = 0; i < SAL_N_ELEMENTS( aNavigationInsertIds ); ++i )
for ( size_t i = 0; i < SAL_N_ELEMENTS( aNavigationInsertIds ); ++i )
{
if ( nMoveType == aNavigationInsertIds[i] )
{
......
......@@ -60,7 +60,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;
......
......@@ -464,7 +464,7 @@ void SwOneExampleFrame::CreatePopup(const Point& rPt)
aZoom >>= nZoom;
VclPtrInstance<PopupMenu> aSubPop1;
for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(nZoomValues); ++i)
for (size_t i = 0; i < SAL_N_ELEMENTS(nZoomValues); ++i)
{
OUString sTemp = unicode::formatPercent(nZoomValues[i],
Application::GetSettings().GetUILanguageTag());
......
......@@ -637,7 +637,7 @@ void CanvasBitmapTest::runTest()
// Testing VclCanvasBitmap wrapper
for( unsigned int i=0; i<SAL_N_ELEMENTS(lcl_depths); ++i )
for( size_t i=0; i<SAL_N_ELEMENTS(lcl_depths); ++i )
{
const sal_Int8 nDepth( lcl_depths[i] );
Bitmap aBitmap(Size(200,200),nDepth);
......
......@@ -1047,8 +1047,6 @@ TrueTypeTable *TrueTypeTableNew_post(sal_uInt32 format,
int GetRawData(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt32 *tag)
{
/* XXX do a binary search */
unsigned int i;
assert(_this != nullptr);
assert(ptr != nullptr);
assert(len != nullptr);
......@@ -1061,7 +1059,7 @@ int GetRawData(TrueTypeTable *_this, sal_uInt8 **ptr, sal_uInt32 *len, sal_uInt3
_this->rawdata = nullptr;
}
for(i=0; i < SAL_N_ELEMENTS(vtable2); i++) {
for(size_t i=0; i < SAL_N_ELEMENTS(vtable2); i++) {
if (_this->tag == vtable2[i].tag) {
return vtable2[i].f(_this, ptr, len, tag);
}
......@@ -1443,13 +1441,11 @@ extern "C"
{
vcl::TrueTypeTable *_this = static_cast<vcl::TrueTypeTable *>(arg);
/* XXX do a binary search */
unsigned int i;
assert(_this != nullptr);
if (_this->rawdata) free(_this->rawdata);
for(i=0; i < SAL_N_ELEMENTS(vcl::vtable1); i++) {
for(size_t i=0; i < SAL_N_ELEMENTS(vcl::vtable1); i++) {
if (_this->tag == vcl::vtable1[i].tag) {
vcl::vtable1[i].f(_this);
return;
......
......@@ -869,7 +869,7 @@ static void lcl_MoveBorderPropertiesToFrame(std::vector<beans::PropertyValue>& r
PROP_BOTTOM_BORDER_DISTANCE
};
for( sal_uInt32 nProperty = 0; nProperty < SAL_N_ELEMENTS( aBorderProperties ); ++nProperty)
for( size_t nProperty = 0; nProperty < SAL_N_ELEMENTS( aBorderProperties ); ++nProperty)
{
OUString sPropertyName = getPropertyName(aBorderProperties[nProperty]);
beans::PropertyValue aValue;
......@@ -3563,7 +3563,7 @@ void DomainMapper_Impl::handleAuthor
uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xUserDefinedProps->getPropertySetInfo();
//search for a field mapping
OUString sFieldServiceName;
sal_uInt16 nMap = 0;
size_t nMap = 0;
for( ; nMap < SAL_N_ELEMENTS(aDocProperties); ++nMap )
{
if ((rFirstParam.equalsAscii(aDocProperties[nMap].pDocPropertyName)) && (!xPropertySetInfo->hasPropertyByName(rFirstParam)))
......
......@@ -1411,7 +1411,7 @@ OUString StyleSheetTable::ConvertStyleName( const OUString& rWWName, bool bExten
// create a map only once
if(m_pImpl->m_aStyleNameMap.empty())
{
for( sal_uInt32 nPair = 0; nPair < SAL_N_ELEMENTS(aStyleNamePairs)/2; ++nPair)
for( size_t nPair = 0; nPair < SAL_N_ELEMENTS(aStyleNamePairs)/2; ++nPair)
{
OUString aFrom = OUString::createFromAscii(aStyleNamePairs[2 * nPair]);
OUString aTo = OUString::createFromAscii(aStyleNamePairs[2 * nPair + 1]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment