diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-08 12:00:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-08 15:23:52 +0100 |
commit | ed0b12f4eadf1f2242f06cbd56804f75376274b1 (patch) | |
tree | 7028abd9cf514c74bd1b795cc6398b0bb433f319 /forms/source | |
parent | 5ff283e3b841230a45715e48a251c3c4216d1cec (diff) |
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 <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/xforms/computedexpression.cxx | 2 | ||||
-rw-r--r-- | forms/source/xforms/submission/replace.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
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<XXPathAPI> ComputedExpression::_getXPathAPI(const xforms::EvaluationCo Reference<XXPathAPI> 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; |