From dd8d5e5795358d732a9f7a8af7c35f662321e332 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 29 Apr 2019 11:18:21 +0200 Subject: improve loplugin:stringconstant to find more places we can elide the OUString() constructor at call sites Change-Id: Ie09f3c61f2c4b4959c97dc98ebcbaf7c51d5d713 Reviewed-on: https://gerrit.libreoffice.org/71514 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/qa/extras/uiwriter/uiwriter.cxx | 4 ++-- sw/source/core/doc/DocumentTimerManager.cxx | 3 +-- sw/source/core/swg/SwXMLTextBlocks1.cxx | 2 +- sw/source/filter/ww8/rtfexport.cxx | 2 +- sw/source/uibase/app/appopt.cxx | 6 +++--- 5 files changed, 8 insertions(+), 9 deletions(-) (limited to 'sw') diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 21138677443b..d6795ead6620 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -2248,7 +2248,7 @@ void SwUiWriterTest::testTdf69282() verticalSpace.SetLower(14); rSourceMasterFormat.SetFormatAttr(verticalSpace); //Changing the style and copying it to target - source->ChgPageDesc(OUString("SourceStyle"), *sPageDesc); + source->ChgPageDesc("SourceStyle", *sPageDesc); target->CopyPageDesc(*sPageDesc, *tPageDesc); //Checking the set values on all Formats in target SwFrameFormat& rTargetMasterFormat = tPageDesc->GetMaster(); @@ -2309,7 +2309,7 @@ void SwUiWriterTest::testTdf69282WithMirror() verticalSpace.SetLower(14); rSourceMasterFormat.SetFormatAttr(verticalSpace); //Changing the style and copying it to target - source->ChgPageDesc(OUString("SourceStyle"), *sPageDesc); + source->ChgPageDesc("SourceStyle", *sPageDesc); target->CopyPageDesc(*sPageDesc, *tPageDesc); //Checking the set values on all Formats in target SwFrameFormat& rTargetMasterFormat = tPageDesc->GetMaster(); diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx index 1ed1b556ad6a..266ee7386875 100644 --- a/sw/source/core/doc/DocumentTimerManager.cxx +++ b/sw/source/core/doc/DocumentTimerManager.cxx @@ -124,8 +124,7 @@ DocumentTimerManager::IdleJob DocumentTimerManager::GetNextIdleJob() const { bool bIsOnlineSpell = pShell->GetViewOptions()->IsOnlineSpell(); bool bIsAutoGrammar = false; - SvtLinguConfig().GetProperty( OUString( - UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar; + SvtLinguConfig().GetProperty( UPN_IS_GRAMMAR_AUTO ) >>= bIsAutoGrammar; if( bIsOnlineSpell && bIsAutoGrammar && m_rDoc.StartGrammarChecking( true ) ) return IdleJob::Grammar; diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx index 1299cbc1c90e..0a064945be94 100644 --- a/sw/source/core/swg/SwXMLTextBlocks1.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx @@ -68,7 +68,7 @@ ErrCode SwXMLTextBlocks::GetDoc( sal_uInt16 nIdx ) try { xRoot = xBlkRoot->openStorageElement( aFolderName, embed::ElementModes::READ ); - xMedium = new SfxMedium( xRoot, GetBaseURL(), OUString( "writer8" ) ); + xMedium = new SfxMedium( xRoot, GetBaseURL(), "writer8" ); SwReader aReader( *xMedium, aFolderName, m_xDoc.get() ); ReadXML->SetBlockMode( true ); aReader.Read( *ReadXML ); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 2dbd38230402..504424b70d8a 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -259,7 +259,7 @@ void RtfExport::WriteRevTab() return; // RTF always seems to use Unknown as the default first entry - GetRedline(OUString("Unknown")); + GetRedline("Unknown"); for (SwRangeRedline* pRedl : m_pDoc->getIDocumentRedlineAccess().GetRedlineTable()) { diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx index 7929b5a4efd1..9a0b995679a7 100644 --- a/sw/source/uibase/app/appopt.cxx +++ b/sw/source/uibase/app/appopt.cxx @@ -151,17 +151,17 @@ std::unique_ptr SwModule::CreateItemSet( sal_uInt16 nId ) using namespace ::com::sun::star::i18n::ScriptType; - Any aLang = aLinguCfg.GetProperty(OUString("DefaultLocale")); + Any aLang = aLinguCfg.GetProperty("DefaultLocale"); aLang >>= aLocale; nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), LATIN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE)); - aLang = aLinguCfg.GetProperty(OUString("DefaultLocale_CJK")); + aLang = aLinguCfg.GetProperty("DefaultLocale_CJK"); aLang >>= aLocale; nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), ASIAN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE)); - aLang = aLinguCfg.GetProperty(OUString("DefaultLocale_CTL")); + aLang = aLinguCfg.GetProperty("DefaultLocale_CTL"); aLang >>= aLocale; nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), COMPLEX); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE)); -- cgit