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 /starmath/source/mathml | |
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 'starmath/source/mathml')
-rw-r--r-- | starmath/source/mathml/export.cxx | 6 | ||||
-rw-r--r-- | starmath/source/mathml/import.cxx | 6 | ||||
-rw-r--r-- | starmath/source/mathml/mathmlexport.cxx | 3 | ||||
-rw-r--r-- | starmath/source/mathml/mathmlimport.cxx | 6 |
4 files changed, 14 insertions, 7 deletions
diff --git a/starmath/source/mathml/export.cxx b/starmath/source/mathml/export.cxx index 2f76dc3a796e..80d9b4f79762 100644 --- a/starmath/source/mathml/export.cxx +++ b/starmath/source/mathml/export.cxx @@ -69,7 +69,8 @@ using namespace ::xmloff::token; bool SmMLExportWrapper::Export(SfxMedium& rMedium) { bool bRet = true; - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext( + comphelper::getProcessComponentContext()); // Check all fine SAL_WARN_IF(m_xModel == nullptr, "starmath", "Missing model"); @@ -224,7 +225,8 @@ bool SmMLExportWrapper::Export(SfxMedium& rMedium) OUString SmMLExportWrapper::Export(SmMlElement* pElementTree) { - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext( + comphelper::getProcessComponentContext()); // Check all fine m_pElementTree = nullptr; diff --git a/starmath/source/mathml/import.cxx b/starmath/source/mathml/import.cxx index 8c057066ad00..aac7d768472b 100644 --- a/starmath/source/mathml/import.cxx +++ b/starmath/source/mathml/import.cxx @@ -75,7 +75,8 @@ SmMlElement* SmMLImportWrapper::getElementTree() ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium) { // Fetch context - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext( + comphelper::getProcessComponentContext()); if (!xContext.is()) { SAL_WARN("starmath", "Failed to fetch model while file input"); @@ -284,7 +285,8 @@ ErrCode SmMLImportWrapper::Import(SfxMedium& rMedium) ErrCode SmMLImportWrapper::Import(std::u16string_view aSource) { // Fetch context - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext( + comphelper::getProcessComponentContext()); if (!xContext.is()) { SAL_WARN("starmath", "Failed to fetch model while file input"); diff --git a/starmath/source/mathml/mathmlexport.cxx b/starmath/source/mathml/mathmlexport.cxx index 9044c8ee0c90..380a7071ce16 100644 --- a/starmath/source/mathml/mathmlexport.cxx +++ b/starmath/source/mathml/mathmlexport.cxx @@ -91,7 +91,8 @@ sal_uInt32 ConvertMathToMathML(std::u16string_view rText, sal_Int32 nIndex = 0) bool SmXMLExportWrapper::Export(SfxMedium& rMedium) { bool bRet = true; - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext( + comphelper::getProcessComponentContext()); //Get model uno::Reference<lang::XComponent> xModelComp = xModel; diff --git a/starmath/source/mathml/mathmlimport.cxx b/starmath/source/mathml/mathmlimport.cxx index 91bc834a27b0..0ac32397e099 100644 --- a/starmath/source/mathml/mathmlimport.cxx +++ b/starmath/source/mathml/mathmlimport.cxx @@ -96,7 +96,8 @@ ErrCode SmXMLImportWrapper::Import(SfxMedium& rMedium) { ErrCode nError = ERRCODE_SFX_DOLOADFAILED; - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext( + comphelper::getProcessComponentContext()); OSL_ENSURE(m_xModel.is(), "XMLReader::Read: got no model"); @@ -2633,7 +2634,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportMML(SvStream& rStream) uno::Reference<frame::XModel> xModel(xDocSh->GetModel()); uno::Reference<beans::XPropertySet> xInfoSet; - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); + const uno::Reference<uno::XComponentContext>& xContext( + comphelper::getProcessComponentContext()); uno::Reference<io::XInputStream> xStream(new utl::OSeekableInputStreamWrapper(rStream)); //SetLoading hack because the document properties will be re-initted |