summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx
diff options
context:
space:
mode:
authorGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>2016-08-20 15:53:17 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2021-11-01 18:45:19 +0100
commite384a009c35542c51e0f991466af40b70a4fdb33 (patch)
tree72223f9443aa6d873ef3444d8d2c5dc134f5b425 /ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx
parent7541727dfc5938910ce58c73c4dfbcd727dcb7f1 (diff)
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 <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx')
-rw-r--r--ucb/source/ucp/webdav-curl/webdavcontentcaps.cxx18
1 files changed, 17 insertions, 1 deletions
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.