[Libreoffice-commits] .: sw/source

Julien Nabet serval2412 at kemper.freedesktop.org
Tue Feb 1 14:41:00 PST 2011


 sw/source/core/unocore/unochart.cxx |    2 +-
 sw/source/core/unocore/unosrch.cxx  |    2 +-
 sw/source/core/unocore/unotbl.cxx   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 56156e02fac715ac7d95e773b5587b9077525084
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Feb 1 23:40:19 2011 +0100

    Cppcheck Reduce scope of variables

diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index dad4d46..32ff37e 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -1717,9 +1717,9 @@ void SwChartDataProvider::AddRowCols(
     SwTableBox* pFirstBox	= *( rBoxes.GetData() + 0 );
     SwTableBox* pLastBox	= *( rBoxes.GetData() + nBoxes - 1 );
 
-    sal_Int32 nFirstCol = -1, nFirstRow = -1, nLastCol = -1, nLastRow = -1;
     if (pFirstBox && pLastBox)
     {
+        sal_Int32 nFirstCol = -1, nFirstRow = -1, nLastCol = -1, nLastRow = -1;
         lcl_GetCellPosition( pFirstBox->GetName(), nFirstCol, nFirstRow  );
         lcl_GetCellPosition( pLastBox->GetName(),  nLastCol,  nLastRow );
 
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 72fcad4..bc025c4 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -527,9 +527,9 @@ uno::Any SwXTextSearch::getPropertyValue(const OUString& rPropertyName) throw( b
 
     const SfxItemPropertySimpleEntry*  pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName);
     sal_Bool bSet = sal_False;
-    sal_Int16 nSet = 0;
     if(pEntry)
     {
+        sal_Int16 nSet = 0;
         switch(pEntry->nWID)
         {
             case WID_SEARCH_ALL :			bSet = bAll; goto SET_BOOL;
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 8cb8dd7..52375ca 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -167,10 +167,10 @@ void lcl_SetSpecialProperty(SwFrmFmt* pFmt, const SfxItemPropertySimpleEntry* pE
         case  FN_TABLE_WIDTH:
         case  FN_TABLE_RELATIVE_WIDTH:
         {
-            sal_Int32 nWidth = 0;
             SwFmtFrmSize aSz( pFmt->GetFrmSize() );
             if(FN_TABLE_WIDTH == pEntry->nWID)
             {
+                sal_Int32 nWidth = 0;
                 aValue >>= nWidth;
                 aSz.SetWidthPercent(0);
                 aSz.SetWidth ( MM100_TO_TWIP ( nWidth ) );


More information about the Libreoffice-commits mailing list