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

Matúš Kukan matus.kukan at collabora.com
Tue Feb 25 23:49:14 PST 2014


 ucb/source/ucp/webdav/AprEnv.hxx                   |    2 
 ucb/source/ucp/webdav/ContentProperties.cxx        |    8 +--
 ucb/source/ucp/webdav/ContentProperties.hxx        |    4 -
 ucb/source/ucp/webdav/DAVProperties.cxx            |   14 +++---
 ucb/source/ucp/webdav/DAVResourceAccess.cxx        |   16 +++----
 ucb/source/ucp/webdav/DAVResourceAccess.hxx        |    4 -
 ucb/source/ucp/webdav/DAVSessionFactory.cxx        |    8 +--
 ucb/source/ucp/webdav/DAVSessionFactory.hxx        |    8 +--
 ucb/source/ucp/webdav/PropertyMap.hxx              |    4 -
 ucb/source/ucp/webdav/SerfCallbacks.cxx            |    5 +-
 ucb/source/ucp/webdav/SerfCallbacks.hxx            |    7 +--
 ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx      |    2 
 ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx    |    2 
 ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx     |    2 
 ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx      |    2 
 ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx      |   17 +------
 ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx  |   36 ++++++++-------
 ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx |   22 +++++----
 ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx       |   24 ----------
 ucb/source/ucp/webdav/SerfRequestProcessor.cxx     |   14 +++---
 ucb/source/ucp/webdav/SerfRequestProcessor.hxx     |    2 
 ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx |   35 ++++++++++++++-
 ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx |   11 +++-
 ucb/source/ucp/webdav/SerfSession.cxx              |   34 +++++++++-----
 ucb/source/ucp/webdav/SerfSession.hxx              |    6 --
 ucb/source/ucp/webdav/SerfTypes.hxx                |    2 
 ucb/source/ucp/webdav/SerfUri.hxx                  |    2 
 ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx     |    2 
 ucb/source/ucp/webdav/webdavcontent.cxx            |   48 +++++++++------------
 ucb/source/ucp/webdav/webdavcontent.hxx            |    6 +-
 ucb/source/ucp/webdav/webdavdatasupplier.cxx       |   40 ++++++++---------
 ucb/source/ucp/webdav/webdavdatasupplier.hxx       |    8 +--
 ucb/source/ucp/webdav/webdavprovider.cxx           |   16 +++----
 ucb/source/ucp/webdav/webdavprovider.hxx           |    2 
 ucb/source/ucp/webdav/webdavresponseparser.cxx     |    6 +-
 ucb/source/ucp/webdav/webdavresultset.cxx          |    8 +--
 36 files changed, 220 insertions(+), 209 deletions(-)

New commits:
commit d60301d03b098e1d45b8de6b169e9fb54600c3f1
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Feb 6 14:49:13 2014 +0100

    webdav: fix remaining build issues
    
    Change-Id: I9416551ba78a6a27071fdf92a6c36c271a1032b7

