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 /vbahelper/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 'vbahelper/source')
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 2 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbashape.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 6905cca88978..285d8d64d790 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -143,7 +143,7 @@ dispatchRequests (const uno::Reference< frame::XModel>& xModel, const OUString & uno::Reference<frame::XDispatchProvider> xDispatchProvider (xFrame,uno::UNO_QUERY_THROW); try { - uno::Reference<uno::XComponentContext > xContext( + const uno::Reference<uno::XComponentContext >& xContext( comphelper::getProcessComponentContext() ); uno::Reference<util::XURLTransformer> xParser( util::URLTransformer::create(xContext) ); xParser->parseStrict (url); diff --git a/vbahelper/source/vbahelper/vbashape.cxx b/vbahelper/source/vbahelper/vbashape.cxx index 183d3bb9a984..db0942fd29cf 100644 --- a/vbahelper/source/vbahelper/vbashape.cxx +++ b/vbahelper/source/vbahelper/vbashape.cxx @@ -393,7 +393,7 @@ ScVbaShape::TextFrame() uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW ); if( xServiceInfo->supportsService( u"com.sun.star.sheet.SpreadsheetDocument"_ustr ) ) { - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext(); uno::Reference< uno::XInterface > xTextFrame = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( u"ooo.vba.excel.TextFrame"_ustr , { uno::Any(getParent()), uno::Any(m_xShape) }, xContext ); return uno::Any( xTextFrame ); } @@ -727,7 +727,7 @@ ScVbaShape::WrapFormat() uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW ); if( xServiceInfo->supportsService( u"com.sun.star.text.TextDocument"_ustr )) { - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + const uno::Reference< uno::XComponentContext >& xContext = comphelper::getProcessComponentContext(); uno::Reference< uno::XInterface > xWrapFormat = xContext->getServiceManager()->createInstanceWithArgumentsAndContext( u"ooo.vba.word.WrapFormat"_ustr ,{ uno::Any(getParent()), uno::Any(m_xShape) }, xContext ); return uno::Any( xWrapFormat ); } |