[Libreoffice-commits] core.git: sc/source

Stephan Bergmann sbergman at redhat.com
Tue Mar 7 18:58:15 UTC 2017


 sc/source/core/data/documen8.cxx           |    2 +-
 sc/source/core/tool/dbdata.cxx             |    7 +++----
 sc/source/filter/qpro/qproform.cxx         |    6 +++---
 sc/source/filter/xml/xmlimprt.cxx          |    2 +-
 sc/source/filter/xml/xmlstyle.cxx          |    2 +-
 sc/source/ui/drawfunc/fuconcustomshape.cxx |    3 +--
 sc/source/ui/miscdlgs/mvtabdlg.cxx         |    2 +-
 sc/source/ui/pagedlg/areasdlg.cxx          |    2 +-
 sc/source/ui/undo/undotab.cxx              |    8 +++-----
 9 files changed, 15 insertions(+), 19 deletions(-)

New commits:
commit 5b805de10a1b05647b616e726f0a8b88ff30ae77
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 7 19:57:02 2017 +0100

    loplugin:loopvartoosmall
    
    Change-Id: I81b56ad2a32ef61a514d5e6e9f45c3f956126040

diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 59c611e..2472f4a 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1068,7 +1068,7 @@ void ScDocument::DeleteAreaLinksOnTab( SCTAB nTab )
         return;
 
     const ::sfx2::SvBaseLinks& rLinks = pMgr->GetLinks();
