[Libreoffice-commits] .: sc/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sun Apr 15 13:44:26 PDT 2012


 sc/source/core/tool/defaultsoptions.cxx |    2 +-
 sc/source/core/tool/formulaopt.cxx      |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 0b468babb2aab1cc2910e2ad967584b6ea34b698
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Apr 15 22:42:30 2012 +0200

    Fix 2 "scope of the variable can be reduced"

diff --git a/sc/source/core/tool/defaultsoptions.cxx b/sc/source/core/tool/defaultsoptions.cxx
index f582c10..0bf9e1a 100644
--- a/sc/source/core/tool/defaultsoptions.cxx
+++ b/sc/source/core/tool/defaultsoptions.cxx
@@ -147,7 +147,6 @@ Sequence<OUString> ScDefaultsCfg::GetPropertyNames()
 ScDefaultsCfg::ScDefaultsCfg() :
     ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_FORMULA )) )
 {
-    sal_Int32 nIntVal = 0;
     OUString aPrefix;
 
     Sequence<OUString> aNames = GetPropertyNames();
@@ -156,6 +155,7 @@ ScDefaultsCfg::ScDefaultsCfg() :
     OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
     if(aValues.getLength() == aNames.getLength())
     {
+        sal_Int32 nIntVal = 0;
         for(int nProp = 0; nProp < aNames.getLength(); nProp++)
         {
             OSL_ENSURE(pValues[nProp].hasValue(), "property value missing");
diff --git a/sc/source/core/tool/formulaopt.cxx b/sc/source/core/tool/formulaopt.cxx
index 3d2e55d..dab52bf 100644
--- a/sc/source/core/tool/formulaopt.cxx
+++ b/sc/source/core/tool/formulaopt.cxx
@@ -229,14 +229,13 @@ Sequence<OUString> ScFormulaCfg::GetPropertyNames()
 ScFormulaCfg::ScFormulaCfg() :
     ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM( CFGPATH_FORMULA )) )
 {
-    sal_Int32 nIntVal = 0;
-
     Sequence<OUString> aNames = GetPropertyNames();
     Sequence<Any> aValues = GetProperties(aNames);
     const Any* pValues = aValues.getConstArray();
     OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
     if(aValues.getLength() == aNames.getLength())
     {
+        sal_Int32 nIntVal = 0;
         for(int nProp = 0; nProp < aNames.getLength(); nProp++)
         {
             OSL_ENSURE(pValues[nProp].hasValue(), "property value missing");


More information about the Libreoffice-commits mailing list