From 26c82e22bf4f077022ae88d0a7f8ad0fa6d2a5ba Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 27 Jun 2017 14:06:27 +0200 Subject: loplugin:oncevar in ucb..vbahelper Change-Id: I1fc7c7505a42b3bf9d4a5ab22961930b9831d4ae Reviewed-on: https://gerrit.libreoffice.org/39327 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/accessibility/accessiblerelationsethelper.cxx | 6 ++---- unotools/source/config/fontcfg.cxx | 14 +++++++------- unotools/source/config/lingucfg.cxx | 3 +-- unotools/source/misc/ZipPackageHelper.cxx | 3 +-- unotools/source/misc/fontcvt.cxx | 6 ++---- unotools/source/misc/mediadescriptor.cxx | 3 +-- unotools/source/ucbhelper/ucblockbytes.cxx | 3 +-- 7 files changed, 15 insertions(+), 23 deletions(-) (limited to 'unotools') diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx index 3ca876f1aa46..6456085f55a0 100644 --- a/unotools/source/accessibility/accessiblerelationsethelper.cxx +++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx @@ -83,13 +83,11 @@ AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16 { sal_Int32 nCount(getRelationCount()); sal_Int32 i(0); - bool bFound(false); - while ((i < nCount) && !bFound) + while (i < nCount) { if (maRelations[i].RelationType == aRelationType) return maRelations[i]; - else - i++; + i++; } return AccessibleRelation(); } diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index 37356821911b..8f577c70b0d0 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -1020,13 +1020,13 @@ void FontSubstConfiguration::readLocaleSubst( const OUString& rBcp47 ) const it->second.aSubstAttributes.reserve( nFonts ); // strings for subst retrieval, construct only once - OUString aSubstFontsStr ( "SubstFonts" ); - OUString aSubstFontsMSStr ( "SubstFontsMS" ); - OUString aSubstFontsPSStr ( "SubstFontsPS" ); - OUString aSubstFontsHTMLStr ( "SubstFontsHTML" ); - OUString aSubstWeightStr ( "FontWeight" ); - OUString aSubstWidthStr ( "FontWidth" ); - OUString aSubstTypeStr ( "FontType" ); + OUString const aSubstFontsStr ( "SubstFonts" ); + OUString const aSubstFontsMSStr ( "SubstFontsMS" ); + OUString const aSubstFontsPSStr ( "SubstFontsPS" ); + OUString const aSubstFontsHTMLStr ( "SubstFontsHTML" ); + OUString const aSubstWeightStr ( "FontWeight" ); + OUString const aSubstWidthStr ( "FontWidth" ); + OUString const aSubstTypeStr ( "FontType" ); for( int i = 0; i < nFonts; i++ ) { Reference< XNameAccess > xFont; diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index d11b9c62fd6f..6dc0bf1ca68a 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -1158,8 +1158,7 @@ OUString SvtLinguConfig::GetSynonymsContextImage( OUString aRes; if (!rServiceImplName.isEmpty()) { - OUString aImageName( "SynonymsContextMenuImage" ); - OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) ); + OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, "SynonymsContextMenuImage" ) ); aRes = aPath; } return aRes; diff --git a/unotools/source/misc/ZipPackageHelper.cxx b/unotools/source/misc/ZipPackageHelper.cxx index 609b863c6710..7d03b43a9279 100644 --- a/unotools/source/misc/ZipPackageHelper.cxx +++ b/unotools/source/misc/ZipPackageHelper.cxx @@ -87,8 +87,7 @@ ZipPackageHelper::ZipPackageHelper( mxFactory = xFactory; // get root zip folder - OUString szRootFolder("/"); - mxHNameAccess->getByHierarchicalName( szRootFolder ) >>= mxRootFolder; + mxHNameAccess->getByHierarchicalName( "/" ) >>= mxRootFolder; } static OUString encodeZipUri( const OUString& rURI ) diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx index 97fdc3cb13af..dd3ad60fada3 100644 --- a/unotools/source/misc/fontcvt.cxx +++ b/unotools/source/misc/fontcvt.cxx @@ -1348,8 +1348,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const OUString& rOrgFontName, con if( aMapName == "starsymbol" || aMapName == "opensymbol" ) { - int nEntries = SAL_N_ELEMENTS(aStarSymbolRecodeTable); - for( int i = 0; i < nEntries; ++i) + for( int i = 0; i < int(SAL_N_ELEMENTS(aStarSymbolRecodeTable)); ++i) { const RecodeTable& r = aStarSymbolRecodeTable[i]; if( aOrgName.equalsAscii( r.pOrgName ) ) @@ -1364,8 +1363,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const OUString& rOrgFontName, con //adobe-symbol to unicode conversion in rtl instead else if( aMapName == "applesymbol" ) { - int nEntries = SAL_N_ELEMENTS(aAppleSymbolRecodeTable); - for( int i = 0; i < nEntries; ++i) + for( int i = 0; i < int(SAL_N_ELEMENTS(aAppleSymbolRecodeTable)); ++i) { const RecodeTable& r = aAppleSymbolRecodeTable[i]; if( aOrgName.equalsAscii( r.pOrgName ) ) diff --git a/unotools/source/misc/mediadescriptor.cxx b/unotools/source/misc/mediadescriptor.cxx index c8c2ec98ea91..1e37fe199cad 100644 --- a/unotools/source/misc/mediadescriptor.cxx +++ b/unotools/source/misc/mediadescriptor.cxx @@ -575,8 +575,7 @@ bool MediaDescriptor::impl_openStreamWithPostData( const css::uno::Reference< cs aPostArgument.MediaType = sMediaType; aPostArgument.Referer = getUnpackedValueOrDefault( PROP_REFERRER(), OUString() ); - OUString sCommandName( "post" ); - aContent.executeCommand( sCommandName, css::uno::makeAny( aPostArgument ) ); + aContent.executeCommand( "post", css::uno::makeAny( aPostArgument ) ); // get result xResultStream = xSink->getInputStream(); diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index 1aa5abaca117..b16bf68dfacd 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -194,8 +194,7 @@ void SAL_CALL UcbPropertiesChangeListener_Impl::propertiesChange ( const Sequenc OUString aUrl; if (evt.NewValue >>= aUrl) { - OUString aBad ("private:"); - if (!aUrl.startsWith(aBad)) + if (!aUrl.startsWith("private:")) { // URL changed (Redirection). m_xLockBytes->SetRealURL_Impl( aUrl ); -- cgit v1.2.3