diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2015-01-16 13:00:37 +0000 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-01-19 06:15:36 +0000 |
commit | d1aecd4353bd6ac3961a30df67de78f4b8f0a66b (patch) | |
tree | 5d7fd75ed46970a1f459a763cfade2fa7d299f54 /sw/source/core/edit/edfld.cxx | |
parent | 07e84cae983c08afdba03018413a19d01abb3006 (diff) |
fdo#39440 sw: reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Iccdd4bebd46f274697597b13746c820aaadc99a4
Reviewed-on: https://gerrit.libreoffice.org/13960
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source/core/edit/edfld.cxx')
-rw-r--r-- | sw/source/core/edit/edfld.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 8377fb3fec5b..6d8360256969 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -221,30 +221,34 @@ static SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld ) SwTxtFld* pTFld = 0; if( RES_INPUTFLD == rFld.Which() ) { - const SfxPoolItem* pItem = NULL; const sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INPUTFIELD ); for( sal_uInt32 n = 0; n < nMaxItems; ++n ) + { + const SfxPoolItem* pItem = NULL; if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_INPUTFIELD, n ) ) && static_cast<const SwFmtFld*>(pItem)->GetField() == &rFld ) { pTFld = const_cast<SwFmtFld*>(static_cast<const SwFmtFld*>(pItem))->GetTxtFld(); break; } + } } else if( RES_SETEXPFLD == rFld.Which() && static_cast<SwSetExpField&>(rFld).GetInputFlag() ) { - const SfxPoolItem* pItem = NULL; const sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD ); for( sal_uInt32 n = 0; n < nMaxItems; ++n ) + { + const SfxPoolItem* pItem = NULL; if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) ) && static_cast<const SwFmtFld*>(pItem)->GetField() == &rFld ) { pTFld = const_cast<SwFmtFld*>(static_cast<const SwFmtFld*>(pItem))->GetTxtFld(); break; } + } } return pTFld; } |