[Libreoffice-commits] .: sc/source tools/source vcl/unx

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 29 09:28:24 PST 2012


 sc/source/core/data/column2.cxx         |    2 +-
 sc/source/core/data/conditio.cxx        |    5 ++---
 sc/source/core/data/documen8.cxx        |    5 ++---
 sc/source/core/data/fillinfo.cxx        |    2 +-
 sc/source/ui/condformat/colorformat.cxx |    3 +--
 tools/source/inet/inetstrm.cxx          |    2 +-
 vcl/unx/generic/printer/ppdparser.cxx   |    2 +-
 7 files changed, 9 insertions(+), 12 deletions(-)

New commits:
commit c4b2921fc21eed2ec7a5333a3d24cdba46be1203
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Dec 29 18:25:56 2012 +0100

    Some cppcheck cleaning
    
    Change-Id: Id027823617d2328b9e827268825812634731a828

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 2bdb401..42f6cd0 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1221,10 +1221,10 @@ bool ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const
 SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const
 {
     SCSIZE nLines = 0;
-    bool bFound = false;
     SCSIZE i;
     if ( !maItems.empty() )
     {
+        bool bFound = false;
         if (eDir == DIR_BOTTOM)
         {
             i = maItems.size();
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 016c5e9..d2206ba 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -527,11 +527,9 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode,
     bool bInsertTab = ( eUpdateRefMode == URM_INSDEL && nDz >= 1 );
     bool bDeleteTab = ( eUpdateRefMode == URM_INSDEL && nDz <= -1 );
 
-    bool bChanged1 = false;
-    bool bChanged2 = false;
-
     if (pFormula1)
     {
+        bool bChanged1 = false;
         if ( bInsertTab )
             lcl_CondUpdateInsertTab( *pFormula1, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged1, nDz );
         else
@@ -553,6 +551,7 @@ void ScConditionEntry::UpdateReference( UpdateRefMode eUpdateRefMode,
     }
     if (pFormula2)
     {
+        bool bChanged2 = false;
         if ( bInsertTab )
             lcl_CondUpdateInsertTab( *pFormula2, rRange.aStart.Tab(), aSrcPos.Tab(), bChanged2, nDz );
         else
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index b83b63f..d36453b 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -449,8 +449,6 @@ bool ScDocument::IdleCalcTextWidth()            // true = demnaechst wieder vers
     ScStyleSheet*       pStyle   = NULL;
     ScColumnIterator*   pColIter = NULL;
     ScTable*            pTable   = NULL;
-    ScColumn*           pColumn  = NULL;
-    ScBaseCell*         pCell    = NULL;
     SCTAB               nTab     = aCurTextWidthCalcPos.Tab();
     SCROW               nRow     = aCurTextWidthCalcPos.Row();
     SCsCOL              nCol     = aCurTextWidthCalcPos.Col();
@@ -484,10 +482,11 @@ bool ScDocument::IdleCalcTextWidth()            // true = demnaechst wieder vers
         sal_uInt16 nRestart = 0;
         sal_uInt16 nZoom = 0;
         sal_uInt16 nCount = 0;
+        ScBaseCell* pCell = NULL;
 
         nZoom    = GET_SCALEVALUE(pStyle->GetItemSet(),ATTR_PAGE_SCALE);
         Fraction aZoomFract( nZoom, 100 );
-        pColumn  = &pTable->aCol[nCol];
+        ScColumn* pColumn  = &pTable->aCol[nCol];
         pColIter = new ScColumnIterator( pColumn, nRow, MAXROW );
 
         while ( (nZoom > 0) && (nCount < CALCMAX) && (nRestart < 2) )
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx
index d950164..53ff7bb 100644
--- a/sc/source/core/data/fillinfo.cxx
+++ b/sc/source/core/data/fillinfo.cxx
@@ -599,13 +599,13 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX
                     {
                         //  Blockmarken
                         const ScMarkArray* pThisMarkArr = pMarkData->GetArray()+nX;
-                        bool bThisMarked;
                         nArrY = 1;
                         nCurRow = nY1;                                      // einzelne Zeile
                         nThisRow = nY1;                                     // Ende des Bereichs
 
                         if ( pThisMarkArr->Search( nY1, nIndex ) )
                         {
+                            bool bThisMarked;
                             do
                             {
                                 nThisRow=pThisMarkArr->pData[nIndex].nRow;      // Ende des Bereichs
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index bda89a4..581954c 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -136,14 +136,13 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma
 void ScDataBarSettingsDlg::Init()
 {
     SfxObjectShell*     pDocSh      = SfxObjectShell::Current();
-    const SfxPoolItem*  pItem       = NULL;
     XColorListRef       pColorTable;
 
     DBG_ASSERT( pDocSh, "DocShell not found!" );
 
     if ( pDocSh )
     {
-        pItem = pDocSh->GetItem( SID_COLOR_TABLE );
+        const SfxPoolItem*  pItem = pDocSh->GetItem( SID_COLOR_TABLE );
         if ( pItem != NULL )
             pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
     }
diff --git a/tools/source/inet/inetstrm.cxx b/tools/source/inet/inetstrm.cxx
index 1812a99..fb1c462 100644
--- a/tools/source/inet/inetstrm.cxx
+++ b/tools/source/inet/inetstrm.cxx
@@ -1480,10 +1480,10 @@ int INetMIMEMessageStream::PutMsgLine (const sal_Char *pData, sal_uIntPtr nSize)
 
                 const sal_Char* pChar;
                 const sal_Char* pOldPos;
+                int status;
                 for( pOldPos = pChar = (const sal_Char *) pMsgBuffer->GetData(); nBufSize--;
                      pChar++ )
                 {
-                    int status;
                     if( *pChar == '\r' || *pChar == '\n' )
                     {
                         if( aDelim.compareTo(pOldPos, aDelim.getLength())
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index d746b72..5dccb6f 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -682,9 +682,9 @@ PPDParser::PPDParser( const String& rFile ) :
     // read in the file
     std::list< rtl::OString > aLines;
     PPDDecompressStream aStream( m_aFile );
-    bool bLanguageEncoding = false;
     if( aStream.IsOpen() )
     {
+        bool bLanguageEncoding = false;
         while( ! aStream.IsEof() )
         {
             rtl::OString aCurLine = aStream.ReadLine();


More information about the Libreoffice-commits mailing list