diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-03-05 11:23:38 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-03-07 15:37:22 +0100 |
commit | 4256c764aee0777770466115a97420d9b55c23ac (patch) | |
tree | 9452b0dc5c84355826d070ad3eccba498ef9c5e8 /embeddedobj | |
parent | 58c6a36bfcc853ca9da81fbc2d071fa50585655b (diff) |
do not pass XComponentContext to officecfg::...::get() calls
It's used only for the ConfigurationWrapper singleton, so it's used
only the first time and then ignored. It also causes calls to
comphelper::getProcessComponentContext() for every single invocation
despite the value not being needed, and the calls may not be cheap
(it's ~5% CPU during ODS save because relatively frequent calls
to officecfg::Office::Common::Save::ODF::DefaultVersion::get()).
Change-Id: I02c17a1a9cb498aeef220ddd5a0bde5523cb0ffb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131056
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/general/xcreator.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx index d057aeba4a1a..c4a8635e465d 100644 --- a/embeddedobj/source/general/xcreator.cxx +++ b/embeddedobj/source/general/xcreator.cxx @@ -188,13 +188,11 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta * Decides if rFilter should be used to load data into a doc model or real OLE embedding should * happen. Empty return value means the later. */ -static OUString HandleFilter(const uno::Reference<uno::XComponentContext>& xComponentContext, - const OUString& rFilter) +static OUString HandleFilter(const OUString& rFilter) { OUString aRet = rFilter; - if (!officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get( - xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get()) { if (rFilter == "MS Word 97" || rFilter == "MS Word 2007 XML") { @@ -202,29 +200,28 @@ static OUString HandleFilter(const uno::Reference<uno::XComponentContext>& xComp } } - if (!officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::get(xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::get()) { if (rFilter == "MS Excel 97" || rFilter == "Calc MS Excel 2007 XML") { aRet.clear(); } } - if (!officecfg::Office::Common::Filter::Microsoft::Import::PowerPointToImpress::get( - xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::PowerPointToImpress::get()) { if (rFilter == "MS PowerPoint 97" || rFilter == "Impress MS PowerPoint 2007 XML") { aRet.clear(); } } - if (!officecfg::Office::Common::Filter::Microsoft::Import::VisioToDraw::get(xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::VisioToDraw::get()) { if (rFilter == "Visio Document") { aRet.clear(); } } - if (!officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::get(xComponentContext)) + if (!officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::get()) { if (rFilter == "draw_pdf_import") { @@ -259,7 +256,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta // check if there is FilterName OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, false ); - aFilterName = HandleFilter(m_xContext, aFilterName); + aFilterName = HandleFilter(aFilterName); if ( !aFilterName.isEmpty() ) { |