ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
New commits: commit e384a009c35542c51e0f991466af40b70a4fdb33 Author: Giuseppe Castagno <[email protected]> AuthorDate: Sat Aug 20 15:53:17 2016 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Mon Nov 1 18:45:19 2021 +0100 ucb: webdav-curl: Related: tdf#82677, add cache use in Content::getProperties() [ port of commit 00e1f840be4a1ff202d82377b3cbf233b352b1c3 ] Change-Id: I8c7f372404239276101fb7f64ba3415ef922e7e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123482 Tested-by: Michael Stahl <[email protected]> Reviewed-by: Michael Stahl <[email protected]> diff --git a/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx index ca1fde461ebf..e44e08812b73 100644 --- a/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx @@ -257,6 +257,8 @@ bool ContentProvider::getProperty( } +static PropertyNamesCache aStaticPropertyNamesCache; + // Content implementation. @@ -295,7 +297,21 @@ uno::Sequence< beans::Property > Content::getProperties( try { std::vector< DAVResourceInfo > props; - xResAccess->PROPFIND( DAVZERO, props, xEnv ); + OUString aTheURL( xResAccess->getURL() ); + PropertyNames aPropsNames( aTheURL ); + + if( !aStaticPropertyNamesCache.getCachedPropertyNames( aTheURL, aPropsNames ) ) + { + + xResAccess->PROPFIND( DAVZERO, props, xEnv ); + aPropsNames.setPropertiesNames( props ); + + aStaticPropertyNamesCache.addCachePropertyNames( aPropsNames, 10 ); + } + else + { + props = aPropsNames.getPropertiesNames(); + } // Note: vector always contains exactly one resource info, because // we used a depth of DAVZERO for PROPFIND.
