summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-11-10 17:34:31 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-11-10 23:11:28 +0100
commitafbfe42e63cdba1a18c292d7eb4875009b0f19c0 (patch)
tree4d4feec02830008c898cc1cd4eff768f26efda84 /sw
parent41b09c0ed154aed0caf325a1ab0b7f7ffa688a35 (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 'sw')
-rw-r--r--sw/qa/core/macros-test.cxx2
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx4
-rw-r--r--sw/source/core/unocore/unofield.cxx2
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx5
-rw-r--r--sw/source/uibase/sidebar/PageStylesPanel.cxx2
-rw-r--r--sw/source/uibase/utlui/unotools.cxx2
6 files changed, 8 insertions, 9 deletions
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index ac00e300fc59..068001c7551b 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -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);
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index a2620feaf55a..3527541a0177 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -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);
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 857b577e621e..1f249f4059c0 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -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
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 36eea8a94e11..4dd4d8d03c5a 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -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] )
{
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.cxx b/sw/source/uibase/sidebar/PageStylesPanel.cxx
index 971ba20ae919..ae9a692dbe4e 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.cxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.cxx
@@ -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;
diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index 4d91348c8e28..29f698df0a0d 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -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());