diff options
author | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-08-20 15:53:17 +0200 |
---|---|---|
committer | Giuseppe Castagno <giuseppe.castagno@acca-esse.eu> | 2016-08-23 11:23:32 +0000 |
commit | 00e1f840be4a1ff202d82377b3cbf233b352b1c3 (patch) | |
tree | 2fd7e03dc91ec8e483f041d503d5707228668aed /ucb | |
parent | 8f49381a2174300985de114ca68f64f97a4ebe42 (diff) |
Related: tdf#82677, add cache use in Content::getProperties()
Change-Id: I47f583c808498aaf0f7cca1749fb5ef841ad10f3
Reviewed-on: https://gerrit.libreoffice.org/28274
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Giuseppe Castagno <giuseppe.castagno@acca-esse.eu>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx index fec4b627192f..4e0ce71e9151 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx @@ -282,6 +282,8 @@ bool ContentProvider::getProperty( } +static PropertyNamesCache aStaticPropertyNamesCache; + // Content implementation. @@ -321,7 +323,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. |