-    sal_uInt16 nPos = 0;
+    sfx2::SvBaseLinks::size_type nPos = 0;
     while ( nPos < rLinks.size() )
     {
         const ::sfx2::SvBaseLink* pBase = rLinks[nPos].get();
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 2b7b05a..ebfa420 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -343,14 +343,13 @@ void ScDBData::SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW
 
 void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
 {
-    sal_uInt16 i;
     long nDifX = ((long) nCol1) - ((long) nStartCol);
     long nDifY = ((long) nRow1) - ((long) nStartRow);
 
     long nSortDif = bByRow ? nDifX : nDifY;
     long nSortEnd = bByRow ? static_cast<long>(nCol2) : static_cast<long>(nRow2);
 
-    for (i=0; i<mpSortParam->GetSortKeyCount(); i++)
+    for (sal_uInt16 i=0; i<mpSortParam->GetSortKeyCount(); i++)
     {
         mpSortParam->maKeyState[i].nField += nSortDif;
         if (mpSortParam->maKeyState[i].nField > nSortEnd)
@@ -361,7 +360,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
     }
 
     SCSIZE nCount = mpQueryParam->GetEntryCount();
-    for (i = 0; i < nCount; ++i)
+    for (SCSIZE i = 0; i < nCount; ++i)
     {
         ScQueryEntry& rEntry = mpQueryParam->GetEntry(i);
         rEntry.nField += nDifX;
@@ -371,7 +370,7 @@ void ScDBData::MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW n
             rEntry.bDoQuery = false;
         }
     }
-    for (i=0; i<MAXSUBTOTAL; i++)
+    for (sal_uInt16 i=0; i<MAXSUBTOTAL; i++)
     {
         mpSubTotal->nField[i] = sal::static_int_cast<SCCOL>( mpSubTotal->nField[i] + nDifX );
         if (mpSubTotal->nField[i] > nCol2)
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index 380d63f..4ec3f38 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -174,7 +174,7 @@ do { \
 
 ConvErr QProToSc::Convert( const ScTokenArray*& pArray )
 {
-    sal_uInt8 nFmla[ nBufSize ], i, nArg;
+    sal_uInt8 nFmla[ nBufSize ], nArg;
     sal_uInt8 nArgArray[ nBufSize ] = {0};
     sal_Int8 nCol, nPage;
     sal_uInt16 nInt, nIntCount = 0, nStringCount = 0, nFloatCount = 0, nDLLCount = 0, nArgCount = 0;
@@ -197,7 +197,7 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray )
 
     if( nRef < nBufSize )
     {
-        for( i=0; i < nRef; i++)
+        for( sal_uInt16 i=0; i < nRef; i++)
         {
             maIn.ReadUChar( nFmla[i] );
 
@@ -239,7 +239,7 @@ ConvErr QProToSc::Convert( const ScTokenArray*& pArray )
     else
         return ConvErr::Count;
 
-    i = 0;
+    sal_uInt16 i = 0;
     nIntCount = 0;
     nFloatCount = 0;
     nDLLCount = 0;
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index 34208af..54b7ace 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -3123,7 +3123,7 @@ sal_Int32 ScXMLImport::GetRangeType(const OUString& sRangeType)
 {
     sal_Int32 nRangeType(0);
     OUStringBuffer sBuffer;
-    sal_Int16 i = 0;
+    sal_Int32 i = 0;
     while (i <= sRangeType.getLength())
     {
         if ((i == sRangeType.getLength()) || (sRangeType[i] == ' '))
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index 1777058..de8158b 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -1012,7 +1012,7 @@ bool XmlScPropHdl_CellProtection::importXML(
         }
         else
         {
-            sal_Int16 i(0);
+            sal_Int32 i(0);
             while (i < rStrImpValue.getLength() && rStrImpValue[i] != ' ')
                 ++i;
             OUString sFirst(rStrImpValue.copy(0, i));
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index f49bc8b..eb484b9 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -190,8 +190,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
         std::vector< OUString > aObjList;
         if ( GalleryExplorer::FillObjListTitle( GALLERY_THEME_POWERPOINT, aObjList ) )
         {
-            sal_uInt16 i;
-            for ( i = 0; i < aObjList.size(); i++ )
+            for ( std::vector<OUString>::size_type i = 0; i < aObjList.size(); i++ )
             {
                 if ( aObjList[ i ].equalsIgnoreAsciiCase( aCustomShape ) )
                 {
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index fc0240a..2a64d87 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -163,7 +163,7 @@ void ScMoveTableDlg::CheckNewTabName()
     bool bMoveInCurrentDoc = pBtnMove->IsChecked() && pLbDoc->GetSelectEntryPos() == mnCurrentDocPos;
     bool bFound = false;
     const sal_Int32 nLast = pLbTable->GetEntryCount();
-    for ( sal_uInt16 i=0; i<nLast && !bFound; ++i )
+    for ( sal_Int32 i=0; i<nLast && !bFound; ++i )
     {
         if ( aNewName.equals(pLbTable->GetEntry(i)) )
         {
diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx
index b0561f2..1bc76f6 100644
--- a/sc/source/ui/pagedlg/areasdlg.cxx
+++ b/sc/source/ui/pagedlg/areasdlg.cxx
@@ -602,7 +602,7 @@ IMPL_LINK( ScPrintAreasDlg, Impl_ModifyHdl, Edit&, rEd, void )
     if ( (nEntryCount > nFirstCustomPos) && !aStrEd.isEmpty() )
     {
         bool    bFound  = false;
-        sal_uInt16 i;
+        sal_Int32 i;
 
         for ( i=nFirstCustomPos; i<nEntryCount && !bFound; i++ )
         {
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 0e54166..49129b1 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -295,15 +295,13 @@ static SCTAB lcl_GetVisibleTabBefore( ScDocument& rDoc, SCTAB nTab )
 void ScUndoDeleteTab::Undo()
 {
     BeginUndo();
-    unsigned int i=0;
     ScDocument& rDoc = pDocShell->GetDocument();
 
     bool bLink = false;
     OUString aName;
 
-    for(i=0; i<theTabs.size(); ++i)
+    for(SCTAB nTab: theTabs)
     {
-        SCTAB nTab = theTabs[i];
         pRefUndoDoc->GetName( nTab, aName );
 
         bDrawIsInUndo = true;
@@ -355,9 +353,9 @@ void ScUndoDeleteTab::Undo()
     if ( pChangeTrack )
         pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
 
-    for(i=0; i<theTabs.size(); ++i)
+    for(SCTAB nTab: theTabs)
     {
-        pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, theTabs[i]) );
+        pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, nTab) );
     }
     SfxApplication* pSfxApp = SfxGetpApp();                                // Navigator
     pSfxApp->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );


More information about the Libreoffice-commits mailing list