summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-03-05 11:23:38 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-03-07 15:37:22 +0100
commit4256c764aee0777770466115a97420d9b55c23ac (patch)
tree9452b0dc5c84355826d070ad3eccba498ef9c5e8 /fpicker
parent58c6a36bfcc853ca9da81fbc2d071fa50585655b (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 'fpicker')
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx8
-rw-r--r--fpicker/source/office/iodlg.cxx7
-rw-r--r--fpicker/source/office/iodlg.hxx2
3 files changed, 7 insertions, 10 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 64dccd911941..c36d55deb81b 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -137,7 +137,7 @@ RemoteFilesDialog::~RemoteFilesDialog()
}
// save services
- std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_xContext ) );
+ std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() );
officecfg::Office::Common::Misc::FilePickerLastService::set( m_sLastServiceUrl, batch );
@@ -258,13 +258,13 @@ void RemoteFilesDialog::FillServicesListbox()
m_aServices.clear();
// Load from user settings
- Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get( m_xContext ) );
- Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get( m_xContext ) );
+ Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get() );
+ Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get() );
unsigned int nPos = 0;
unsigned int i = 0;
- m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get( m_xContext );
+ m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get();
for( sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace )
{
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 33f42647e308..c358636ca071 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -288,7 +288,6 @@ SvtFileDialog::SvtFileDialog(weld::Window* pParent, PickerFlags nStyle)
, m_bIsInExecute(false)
, m_bInExecuteAsync(false)
, m_bHasFilename(false)
- , m_xContext(comphelper::getProcessComponentContext())
{
m_xImpl->m_xCbOptions = m_xBuilder->weld_check_button("options");
m_xImpl->m_xFtFileName = m_xBuilder->weld_label("file_name_label");
@@ -494,7 +493,7 @@ SvtFileDialog::~SvtFileDialog()
}
}
- std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_xContext));
+ std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
officecfg::Office::Common::Misc::FilePickerPlacesUrls::set(placesUrlsList, batch);
officecfg::Office::Common::Misc::FilePickerPlacesNames::set(placesNamesList, batch);
batch->commit();
@@ -2284,8 +2283,8 @@ void SvtFileDialog::initDefaultPlaces( )
m_xImpl->m_xPlaces->AppendPlace( pRootPlace );
// Load from user settings
- Sequence< OUString > placesUrlsList(officecfg::Office::Common::Misc::FilePickerPlacesUrls::get(m_xContext));
- Sequence< OUString > placesNamesList(officecfg::Office::Common::Misc::FilePickerPlacesNames::get(m_xContext));
+ Sequence< OUString > placesUrlsList(officecfg::Office::Common::Misc::FilePickerPlacesUrls::get());
+ Sequence< OUString > placesNamesList(officecfg::Office::Common::Misc::FilePickerPlacesNames::get());
for(sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace)
{
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 3578ae883de6..86b707e3aedf 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -77,8 +77,6 @@ private:
m_pCurrentAsyncAction;
bool m_bInExecuteAsync;
bool m_bHasFilename;
- css::uno::Reference < css::uno::XComponentContext >
- m_xContext;
DECL_LINK( FilterSelectHdl_Impl, weld::ComboBox&, void );
DECL_LINK( FilterSelectTimerHdl_Impl, Timer*, void );