From 63b902175b58b65fb6f385cd084d55d6ac02da17 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Sun, 1 Jun 2014 19:12:30 +0200 Subject: Avoid temporary OUStrings Change-Id: I02f26228f0f9068ce7f497913fb36ac8945e785b --- sw/source/core/unocore/unocoll.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 8e992dbbb041..cccb2c3899d4 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -608,7 +608,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 { uno::Sequence< uno::Any > aArgs(1); aArgs[ 0 ] <<= pDoc->GetDocShell()->GetModel(); - aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( OUString("ooo.vba.word.Globals"), aArgs ); + aGlobs <<= ::comphelper::getProcessServiceFactory()->createInstanceWithArguments( "ooo.vba.word.Globals", aArgs ); pDoc->GetDocShell()->GetBasicManager()->SetGlobalUNOConstant( "VBAGlobals", aGlobs ); } aGlobs >>= xRet; @@ -1465,21 +1465,20 @@ uno::Any SwXTextSections::getByIndex(sal_Int32 nIndex) return makeAny(xRet); } -uno::Any SwXTextSections::getByName(const OUString& Name) +uno::Any SwXTextSections::getByName(const OUString& rName) throw( NoSuchElementException, WrappedTargetException, uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; uno::Any aRet; if(IsValid()) { - OUString aName(Name); SwSectionFmts& rFmts = GetDoc()->GetSections(); uno::Reference< XTextSection > xSect; for(size_t i = 0; i < rFmts.size(); ++i) { SwSectionFmt* pFmt = rFmts[i]; if (pFmt->IsInNodesArr() - && (aName == pFmt->GetSection()->GetSectionName())) + && (rName == pFmt->GetSection()->GetSectionName())) { xSect = GetObject(*pFmt); aRet.setValue(&xSect, cppu::UnoType::get()); -- cgit