From ed0b12f4eadf1f2242f06cbd56804f75376274b1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 8 Nov 2024 12:00:27 +0200 Subject: no need to take a copy of the getProcessComponentContext return value we can just take a "const &". (found by running clang-tidy with the performance-unnecessary-copy-initialization warning) Change-Id: I20fd208c65303da78170b1ac06c638fdf3aa094b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176267 Reviewed-by: Noel Grandin Tested-by: Jenkins --- forms/source/xforms/computedexpression.cxx | 2 +- forms/source/xforms/submission/replace.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'forms/source') diff --git a/forms/source/xforms/computedexpression.cxx b/forms/source/xforms/computedexpression.cxx index add8d4350ac7..4b9b43065acd 100644 --- a/forms/source/xforms/computedexpression.cxx +++ b/forms/source/xforms/computedexpression.cxx @@ -153,7 +153,7 @@ Reference ComputedExpression::_getXPathAPI(const xforms::EvaluationCo Reference xXPath( XPathAPI::create( comphelper::getProcessComponentContext() ) ); // register xforms extension# - Reference< XComponentContext > aComponentContext = comphelper::getProcessComponentContext(); + const Reference< XComponentContext >& aComponentContext = comphelper::getProcessComponentContext(); Reference< XXPathExtension > aExtension = XPathExtension::createWithModel(aComponentContext, aContext.mxModel, aContext.mxContextNode); xXPath->registerExtensionInstance(aExtension); diff --git a/forms/source/xforms/submission/replace.cxx b/forms/source/xforms/submission/replace.cxx index 631d75a06a7e..14924db31ee6 100644 --- a/forms/source/xforms/submission/replace.cxx +++ b/forms/source/xforms/submission/replace.cxx @@ -50,7 +50,7 @@ CSubmission::SubmissionResult CSubmission::replace(std::u16string_view aReplace, return CSubmission::UNKNOWN_ERROR; try { - Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); + const Reference< XComponentContext >& xContext = comphelper::getProcessComponentContext(); if (o3tl::equalsIgnoreAsciiCase(aReplace, u"all") || o3tl::equalsIgnoreAsciiCase(aReplace, u"document")) { Reference< XComponentLoader > xLoader; -- cgit