diff --git a/ucb/source/ucp/webdav/ContentProperties.cxx b/ucb/source/ucp/webdav/ContentProperties.cxx
index d04aa07..64106e1 100644
--- a/ucb/source/ucp/webdav/ContentProperties.cxx
+++ b/ucb/source/ucp/webdav/ContentProperties.cxx
@@ -424,7 +424,7 @@ void ContentProperties::addProperty( const OUString & rName,
                                      const com::sun::star::uno::Any & rValue,
                                      bool bIsCaseSensitive )
 {
-    if ( rName == DAVProperties::CREATIONDATE ) )
+    if ( rName == DAVProperties::CREATIONDATE )
     {
         // Map DAV:creationdate to UCP:DateCreated
         OUString aValue;
@@ -441,7 +441,7 @@ void ContentProperties::addProperty( const OUString & rName,
     //  else if ( rName.equals( DAVProperties::GETCONTENTLANGUAGE ) )
     //  {
     //  }
-    else if ( rName == DAVProperties::GETCONTENTLENGTH ) )
+    else if ( rName == DAVProperties::GETCONTENTLENGTH )
     {
         // Map DAV:getcontentlength to UCP:Size
         OUString aValue;
@@ -462,7 +462,7 @@ void ContentProperties::addProperty( const OUString & rName,
         (*m_xProps)[ OUString( "Size" ) ]
             = PropertyValue( uno::makeAny( aValue.toInt64() ), true );
     }
-    else if ( rName == DAVProperties::GETCONTENTTYPE ) )
+    else if ( rName == DAVProperties::GETCONTENTTYPE )
     {
         // Map DAV:getcontenttype to UCP:MediaType (1:1)
         (*m_xProps)[ OUString( "MediaType" ) ]
@@ -508,7 +508,7 @@ void ContentProperties::addProperty( const OUString & rName,
     //  else if ( rName.equals( DAVProperties::LOCKDISCOVERY ) )
     //  {
     //  }
-    else if ( rName == DAVProperties::RESOURCETYPE ) )
+    else if ( rName == DAVProperties::RESOURCETYPE )
     {
         OUString aValue;
         rValue >>= aValue;
diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx
index eabe6b4..34537d2 100644
--- a/ucb/source/ucp/webdav/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav/DAVProperties.cxx
@@ -198,7 +198,7 @@ bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OU
         return false;
 
     // TODO skip whitespaces?
-    if ( !rFullName.startsWith( "xmlns:prop=\"", ++nEnd ) )
+    if ( !rFullName.match( "xmlns:prop=\"", ++nEnd ) )
         return false;
 
     nStart = nEnd + RTL_CONSTASCII_LENGTH( "xmlns:prop=\"" );
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 83a0da1..fd5850a 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -1592,7 +1592,7 @@ SerfSession::isDomainMatch( OUString certHostName )
     if (hostName.equalsIgnoreAsciiCase( certHostName ) )
         return sal_True;
 
-    if ( certHostName.startsWith( '*' ) &&
+    if ( certHostName.startsWith( "*" ) &&
          hostName.getLength() >= certHostName.getLength()  )
     {
         OUString cmpStr = certHostName.copy( 1 );
diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
index f8f234f..ca48a10 100644
--- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
+++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
@@ -194,7 +194,7 @@ static OUString encodeValue( const OUString & rValue )
         else
             aResult.append( c );
     }
-    return OUString( aResult );
+    return aResult.makeStringAndClear();
 }
 
 /*
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 3d5d2aa..44a1d2c 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -573,7 +573,7 @@ uno::Any SAL_CALL Content::execute(
         // Note: Implemented by base class.
         aRet <<= getCommandInfo( Environment, sal_False );
     }
-    else if ( aCommand.Name "open" )
+    else if ( aCommand.Name == "open" )
     {
         //////////////////////////////////////////////////////////////////
         // open
diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
index 065c5bd..d70b161 100644
--- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
@@ -74,15 +74,15 @@ struct DataSupplier_Impl
     rtl::Reference< Content >                    m_xContent;
     uno::Reference< uno::XComponentContext > m_xContext;
     sal_Int32                                    m_nOpenMode;
-    sal_Bool                                     m_bCountFinal;
-    sal_Bool                                     m_bThrowException;
+    bool                                     m_bCountFinal;
+    bool                                     m_bThrowException;
 
     DataSupplier_Impl(
                 const uno::Reference< uno::XComponentContext >& rxContext,
                 const rtl::Reference< Content >& rContent,
                 sal_Int32 nOpenMode )
     : m_xContent( rContent ), m_xContext( rxContext ), m_nOpenMode( nOpenMode ),
-      m_bCountFinal( sal_False ), m_bThrowException( sal_False ) {}
+      m_bCountFinal( false ), m_bThrowException( false ) {}
     ~DataSupplier_Impl();
 };
 
@@ -229,14 +229,14 @@ DataSupplier::queryContent( sal_uInt32 nIndex )
 
 //=========================================================================
 // virtual
-sal_Bool DataSupplier::getResult( sal_uInt32 nIndex )
+bool DataSupplier::getResult( sal_uInt32 nIndex )
 {
     osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
 
     if ( m_pImpl->m_aResults.size() > nIndex )
     {
         // Result already present.
-        return sal_True;
+        return true;
     }
 
     // Obtain values...
@@ -245,11 +245,11 @@ sal_Bool DataSupplier::getResult( sal_uInt32 nIndex )
         if ( m_pImpl->m_aResults.size() > nIndex )
         {
             // Result already present.
-            return sal_True;
+            return true;
         }
     }
 
-    return sal_False;
+    return false;
 }
 
 //=========================================================================
@@ -271,7 +271,7 @@ sal_uInt32 DataSupplier::currentCount()
 
 //=========================================================================
 // virtual
-sal_Bool DataSupplier::isCountFinal()
+bool DataSupplier::isCountFinal()
 {
     return m_pImpl->m_bCountFinal;
 }
@@ -336,7 +336,7 @@ void DataSupplier::validate()
 }
 
 //=========================================================================
-sal_Bool DataSupplier::getData()
+bool DataSupplier::getData()
 {
     osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
 
@@ -379,8 +379,8 @@ sal_Bool DataSupplier::getData()
         }
         catch ( DAVException & )
         {
-//          OSL_ENSURE( sal_False, "PROPFIND : DAVException" );
-            m_pImpl->m_bThrowException = sal_True;
+//          OSL_ENSURE( false, "PROPFIND : DAVException" );
+            m_pImpl->m_bThrowException = true;
         }
 
         if ( !m_pImpl->m_bThrowException )
@@ -436,7 +436,7 @@ sal_Bool DataSupplier::getData()
                     {
                     case ucb::OpenMode::FOLDERS:
                         {
-                            sal_Bool bFolder = sal_False;
+                            bool bFolder = false;
 
                             const uno::Any & rValue
                                 = pContentProperties->getValue(
@@ -452,7 +452,7 @@ sal_Bool DataSupplier::getData()
 
                     case ucb::OpenMode::DOCUMENTS:
                         {
-                            sal_Bool bDocument = sal_False;
+                            bool bDocument = false;
 
                             const uno::Any & rValue
                                 = pContentProperties->getValue(
@@ -480,7 +480,7 @@ sal_Bool DataSupplier::getData()
             }
         }
 
-        m_pImpl->m_bCountFinal = sal_True;
+        m_pImpl->m_bCountFinal = true;
 
         // Callback possible, because listeners may be informed!
         aGuard.clear();
diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.hxx b/ucb/source/ucp/webdav/webdavdatasupplier.hxx
index dbeffb2..bc1c837 100644
--- a/ucb/source/ucp/webdav/webdavdatasupplier.hxx
+++ b/ucb/source/ucp/webdav/webdavdatasupplier.hxx
@@ -38,7 +38,7 @@ class DataSupplier : public ucbhelper::ResultSetDataSupplier
     DataSupplier_Impl* m_pImpl;
 
 private:
-    sal_Bool getData();
+    bool getData();
 
 public:
     DataSupplier( const com::sun::star::uno::Reference<
@@ -55,11 +55,11 @@ public:
     virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
     queryContent( sal_uInt32 nIndex );
 
-    virtual sal_Bool getResult( sal_uInt32 nIndex );
+    virtual bool getResult( sal_uInt32 nIndex );
 
     virtual sal_uInt32 totalCount();
     virtual sal_uInt32 currentCount();
-    virtual sal_Bool isCountFinal();
+    virtual bool isCountFinal();
 
     virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
     queryPropertyValues( sal_uInt32 nIndex  );
commit f9f70d95a19f7c139c2f9093e033edd9e6dcf45e
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Feb 6 14:19:16 2014 +0100

    webdav: fix include paths
    
    Change-Id: I323bef2e1c21e2a1981409d4295ccf555088e5ea

diff --git a/ucb/source/ucp/webdav/AprEnv.hxx b/ucb/source/ucp/webdav/AprEnv.hxx
index a887256..9b7c59b 100644
--- a/ucb/source/ucp/webdav/AprEnv.hxx
+++ b/ucb/source/ucp/webdav/AprEnv.hxx
@@ -21,7 +21,7 @@
 #ifndef INCLUDED_APRENV_HXX
 #define INCLUDED_APRENV_HXX
 
-#include <apr/apr_pools.h>
+#include <apr_pools.h>
 
 namespace apr_environment
 {
diff --git a/ucb/source/ucp/webdav/SerfCallbacks.hxx b/ucb/source/ucp/webdav/SerfCallbacks.hxx
index 1d8776f..a52602b 100644
--- a/ucb/source/ucp/webdav/SerfCallbacks.hxx
+++ b/ucb/source/ucp/webdav/SerfCallbacks.hxx
@@ -21,7 +21,7 @@
 #ifndef INCLUDED_CALLBACKS_HXX
 #define INCLUDED_CALLBACKS_HXX
 
-#include <serf/serf.h>
+#include <serf.h>
 
 extern "C" apr_status_t Serf_ConnectSetup( apr_socket_t *skt,
                                            serf_bucket_t **read_bkt,
diff --git a/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
index f098b80..1bc2098 100644
--- a/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfCopyReqProcImpl.cxx
@@ -19,7 +19,7 @@
 
 #include "SerfCopyReqProcImpl.hxx"
 
-#include <serf/serf.h>
+#include <serf.h>
 
 namespace http_dav_ucp
 {
diff --git a/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
index 893c407..9287408 100644
--- a/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfDeleteReqProcImpl.cxx
@@ -19,7 +19,7 @@
 
 #include "SerfDeleteReqProcImpl.hxx"
 
-#include <serf/serf.h>
+#include <serf.h>
 
 namespace http_dav_ucp
 {
diff --git a/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
index b7b2105..07c6725 100644
--- a/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfMkColReqProcImpl.cxx
@@ -19,7 +19,7 @@
 
 #include "SerfMkColReqProcImpl.hxx"
 
-#include <serf/serf.h>
+#include <serf.h>
 
 namespace http_dav_ucp
 {
diff --git a/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
index 4518fcd..b0cb2cc 100644
--- a/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfMoveReqProcImpl.cxx
@@ -19,7 +19,7 @@
 
 #include "SerfMoveReqProcImpl.hxx"
 
-#include <serf/serf.h>
+#include <serf.h>
 
 namespace http_dav_ucp
 {
diff --git a/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
index 4135e5d..1938fcb 100644
--- a/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
@@ -19,7 +19,7 @@
 
 #include "SerfPostReqProcImpl.hxx"
 
-#include <serf/serf.h>
+#include <serf.h>
 
 using namespace com::sun::star;
 
diff --git a/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
index e98ca26..a64ecff 100644
--- a/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
@@ -21,7 +21,7 @@
 
 #include "SerfPutReqProcImpl.hxx"
 
-#include <serf/serf.h>
+#include <serf.h>
 
 namespace http_dav_ucp
 {
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessor.hxx b/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
index d1bfe97..9addb34 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
@@ -24,7 +24,7 @@
 #include <apr_errno.h>
 #include <apr_pools.h>
 
-#include <serf/serf.h>
+#include <serf.h>
 
 #include "DAVTypes.hxx"
 #include "DAVResource.hxx"
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
index d26c9ef..9f42a8a 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
@@ -20,7 +20,7 @@
 #ifndef INCLUDED_SERFREQUESTPROCESSORIMPL_HXX
 #define INCLUDED_SERFREQUESTPROCESSORIMPL_HXX
 
-#include <serf/serf.h>
+#include <serf.h>
 
 #include <sal/types.h>
 #include "DAVRequestEnvironment.hxx"
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 621c85f..83a0da1 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <hash_map>
 #include <vector>
 #include <string.h>
 #include <rtl/string.h>
@@ -26,7 +25,7 @@
 #include "ucbhelper/simplecertificatevalidationrequest.hxx"
 
 #include "AprEnv.hxx"
-#include <apr/apr_strings.h>
+#include <apr_strings.h>
 
 #include "DAVAuthListener.hxx"
 #include "SerfTypes.hxx"
diff --git a/ucb/source/ucp/webdav/SerfTypes.hxx b/ucb/source/ucp/webdav/SerfTypes.hxx
index 5be06a6..b396697 100644
--- a/ucb/source/ucp/webdav/SerfTypes.hxx
+++ b/ucb/source/ucp/webdav/SerfTypes.hxx
@@ -22,7 +22,7 @@
 #ifndef INCLUDED_SERFTYPES_HXX
 #define INCLUDED_SERFTYPES_HXX
 
-#include <serf/serf.h>
+#include <serf.h>
 
 typedef serf_connection_t SerfConnection;
 
diff --git a/ucb/source/ucp/webdav/SerfUri.hxx b/ucb/source/ucp/webdav/SerfUri.hxx
index eb192b5..2a05790 100644
--- a/ucb/source/ucp/webdav/SerfUri.hxx
+++ b/ucb/source/ucp/webdav/SerfUri.hxx
@@ -21,7 +21,7 @@
 #ifndef INCLUDED_SERFURI_HXX
 #define INCLUDED_SERFURI_HXX
 
-#include <apr-util/apr_uri.h>
+#include <apr_uri.h>
 #include <rtl/ustring.hxx>
 #include "DAVException.hxx"
 
commit ff3b92017d3c831987ab437e48178e9d29a36bfb
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Feb 6 14:21:20 2014 +0100

    webdav: std::hash_set|map -> std::unordered_set|map
    
    Change-Id: Id0c18cb51af742d073d532662558fdd84d476f88

diff --git a/ucb/source/ucp/webdav/ContentProperties.hxx b/ucb/source/ucp/webdav/ContentProperties.hxx
index b9e075c..2e7054b 100644
--- a/ucb/source/ucp/webdav/ContentProperties.hxx
+++ b/ucb/source/ucp/webdav/ContentProperties.hxx
@@ -24,7 +24,7 @@
 
 #include <memory>
 #include <vector>
-#include <hash_map>
+#include <unordered_map>
 #include <rtl/ustring.hxx>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
@@ -82,7 +82,7 @@ public:
 
 };
 
-typedef std::hash_map
+typedef std::unordered_map
 <
     OUString,
     PropertyValue,
diff --git a/ucb/source/ucp/webdav/PropertyMap.hxx b/ucb/source/ucp/webdav/PropertyMap.hxx
index 2cb18e6..1729e07 100644
--- a/ucb/source/ucp/webdav/PropertyMap.hxx
+++ b/ucb/source/ucp/webdav/PropertyMap.hxx
@@ -22,7 +22,7 @@
 #ifndef _WEBDAV_UCP_PROPERTYMAP_HXX
 #define _WEBDAV_UCP_PROPERTYMAP_HXX
 
-#include <hash_set>
+#include <unordered_set>
 #include <com/sun/star/beans/Property.hpp>
 
 namespace http_dav_ucp {
@@ -46,7 +46,7 @@ struct hashPropertyName
     }
 };
 
-typedef std::hash_set
+typedef std::unordered_set
 <
     ::com::sun::star::beans::Property,
     hashPropertyName,
diff --git a/ucb/source/ucp/webdav/webdavresponseparser.cxx b/ucb/source/ucp/webdav/webdavresponseparser.cxx
index 1b87086..dc1ffb6 100644
--- a/ucb/source/ucp/webdav/webdavresponseparser.cxx
+++ b/ucb/source/ucp/webdav/webdavresponseparser.cxx
@@ -28,7 +28,7 @@
 #include <com/sun/star/ucb/LockScope.hpp>
 #include <com/sun/star/ucb/LockType.hpp>
 #include <map>
-#include <hash_map>
+#include <unordered_map>
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -64,7 +64,7 @@ namespace
 } // end of anonymous namespace
 
 //////////////////////////////////////////////////////////////////////////////
-// WebDAVName enum and StringToEnum converter using hash_map
+// WebDAVName enum and StringToEnum converter using unordered_map
 
 namespace
 {
@@ -96,7 +96,7 @@ namespace
 
     WebDAVName StrToWebDAVName(const OUString& rStr)
     {
-        typedef std::hash_map< OUString, WebDAVName, OUStringHash > WebDAVNameMapper;
+        typedef std::unordered_map< OUString, WebDAVName, OUStringHash > WebDAVNameMapper;
         typedef std::pair< OUString, WebDAVName > WebDAVNameValueType;
         static WebDAVNameMapper aWebDAVNameMapperList;
 
commit aa68e4c54952578fcf644f7a6df5174028a1412d
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Feb 6 22:59:42 2014 +0100

    webdav: fix cherry-pick commit 7056e8ef89e938e38fc5b2b8a7493f0c79d5efd4
    
    Change-Id: I177daf0d4e22d96167ab094a5c9d5c9cab6cf409

diff --git a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
index 1d5d0f0..557a0e7 100644
--- a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
@@ -113,14 +113,14 @@ serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t
                                                    thePropName );
 
                 /* <*propname* xmlns="*propns*" /> */
-                aBodyText += "<";
-                aBodyText += OUString::createFromAscii( thePropName.name );
-                aBodyText += " xmlnx=\"";
-                aBodyText += OUString::createFromAscii( thePropName.nspace );
-                aBodyText += "\"/>";
+                aBuffer.append( "<" );
+                aBuffer.append( thePropName.name );
+                aBuffer.append( " xmlnx=\"" );
+                aBuffer.append( thePropName.nspace );
+                aBuffer.append( "\"/>" );
             }
 
-            aBodyText = "<prop>" + aBodyText + "</prop>";
+            aBuffer.append( "</prop>" );
         }
         else
         {
commit 43fc67adcc3bdc5efaaaf9b0d65e53e99880b18a
Author: Herbert Dürr <hdu at apache.org>
Date:   Fri Feb 7 11:40:26 2014 +0100

     #i123068# remove implicit conversions from rtl strings to their elements
    
    (cherry picked from commit 1a15756db5173403fcdbc3ad522c3a76e88a7082)
    
    Conflicts:
    	ucb/source/ucp/webdav/DAVProperties.cxx
    	ucb/source/ucp/webdav/SerfRequestProcessor.cxx
    	ucb/source/ucp/webdav/SerfSession.cxx
    
    Rest ignored.
    
    Change-Id: I7d25170cc07538dbab70bc72af8764820da2b60b

diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx
index be21621..eabe6b4 100644
--- a/ucb/source/ucp/webdav/DAVProperties.cxx
+++ b/ucb/source/ucp/webdav/DAVProperties.cxx
@@ -58,7 +58,7 @@ void DAVProperties::createSerfPropName( const OUString & rFullName,
         rName.name
             = strdup( OUStringToOString(
                         rFullName.copy( RTL_CONSTASCII_LENGTH( "DAV:" ) ),
-                                        RTL_TEXTENCODING_UTF8 ) );
+                                        RTL_TEXTENCODING_UTF8 ).getStr() );
     }
     else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) )
     {
@@ -68,7 +68,7 @@ void DAVProperties::createSerfPropName( const OUString & rFullName,
                         rFullName.copy(
                             RTL_CONSTASCII_LENGTH(
                                 "http://apache.org/dav/props/" ) ),
-                            RTL_TEXTENCODING_UTF8 ) );
+                            RTL_TEXTENCODING_UTF8 ).getStr() );
     }
     else if ( rFullName.startsWith( "http://ucb.openoffice.org/dav/props/" ) )
     {
@@ -78,7 +78,7 @@ void DAVProperties::createSerfPropName( const OUString & rFullName,
                         rFullName.copy(
                             RTL_CONSTASCII_LENGTH(
                                 "http://ucb.openoffice.org/dav/props/" ) ),
-                            RTL_TEXTENCODING_UTF8 ) );
+                            RTL_TEXTENCODING_UTF8 ).getStr() );
     }
     else if ( rFullName.startsWith( "<prop:" ) )
     {
@@ -91,11 +91,11 @@ void DAVProperties::createSerfPropName( const OUString & rFullName,
 
         sal_Int32 nStart = RTL_CONSTASCII_LENGTH( "<prop:" );
         sal_Int32 nLen = aFullName.indexOf( ' ' ) - nStart;
-        rName.name = strdup( aFullName.copy( nStart, nLen ) );
+        rName.name = strdup( aFullName.copy( nStart, nLen ).getStr() );
 
         nStart = aFullName.indexOf( '=', nStart + nLen ) + 2; // after ="
         nLen = aFullName.getLength() - RTL_CONSTASCII_LENGTH( "\">" ) - nStart;
-        rName.nspace = strdup( aFullName.copy( nStart, nLen ) );
+        rName.nspace = strdup( aFullName.copy( nStart, nLen ).getStr() );
     }
     else
     {
@@ -103,7 +103,7 @@ void DAVProperties::createSerfPropName( const OUString & rFullName,
         rName.nspace = "http://ucb.openoffice.org/dav/props/";
         rName.name
             = strdup( OUStringToOString( rFullName,
-                                              RTL_TEXTENCODING_UTF8 ) );
+                                              RTL_TEXTENCODING_UTF8 ).getStr() );
     }
 }
 
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessor.cxx b/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
index dbf1ec1..5e2b67e 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
@@ -50,7 +50,7 @@ SerfRequestProcessor::SerfRequestProcessor( SerfSession& rSerfSession,
     , mbHandleSerfResponseCalled( false )
 {
     mPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
-                            OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ) );
+                            OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ).getStr() );
 }
 
 SerfRequestProcessor::~SerfRequestProcessor()
