summaryrefslogtreecommitdiff
path: root/ucb
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 /ucb
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 'ucb')
-rw-r--r--ucb/source/ucp/webdav-curl/CurlSession.cxx4
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontent.cxx10
2 files changed, 7 insertions, 7 deletions
diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 90ce91c3cddc..3e48874c3108 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -650,7 +650,7 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext,
throw DAVException(DAVException::DAV_SESSION_CREATE,
ConnectionEndPointString(m_URI.GetHost(), m_URI.GetPort()));
}
- auto const connectTimeout(officecfg::Inet::Settings::ConnectTimeout::get(m_xContext));
+ auto const connectTimeout(officecfg::Inet::Settings::ConnectTimeout::get());
// default is 300s
rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_CONNECTTIMEOUT,
::std::max<long>(2L, ::std::min<long>(connectTimeout, 180L)));
@@ -660,7 +660,7 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext,
throw DAVException(DAVException::DAV_SESSION_CREATE,
ConnectionEndPointString(m_URI.GetHost(), m_URI.GetPort()));
}
- auto const readTimeout(officecfg::Inet::Settings::ReadTimeout::get(m_xContext));
+ auto const readTimeout(officecfg::Inet::Settings::ReadTimeout::get());
m_nReadTimeout = ::std::max<int>(20, ::std::min<long>(readTimeout, 180)) * 1000;
// default is infinite
rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_TIMEOUT, 300L);
diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
index 30f141368e3a..8528f31fa263 100644
--- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx
@@ -3971,23 +3971,23 @@ void Content::initOptsCacheLifeTime()
// officecfg/registry/schema/org/openoffice/Inet.xcs
// for use of these field values.
sal_uInt32 nAtime;
- nAtime = officecfg::Inet::Settings::OptsCacheLifeImplWeb::get( m_xContext );
+ nAtime = officecfg::Inet::Settings::OptsCacheLifeImplWeb::get();
m_nOptsCacheLifeImplWeb = std::max( sal_uInt32( 0 ),
std::min( nAtime, sal_uInt32( 3600 ) ) );
- nAtime = officecfg::Inet::Settings::OptsCacheLifeDAV::get( m_xContext );
+ nAtime = officecfg::Inet::Settings::OptsCacheLifeDAV::get();
m_nOptsCacheLifeDAV = std::max( sal_uInt32( 0 ),
std::min( nAtime, sal_uInt32( 3600 ) ) );
- nAtime = officecfg::Inet::Settings::OptsCacheLifeDAVLocked::get( m_xContext );
+ nAtime = officecfg::Inet::Settings::OptsCacheLifeDAVLocked::get();
m_nOptsCacheLifeDAVLocked = std::max( sal_uInt32( 0 ),
std::min( nAtime, sal_uInt32( 3600 ) ) );
- nAtime = officecfg::Inet::Settings::OptsCacheLifeNotImpl::get( m_xContext );
+ nAtime = officecfg::Inet::Settings::OptsCacheLifeNotImpl::get();
m_nOptsCacheLifeNotImpl = std::max( sal_uInt32( 0 ),
std::min( nAtime, sal_uInt32( 43200 ) ) );
- nAtime = officecfg::Inet::Settings::OptsCacheLifeNotFound::get( m_xContext );
+ nAtime = officecfg::Inet::Settings::OptsCacheLifeNotFound::get();
m_nOptsCacheLifeNotFound = std::max( sal_uInt32( 0 ),
std::min( nAtime, sal_uInt32( 30 ) ) );
}