[Libreoffice-commits] core.git: ucb/source

Giuseppe Castagno giuseppe.castagno at acca-esse.eu
Tue Aug 23 11:23:56 UTC 2016


 ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 00e1f840be4a1ff202d82377b3cbf233b352b1c3
Author: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>
Date:   Sat Aug 20 15:53:17 2016 +0200

    Related: tdf#82677, add cache use in Content::getProperties()
    
    Change-Id: I47f583c808498aaf0f7cca1749fb5ef841ad10f3
    Reviewed-on: https://gerrit.libreoffice.org/28274
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Giuseppe Castagno <giuseppe.castagno at acca-esse.eu>

diff --git a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx
index fec4b62..4e0ce71 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.


More information about the Libreoffice-commits mailing list