[Libreoffice-commits] .: sw/source

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Sat Jan 8 19:56:38 PST 2011


 sw/source/core/doc/doc.cxx         |    3 +--
 sw/source/core/docnode/nodes.cxx   |    2 +-
 sw/source/core/unocore/unocoll.cxx |    2 +-
 sw/source/ui/docvw/PostItMgr.cxx   |    4 ++--
 4 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit c710c01c7245afddd63c9c2e1c135212a501c1b3
Author: Kayo Hamid <kayo.hamid at gekkolinux.com.br>
Date:   Sat Jan 8 21:56:24 2011 -0600

    cppcheck: reduce variables scope

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 1436f6e..73ad556 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1246,7 +1246,6 @@ void SwDoc::CalculatePagesForPrinting(
 
     USHORT nFirstPageNo = 0;
     USHORT nLastPageNo  = 0;
-    USHORT nPageNo      = 1;
 
     for( USHORT i = 1; i <= (USHORT)aPages.Max(); ++i )
     {
@@ -1293,7 +1292,7 @@ void SwDoc::CalculatePagesForPrinting(
         aMulti = aTmpMulti;
 // Ende des HACKs
 
-        nPageNo = nFirstPageNo;
+        USHORT nPageNo = nFirstPageNo;
 
         std::map< sal_Int32, sal_Int32 > &rPrinterPaperTrays = rData.GetPrinterPaperTrays();
         std::set< sal_Int32 > &rValidPages = rData.GetValidPagesSet();
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index 944d2ff..221851a 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -1629,7 +1629,6 @@ BOOL SwNodes::CheckNodesRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd
 *************************************************************************/
 void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
 {
-    int bUpdateNum = 0;
     ULONG nSttIdx = rStart.GetIndex();
 
     if( !nSttIdx && nCnt == GetEndOfContent().GetIndex()+1 )
@@ -1657,6 +1656,7 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, ULONG nCnt )
     }
     else
     {
+        int bUpdateNum = 0;
         for( ULONG n = nSttIdx, nEnd = nSttIdx + nCnt; n < nEnd; ++n )
         {
             SwNode* pNd = (*this)[ n ];
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index f19d8bf..e04aa7b 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1819,12 +1819,12 @@ uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex)
 {
     SolarMutexGuard aGuard;
     uno::Any aRet;
-    sal_Int32 nCount = 0;
     if(IsValid())
     {
         sal_uInt16 n, nFtnCnt = GetDoc()->GetFtnIdxs().Count();
         SwTxtFtn* pTxtFtn;
         uno::Reference< XFootnote >  xRef;
+        sal_Int32 nCount = 0;
         for( n = 0; n < nFtnCnt; ++n )
         {
             pTxtFtn = GetDoc()->GetFtnIdxs()[ n ];
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index e06d558..83968df 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -950,9 +950,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
     long			lTopBorder		= rBorder.Top() + 5;
     long			lBottomBorder	= rBorder.Bottom() - 5;
     const long		lVisibleHeight	= lBottomBorder - lTopBorder; //rBorder.GetHeight() ;
-    long			lSpaceUsed		= 0;
     long			lTranslatePos	= 0;
-    int				loop			= 0;
     bool			bDone			= false;
     bool			bScrollbars		= false;
 
@@ -982,6 +980,8 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons
     //start the real layout so nothing overlaps anymore
     if (aVisiblePostItList.size()>1)
     {
+        long lSpaceUsed = 0;
+        int	 loop = 0;
         // if no window is moved anymore we are finished
         while (!bDone)
         {


More information about the Libreoffice-commits mailing list