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 --- javaunohelper/source/vm.cxx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'javaunohelper') diff --git a/javaunohelper/source/vm.cxx b/javaunohelper/source/vm.cxx index 4b42b5446cb9..763fc4c98aee 100644 --- a/javaunohelper/source/vm.cxx +++ b/javaunohelper/source/vm.cxx @@ -68,11 +68,7 @@ css::uno::Reference< css::uno::XInterface > SingletonFactory::createInstanceWith css::uno::Reference< css::uno::XComponentContext > const & xContext ) { sal_Int64 handle = reinterpret_cast< sal_Int64 >( m_vm_access.get() ); - css::uno::Any arg( - css::uno::makeAny( - css::beans::NamedValue( - OUString( "UnoVirtualMachine" ), - css::uno::makeAny( handle ) ) ) ); + css::uno::Any arg( css::beans::NamedValue( "UnoVirtualMachine", css::uno::makeAny( handle ) ) ); return xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "com.sun.star.java.JavaVirtualMachine", css::uno::Sequence< css::uno::Any >( &arg, 1 ), xContext ); @@ -111,7 +107,7 @@ css::uno::Reference< css::uno::XComponentContext > install_vm_singleton( { css::uno::Reference< css::lang::XSingleComponentFactory > xFac( new SingletonFactory( vm_access ) ); ::cppu::ContextEntry_Init entry( - OUString("/singletons/com.sun.star.java.theJavaVirtualMachine"), + "/singletons/com.sun.star.java.theJavaVirtualMachine", css::uno::makeAny( xFac ), true ); return ::cppu::createComponentContext( &entry, 1, xContext ); } -- cgit