@@ -209,9 +209,9 @@ bool SerfRequestProcessor::processPost( const char* inData,
                                         apr_status_t& outSerfStatus )
 {
     mContentType = apr_pstrdup( mrSerfSession.getAprPool(),
-                                OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ) );
+                                OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
     mReferer = apr_pstrdup( mrSerfSession.getAprPool(),
-                                OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ) );
+                                OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
     mpProcImpl = createPostReqProcImpl( mPathStr,
                                         mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
                                         inData,
@@ -233,9 +233,9 @@ bool SerfRequestProcessor::processPost( const char* inData,
                                         apr_status_t& outSerfStatus )
 {
     mContentType = apr_pstrdup( mrSerfSession.getAprPool(),
-                                OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ) );
+                                OUStringToOString( inContentType, RTL_TEXTENCODING_UTF8 ).getStr() );
     mReferer = apr_pstrdup( mrSerfSession.getAprPool(),
-                            OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ) );
+                            OUStringToOString( inReferer, RTL_TEXTENCODING_UTF8 ).getStr() );
     mpProcImpl = createPostReqProcImpl( mPathStr,
                                         mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
                                         inData,
@@ -274,7 +274,7 @@ bool SerfRequestProcessor::processCopy( const OUString & inDestinationPath,
                                         apr_status_t& outSerfStatus )
 {
     mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
-                                OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ) );
+                                OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
     mpProcImpl = createCopyReqProcImpl( mPathStr,
                                         mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
                                         mDestPathStr,
@@ -290,7 +290,7 @@ bool SerfRequestProcessor::processMove( const OUString & inDestinationPath,
                                         apr_status_t& outSerfStatus )
 {
     mDestPathStr = apr_pstrdup( mrSerfSession.getAprPool(),
-                                OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ) );
+                                OUStringToOString( inDestinationPath, RTL_TEXTENCODING_UTF8 ).getStr() );
     mpProcImpl = createMoveReqProcImpl( mPathStr,
                                         mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
                                         mDestPathStr,
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 0b56bd1..621c85f 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -163,7 +163,7 @@ void SerfSession::Init()
         {
             apr_sockaddr_t *proxy_address = NULL;
             const apr_status_t status = apr_sockaddr_info_get( &proxy_address,
-                                                               OUStringToOString( m_aProxyName, RTL_TEXTENCODING_UTF8 ),
+                                                               OUStringToOString( m_aProxyName, RTL_TEXTENCODING_UTF8 ).getStr(),
                                                                APR_UNSPEC,
                                                                static_cast<apr_port_t>(m_nProxyPort),
                                                                0, getAprPool() );
@@ -339,8 +339,8 @@ apr_status_t SerfSession::provideSerfCredentials( bool bGiveProvidedCredentialsA
 
     if ( theRetVal == 0 )
     {
-        *outUsername = apr_pstrdup( inAprPool, OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ) );
-        *outPassword = apr_pstrdup( inAprPool, OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ) );
+        *outUsername = apr_pstrdup( inAprPool, OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ).getStr() );
+        *outPassword = apr_pstrdup( inAprPool, OUStringToOString( thePassWord, RTL_TEXTENCODING_UTF8 ).getStr() );
     }
 
     return theRetVal != 0 ? SERF_ERROR_AUTHN_FAILED : APR_SUCCESS;
