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 --- svl/qa/unit/items/test_IndexedStyleSheets.cxx | 6 +++--- svl/source/items/srchitem.cxx | 4 ++-- svl/source/misc/documentlockfile.cxx | 2 +- svl/source/misc/sharecontrolfile.cxx | 2 +- svl/source/passwordcontainer/passwordcontainer.cxx | 2 +- svl/source/passwordcontainer/syscreds.cxx | 3 +-- 6 files changed, 9 insertions(+), 10 deletions(-) (limited to 'svl') diff --git a/svl/qa/unit/items/test_IndexedStyleSheets.cxx b/svl/qa/unit/items/test_IndexedStyleSheets.cxx index f645733d6aea..da86044d2fe3 100644 --- a/svl/qa/unit/items/test_IndexedStyleSheets.cxx +++ b/svl/qa/unit/items/test_IndexedStyleSheets.cxx @@ -87,7 +87,7 @@ void IndexedStyleSheetsTest::AddedStylesheetsCanBeFoundAndRetrievedByPosition() void IndexedStyleSheetsTest::AddingSameStylesheetTwiceHasNoEffect() { - rtl::Reference sheet1(new MockedStyleSheet(rtl::OUString("sheet1"))); + rtl::Reference sheet1(new MockedStyleSheet("sheet1")); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); CPPUNIT_ASSERT_EQUAL(1u, iss.GetNumberOfStyleSheets()); @@ -111,8 +111,8 @@ void IndexedStyleSheetsTest::RemovedStyleSheetIsNotFound() void IndexedStyleSheetsTest::RemovingStyleSheetWhichIsNotAvailableHasNoEffect() { - rtl::Reference sheet1(new MockedStyleSheet(rtl::OUString("sheet1"))); - rtl::Reference sheet2(new MockedStyleSheet(rtl::OUString("sheet2"))); + rtl::Reference sheet1(new MockedStyleSheet("sheet1")); + rtl::Reference sheet2(new MockedStyleSheet("sheet2")); IndexedStyleSheets iss; iss.AddStyleSheet(sheet1); CPPUNIT_ASSERT_EQUAL(1u, iss.GetNumberOfStyleSheets()); diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index fe37c3fb33c7..d60f07b6645b 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -103,7 +103,7 @@ static Sequence< OUString > lcl_GetNotifyNames() SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : SfxPoolItem( nId ), - ConfigItem( OUString(CFG_ROOT_NODE ) ), + ConfigItem( CFG_ROOT_NODE ), m_aSearchOpt ( SearchAlgorithms_ABSOLUTE, SearchFlags::LEV_RELAXED, @@ -209,7 +209,7 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) : SfxPoolItem ( rItem ), - ConfigItem( OUString(CFG_ROOT_NODE ) ), + ConfigItem( CFG_ROOT_NODE ), m_aSearchOpt ( rItem.m_aSearchOpt ), m_eFamily ( rItem.m_eFamily ), diff --git a/svl/source/misc/documentlockfile.cxx b/svl/source/misc/documentlockfile.cxx index 6dcd09b0ca62..f79e55e3f240 100644 --- a/svl/source/misc/documentlockfile.cxx +++ b/svl/source/misc/documentlockfile.cxx @@ -53,7 +53,7 @@ bool DocumentLockFile::m_bAllowInteraction = true; DocumentLockFile::DocumentLockFile( const OUString& aOrigURL ) -: LockFileCommon( aOrigURL, OUString( ".~lock." ) ) +: LockFileCommon( aOrigURL, ".~lock." ) { } diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index 205c4e2b2b26..67445e36c17a 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -52,7 +52,7 @@ namespace svt { ShareControlFile::ShareControlFile( const OUString& aOrigURL ) -: LockFileCommon( aOrigURL, OUString( ".~sharing." ) ) +: LockFileCommon( aOrigURL, ".~sharing." ) { if ( !m_xStream.is() && !m_aURL.isEmpty() ) { diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx index f328c8419878..1d7790070e7b 100644 --- a/svl/source/passwordcontainer/passwordcontainer.cxx +++ b/svl/source/passwordcontainer/passwordcontainer.cxx @@ -379,7 +379,7 @@ PasswordContainer::PasswordContainer( const Reference& xSe mComponent.set( xServiceFactory, UNO_QUERY ); mComponent->addEventListener( this ); - m_pStorageFile = new StorageItem( this, OUString("Office.Common/Passwords") ); + m_pStorageFile = new StorageItem( this, "Office.Common/Passwords" ); if( m_pStorageFile->useStorage() ) m_aContainer = m_pStorageFile->getInfo(); } diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx index 69df68a5e521..9828f13b7c17 100644 --- a/svl/source/passwordcontainer/syscreds.cxx +++ b/svl/source/passwordcontainer/syscreds.cxx @@ -26,8 +26,7 @@ using namespace com::sun::star; SysCredentialsConfigItem::SysCredentialsConfigItem( SysCredentialsConfig * pOwner ) -: utl::ConfigItem( OUString("Office.Common/Passwords"), - ConfigItemMode::ImmediateUpdate ), +: utl::ConfigItem( "Office.Common/Passwords", ConfigItemMode::ImmediateUpdate ), m_bInited( false ), m_pOwner( pOwner ) { -- cgit