diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-30 12:16:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-31 08:25:07 +0200 |
commit | c9253818ec8252169c20450b41878be459568d95 (patch) | |
tree | 1f271151725042f33c3c8aa3988343bcd7f89e12 /unotools | |
parent | 242a796a71e29a1d8cdc4dd71d2465b898db32ab (diff) |
loplugin:oncevar
extend oncevar to any POD type
Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0
Reviewed-on: https://gerrit.libreoffice.org/40564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 8 | ||||
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 27 | ||||
-rw-r--r-- | unotools/source/misc/fontdefs.cxx | 2 |
3 files changed, 12 insertions, 25 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index 6dc0bf1ca68a..6be5e6ce8824 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -1130,9 +1130,7 @@ OUString SvtLinguConfig::GetSpellAndGrammarContextSuggestionImage( OUString aRes; if (!rServiceImplName.isEmpty()) { - OUString aImageName( "SpellAndGrammarContextMenuSuggestionImage" ); - OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); - aRes = aPath; + aRes = GetVendorImageUrl_Impl( rServiceImplName, "SpellAndGrammarContextMenuSuggestionImage" ); } return aRes; } @@ -1144,9 +1142,7 @@ OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage( OUString aRes; if (!rServiceImplName.isEmpty()) { - OUString aImageName( "SpellAndGrammarContextMenuDictionaryImage" ); - OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); - aRes = aPath; + aRes = GetVendorImageUrl_Impl( rServiceImplName, "SpellAndGrammarContextMenuDictionaryImage" ); } return aRes; } diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index e65713cb7d15..69cb9c066f49 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -641,8 +641,7 @@ void LocaleDataWrapper::getCurrSymbolsImpl() { if (areChecksEnabled()) { - OUString aMsg( "LocaleDataWrapper::getCurrSymbolsImpl: no default currency" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrSymbolsImpl: no default currency" ) ); } nElem = 0; if ( nElem >= nCnt ) @@ -748,8 +747,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() { // bad luck if (areChecksEnabled()) { - OUString aMsg( "LocaleDataWrapper::getCurrFormatsImpl: no currency formats" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrFormatsImpl: no currency formats" ) ); } nCurrPositiveFormat = nCurrNegativeFormat = nCurrFormatDefault; return; @@ -796,8 +794,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() scanCurrFormatImpl( pFormatArr[nElem].Code, 0, nSign, nPar, nNum, nBlank, nSym ); if (areChecksEnabled() && (nNum == -1 || nSym == -1)) { - OUString aMsg( "LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrFormatsImpl: CurrPositiveFormat?" ) ); } if (nBlank == -1) { @@ -824,8 +821,7 @@ void LocaleDataWrapper::getCurrFormatsImpl() scanCurrFormatImpl( rCode, nDelim+1, nSign, nPar, nNum, nBlank, nSym ); if (areChecksEnabled() && (nNum == -1 || nSym == -1 || (nPar == -1 && nSign == -1))) { - OUString aMsg( "LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?" ) ); } // NOTE: one of nPar or nSign are allowed to be -1 if (nBlank == -1) @@ -957,8 +953,7 @@ DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode ) { if (areChecksEnabled()) { - OUString aMsg( "LocaleDataWrapper::scanDateOrder: not all DMY present" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::scanDateOrder: not all DMY present" ) ); } if (nDay == -1) nDay = rCode.getLength(); @@ -979,8 +974,7 @@ DateOrder LocaleDataWrapper::scanDateOrderImpl( const OUString& rCode ) { if (areChecksEnabled()) { - OUString aMsg( "LocaleDataWrapper::scanDateOrder: no magic applicable" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::scanDateOrder: no magic applicable" ) ); } return DateOrder::DMY; } @@ -995,8 +989,7 @@ void LocaleDataWrapper::getDateOrdersImpl() { // bad luck if (areChecksEnabled()) { - OUString aMsg( "LocaleDataWrapper::getDateOrdersImpl: no date formats" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getDateOrdersImpl: no date formats" ) ); } nDateOrder = nLongDateOrder = DateOrder::DMY; return; @@ -1039,15 +1032,13 @@ void LocaleDataWrapper::getDateOrdersImpl() { if (areChecksEnabled()) { - OUString aMsg( "LocaleDataWrapper::getDateOrdersImpl: no edit" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getDateOrdersImpl: no edit" ) ); } if ( nDef == -1 ) { if (areChecksEnabled()) { - OUString aMsg( "LocaleDataWrapper::getDateOrdersImpl: no default" ); - outputCheckMessage( appendLocaleInfo( aMsg ) ); + outputCheckMessage( appendLocaleInfo( "LocaleDataWrapper::getDateOrdersImpl: no default" ) ); } if ( nMedium != -1 ) nDef = nMedium; diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx index 08874982d1b6..d74b5f0e3090 100644 --- a/unotools/source/misc/fontdefs.cxx +++ b/unotools/source/misc/fontdefs.cxx @@ -324,7 +324,7 @@ OUString StripScriptFromName(const OUString& _aName) { // I worry that someone will have a font which *does* have // e.g. "Greek" legitimately at the end of its name :-( - const char*suffixes[] = { " baltic", + const char*const suffixes[] = { " baltic", " ce", " cyr", " greek", |