diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2015-01-10 15:52:17 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-01-12 06:45:19 +0000 |
commit | d5f48d742ac1fea9fd341244bbcea09bcd78b476 (patch) | |
tree | e68143fca184da493e368081981d666bad8bd906 /svtools/source/control/roadmap.cxx | |
parent | babe4ab629d476bbddbacb85c33436ba09655aea (diff) |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: I46b9293eed0cba2ebca119cc1fb0a6334ea66308
Reviewed-on: https://gerrit.libreoffice.org/13844
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source/control/roadmap.cxx')
-rw-r--r-- | svtools/source/control/roadmap.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx index 093390848d32..7d8705eab97b 100644 --- a/svtools/source/control/roadmap.cxx +++ b/svtools/source/control/roadmap.cxx @@ -314,13 +314,12 @@ namespace svt const HL_Vector& rItems = m_pImpl->getHyperLabels(); if ( _nIndex < (ItemIndex)rItems.size() ) { - RoadmapItem* pItem = NULL; for ( HL_Vector::const_iterator i = rItems.begin() + _nIndex; i != rItems.end(); ++i, ++_nIndex ) { - pItem = *i; + RoadmapItem* pItem = *i; pItem->SetIndex( _nIndex ); pItem->SetPosition( GetPreviousHyperLabel( _nIndex ) ); @@ -463,12 +462,10 @@ namespace svt RoadmapTypes::ItemId ORoadmap::GetNextAvailableItemId( ItemIndex _nNewIndex ) { - RoadmapItem* pItem = NULL; - ItemIndex searchIndex = ++_nNewIndex; while ( searchIndex < m_pImpl->getItemCount() ) { - pItem = GetByIndex( searchIndex ); + RoadmapItem* pItem = GetByIndex( searchIndex ); if ( pItem->IsEnabled() ) return pItem->GetID( ); @@ -480,11 +477,10 @@ namespace svt RoadmapTypes::ItemId ORoadmap::GetPreviousAvailableItemId( ItemIndex _nNewIndex ) { - RoadmapItem* pItem = NULL; ItemIndex searchIndex = --_nNewIndex; while ( searchIndex > -1 ) { - pItem = GetByIndex( searchIndex ); + RoadmapItem* pItem = GetByIndex( searchIndex ); if ( pItem->IsEnabled() ) return pItem->GetID( ); |