From f29ef71073bb31f05d6cc50f952e827134868c2d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 17 Aug 2021 14:46:29 +0200 Subject: avoid constructing OUString on hot path (tdf#105575) Change-Id: I7c9925fc7f68cdc9bd1a9c1834daabff09c8cf6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120604 Tested-by: Jenkins Reviewed-by: Noel Grandin --- comphelper/source/processfactory/processfactory.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comphelper/source/processfactory/processfactory.cxx b/comphelper/source/processfactory/processfactory.cxx index 8df1e244ca19..ea5595646e4c 100644 --- a/comphelper/source/processfactory/processfactory.cxx +++ b/comphelper/source/processfactory/processfactory.cxx @@ -86,8 +86,9 @@ Reference< XComponentContext > getComponentContext( Reference< XComponentContext > xRet; uno::Reference const xProps( factory, uno::UNO_QUERY ); if (xProps.is()) { + static constexpr OUStringLiteral DEFAULT_CONTEXT = u"DefaultContext"; try { - xRet.set( xProps->getPropertyValue("DefaultContext"), + xRet.set( xProps->getPropertyValue(DEFAULT_CONTEXT), uno::UNO_QUERY ); } catch (beans::UnknownPropertyException & e) { -- cgit