From 1c3e84d8192218befebcddae2ed9842d081dc6c7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 30 Jan 2017 16:38:54 +0200 Subject: teach lolugin:stringconstant about calling constructors so we can remove unnecessary calls to the OUString(literal) constructor when calling constructors like this: Foo(OUString("xxx"), 1) Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36 Reviewed-on: https://gerrit.libreoffice.org/33698 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/customize/cfg.cxx | 8 ++------ cui/source/options/cfgchart.cxx | 2 +- cui/source/options/optgdlg.cxx | 10 +++++----- cui/source/options/optpath.cxx | 2 +- cui/source/tabpages/macroass.cxx | 4 ++-- cui/source/tabpages/numpages.cxx | 3 +-- 6 files changed, 12 insertions(+), 17 deletions(-) (limited to 'cui') diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index e10ecd7ddf4b..0c05e23bf9b0 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1028,9 +1028,7 @@ MenuSaveInData::GetEntries() { if ( pRootEntry == nullptr ) { - pRootEntry = new SvxConfigEntry( - OUString("MainMenus"), - OUString(), true); + pRootEntry = new SvxConfigEntry( "MainMenus", OUString(), true); if ( m_xMenuSettings.is() ) { @@ -3880,9 +3878,7 @@ SvxEntries* ToolbarSaveInData::GetEntries() if ( pRootEntry == nullptr ) { - pRootEntry.reset( new SvxConfigEntry( - OUString("MainToolbars"), - OUString(), true) ); + pRootEntry.reset( new SvxConfigEntry( "MainToolbars", OUString(), true) ); uno::Sequence< uno::Sequence < beans::PropertyValue > > info = GetConfigManager()->getUIElementsInfo( diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx index 474a74014733..662ce50234f2 100644 --- a/cui/source/options/cfgchart.cxx +++ b/cui/source/options/cfgchart.cxx @@ -174,7 +174,7 @@ bool SvxChartColorTable::operator==( const SvxChartColorTable & _rOther ) const SvxChartOptions::SvxChartOptions() : - ::utl::ConfigItem( OUString("Office.Chart") ), + ::utl::ConfigItem( "Office.Chart" ), mbIsInitialized( false ) { maPropertyNames.realloc( 1 ); diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index f8244f5dd5cc..3e14eea080cb 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -469,7 +469,7 @@ CanvasSettings::CanvasSettings() : Any propValue( makeAny( NamedValue( - OUString("nodepath"), + "nodepath", makeAny( OUString("/org.openoffice.Office.Canvas") ) ) ) ); mxForceFlagNameAccess.set( @@ -480,7 +480,7 @@ CanvasSettings::CanvasSettings() : propValue = makeAny( NamedValue( - OUString("nodepath"), + "nodepath", makeAny( OUString("/org.openoffice.Office.Canvas/CanvasServiceList") ) ) ); Reference xNameAccess( @@ -1170,7 +1170,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& Reference< XNameAccess > theNameAccess; // find out which locales are currently installed and add them to the listbox - theArgs[0] = makeAny(NamedValue(OUString("nodepath"), makeAny(OUString(sInstalledLocalesPath)))); + theArgs[0] = makeAny(NamedValue("nodepath", makeAny(OUString(sInstalledLocalesPath)))); theNameAccess.set( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs ), UNO_QUERY_THROW ); seqInstalledLanguages = theNameAccess->getElementNames(); @@ -1189,7 +1189,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage(vcl::Window* pParent, const SfxItemSet& // find out whether the user has a specific locale specified Sequence< Any > theArgs2(1); - theArgs2[0] = makeAny(NamedValue(OUString("nodepath"), makeAny(OUString(sUserLocalePath)))); + theArgs2[0] = makeAny(NamedValue("nodepath", makeAny(OUString(sUserLocalePath)))); theNameAccess.set( theConfigProvider->createInstanceWithArguments(sAccessSrvc, theArgs2 ), UNO_QUERY_THROW ); if (theNameAccess->hasByName(sUserLocaleKey)) @@ -1370,7 +1370,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet ) css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext())); Sequence< Any > theArgs(1); - theArgs[0] = makeAny(NamedValue(OUString("nodepath"), makeAny(OUString(sUserLocalePath)))); + theArgs[0] = makeAny(NamedValue("nodepath", makeAny(OUString(sUserLocalePath)))); Reference< XPropertySet >xProp( theConfigProvider->createInstanceWithArguments(sAccessUpdSrvc, theArgs ), UNO_QUERY_THROW ); if ( !m_sUserLocaleValue.equals(aLangString)) diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index a9bfaed9291e..eaf355b97c52 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -70,7 +70,7 @@ using namespace svx; #define POSTFIX_USER "_user" #define POSTFIX_WRITABLE "_writable" #define VAR_ONE "%1" -#define IODLG_CONFIGNAME OUString("FilePicker_Save") +#define IODLG_CONFIGNAME "FilePicker_Save" // struct OptPath_Impl --------------------------------------------------- diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index e2f241190067..22b2453c6032 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -342,13 +342,13 @@ bool SfxMacroTabPage::AssignDeleteHdl(Control* pBtn) if( sScriptURI.startsWith( "vnd.sun.star.script:" ) ) { aTbl.Insert( - nEvent, SvxMacro( sScriptURI, OUString( SVX_MACRO_LANGUAGE_SF ) ) ); + nEvent, SvxMacro( sScriptURI, SVX_MACRO_LANGUAGE_SF ) ); } else { OSL_ENSURE( false, "SfxMacroTabPage::AssignDeleteHdl_Impl: this branch is *not* dead? (out of interest: tell fs, please!)" ); aTbl.Insert( - nEvent, SvxMacro( sScriptURI, OUString( SVX_MACRO_LANGUAGE_STARBASIC ) ) ); + nEvent, SvxMacro( sScriptURI, SVX_MACRO_LANGUAGE_STARBASIC ) ); } } diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index a365cf607f0c..df6aad67f5ae 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -156,8 +156,7 @@ static bool lcl_IsNumFmtSet(SvxNumRule* pNum, sal_uInt16 nLevelMask) static vcl::Font& lcl_GetDefaultBulletFont() { static bool bInit = false; - static vcl::Font aDefBulletFont( OUString("StarSymbol"), - OUString(), Size( 0, 14 ) ); + static vcl::Font aDefBulletFont( "StarSymbol", OUString(), Size( 0, 14 ) ); if(!bInit) { aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL ); -- cgit