commit ff824e87a51b1242f0584a35ce3fc7a579152cd2
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Fri Apr 5 14:07:46 2013 +0000

     #122008# - use <serf_bucket_headers_setc(..)>
    
    when header name's data need to be copied
    
    (cherry picked from commit e50d4638e4fe64eb05b8f22006c7f04c05ec288b)
    
    Change-Id: Ib4f171b05bafe380187a09cbfe143b0bef8b6f25

diff --git a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
index 801a920..e20cffc 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
@@ -96,9 +96,9 @@ void SerfRequestProcessorImpl::setRequestHeaders( serf_bucket_t* inoutSerfHeader
         if ( !bHasUserAgent )
             bHasUserAgent = aHeaderIter->first == "User-Agent";
 
-        serf_bucket_headers_set( inoutSerfHeaderBucket,
-                                 aHeader.getStr(),
-                                 aValue.getStr() );
+        serf_bucket_headers_setc( inoutSerfHeaderBucket,
+                                  aHeader.getStr(),
+                                  aValue.getStr() );
 
         ++aHeaderIter;
     }
commit 6a8e29563ca28ebb6e0bef34c20c82a2c0262c36
Author: Herbert Dürr <hdu at apache.org>
Date:   Fri Feb 1 07:52:26 2013 +0000

    minor WaE cleanup for SerfRequestProcessorImpl.hxx
    
    that solves another dozen warnings
    (cherry picked from commit f42f6eb8aa2ab01befeba42871d9d5c7b381f49f)
    
    Change-Id: Ia06cee06e04b09fe6ed45cf4159722be191a21d2

diff --git a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
index 8e00416..d26c9ef 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
@@ -64,7 +64,7 @@ protected:
     void handleEndOfResponseData( serf_bucket_t * inSerfResponseBucket ) = 0;
 
     const char* getPathStr() const;
-    const bool useChunkedEncoding() const;
+    bool useChunkedEncoding() const;
 
 private:
     const char* mPathStr;
commit da41a44fb3883d6d72e6c22605eec7d29559dfb0
Author: Andre Fischer <af at apache.org>
Date:   Wed Jun 20 07:12:37 2012 +0000

    #i120041# Update of serf library from 1.0.0 to 1.1.0.
    
    (cherry picked from commit eb0311f38de6c30fb15f87b4599e932897f281f5)
    
    Conflicts:
    	external_deps.lst
    	scp2/source/ooo/file_library_ooo.scp
    	solenv/bin/download_external_dependencies.pl
    	ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
    	ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
    	ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
    	ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
    	ucb/source/ucp/webdav/SerfSession.cxx
    
    Change-Id: I6b9576226f86b87397bedc2b67a9289bc19317a7

