diff options
author | Michaël Lefèvre <lefevre00@yahoo.fr> | 2015-09-21 15:11:57 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-23 07:29:33 +0000 |
commit | 92c8d74c543aa94cd512369072975dca7006d5b3 (patch) | |
tree | eb7fe0edfa601a3062f3756274b26502021cdf69 /editeng | |
parent | 3e27df1035677c7cca5200858d5d8e8283bf7aa9 (diff) |
CppCheck : reduce variables scope
Change-Id: Ief402017b693a4337f330fb07bb7a6dc6e749f72
Reviewed-on: https://gerrit.libreoffice.org/18753
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/numitem.cxx | 2 | ||||
-rw-r--r-- | editeng/source/rtf/svxrtf.cxx | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 48264095dd97..834d5f44e26d 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -870,9 +870,9 @@ bool SvxNumRule::UnLinkGraphics() { SvxNumberFormat aFmt(GetLevel(i)); const SvxBrushItem* pBrush = aFmt.GetBrush(); - const Graphic* pGraphic = NULL; if(SVX_NUM_BITMAP == aFmt.GetNumberingType()) { + const Graphic* pGraphic = NULL; if(pBrush && !pBrush->GetGraphicLink().isEmpty() && 0 != (pGraphic = pBrush->GetGraphic())) diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 0d10e23e4251..1e11a0f30570 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -446,7 +446,6 @@ void SvxRTFParser::ReadColorTable() void SvxRTFParser::ReadFontTable() { - int nToken = 0; int _nOpenBrakets = 1; // the first was already detected earlier!! std::unique_ptr<vcl::Font> pFont(new vcl::Font); short nFontNo(0), nInsFontNo (0); @@ -459,6 +458,7 @@ void SvxRTFParser::ReadFontTable() while( _nOpenBrakets && IsParserWorking() ) { + int nToken = 0; bool bCheckNewFont = false; switch( ( nToken = GetNextToken() )) { @@ -593,10 +593,11 @@ void SvxRTFParser::ReadOLEData() OUString& SvxRTFParser::GetTextToEndGroup( OUString& rStr ) { rStr.clear(); - int _nOpenBrakets = 1, nToken = 0; // the first was already detected earlier!! + int _nOpenBrakets = 1; // the first was already detected earlier!! while( _nOpenBrakets && IsParserWorking() ) { + int nToken = 0; switch( nToken = GetNextToken() ) { case '}': --_nOpenBrakets; break; @@ -653,7 +654,7 @@ util::DateTime SvxRTFParser::GetDateTimeStamp( ) void SvxRTFParser::ReadInfo( const sal_Char* pChkForVerNo ) { - int _nOpenBrakets = 1, nToken = 0; // the first was already detected earlier!! + int _nOpenBrakets = 1; // the first was already detected earlier!! DBG_ASSERT(m_xDocProps.is(), "SvxRTFParser::ReadInfo: no DocumentProperties"); OUString sStr, sComment; @@ -661,6 +662,7 @@ void SvxRTFParser::ReadInfo( const sal_Char* pChkForVerNo ) while( _nOpenBrakets && IsParserWorking() ) { + int nToken = 0; switch( nToken = GetNextToken() ) { case '}': --_nOpenBrakets; break; |