[Libreoffice-commits] core.git: cui/source desktop/source drawinglayer/source extensions/source filter/source libreofficekit/qa lotuswordpro/source opencl/source scaddins/source sc/source sdext/source svl/source svx/source sw/source vcl/backendtest vcl/headless vcl/source vcl/win winaccessibility/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 1 12:02:57 UTC 2018


 cui/source/options/optgdlg.cxx                              |    2 +-
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx       |    2 +-
 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx |    2 +-
 extensions/source/bibliography/bibconfig.cxx                |    2 +-
 filter/source/graphicfilter/ipict/shape.cxx                 |    2 +-
 filter/source/msfilter/escherex.cxx                         |    3 ++-
 libreofficekit/qa/tilebench/tilebench.cxx                   |   12 ++++++------
 lotuswordpro/source/filter/lwpnumericfmt.cxx                |    2 +-
 opencl/source/opencl_device.cxx                             |    2 +-
 sc/source/core/opencl/formulagroupcl.cxx                    |    2 +-
 sc/source/core/tool/scmatrix.cxx                            |    8 ++++----
 scaddins/source/analysis/analysishelper.cxx                 |    2 +-
 sdext/source/pdfimport/filterdet.cxx                        |    2 +-
 sdext/source/pdfimport/pdfparse/pdfentries.cxx              |    4 ++--
 sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx          |    2 +-
 svl/source/numbers/zformat.cxx                              |    8 ++++----
 svx/source/dialog/ClassificationDialog.cxx                  |    2 +-
 svx/source/dialog/srchdlg.cxx                               |    2 +-
 svx/source/dialog/svxruler.cxx                              |    4 ++--
 svx/source/form/fmshimp.cxx                                 |    2 +-
 sw/source/uibase/docvw/PostItMgr.cxx                        |    4 ++--
 vcl/backendtest/outputdevice/common.cxx                     |    4 ++--
 vcl/headless/svpgdi.cxx                                     |    4 ++--
 vcl/source/gdi/impvect.cxx                                  |    6 ++++--
 vcl/source/gdi/pdfwriter_impl2.cxx                          |    6 ++++--
 vcl/source/gdi/regionband.cxx                               |    2 +-
 vcl/win/gdi/salgdi2.cxx                                     |    2 +-
 winaccessibility/source/UAccCOM/MAccessible.cxx             |    4 ++--
 28 files changed, 52 insertions(+), 47 deletions(-)