diff --git a/ucb/source/ucp/webdav/SerfCallbacks.cxx b/ucb/source/ucp/webdav/SerfCallbacks.cxx
index c0aa58b..afa177a 100644
--- a/ucb/source/ucp/webdav/SerfCallbacks.cxx
+++ b/ucb/source/ucp/webdav/SerfCallbacks.cxx
@@ -59,8 +59,9 @@ extern "C" apr_status_t Serf_Credentials( char **username,
 extern "C" apr_status_t Serf_CertificateChainValidation(
     void* pSerfSession,
     int nFailures,
-    const char** pCertificateChainBase64Encoded,
-    int nCertificateChainLength)
+    int nErrorCode,
+    const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
+    apr_size_t nCertificateChainLength)
 {
     return static_cast<SerfSession*>(pSerfSession)
         ->verifySerfCertificateChain(nFailures, pCertificateChainBase64Encoded, nCertificateChainLength);
diff --git a/ucb/source/ucp/webdav/SerfCallbacks.hxx b/ucb/source/ucp/webdav/SerfCallbacks.hxx
index 78b0d06..1d8776f 100644
--- a/ucb/source/ucp/webdav/SerfCallbacks.hxx
+++ b/ucb/source/ucp/webdav/SerfCallbacks.hxx
@@ -41,8 +41,9 @@ extern "C" apr_status_t Serf_Credentials( char **username,
 extern "C" apr_status_t Serf_CertificateChainValidation(
     void* pSerfSession,
     int nFailures,
-    const char** pCertificateChainBase64Encoded,
-    int nCertificateChainLength);
+    int error_depth,
+    const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
+    apr_size_t nCertificateChainLength);
 
 extern "C" apr_status_t Serf_SetupRequest( serf_request_t *request,
                                            void *setup_baton,
diff --git a/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
index 5bf1ce9..4135e5d 100644
--- a/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPostReqProcImpl.cxx
@@ -73,10 +73,6 @@ serf_bucket_t * SerfPostReqProcImpl::createSerfRequestBucket( serf_request_t * i
     if ( mpPostData != 0 && mnPostDataLen > 0 )
     {
         body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpPostData, mnPostDataLen, pSerfBucketAlloc );
-        if ( useChunkedEncoding() )
-        {
-            body_bkt = serf_bucket_chunk_create( body_bkt, pSerfBucketAlloc );
-        }
     }
 
     // create serf request
@@ -91,16 +87,9 @@ serf_bucket_t * SerfPostReqProcImpl::createSerfRequestBucket( serf_request_t * i
     // general header fields provided by caller
     setRequestHeaders( hdrs_bkt );
 
+    handleChunkedEncoding(req_bkt, mnPostDataLen);
+
     // request specific header fields
-    if ( body_bkt != 0 )
-    {
-        if ( useChunkedEncoding() )
-        {
-            serf_bucket_headers_set( hdrs_bkt, "Transfer-Encoding", "chunked");
-        }
-        serf_bucket_headers_set( hdrs_bkt, "Content-Length",
-                                 OUStringToOString( OUString::valueOf( (sal_Int32)mnPostDataLen ), RTL_TEXTENCODING_UTF8 ) );
-    }
     if ( mpContentType != 0 )
     {
         serf_bucket_headers_set( hdrs_bkt, "Content-Type", mpContentType );
diff --git a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
index 9cff1d7..1d5d0f0 100644
--- a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
@@ -147,23 +147,25 @@ serf_bucket_t * SerfPropFindReqProcImpl::createSerfRequestBucket( serf_request_t
                                                                  getPathStr(),
                                                                  body_bkt,
                                                                  pSerfBucketAlloc );
+    handleChunkedEncoding(req_bkt, aBodyText.getLength());
 
     // set request header fields
     serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-
-    // request specific header fields
-    serf_bucket_headers_set( hdrs_bkt, "Depth", mDepthStr );
-    if ( body_bkt != 0 && aBodyText.getLength() > 0 )
+    if (hdrs_bkt != NULL)
     {
-        if ( useChunkedEncoding() )
+        // general header fields provided by caller
+        setRequestHeaders( hdrs_bkt );
+
+        // request specific header fields
+        serf_bucket_headers_set( hdrs_bkt, "Depth", mDepthStr );
+        if (hdrs_bkt!=NULL && body_bkt != 0 && aBodyText.getLength() > 0 )
         {
-            serf_bucket_headers_set( hdrs_bkt, "Transfer-Encoding", "chunked");
+            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
         }
-        serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
-        serf_bucket_headers_set( hdrs_bkt, "Content-Length",
-                                 OUStringToOString( OUString::valueOf( aBodyText.getLength() ), RTL_TEXTENCODING_UTF8 ) );
+    }
+    else
+    {
+        OSL_ASSERT("Headers Bucket missing");
     }
 
     return req_bkt;
diff --git a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
index 809a81e..86a97ae 100644
--- a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
@@ -152,22 +152,24 @@ serf_bucket_t * SerfPropPatchReqProcImpl::createSerfRequestBucket( serf_request_
                                                                  getPathStr(),
                                                                  body_bkt,
                                                                  pSerfBucketAlloc ) ;
+    handleChunkedEncoding(req_bkt, aBodyText.getLength());
 
     // set request header fields
     serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-
-    // request specific header fields
-    if ( body_bkt != 0 && aBodyText.getLength() > 0 )
+    if (hdrs_bkt != NULL)
     {
-        if ( useChunkedEncoding() )
+        // general header fields provided by caller
+        setRequestHeaders( hdrs_bkt );
+
+        // request specific header fields
+        if ( body_bkt != 0 && aBodyText.getLength() > 0 )
         {
-            serf_bucket_headers_set( hdrs_bkt, "Transfer-Encoding", "chunked");
+            serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
         }
-        serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
-        serf_bucket_headers_set( hdrs_bkt, "Content-Length",
-                                 OUStringToOString( OUString::valueOf( aBodyText.getLength() ), RTL_TEXTENCODING_UTF8 ) );
+    }
+    else
+    {
+        OSL_ASSERT("Headers Bucket missing");
     }
 
     return req_bkt;
diff --git a/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
index e3617f9..e98ca26 100644
--- a/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx
@@ -49,10 +49,6 @@ serf_bucket_t * SerfPutReqProcImpl::createSerfRequestBucket( serf_request_t * in
     if ( mpData != 0 && mnDataLen > 0 )
     {
         body_bkt = SERF_BUCKET_SIMPLE_STRING_LEN( mpData, mnDataLen, pSerfBucketAlloc );
-        if ( useChunkedEncoding() )
-        {
-            body_bkt = serf_bucket_chunk_create( body_bkt, pSerfBucketAlloc );
-        }
     }
 
     // create serf request
@@ -61,23 +57,7 @@ serf_bucket_t * SerfPutReqProcImpl::createSerfRequestBucket( serf_request_t * in
                                                                  getPathStr(),
                                                                  body_bkt,
                                                                  serf_request_get_alloc( inSerfRequest ) );
-
-    // set request header fields
-    serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
-    // general header fields provided by caller
-    setRequestHeaders( hdrs_bkt );
-
-    // request specific header fields
-    if ( body_bkt != 0 )
-    {
-        if ( useChunkedEncoding() )
-        {
-            serf_bucket_headers_set( hdrs_bkt, "Transfer-Encoding", "chunked");
-        }
-        serf_bucket_headers_set( hdrs_bkt, "Content-Length",
-                                 OUStringToOString( OUString::valueOf( (sal_Int32)mnDataLen ), RTL_TEXTENCODING_UTF8 ) );
-    }
-
+    handleChunkedEncoding(req_bkt, mnDataLen);
 
     // set request header fields
     serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
index 49963ca0..801a920 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.cxx
@@ -20,6 +20,14 @@
 #include "SerfRequestProcessorImpl.hxx"
 #include "webdavuseragent.hxx"
 
+namespace
+{
+// Define a magic value that is used by serf to reset chunked
+// encoding.  The value definition is not supported by serf, hence the
+// definition here.
+static const apr_int64_t SERF_UNKNOWN_LENGTH (-1);
+}
+
 namespace http_dav_ucp
 {
 
@@ -50,6 +58,27 @@ bool SerfRequestProcessorImpl::useChunkedEncoding() const
     return mbUseChunkedEncoding;
 }
 
+
+void SerfRequestProcessorImpl::handleChunkedEncoding (
+    serf_bucket_t* pRequestBucket,
+    apr_int64_t nLength) const
+{
+    if (pRequestBucket != NULL)
+    {
+        if (useChunkedEncoding())
+        {
+            // Activate chunked encoding.
+            serf_bucket_request_set_CL(pRequestBucket, SERF_UNKNOWN_LENGTH);
+        }
+        else
+        {
+            // Deactivate chunked encoding by setting the length.
+            serf_bucket_request_set_CL(pRequestBucket, nLength);
+        }
+    }
+}
+
+
 void SerfRequestProcessorImpl::setRequestHeaders( serf_bucket_t* inoutSerfHeaderBucket )
 {
     bool bHasUserAgent( false );
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
index 1c15621..8e00416 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessorImpl.hxx
@@ -47,6 +47,13 @@ public:
 
     void activateChunkedEncoding();
 
+    /** Turn chunked encoding on or off, dependeing on the result of
+        useChunkedEncoding().
+    */
+    void handleChunkedEncoding (
+        serf_bucket_t* pRequestBucket,
+        apr_int64_t nLength) const;
+
 protected:
     void setRequestHeaders( serf_bucket_t* inoutSerfHeaderBucket );
 
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 4364a69..0b56bd1 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -269,6 +269,7 @@ apr_status_t SerfSession::setupSerfConnection( apr_socket_t * inAprSocket,
         */
         serf_ssl_server_cert_chain_callback_set(
             serf_bucket_ssl_decrypt_context_get(tmpInputBkt),
+            NULL,
             Serf_CertificateChainValidation,
             this);
         serf_ssl_set_hostname( serf_bucket_ssl_decrypt_context_get( tmpInputBkt ),
@@ -366,7 +367,7 @@ namespace {
 
 apr_status_t SerfSession::verifySerfCertificateChain (
     int,
-    const char** pCertificateChainBase64Encoded,
+    const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
     int nCertificateChainLength)
 {
     // Check arguments.
@@ -411,9 +412,13 @@ apr_status_t SerfSession::verifySerfCertificateChain (
     }
 
     // Decode the server certificate.
+    const char* sBase64EncodedServerCertificate (
+        serf_ssl_cert_export(
+            pCertificateChainBase64Encoded[0],
+            getAprPool()));
     uno::Reference< security::XCertificate > xServerCertificate(
         xSecurityEnv->createCertificateFromAscii(
-            OUString::createFromAscii(pCertificateChainBase64Encoded[0])));
+            OUString::createFromAscii(sBase64EncodedServerCertificate)));
     if ( ! xServerCertificate.is())
         return SERF_SSL_CERT_UNKNOWN_FAILURE;
 
@@ -454,9 +459,13 @@ apr_status_t SerfSession::verifySerfCertificateChain (
     std::vector< uno::Reference< security::XCertificate > > aChain;
     for (int nIndex=1; nIndex<nCertificateChainLength; ++nIndex)
     {
+        const char* sBase64EncodedCertificate (
+            serf_ssl_cert_export(
+                pCertificateChainBase64Encoded[nIndex],
+                getAprPool()));
         uno::Reference< security::XCertificate > xCertificate(
             xSecurityEnv->createCertificateFromAscii(
-                OUString::createFromAscii(pCertificateChainBase64Encoded[nIndex])));
+                OUString::createFromAscii(sBase64EncodedCertificate)));
         if ( ! xCertificate.is())
             return SERF_SSL_CERT_UNKNOWN_FAILURE;
         aChain.push_back(xCertificate);
diff --git a/ucb/source/ucp/webdav/SerfSession.hxx b/ucb/source/ucp/webdav/SerfSession.hxx
index a84fcc1..291c185 100644
--- a/ucb/source/ucp/webdav/SerfSession.hxx
+++ b/ucb/source/ucp/webdav/SerfSession.hxx
@@ -96,7 +96,7 @@ public:
 
     apr_status_t verifySerfCertificateChain (
         int nFailures,
-        const char** pCertificateChainBase64Encoded,
+        const serf_ssl_certificate_t * const * pCertificateChainBase64Encoded,
         int nCertificateChainLength);
 
     serf_bucket_t* acceptSerfResponse( serf_request_t * inSerfRequest,
commit 317b5bdadebc5560d38da4c9dd6d68c64a93b9a8
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Thu Feb 6 16:02:47 2014 +0100

    webdav: lang::XMultiServiceFactory -> uno::XComponentContext
    
    Change-Id: I71984066a512a023c67d1690bd984d66f75f894b

diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index 088b868..c997a4a 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -131,12 +131,12 @@ int DAVAuthListener_Impl::authenticate(
 
 //=========================================================================
 DAVResourceAccess::DAVResourceAccess(
-    const uno::Reference< lang::XMultiServiceFactory > & rSMgr,
+    const uno::Reference< uno::XComponentContext > & rContext,
     rtl::Reference< DAVSessionFactory > const & rSessionFactory,
     const OUString & rURL )
 : m_aURL( rURL ),
   m_xSessionFactory( rSessionFactory ),
-  m_xSMgr( rSMgr )
+  m_xContext( rContext )
 {
 }
 
@@ -146,7 +146,7 @@ DAVResourceAccess::DAVResourceAccess( const DAVResourceAccess & rOther )
   m_aPath( rOther.m_aPath ),
   m_xSession( rOther.m_xSession ),
   m_xSessionFactory( rOther.m_xSessionFactory ),
-  m_xSMgr( rOther.m_xSMgr ),
+  m_xContext( rOther.m_xContext ),
   m_aRedirectURIs( rOther.m_aRedirectURIs )
 {
 }
@@ -159,7 +159,7 @@ DAVResourceAccess & DAVResourceAccess::operator=(
     m_aPath           = rOther.m_aPath;
     m_xSession        = rOther.m_xSession;
     m_xSessionFactory = rOther.m_xSessionFactory;
-    m_xSMgr           = rOther.m_xSMgr;
+    m_xContext           = rOther.m_xContext;
     m_aRedirectURIs   = rOther.m_aRedirectURIs;
 
     return *this;
@@ -592,7 +592,7 @@ void DAVResourceAccess::PUT(
     // Make stream seekable, if it not. Needed, if request must be retried.
     uno::Reference< io::XInputStream > xSeekableStream
         = comphelper::OSeekableInputWrapper::CheckSeekableCanWrap(
-            rStream, m_xSMgr );
+            rStream, m_xContext );
 
     int errorCount = 0;
     bool bRetry = false;
@@ -641,7 +641,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST(
     // Make stream seekable, if it not. Needed, if request must be retried.
     uno::Reference< io::XInputStream > xSeekableStream
         = comphelper::OSeekableInputWrapper::CheckSeekableCanWrap(
-            rInputStream, m_xSMgr );
+            rInputStream, m_xContext );
 
     uno::Reference< io::XInputStream > xStream;
     int errorCount = 0;
@@ -705,7 +705,7 @@ void DAVResourceAccess::POST(
     // Make stream seekable, if it not. Needed, if request must be retried.
     uno::Reference< io::XInputStream > xSeekableStream
         = comphelper::OSeekableInputWrapper::CheckSeekableCanWrap(
-            rInputStream, m_xSMgr );
+            rInputStream, m_xContext );
 
     int errorCount = 0;
     bool bRetry  = false;
@@ -1068,7 +1068,7 @@ void DAVResourceAccess::initialize()
 
             // create new webdav session
             m_xSession
-                = m_xSessionFactory->createDAVSession( m_aURL, m_xSMgr );
+                = m_xSessionFactory->createDAVSession( m_aURL, m_xContext );
 
             if ( !m_xSession.is() )
                 return;
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx
index 222b37e..4c14270 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx
@@ -51,13 +51,13 @@ class DAVResourceAccess
     rtl::Reference< DAVSession > m_xSession;
     rtl::Reference< DAVSessionFactory > m_xSessionFactory;
     com::sun::star::uno::Reference<
-        com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+        com::sun::star::uno::XComponentContext > m_xContext;
     std::vector< SerfUri > m_aRedirectURIs;
 
 public:
     DAVResourceAccess() : m_xSessionFactory( 0 ) {}
     DAVResourceAccess( const com::sun::star::uno::Reference<
-                           com::sun::star::lang::XMultiServiceFactory > & rSMgr,
+                           com::sun::star::uno::XComponentContext > & rContext,
                        rtl::Reference<
                        DAVSessionFactory > const & rSessionFactory,
                        const OUString & rURL );
diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
index 77bb317..409d2e9 100644
--- a/ucb/source/ucp/webdav/DAVSessionFactory.cxx
+++ b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
@@ -20,7 +20,7 @@
 #include "DAVSessionFactory.hxx"
 #include "SerfSession.hxx"
 #include "SerfUri.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 
 using namespace http_dav_ucp;
 using namespace com::sun::star;
@@ -31,15 +31,15 @@ DAVSessionFactory::~DAVSessionFactory()
 
 rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
                 const OUString & inUri,
-                const uno::Reference< lang::XMultiServiceFactory > & rxSMgr )
+                const uno::Reference< uno::XComponentContext > & rxContext )
     throw( DAVException )
 {
-    m_xMSF = rxSMgr;
+    m_xMSF = rxContext;
 
     osl::MutexGuard aGuard( m_aMutex );
 
     if ( !m_xProxyDecider.get() )
-        m_xProxyDecider.reset( new ucbhelper::InternetProxyDecider( rxSMgr ) );
+        m_xProxyDecider.reset( new ucbhelper::InternetProxyDecider( rxContext ) );
 
     Map::iterator aIt( m_aMap.begin() );
     Map::iterator aEnd( m_aMap.end() );
diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.hxx b/ucb/source/ucp/webdav/DAVSessionFactory.hxx
index 27f58ef..6617e8c 100644
--- a/ucb/source/ucp/webdav/DAVSessionFactory.hxx
+++ b/ucb/source/ucp/webdav/DAVSessionFactory.hxx
@@ -52,11 +52,11 @@ public:
     rtl::Reference< DAVSession >
         createDAVSession( const OUString & inUri,
                           const ::com::sun::star::uno::Reference<
-                            ::com::sun::star::lang::XMultiServiceFactory >&
-                                rxSMgr )
+                            ::com::sun::star::uno::XComponentContext >&
+                                rxContext )
             throw( DAVException );
 
-    ::uno::Reference< ::lang::XMultiServiceFactory > getServiceFactory() {  return m_xMSF; }
+    ::uno::Reference< ::uno::XComponentContext > getServiceFactory() {  return m_xMSF; }
 private:
     typedef std::map< OUString, DAVSession * > Map;
 
@@ -64,7 +64,7 @@ private:
     osl::Mutex m_aMutex;
     std::auto_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider;
 
-    ::uno::Reference< ::lang::XMultiServiceFactory > m_xMSF;
+    ::uno::Reference< ::uno::XComponentContext > m_xMSF;
 
     void releaseElement( DAVSession * pElement ) SAL_THROW(());
 
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index b836890..4364a69 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -385,12 +385,14 @@ apr_status_t SerfSession::verifySerfCertificateChain (
     uno::Reference< xml::crypto::XSecurityEnvironment > xSecurityEnv;
     try
     {
+        css::uno::Reference< css::uno::XComponentContext > xContext =
+            ::comphelper::getProcessComponentContext();
         // Create a certificate container.
-        xCertificateContainer = security::CertificateContainer::create( comphelper::getComponentContext(getMSF()) );
+        xCertificateContainer = security::CertificateContainer::create( xContext );
 
         xSEInitializer = uno::Reference< xml::crypto::XSEInitializer >(
-            getMSF()->createInstance(
-                OUString( "com.sun.star.xml.crypto.SEInitializer" ) ),
+            xContext->getServiceManager()->createInstanceWithContext(
+                OUString( "com.sun.star.xml.crypto.SEInitializer" ), xContext ),
             uno::UNO_QUERY_THROW);
 
         xSecurityContext = xSEInitializer->createSecurityContext( OUString() );
diff --git a/ucb/source/ucp/webdav/SerfSession.hxx b/ucb/source/ucp/webdav/SerfSession.hxx
index aa75d45..a84fcc1 100644
--- a/ucb/source/ucp/webdav/SerfSession.hxx
+++ b/ucb/source/ucp/webdav/SerfSession.hxx
@@ -29,7 +29,6 @@
 #include "SerfTypes.hxx"
 //#include "SerfLockStore.hxx"
 #include "SerfUri.hxx"
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 
 namespace ucbhelper { class ProxyDecider; }
 
@@ -251,9 +250,6 @@ public:
     const OUString & getHostName() const { return m_aUri.GetHost(); }
     int getPort() const { return m_aUri.GetPort(); }
 
-    const ::uno::Reference< ::lang::XMultiServiceFactory > getMSF()
-    { return m_xFactory->getServiceFactory(); }
-
     sal_Bool isDomainMatch( OUString certHostName );
 
 private:
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index 1fce24b..3d5d2aa 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -21,7 +21,6 @@
 #include <osl/doublecheckedlocking.h>
 #include <rtl/uri.hxx>
 #include <rtl/ustrbuf.hxx>
-#include <comphelper/processfactory.hxx>
 #include <ucbhelper/contentidentifier.hxx>
 #include <ucbhelper/propertyvalueset.hxx>
 #include <ucbhelper/simpleinteractionrequest.hxx>
@@ -199,12 +198,12 @@ static void lcl_sendPartialGETRequest( bool &bError,
 //=========================================================================
 // ctr for content on an existing webdav resource
 Content::Content(
-          const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
+          const uno::Reference< uno::XComponentContext >& rxContext,
           ContentProvider* pProvider,
           const uno::Reference< ucb::XContentIdentifier >& Identifier,
           rtl::Reference< DAVSessionFactory > const & rSessionFactory )
   throw ( ucb::ContentCreationException )
-: ContentImplHelper( rxSMgr, pProvider, Identifier ),
+: ContentImplHelper( rxContext, pProvider, Identifier ),
   m_eResourceType( UNKNOWN ),
   m_pProvider( pProvider ),
   m_bTransient( false ),
@@ -214,7 +213,7 @@ Content::Content(
     try
     {
         m_xResAccess.reset( new DAVResourceAccess(
-                rxSMgr,
+                rxContext,
                 rSessionFactory,
                 Identifier->getContentIdentifier() ) );
 
@@ -230,13 +229,13 @@ Content::Content(
 //=========================================================================
 // ctr for content on an non-existing webdav resource
 Content::Content(
-            const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
+            const uno::Reference< uno::XComponentContext >& rxContext,
             ContentProvider* pProvider,
             const uno::Reference< ucb::XContentIdentifier >& Identifier,
             rtl::Reference< DAVSessionFactory > const & rSessionFactory,
             sal_Bool isCollection )
   throw ( ucb::ContentCreationException )
-: ContentImplHelper( rxSMgr, pProvider, Identifier ),
+: ContentImplHelper( rxContext, pProvider, Identifier ),
   m_eResourceType( UNKNOWN ),
   m_pProvider( pProvider ),
   m_bTransient( true ),
@@ -246,7 +245,7 @@ Content::Content(
     try
     {
         m_xResAccess.reset( new DAVResourceAccess(
-            rxSMgr, rSessionFactory, Identifier->getContentIdentifier() ) );
+            rxContext, rSessionFactory, Identifier->getContentIdentifier() ) );
     }
     catch ( DAVException const & )
     {
@@ -298,7 +297,7 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType )
         try
         {
             uno::Reference< beans::XPropertySet > const xProps(
-                m_xSMgr, uno::UNO_QUERY_THROW );
+                m_xContext, uno::UNO_QUERY_THROW );
             uno::Reference< uno::XComponentContext > xCtx;
             xCtx.set( xProps->getPropertyValue(
                 OUString( "DefaultContext" ) ),
@@ -1195,12 +1194,12 @@ Content::createNewContent( const ucb::ContentInfo& Info )
     }
 
     uno::Reference< ucb::XContentIdentifier > xId(
-                    new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL ) );
+                    new ::ucbhelper::ContentIdentifier( aURL ) );
 
     // create the local content
     try
     {
-        return new ::http_dav_ucp::Content( m_xSMgr,
+        return new ::http_dav_ucp::Content( m_xContext,
                                           m_pProvider,
                                           xId,
                                           m_xResAccess->getSessionFactory(),
@@ -1343,7 +1342,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
     std::auto_ptr< DAVResourceAccess > xResAccess;
     OUString aUnescapedTitle;
     bool bHasAll = false;
-    uno::Reference< lang::XMultiServiceFactory > xSMgr;
+    uno::Reference< uno::XComponentContext > xContext;
     uno::Reference< ucb::XContentIdentifier > xIdentifier;
     rtl::Reference< ::ucbhelper::ContentProviderImplHelper > xProvider;
 
@@ -1351,7 +1350,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
         osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
         aUnescapedTitle = SerfUri::unescape( m_aEscapedTitle );
-        xSMgr.set( m_xSMgr );
+        xContext.set( m_xContext );
         xIdentifier.set( m_xIdentifier );
         xProvider.set( m_xProvider.get() );
         xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
@@ -1655,7 +1654,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
     }
 
     uno::Reference< sdbc::XRow > xResultRow
-        = getPropertyValues( comphelper::getComponentContext(xSMgr),
+        = getPropertyValues( xContext,
                              rProperties,
                              *xProps,
                              xProvider,
@@ -1682,7 +1681,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
                 const uno::Reference< ucb::XCommandEnvironment >& xEnv )
     throw ( uno::Exception )
 {
-    uno::Reference< lang::XMultiServiceFactory > xSMgr;
     uno::Reference< ucb::XContentIdentifier >    xIdentifier;
     rtl::Reference< ContentProvider >            xProvider;
     sal_Bool bTransient;
@@ -1695,7 +1693,6 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
         xIdentifier.set( m_xIdentifier );
         bTransient = m_bTransient;
         xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
-        xSMgr.set( m_xSMgr );
     }
 
     uno::Sequence< uno::Any > aRet( rValues.getLength() );
@@ -2008,7 +2005,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
         aNewURL += SerfUri::escapeSegment( aNewTitle );
 
         uno::Reference< ucb::XContentIdentifier > xNewId
-            = new ::ucbhelper::ContentIdentifier( xSMgr, aNewURL );
+            = new ::ucbhelper::ContentIdentifier( aNewURL );
         uno::Reference< ucb::XContentIdentifier > xOldId = xIdentifier;
 
         try
@@ -2106,7 +2103,7 @@ uno::Any Content::open(
             // Open collection.
 
             uno::Reference< ucb::XDynamicResultSet > xSet
-                = new DynamicResultSet( comphelper::getComponentContext(m_xSMgr), this, rArg, xEnv );
+                = new DynamicResultSet( m_xContext, this, rArg, xEnv );
             aRet <<= xSet;
         }
         else
@@ -2598,7 +2595,7 @@ void Content::insert(
         {
             osl::Guard< osl::Mutex > aGuard( m_aMutex );
             m_xIdentifier
-                = new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL );
+                = new ::ucbhelper::ContentIdentifier( aURL );
         }
 
         inserted();
@@ -2644,7 +2641,7 @@ void Content::transfer(
         const uno::Reference< ucb::XCommandEnvironment >& Environment )
     throw( uno::Exception )
 {
-    uno::Reference< lang::XMultiServiceFactory > xSMgr;
+    uno::Reference< uno::XComponentContext > xContext;
     uno::Reference< ucb::XContentIdentifier >    xIdentifier;
     uno::Reference< ucb::XContentProvider >      xProvider;
     std::auto_ptr< DAVResourceAccess > xResAccess;
@@ -2652,7 +2649,7 @@ void Content::transfer(
     {
         osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
-        xSMgr.set( m_xSMgr );
+        xContext.set( m_xContext );
         xIdentifier.set( m_xIdentifier );
         xProvider.set( m_xProvider.get() );
         xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
@@ -2742,16 +2739,16 @@ void Content::transfer(
         aTargetURL += aTitle;
 
         uno::Reference< ucb::XContentIdentifier > xTargetId
-            = new ::ucbhelper::ContentIdentifier( xSMgr, aTargetURL );
+            = new ::ucbhelper::ContentIdentifier( aTargetURL );
 
-        DAVResourceAccess aSourceAccess( xSMgr,
+        DAVResourceAccess aSourceAccess( xContext,
                                          xResAccess->getSessionFactory(),
                                          sourceURI.GetURI() );
 
         if ( rArgs.MoveData == sal_True )
         {
             uno::Reference< ucb::XContentIdentifier > xId
-                = new ::ucbhelper::ContentIdentifier( xSMgr, rArgs.SourceURL );
+                = new ::ucbhelper::ContentIdentifier( rArgs.SourceURL );
 
             // Note: The static cast is okay here, because its sure that
             //       xProvider is always the WebDAVContentProvider.
@@ -3045,8 +3042,7 @@ sal_Bool Content::exchangeIdentity(
                         aOldURL.getLength(),
                         xNewId->getContentIdentifier() );
                 uno::Reference< ucb::XContentIdentifier > xNewChildId
-                    = new ::ucbhelper::ContentIdentifier(
-                        m_xSMgr, aNewChildURL );
+                    = new ::ucbhelper::ContentIdentifier( aNewChildURL );
 
                 if ( !xChild->exchangeIdentity( xNewChildId ) )
                     return sal_False;
diff --git a/ucb/source/ucp/webdav/webdavcontent.hxx b/ucb/source/ucp/webdav/webdavcontent.hxx
index 10c3022..52f14c8 100644
--- a/ucb/source/ucp/webdav/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav/webdavcontent.hxx
@@ -208,14 +208,14 @@ private:
            com::sun::star::uno::RuntimeException );
 public:
     Content( const ::com::sun::star::uno::Reference<
-                 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+                 ::com::sun::star::uno::XComponentContext >& rxContext,
              ContentProvider* pProvider,
              const ::com::sun::star::uno::Reference<
                  ::com::sun::star::ucb::XContentIdentifier >& Identifier,
              rtl::Reference< DAVSessionFactory > const & rSessionFactory )
         throw ( ::com::sun::star::ucb::ContentCreationException );
     Content( const ::com::sun::star::uno::Reference<
-                 ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+                 ::com::sun::star::uno::XComponentContext >& rxContext,
              ContentProvider* pProvider,
              const ::com::sun::star::uno::Reference<
                  ::com::sun::star::ucb::XContentIdentifier >& Identifier,
@@ -296,7 +296,7 @@ public:
     // Called from resultset data supplier.
     static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >
     getPropertyValues( const ::com::sun::star::uno::Reference<
-                           ::com::sun::star::lang::XMultiServiceFactory >& rSMgr,
+                           ::com::sun::star::uno::XComponentContext >& rContext,
                        const ::com::sun::star::uno::Sequence<
                            ::com::sun::star::beans::Property >& rProperties,
                        const ContentProperties& rData,
diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
index 794b41b..065c5bd 100644
--- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx
+++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx
@@ -72,16 +72,16 @@ struct DataSupplier_Impl
     osl::Mutex                                   m_aMutex;
     ResultList                                   m_aResults;
     rtl::Reference< Content >                    m_xContent;
-    uno::Reference< lang::XMultiServiceFactory > m_xSMgr;
+    uno::Reference< uno::XComponentContext > m_xContext;
     sal_Int32                                    m_nOpenMode;
     sal_Bool                                     m_bCountFinal;
     sal_Bool                                     m_bThrowException;
 
     DataSupplier_Impl(
-                const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
+                const uno::Reference< uno::XComponentContext >& rxContext,
                 const rtl::Reference< Content >& rContent,
                 sal_Int32 nOpenMode )
-    : m_xContent( rContent ), m_xSMgr( rxSMgr ), m_nOpenMode( nOpenMode ),
+    : m_xContent( rContent ), m_xContext( rxContext ), m_nOpenMode( nOpenMode ),
       m_bCountFinal( sal_False ), m_bThrowException( sal_False ) {}
     ~DataSupplier_Impl();
 };
@@ -110,10 +110,10 @@ DataSupplier_Impl::~DataSupplier_Impl()
 //=========================================================================
 
 DataSupplier::DataSupplier(
-            const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
+            const uno::Reference< uno::XComponentContext >& rxContext,
             const rtl::Reference< Content >& rContent,
             sal_Int32 nOpenMode )
-: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) )
+: m_pImpl( new DataSupplier_Impl( rxContext, rContent, nOpenMode ) )
 {
 }
 
@@ -297,7 +297,7 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues(
     {
         uno::Reference< sdbc::XRow > xRow
             = Content::getPropertyValues(
-                m_pImpl->m_xSMgr,
+                m_pImpl->m_xContext,
                 getResultSet()->getProperties(),
                 *(m_pImpl->m_aResults[ nIndex ]->pData),
                 rtl::Reference< ::ucbhelper::ContentProviderImplHelper >(
diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.hxx b/ucb/source/ucp/webdav/webdavdatasupplier.hxx
index c645c47..dbeffb2 100644
--- a/ucb/source/ucp/webdav/webdavdatasupplier.hxx
+++ b/ucb/source/ucp/webdav/webdavdatasupplier.hxx
@@ -42,7 +42,7 @@ private:
 
 public:
     DataSupplier( const com::sun::star::uno::Reference<
-              com::sun::star::lang::XMultiServiceFactory >& rxSMgr,
+              com::sun::star::uno::XComponentContext >& rxContext,
               const rtl::Reference< Content >& rContent,
               sal_Int32 nOpenMode);
 
diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx
index f07239d5..b30069d 100644
--- a/ucb/source/ucp/webdav/webdavprovider.cxx
+++ b/ucb/source/ucp/webdav/webdavprovider.cxx
@@ -62,8 +62,8 @@ OUString &WebDAVUserAgent::operator()() const
 //=========================================================================
 
 ContentProvider::ContentProvider(
-                const uno::Reference< lang::XMultiServiceFactory >& rSMgr )
-: ::ucbhelper::ContentProviderImplHelper( rSMgr ),
+                const uno::Reference< uno::XComponentContext >& rContext )
+: ::ucbhelper::ContentProviderImplHelper( rContext ),
   m_xDAVSessionFactory( new DAVSessionFactory() ),
   m_pProps( 0 )
 {
@@ -73,11 +73,9 @@ ContentProvider::ContentProvider(
     bInit = true;
     try
     {
-        uno::Reference< uno::XComponentContext > xContext(
-            ::comphelper::getProcessComponentContext() );
         uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
-            xContext->getServiceManager()->createInstanceWithContext(
-                OUString("com.sun.star.configuration.ConfigurationProvider"), xContext),
+            rContext->getServiceManager()->createInstanceWithContext(
+                OUString("com.sun.star.configuration.ConfigurationProvider"), rContext),
             uno::UNO_QUERY_THROW );
 
         beans::NamedValue aNodePath;
@@ -151,7 +149,7 @@ XTYPEPROVIDER_IMPL_3( ContentProvider,
 //
 //=========================================================================
 
-XSERVICEINFO_IMPL_1( ContentProvider,
+XSERVICEINFO_IMPL_1_CTX( ContentProvider,
                      OUString( "com.sun.star.comp.WebDAVContentProvider" ),
                      OUString( WEBDAV_CONTENT_PROVIDER_SERVICE_NAME ) );
 
@@ -238,7 +236,7 @@ ContentProvider::queryContent(
     }
 
     if ( bNewId )
-        xCanonicId = new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL );
+        xCanonicId = new ::ucbhelper::ContentIdentifier( aURL );
     else
         xCanonicId = Identifier;
 
@@ -255,7 +253,7 @@ ContentProvider::queryContent(
     try
     {
         xContent = new ::http_dav_ucp::Content(
-                        m_xSMgr, this, xCanonicId, m_xDAVSessionFactory );
+                        m_xContext, this, xCanonicId, m_xDAVSessionFactory );
         registerNewContent( xContent );
     }
     catch ( ucb::ContentCreationException const & )
diff --git a/ucb/source/ucp/webdav/webdavprovider.hxx b/ucb/source/ucp/webdav/webdavprovider.hxx
index ee5169c..142c88e 100644
--- a/ucb/source/ucp/webdav/webdavprovider.hxx
+++ b/ucb/source/ucp/webdav/webdavprovider.hxx
@@ -73,7 +73,7 @@ class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
 
 public:
     ContentProvider( const ::com::sun::star::uno::Reference<
-                        ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
+                        ::com::sun::star::uno::XComponentContext >& rContext );
     virtual ~ContentProvider();
 
     // XInterface
diff --git a/ucb/source/ucp/webdav/webdavresultset.cxx b/ucb/source/ucp/webdav/webdavresultset.cxx
index bfa66f3..ca6b56b 100644
--- a/ucb/source/ucp/webdav/webdavresultset.cxx
+++ b/ucb/source/ucp/webdav/webdavresultset.cxx
@@ -63,9 +63,9 @@ DynamicResultSet::DynamicResultSet(
 void DynamicResultSet::initStatic()
 {
     m_xResultSet1
-        = new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
+        = new ::ucbhelper::ResultSet( m_xContext,
                                       m_aCommand.Properties,
-                                      new DataSupplier( m_xSMgr,
+                                      new DataSupplier( m_xContext,
                                                         m_xContent,
                                                         m_aCommand.Mode ),
                                       m_xEnv );
@@ -75,9 +75,9 @@ void DynamicResultSet::initStatic()
 void DynamicResultSet::initDynamic()
 {
     m_xResultSet1
-        = new ::ucbhelper::ResultSet( comphelper::getComponentContext(m_xSMgr),
+        = new ::ucbhelper::ResultSet( m_xContext,
                                       m_aCommand.Properties,
-                                      new DataSupplier( m_xSMgr,
+                                      new DataSupplier( m_xContext,
                                                         m_xContent,
                                                         m_aCommand.Mode ),
                                       m_xEnv );


More information about the Libreoffice-commits mailing list