diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-20 16:48:11 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2014-12-21 11:36:51 +0100 |
commit | ea5effc3df7b89a9332ea5b1b1e6cd40bf37f081 (patch) | |
tree | 8e73730a6190a094b54e81154b8bc108ab601b26 /sc/source/ui/dbgui | |
parent | 7af4592c1dadbd960453289a94a6156d5c5d76bc (diff) |
fdo#39440 sc: reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: I2eaf9a6792ca2c06a005385ec45c08f1292cba23
Diffstat (limited to 'sc/source/ui/dbgui')
-rw-r--r-- | sc/source/ui/dbgui/filtdlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/foptmgr.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/sfiltdlg.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsubt.cxx | 4 |
5 files changed, 5 insertions, 10 deletions
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index f2776ed5a30d..d98b3e25413b 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -1074,10 +1074,10 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) ScQueryEntry::Item& rItem = rEntry.GetQueryItem(); bool bDoThis = (pLbField->GetSelectEntryPos() != 0); rEntry.bDoQuery = bDoThis; - bool bByEmptyOrNotByEmpty = false; if ( rEntry.bDoQuery || maRefreshExceptQuery[nQE] ) { + bool bByEmptyOrNotByEmpty = false; if ( aStrEmpty.equals(aStrVal) ) { bByEmptyOrNotByEmpty = true; diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx index 4ae721f66544..e1f6f2609775 100644 --- a/sc/source/ui/dbgui/foptmgr.cxx +++ b/sc/source/ui/dbgui/foptmgr.cxx @@ -235,14 +235,13 @@ IMPL_LINK( ScFilterOptionsMgr, EdAreaModifyHdl, Edit*, pEd ) if ( SCA_VALID == (nResult & SCA_VALID) ) { - OUString* pStr = NULL; bool bFound = false; sal_uInt16 i = 0; sal_uInt16 nCount = pLbCopyArea->GetEntryCount(); for ( i=2; i<nCount && !bFound; i++ ) { - pStr = (OUString*)pLbCopyArea->GetEntryData( i ); + OUString* pStr = (OUString*)pLbCopyArea->GetEntryData( i ); bFound = (theCurPosStr == *pStr); } diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index d39e7c424e4d..c889b723e0a2 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -431,14 +431,13 @@ IMPL_LINK( ScSpecialFilterDlg, FilterAreaModHdl, formula::RefEdit*, pEd ) if ( SCA_VALID == (nResult & SCA_VALID) ) { - OUString* pStr = NULL; bool bFound = false; sal_uInt16 i = 0; sal_uInt16 nCount = pLbFilterArea->GetEntryCount(); for ( i=1; i<nCount && !bFound; i++ ) { - pStr = (OUString*)pLbFilterArea->GetEntryData( i ); + OUString* pStr = (OUString*)pLbFilterArea->GetEntryData( i ); bFound = (theCurAreaStr == *pStr); } diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index b6e3a528c977..55557b286473 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -884,14 +884,13 @@ void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd ) if ( SCA_VALID == (nResult & SCA_VALID) ) { - OUString* pStr = NULL; bool bFound = false; sal_uInt16 i = 0; sal_uInt16 nCount = m_pLbOutPos->GetEntryCount(); for ( i=2; i<nCount && !bFound; i++ ) { - pStr = (OUString*)m_pLbOutPos->GetEntryData( i ); + OUString* pStr = (OUString*)m_pLbOutPos->GetEntryData( i ); bFound = (theCurPosStr == *pStr); } diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 6febc35d7227..12aac8fa7713 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -71,11 +71,9 @@ ScTpSubTotalGroup::~ScTpSubTotalGroup() if ( nCount > 0 ) { - sal_uInt16* pData = NULL; - for ( sal_uLong i=0; i<nCount; i++ ) { - pData = (sal_uInt16*)(mpLbColumns->GetEntryData( i )); + sal_uInt16* pData = (sal_uInt16*)(mpLbColumns->GetEntryData( i )); OSL_ENSURE( pData, "EntryData not found" ); delete pData; |