summaryrefslogtreecommitdiff
path: root/svtools/source/contnr
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2015-01-10 15:52:17 +0100
committerNoel Grandin <noelgrandin@gmail.com>2015-01-12 06:45:19 +0000
commitd5f48d742ac1fea9fd341244bbcea09bcd78b476 (patch)
treee68143fca184da493e368081981d666bad8bd906 /svtools/source/contnr
parentbabe4ab629d476bbddbacb85c33436ba09655aea (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/contnr')
-rw-r--r--svtools/source/contnr/treelistbox.cxx10
-rw-r--r--svtools/source/contnr/treelistentry.cxx3
2 files changed, 5 insertions, 8 deletions
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index e9c00302fb32..28de1224101b 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1502,11 +1502,10 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
sal_uInt16 nCount = pEntry->ItemCount();
sal_uInt16 nCur = 0;
sal_uInt16 nHeaderCur = 0;
- SvLBoxItem* pItem;
while( nCur < nCount )
{
// MT: SV_ITEM_ID_EXTENDRLBOXSTRING / GetExtendText() was in use in IA2 cws, but only used in sc: ScSolverOptionsString. Needed?
- pItem = pEntry->GetItem( nCur );
+ SvLBoxItem* pItem = pEntry->GetItem( nCur );
if ( (pItem->GetType() == SV_ITEM_ID_LBOXSTRING ) &&
!static_cast<SvLBoxString*>( pItem )->GetText().isEmpty() )
{
@@ -1775,13 +1774,12 @@ void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry,
const OUString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp,
SvLBoxButtonKind eButtonKind)
{
- SvLBoxButton* pButton;
SvLBoxString* pString;
SvLBoxContextBmp* pContextBmp;
if( nTreeFlags & TREEFLAG_CHKBTN )
{
- pButton= new SvLBoxButton( pEntry,eButtonKind,0,pCheckButtonData );
+ SvLBoxButton* pButton= new SvLBoxButton( pEntry,eButtonKind,0,pCheckButtonData );
pEntry->AddItem( pButton );
}
@@ -2319,14 +2317,14 @@ short SvTreeListBox::GetHeightOffset(const vcl::Font& /* rFont */, Size& aSizeLo
void SvTreeListBox::SetEntryHeight( SvTreeListEntry* pEntry )
{
- short nHeight, nHeightMax=0;
+ short nHeightMax=0;
sal_uInt16 nCount = pEntry->ItemCount();
sal_uInt16 nCur = 0;
SvViewDataEntry* pViewData = GetViewDataEntry( pEntry );
while( nCur < nCount )
{
SvLBoxItem* pItem = pEntry->GetItem( nCur );
- nHeight = (short)(pItem->GetSize( pViewData, nCur ).Height());
+ short nHeight = (short)(pItem->GetSize( pViewData, nCur ).Height());
if( nHeight > nHeightMax )
nHeightMax = nHeight;
nCur++;
diff --git a/svtools/source/contnr/treelistentry.cxx b/svtools/source/contnr/treelistentry.cxx
index e294b9944129..e8bf2de05e5f 100644
--- a/svtools/source/contnr/treelistentry.cxx
+++ b/svtools/source/contnr/treelistentry.cxx
@@ -112,13 +112,12 @@ void SvTreeListEntry::Clone(SvTreeListEntry* pSource)
nListPos |= ( pSource->nListPos & 0x7fffffff);
nAbsPos = pSource->nAbsPos;
- SvLBoxItem* pNewItem;
maItems.clear();
ItemsType::iterator it = pSource->maItems.begin(), itEnd = pSource->maItems.end();
for (; it != itEnd; ++it)
{
SvLBoxItem* pItem = &(*it);
- pNewItem = pItem->Create();
+ SvLBoxItem* pNewItem = pItem->Create();
pNewItem->Clone(pItem);
maItems.push_back(pNewItem);
}