From ccc5ea08d64c38a9ce925d448c3010aca19ed35c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 12 Oct 2015 07:45:01 +0200 Subject: cppcheck:variableScope Change-Id: I037feb335499629300309851dcda3bb661f03d4f Reviewed-on: https://gerrit.libreoffice.org/19316 Tested-by: Jenkins Reviewed-by: Noel Grandin --- desktop/source/migration/services/wordbookmigration.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'desktop') diff --git a/desktop/source/migration/services/wordbookmigration.cxx b/desktop/source/migration/services/wordbookmigration.cxx index 0f4427ce8bde..768d517e6915 100644 --- a/desktop/source/migration/services/wordbookmigration.cxx +++ b/desktop/source/migration/services/wordbookmigration.cxx @@ -146,15 +146,11 @@ namespace migration #define MAX_HEADER_LENGTH 16 bool IsUserWordbook( const OUString& rFile ) { - static const sal_Char* pVerStr2 = "WBSWG2"; - static const sal_Char* pVerStr5 = "WBSWG5"; - static const sal_Char* pVerStr6 = "WBSWG6"; - static const sal_Char* pVerOOo7 = "OOoUserDict1"; - bool bRet = false; SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( OUString(rFile), STREAM_STD_READ ); if ( pStream && !pStream->GetError() ) { + static const sal_Char* pVerOOo7 = "OOoUserDict1"; sal_Size nSniffPos = pStream->Tell(); static sal_Size nVerOOo7Len = sal::static_int_cast< sal_Size >(strlen( pVerOOo7 )); sal_Char pMagicHeader[MAX_HEADER_LENGTH]; @@ -172,9 +168,9 @@ bool IsUserWordbook( const OUString& rFile ) { pStream->Read(pMagicHeader, nLen); pMagicHeader[nLen] = '\0'; - if ( !strcmp(pMagicHeader, pVerStr2) - || !strcmp(pMagicHeader, pVerStr5) - || !strcmp(pMagicHeader, pVerStr6) ) + if ( !strcmp(pMagicHeader, "WBSWG2") + || !strcmp(pMagicHeader, "WBSWG5") + || !strcmp(pMagicHeader, "WBSWG6") ) bRet = true; } } -- cgit