New commits:
commit 26ccd00bc96c585b7065af0dcce246b5bfaae5e1
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Oct 31 17:20:46 2018 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Thu Nov 1 13:02:26 2018 +0100

    clang-tidy: (WIP) bugprone-too-small-loop-variable findings
    
    Change-Id: Iaa255b39928ac45dec1ed37e368c149d6027f561
    Reviewed-on: https://gerrit.libreoffice.org/62701
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 212995580787..d87f6dedc6ee 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1320,7 +1320,7 @@ static void lcl_Update(std::unique_ptr<SfxVoidItem> pInvalidItems[], std::unique
     while(pViewFrm)
     {
         SfxBindings& rBind = pViewFrm->GetBindings();
-        for(sal_Int16 i = 0; i < nCount; i++)
+        for(sal_uInt16 i = 0; i < nCount; i++)
         {
             if(pCurrentFrm == pViewFrm)
                 rBind.InvalidateAll(false);
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index 852addaaa829..36d52750cf9e 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -849,7 +849,7 @@ void UpdateDialog::notifyMenubar( bool bPrepareOnly, bool bRecheckOnly )
     if ( ! bRecheckOnly )
     {
         sal_Int32 nCount = 0;
-        for ( sal_Int16 i = 0; i < m_pUpdates->getItemCount(); ++i )
+        for ( sal_uInt16 i = 0; i < m_pUpdates->getItemCount(); ++i )
         {
             uno::Sequence< OUString > aItem(2);
 
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index 1e890358c25b..85cf4cd548fb 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -209,7 +209,7 @@ namespace drawinglayer
                 // reuse first polygon, it's the second one
                 aCombinedPolyPoly.remove(0);
 
-                for(sal_uInt32 a(0); a < rEntries.size() - 1; a++)
+                for(size_t a(0); a < rEntries.size() - 1; a++)
                 {
                     // create next inner polygon, combined with last one
                     basegfx::B2DPolygon aNextPoly(rUnitPolygon);
diff --git a/extensions/source/bibliography/bibconfig.cxx b/extensions/source/bibliography/bibconfig.cxx
index e18d60a13aaa..aa340c391c8f 100644
--- a/extensions/source/bibliography/bibconfig.cxx
+++ b/extensions/source/bibliography/bibconfig.cxx
@@ -170,7 +170,7 @@ BibConfig::BibConfig()
             OUString sTempReal;
             sal_Int16 nSetMapping = 0;
             nFieldIdx = 0;
-            for(sal_Int16 nFieldVal = 0; nFieldVal < aAssignmentValues.getLength() / 2; nFieldVal++)
+            for(sal_Int32 nFieldVal = 0; nFieldVal < aAssignmentValues.getLength() / 2; nFieldVal++)
             {
                 pAssignmentValues[nFieldIdx++] >>= sTempLogical;
                 pAssignmentValues[nFieldIdx++] >>= sTempReal;
diff --git a/filter/source/graphicfilter/ipict/shape.cxx b/filter/source/graphicfilter/ipict/shape.cxx
index f9bae2acd4eb..3bdd022bb3e7 100644
--- a/filter/source/graphicfilter/ipict/shape.cxx
+++ b/filter/source/graphicfilter/ipict/shape.cxx
@@ -79,7 +79,7 @@ namespace PictReaderShape {
       long origPt[4][2] = { { orig.X(), orig.Y() }, { orig.X()+pSize.Width(), orig.Y() },
                { orig.X()+pSize.Width(), orig.Y()+pSize.Height() },
                { orig.X(), orig.Y()+pSize.Height() }};
-      long origAvoid = dir[0] > 0 ? (dir[1] > 0 ? 2 : 1) : (dir[1] > 0 ? 3 : 0);
+      int origAvoid = dir[0] > 0 ? (dir[1] > 0 ? 2 : 1) : (dir[1] > 0 ? 3 : 0);
       long destPt[4][2] = { { dest.X(), dest.Y() }, { dest.X()+pSize.Width(), dest.Y() },
                { dest.X()+pSize.Width(), dest.Y()+pSize.Height() },
                { dest.X(), dest.Y()+pSize.Height() }};
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 03e69c96c716..c158129fb6a5 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -4577,7 +4577,8 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst )
 
                     if(0 != aPolyPoly.Count())
                     {
-                        sal_Int16 a, b, nIndex = 0;
+                        sal_Int16 nIndex = 0;
+                        sal_uInt16 a, b;
                         sal_uInt32 nDistance = 0xffffffff;
 
                         for ( a = 0; a < aPolyPoly.Count(); a++ )
diff --git a/libreofficekit/qa/tilebench/tilebench.cxx b/libreofficekit/qa/tilebench/tilebench.cxx
index 8f1a2f793494..61d337f6c518 100644
--- a/libreofficekit/qa/tilebench/tilebench.cxx
+++ b/libreofficekit/qa/tilebench/tilebench.cxx
@@ -178,9 +178,9 @@ static void testTile( Document *pDocument, int max_parts,
             // Estimate the maximum tiles based on the number of parts requested, if Writer.
             int nMaxTiles = max_tiles;
             int nTiles = 0;
-            for (int nY = 0; nY < nHeight - 1; nY += nTilePixelHeight)
+            for (long nY = 0; nY < nHeight - 1; nY += nTilePixelHeight)
             {
-                for (int nX = 0; nX < nWidth - 1; nX += nTilePixelWidth)
+                for (long nX = 0; nX < nWidth - 1; nX += nTilePixelWidth)
                 {
                     if (nMaxTiles >= 0 && nTiles >= nMaxTiles)
                     {
@@ -190,7 +190,7 @@ static void testTile( Document *pDocument, int max_parts,
                     pDocument->paintTile(pPixels, nTilePixelWidth, nTilePixelHeight,
                                          nX, nY, nTilePixelWidth, nTilePixelHeight);
                     nTiles++;
-                    fprintf (stderr, "   rendered 1:1 tile %d at %d, %d\n",
+                    fprintf (stderr, "   rendered 1:1 tile %d at %ld, %ld\n",
                              nTiles, nX, nY);
                 }
             }
@@ -203,9 +203,9 @@ static void testTile( Document *pDocument, int max_parts,
             if (pDocument->getDocumentType() == LOK_DOCTYPE_TEXT)
                 nMaxTiles = static_cast<int>(ceil(max_parts * 16128. / nTileTwipHeight) * ceil(static_cast<double>(nWidth) / nTileTwipWidth));
             int nTiles = 0;
-            for (int nY = 0; nY < nHeight - 1; nY += nTileTwipHeight)
+            for (long nY = 0; nY < nHeight - 1; nY += nTileTwipHeight)
             {
-                for (int nX = 0; nX < nWidth - 1; nX += nTileTwipWidth)
+                for (long nX = 0; nX < nWidth - 1; nX += nTileTwipWidth)
                 {
                     if (nMaxTiles >= 0 && nTiles >= nMaxTiles)
                     {
@@ -215,7 +215,7 @@ static void testTile( Document *pDocument, int max_parts,
                     pDocument->paintTile(pPixels, nTilePixelWidth, nTilePixelHeight,
                                          nX, nY, nTileTwipWidth, nTileTwipHeight);
                     nTiles++;
-                    fprintf (stderr, "   rendered scaled tile %d at %d, %d\n",
+                    fprintf (stderr, "   rendered scaled tile %d at %ld, %ld\n",
                              nTiles, nX, nY);
                 }
             }
diff --git a/lotuswordpro/source/filter/lwpnumericfmt.cxx b/lotuswordpro/source/filter/lwpnumericfmt.cxx
index 313c3c3d275e..e70ae6d04208 100644
--- a/lotuswordpro/source/filter/lwpnumericfmt.cxx
+++ b/lotuswordpro/source/filter/lwpnumericfmt.cxx
@@ -371,7 +371,7 @@ OUString    LwpNumericFormat::reencode(const OUString& sCode)
     const sal_Unicode * pString = sCode.getStr();
     sal_uInt16 nLen = sCode.getLength();
     bool bFound = false;
-    sal_uInt16 i;
+    sal_Int32 i;
     std::unique_ptr<sal_Unicode[]> pBuff( new sal_Unicode[sCode.getLength()] );
 
     for (i=0; i< sCode.getLength() - 1; i++)
diff --git a/opencl/source/opencl_device.cxx b/opencl/source/opencl_device.cxx
index c4de9284c8df..7cb34fe60410 100644
--- a/opencl/source/opencl_device.cxx
+++ b/opencl/source/opencl_device.cxx
@@ -410,7 +410,7 @@ ds_status pickBestDevice(std::unique_ptr<ds_profile> const & profile, int& rBest
 int matchDevice(std::unique_ptr<ds_profile> const & profile, char* deviceName)
 {
     int deviceMatch = -1;
-    for (unsigned int d = 0; d < profile->devices.size() - 1; d++)
+    for (size_t d = 0; d < profile->devices.size() - 1; d++)
     {
         if (profile->devices[d].sDeviceName.indexOf(deviceName) != -1)
             deviceMatch = d;
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 7c9c6baa3e88..85c8940c18b1 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1451,7 +1451,7 @@ public:
 
         ss << "\tint i;\n\t";
         ss << "int currentCount0;\n";
-        for (unsigned i = 0; i < vSubArguments.size() - 1; i++)
+        for (size_t i = 0; i < vSubArguments.size() - 1; i++)
             ss << "int currentCount" << i + 1 << ";\n";
         std::stringstream temp3, temp4;
         int outLoopSize = UNROLLING_FACTOR;
diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 0db8757af207..1ed5892abd29 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -1224,7 +1224,7 @@ public:
                 {
                     if (mbFirst)
                     {
-                        for (auto i = 0u; i < mpOp->size(); ++i)
+                        for (size_t i = 0u; i < mpOp->size(); ++i)
                         {
                             (*(*mpOp)[i])(maRes[i].mfFirst, *it);
                         }
@@ -1232,7 +1232,7 @@ public:
                     }
                     else
                     {
-                        for (auto i = 0u; i < mpOp->size(); ++i)
+                        for (size_t i = 0u; i < mpOp->size(); ++i)
                         {
                             (*(*mpOp)[i])(maRes[i].mfRest, *it);
                         }
@@ -1251,7 +1251,7 @@ public:
                 {
                     if (mbFirst)
                     {
-                        for (auto i = 0u; i < mpOp->size(); ++i)
+                        for (size_t i = 0u; i < mpOp->size(); ++i)
                         {
                             (*(*mpOp)[i])(maRes[i].mfFirst, *it);
                         }
@@ -1259,7 +1259,7 @@ public:
                     }
                     else
                     {
-                        for (auto i = 0u; i < mpOp->size(); ++i)
+                        for (size_t i = 0u; i < mpOp->size(); ++i)
                         {
                             (*(*mpOp)[i])(maRes[i].mfRest, *it);
                         }
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx
index 9bd869bc8c95..3d05ac068921 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -538,7 +538,7 @@ double GetYearFrac( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEndDat
                 {
                     // return average of days in year between nDate1 and nDate2, inclusive
                     sal_Int32 nDayCount = 0;
-                    for ( sal_Int16 i = nYear1; i <= nYear2; i++ )
+                    for ( sal_uInt16 i = nYear1; i <= nYear2; i++ )
                         nDayCount += ( IsLeapYear( i ) ? 366 : 365 );
 
                     nDaysInYear = static_cast<double>(nDayCount) / static_cast<double>( nYear2 - nYear1 + 1 );
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index 43cfd1ff0120..b48fc648ea04 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -237,7 +237,7 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF
             if( nBytes > 5 )
             {
                 const sal_Int8* pBytes = aBuf.getConstArray();
-                for( unsigned int i = 0; i < nBytes-5; i++ )
+                for( sal_uInt64 i = 0; i < nBytes-5; i++ )
                 {
                     if( pBytes[i]   == '%' &&
                         pBytes[i+1] == 'P' &&
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index 7d176ebdfc16..7bc541c3b1bd 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -1189,7 +1189,7 @@ static bool check_user_password( const OString& rPwd, PDFFileImplData* pData )
         for( int i = 1; i <= 19; i++ ) // do it 19 times, start with 1
         {
             sal_uInt8 aTempKey[ENCRYPTION_KEY_LEN];
-            for( sal_uInt32 j = 0; j < sizeof(aTempKey); j++ )
+            for( size_t j = 0; j < sizeof(aTempKey); j++ )
                 aTempKey[j] = static_cast<sal_uInt8>( aKey[j] ^ i );
 
             if (rtl_cipher_initARCFOUR( pData->m_aCipher, rtl_Cipher_DirectionEncode,
@@ -1257,7 +1257,7 @@ bool PDFFile::setupDecryptionData( const OString& rPwd ) const
             for( int i = 19; i >= 0; i-- )
             {
                 sal_uInt8 nTempKey[ENCRYPTION_KEY_LEN];
-                for( unsigned int j = 0; j < sizeof(nTempKey); j++ )
+                for( size_t j = 0; j < sizeof(nTempKey); j++ )
                     nTempKey[j] = sal_uInt8(aKey[j] ^ i);
                 if (rtl_cipher_initARCFOUR( m_pData->m_aCipher, rtl_Cipher_DirectionDecode,
                                             nTempKey, nKeyLen, nullptr, 0 )
diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
index 16db05afe870..28334dac56d8 100644
--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
+++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx
@@ -81,7 +81,7 @@ int main(int argc, char **argv)
         aPwBuf[0] = 0; // mark as empty
     else
     {
-        for( unsigned int i = 0; i < sizeof(aPwBuf); i++ )
+        for( size_t i = 0; i < sizeof(aPwBuf); i++ )
         {
             if( aPwBuf[i] == '\n' )
             {
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index c7d01aae0375..8e45f70f7212 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2215,7 +2215,7 @@ void lcl_GetOutputStringScientific(double fNumber, sal_uInt16 nCharCount,
 
 OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo &rInfo, sal_uInt16 nCnt)
 {
-    sal_uInt16 i;
+    sal_Int32 i;
     OUStringBuffer aDenominatorString;
     for( i = 0; i < nCnt; i++ )
     {
@@ -2237,7 +2237,7 @@ OUString lcl_GetDenominatorString(const ImpSvNumberformatInfo &rInfo, sal_uInt16
 
 OUString lcl_GetNumeratorString(const ImpSvNumberformatInfo &rInfo, sal_uInt16 nCnt)
 {
-    sal_Int16 i;
+    sal_Int32 i;
     OUStringBuffer aNumeratorString;
     for( i = 0; i < nCnt; i++ )
     {
@@ -2255,7 +2255,7 @@ OUString lcl_GetNumeratorString(const ImpSvNumberformatInfo &rInfo, sal_uInt16 n
 
 OUString lcl_GetFractionIntegerString(const ImpSvNumberformatInfo &rInfo, sal_uInt16 nCnt)
 {
-    sal_Int16 i;
+    sal_Int32 i;
     OUStringBuffer aIntegerString;
     for( i = 0; i < nCnt; i++ )
     {
@@ -2274,7 +2274,7 @@ OUString lcl_GetFractionIntegerString(const ImpSvNumberformatInfo &rInfo, sal_uI
 
 OUString lcl_GetIntegerFractionDelimiterString(const ImpSvNumberformatInfo &rInfo, sal_uInt16 nCnt)
 {
-    sal_Int16 i;
+    sal_uInt16 i;
     for( i = 0; i < nCnt; i++ )
     {
         if( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_FRACBLANK )
diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx
index db5d4f29e22e..124fbe61da3f 100644
--- a/svx/source/dialog/ClassificationDialog.cxx
+++ b/svx/source/dialog/ClassificationDialog.cxx
@@ -506,7 +506,7 @@ void ClassificationDialog::toggleWidgetsDependingOnCategory()
     for (sal_Int32 nParagraph = 0; nParagraph < rEditEngine.GetParagraphCount(); ++nParagraph)
     {
         sal_uInt16 nFieldCount = rEditEngine.GetFieldCount(nParagraph);
-        for (sal_Int16 nField = 0; nField < nFieldCount; ++nField)
+        for (sal_uInt16 nField = 0; nField < nFieldCount; ++nField)
         {
             EFieldInfo aFieldInfo = rEditEngine.GetFieldInfo(nParagraph, nField);
             if (aFieldInfo.pFieldItem)
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 795df4e6c1b9..83c7aad998a9 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -245,7 +245,7 @@ void SearchAttrItemList::Remove(size_t nPos)
     if ( nPos + nLen > size() )
         nLen = size() - nPos;
 
-    for ( sal_uInt16 i = nPos; i < nPos + nLen; ++i )
+    for ( size_t i = nPos; i < nPos + nLen; ++i )
         if ( !IsInvalidItem( (*this)[i].pItem ) )
             delete (*this)[i].pItem;
 
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index af26b6ebe48d..1fa955469697 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -3518,7 +3518,7 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const
                 lFences = mpBorders[nCol].nWidth;
             }
 
-            for(sal_uInt16 i = nStart; i < mpBorders.size() - 1; ++i)
+            for(size_t i = nStart; i < mpBorders.size() - 1; ++i)
             {
                 long lWidth = mpBorders[i].nPos - lOldPos;
                 lColumns += lWidth;
@@ -3599,7 +3599,7 @@ long SvxRuler::CalcPropMaxRight(sal_uInt16 nCol) const
         else
         {
             long lWidth = 0;
-            for(sal_uInt16 i = nCol; i < mpBorders.size() - 1; i++)
+            for(size_t i = nCol; i < mpBorders.size() - 1; i++)
             {
                 lWidth += glMinFrame + mpBorders[i].nWidth;
             }
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 2390f17f362c..c3a202a06be7 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1318,7 +1318,7 @@ bool FmXFormShell::canConvertCurrentSelectionToControl_Lock(const OString& rIden
 
 void FmXFormShell::checkControlConversionSlotsForCurrentSelection_Lock(Menu& rMenu)
 {
-    for (sal_Int16 i = 0; i < rMenu.GetItemCount(); ++i)
+    for (sal_uInt16 i = 0; i < rMenu.GetItemCount(); ++i)
     {
         // the context is already of a type that corresponds to the entry -> disable
         const sal_uInt16 nId = rMenu.GetItemId(i);
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index 1bad79904b2a..442400bdb173 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -600,7 +600,7 @@ bool SwPostItMgr::CalcRects()
             {
                 const unsigned long nNumberOfPages = mPages.size();
                 mPages.reserve(aPageNum);
-                for (unsigned int j=0; j<aPageNum - nNumberOfPages; ++j)
+                for (unsigned long j=0; j<aPageNum - nNumberOfPages; ++j)
                     mPages.emplace_back( new SwPostItPageItem());
             }
             mPages[aPageNum-1]->mvSidebarItems.push_back(pItem);
@@ -651,7 +651,7 @@ void SwPostItMgr::PreparePageContainer()
     if (lContainerSize < lPageSize)
     {
         mPages.reserve(lPageSize);
-        for (int i=0; i<lPageSize - lContainerSize;i++)
+        for (long i=0; i<lPageSize - lContainerSize;i++)
             mPages.emplace_back( new SwPostItPageItem());
     }
     else if (lContainerSize > lPageSize)
diff --git a/vcl/backendtest/outputdevice/common.cxx b/vcl/backendtest/outputdevice/common.cxx
index 9f69a28fabd3..8124676d93aa 100644
--- a/vcl/backendtest/outputdevice/common.cxx
+++ b/vcl/backendtest/outputdevice/common.cxx
@@ -111,7 +111,7 @@ TestResult checkHorizontalVerticalDiagonalLines(Bitmap& rBitmap, Color aExpected
         checkValue(pAccess, startX, y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh);
         checkValue(pAccess, endX,   y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh);
 
-        for (int x = startX + 1; x <= endX - 1; x++)
+        for (long x = startX + 1; x <= endX - 1; x++)
         {
             checkValue(pAccess, x, y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, false, nColorThresh);
         }
@@ -127,7 +127,7 @@ TestResult checkHorizontalVerticalDiagonalLines(Bitmap& rBitmap, Color aExpected
         checkValue(pAccess, x, startY, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh);
         checkValue(pAccess, x, endY,   aExpectedColor, nNumberOfQuirks, nNumberOfErrors, true, nColorThresh);
 
-        for (int y = startY + 1; y <= endY - 1; y++)
+        for (long y = startY + 1; y <= endY - 1; y++)
         {
             checkValue(pAccess, x, y, aExpectedColor, nNumberOfQuirks, nNumberOfErrors, false, nColorThresh);
         }
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index e42eb3ed3eaa..1921cde62cef 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1657,11 +1657,11 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
     }
     sal_Int32 nStride;
     unsigned char *mask_data = aSurface.getBits(nStride);
-    for (sal_Int32 y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
+    for (long y = rTR.mnSrcY ; y < rTR.mnSrcY + rTR.mnSrcHeight; ++y)
     {
         unsigned char *row = mask_data + (nStride*y);
         unsigned char *data = row + (rTR.mnSrcX * 4);
-        for (sal_Int32 x = rTR.mnSrcX; x < rTR.mnSrcX + rTR.mnSrcWidth; ++x)
+        for (long x = rTR.mnSrcX; x < rTR.mnSrcX + rTR.mnSrcWidth; ++x)
         {
             sal_uInt8 b = unpremultiply(data[SVP_CAIRO_BLUE], data[SVP_CAIRO_ALPHA]);
             sal_uInt8 g = unpremultiply(data[SVP_CAIRO_GREEN], data[SVP_CAIRO_ALPHA]);
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx
index e785aae0aeb7..4a027134402b 100644
--- a/vcl/source/gdi/impvect.cxx
+++ b/vcl/source/gdi/impvect.cxx
@@ -330,7 +330,8 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
             nFirstY = nLastY = maStartPt.Y();
             aArr.ImplSetSize( mnCount << 1 );
 
-            sal_uInt16 i, nPolyPos;
+            sal_uInt16 nPolyPos;
+            sal_uLong i;
             for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
             {
                 const sal_uInt8             cMove = mpCodes[ i ];
@@ -437,7 +438,8 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag )
             nFirstY = nLastY = maStartPt.Y();
             aArr.ImplSetSize( mnCount << 1 );
 
-            sal_uInt16 i, nPolyPos;
+            sal_uInt16 nPolyPos;
+            sal_uLong i;
             for( i = 0, nPolyPos = 0; i < ( mnCount - 1 ); i++ )
             {
                 const sal_uInt8             cMove = mpCodes[ i ];
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 660795082c94..82f99a33cd00 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -1398,7 +1398,8 @@ bool PDFWriterImpl::computeODictionaryValue( const sal_uInt8* i_pPaddedOwnerPass
             //Step 7, only if 128 bit
             if( i_nKeyLength == SECUR_128BIT_KEY )
             {
-                sal_uInt32 i, y;
+                sal_uInt32 i;
+                size_t y;
                 sal_uInt8 nLocalKey[ SECUR_128BIT_KEY ]; // 16 = 128 bit key
 
                 for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
@@ -1472,7 +1473,8 @@ bool PDFWriterImpl::computeUDictionaryValue( EncHashTransporter* i_pTransporter,
             rtl_cipher_encodeARCFOUR( aCipher, nMD5Sum.data(), nMD5Sum.size(), // the data to be encrypted
                                       &io_rProperties.UValue[0], SECUR_128BIT_KEY ); //encrypted data, stored in class data member
             //step 5
-            sal_uInt32 i, y;
+            sal_uInt32 i;
+            size_t y;
             sal_uInt8 nLocalKey[SECUR_128BIT_KEY];
 
             for( i = 1; i <= 19; i++ ) // do it 19 times, start with 1
diff --git a/vcl/source/gdi/regionband.cxx b/vcl/source/gdi/regionband.cxx
index 4cfee2a8d503..28ff3fc79945 100644
--- a/vcl/source/gdi/regionband.cxx
+++ b/vcl/source/gdi/regionband.cxx
@@ -419,7 +419,7 @@ void RegionBand::CreateBandRange(long nYTop, long nYBottom)
     mpLastCheckedBand = mpFirstBand;
     ImplRegionBand* pBand = mpFirstBand;
 
-    for ( int i = nYTop; i <= nYBottom+1; i++ )
+    for ( long i = nYTop; i <= nYBottom+1; i++ )
     {
         // create new band
         ImplRegionBand* pNewBand = new ImplRegionBand( i, i );
diff --git a/vcl/win/gdi/salgdi2.cxx b/vcl/win/gdi/salgdi2.cxx
index 2e2d3469e8bd..4167d1a78c39 100644
--- a/vcl/win/gdi/salgdi2.cxx
+++ b/vcl/win/gdi/salgdi2.cxx
@@ -100,7 +100,7 @@ public:
 
     void convertScanline(sal_uInt8* pSource, sal_uInt8* pDestination)
     {
-        for (int x = 0; x < mnScanlineSize; x += mnComponentSize)
+        for (long x = 0; x < mnScanlineSize; x += mnComponentSize)
         {
             for (int i = 0; i < mnComponentSize; ++i)
             {
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index 01a90065dde0..8abdff2ac1cc 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -1861,8 +1861,8 @@ static XAccessible* getTheParentOfMember(XAccessible* pXAcc)
     }
     Reference<XAccessibleContext> pRContext = pXAcc->getAccessibleContext();
     Reference<XAccessibleRelationSet> pRrelationSet = pRContext->getAccessibleRelationSet();
-    long nRelations = pRrelationSet->getRelationCount();
-    for(int i=0 ; i<nRelations ; i++)
+    sal_Int32 nRelations = pRrelationSet->getRelationCount();
+    for(sal_Int32 i=0 ; i<nRelations ; i++)
     {
         AccessibleRelation accRelation = pRrelationSet->getRelation(i);
         if(accRelation.RelationType == 7)


More information about the Libreoffice-commits mailing list