[Libreoffice-commits] .: comphelper/inc extensions/source offapi/com ucb/source

Thorsten Behrens thorsten at kemper.freedesktop.org
Tue Jan 17 02:43:14 PST 2012


 comphelper/inc/comphelper/stl_types.hxx          |   12 ++++++++++++
 extensions/source/update/feed/updatefeed.cxx     |    7 +++----
 offapi/com/sun/star/ucb/OpenCommandArgument3.idl |    4 ++--
 ucb/source/ucp/webdav/DAVResourceAccess.cxx      |    2 +-
 ucb/source/ucp/webdav/DAVResourceAccess.hxx      |    6 +++---
 ucb/source/ucp/webdav/DAVSession.hxx             |    4 ++--
 ucb/source/ucp/webdav/DAVSessionFactory.cxx      |    2 +-
 ucb/source/ucp/webdav/DAVSessionFactory.hxx      |    4 ++--
 ucb/source/ucp/webdav/NeonSession.cxx            |   16 ++++++++--------
 ucb/source/ucp/webdav/NeonSession.hxx            |    6 +++---
 10 files changed, 37 insertions(+), 26 deletions(-)

New commits:
commit 29bd62fdc2792e215999e9dd0ec9a4bf1102201d
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Tue Jan 17 11:41:14 2012 +0100

    Switch flag sequence of OpenCommandArg3 to NamedValue.
    
    Based on feedback for 09954fc863c8ee900f157cab4458e1dcf51493d3,
    using the less-bulky NamedValue type instead of PropertyValue.

diff --git a/comphelper/inc/comphelper/stl_types.hxx b/comphelper/inc/comphelper/stl_types.hxx
index 79c4a17..477ee67 100644
--- a/comphelper/inc/comphelper/stl_types.hxx
+++ b/comphelper/inc/comphelper/stl_types.hxx
@@ -48,6 +48,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <com/sun/star/uno/Reference.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
 
 //... namespace comphelper ................................................
 namespace comphelper
@@ -130,6 +131,17 @@ public:
     }
 };
 //------------------------------------------------------------------------
+class TNamedValueEqualFunctor : public ::std::binary_function< ::com::sun::star::beans::NamedValue,::rtl::OUString,bool>
+{
+public:
+    TNamedValueEqualFunctor()
+    {}
+    bool operator() (const ::com::sun::star::beans::NamedValue& lhs, const ::rtl::OUString& rhs) const
+    {
+        return !!(lhs.Name == rhs);
+    }
+};
+//------------------------------------------------------------------------
 class UStringMixHash
 {
     sal_Bool m_bCaseSensitive;
diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx
index 944b7be..ae69e7c 100644
--- a/extensions/source/update/feed/updatefeed.cxx
+++ b/extensions/source/update/feed/updatefeed.cxx
@@ -484,10 +484,9 @@ UpdateInformationProvider::load(const rtl::OUString& rURL)
 
     // Disable KeepAlive in webdav - don't want millions of office
     // instances phone home & clog up servers
-    uno::Sequence< beans::PropertyValue > aProps( 1 );
-    aProps[ 0 ] = beans::PropertyValue(
-        UNISTRING("KeepAlive"), -1,
-        uno::makeAny(sal_False), beans::PropertyState_DIRECT_VALUE);
+    uno::Sequence< beans::NamedValue > aProps( 1 );
+    aProps[ 0 ] = beans::NamedValue(
+        UNISTRING("KeepAlive"), uno::makeAny(sal_False));
 
     ucb::OpenCommandArgument3 aOpenArgument;
     aOpenArgument.Mode = ucb::OpenMode::DOCUMENT;
diff --git a/offapi/com/sun/star/ucb/OpenCommandArgument3.idl b/offapi/com/sun/star/ucb/OpenCommandArgument3.idl
index 0c6925a..39554a6 100644
--- a/offapi/com/sun/star/ucb/OpenCommandArgument3.idl
+++ b/offapi/com/sun/star/ucb/OpenCommandArgument3.idl
@@ -29,7 +29,7 @@
 #define __com_sun_star_ucb_OpenCommandArgument3_idl__
 
 #include <com/sun/star/ucb/OpenCommandArgument2.idl>
-#include <com/sun/star/beans/PropertyValue.idl>
+#include <com/sun/star/beans/NamedValue.idl>
 
 module com { module sun { module star { module ucb {
 
@@ -46,7 +46,7 @@ published struct OpenCommandArgument3 : OpenCommandArgument2
 
         <p>WebDav e.g. uses "KeepAlive" to enable/disable the respective http feature.
     */
-    sequence< com::sun::star::beans::PropertyValue > OpeningFlags;
+    sequence< com::sun::star::beans::NamedValue > OpeningFlags;
 };
 
 }; }; }; };
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index 5ff430d..ce76e19 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -1045,7 +1045,7 @@ void DAVResourceAccess::UNLOCK(
 }
 
 //=========================================================================
-void DAVResourceAccess::setFlags( const uno::Sequence< beans::PropertyValue >& rFlags )
+void DAVResourceAccess::setFlags( const uno::Sequence< beans::NamedValue >& rFlags )
     throw ( DAVException )
 {
     osl::Guard< osl::Mutex > aGuard( m_aMutex );
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx
index e0dce82..30770b0 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx
@@ -35,7 +35,7 @@
 #include <osl/mutex.hxx>
 #include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/ucb/Lock.hpp>
 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
 #include "DAVAuthListener.hxx"
@@ -55,7 +55,7 @@ class DAVResourceAccess
     osl::Mutex    m_aMutex;
     rtl::OUString m_aURL;
     rtl::OUString m_aPath;
-    ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aFlags;
+    ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > m_aFlags;
     rtl::Reference< DAVSession > m_xSession;
     rtl::Reference< DAVSessionFactory > m_xSessionFactory;
     com::sun::star::uno::Reference<
@@ -73,7 +73,7 @@ public:
 
     DAVResourceAccess & operator=( const DAVResourceAccess & rOther );
 
-    void setFlags( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rFlags )
+    void setFlags( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rFlags )
         throw ( DAVException );
 
     void setURL( const rtl::OUString & rNewURL )
diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx
index 74db5a5..b353d33 100644
--- a/ucb/source/ucp/webdav/DAVSession.hxx
+++ b/ucb/source/ucp/webdav/DAVSession.hxx
@@ -41,7 +41,7 @@
 #include "DAVRequestEnvironment.hxx"
 
 namespace com { namespace sun { namespace star { namespace beans {
-    struct PropertyValue;
+    struct NamedValue;
 } } } }
 
 namespace com { namespace sun { namespace star { namespace ucb {
@@ -71,7 +71,7 @@ public:
     }
 
     virtual sal_Bool CanUse( const ::rtl::OUString & inPath,
-                             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rFlags ) = 0;
+                             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rFlags ) = 0;
 
     virtual sal_Bool UsesProxy() = 0;
 
diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
index 8fbdbaa..41e19ae 100644
--- a/ucb/source/ucp/webdav/DAVSessionFactory.cxx
+++ b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
@@ -40,7 +40,7 @@ DAVSessionFactory::~DAVSessionFactory()
 
 rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
                 const ::rtl::OUString & inUri,
-                const uno::Sequence< beans::PropertyValue >& rFlags,
+                const uno::Sequence< beans::NamedValue >& rFlags,
                 const uno::Reference< lang::XMultiServiceFactory > & rxSMgr )
     throw( DAVException )
 {
diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.hxx b/ucb/source/ucp/webdav/DAVSessionFactory.hxx
index 9847aec..4e642c4 100644
--- a/ucb/source/ucp/webdav/DAVSessionFactory.hxx
+++ b/ucb/source/ucp/webdav/DAVSessionFactory.hxx
@@ -43,7 +43,7 @@
 using namespace com::sun::star;
 
 namespace com { namespace sun { namespace star { namespace beans {
-    struct PropertyValue;
+    struct NamedValue;
 } } } }
 
 namespace com { namespace sun { namespace star { namespace lang {
@@ -62,7 +62,7 @@ public:
 
     rtl::Reference< DAVSession >
         createDAVSession( const ::rtl::OUString & inUri,
-                          const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rFlags,
+                          const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rFlags,
                           const ::com::sun::star::uno::Reference<
                                ::com::sun::star::lang::XMultiServiceFactory >&
                                 rxSMgr )
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index ec421ad..2ed00dc 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -70,7 +70,7 @@ extern "C" {
 #include <com/sun/star/security/CertificateContainer.hpp>
 #include <com/sun/star/security/XCertificateContainer.hpp>
 #include <com/sun/star/ucb/Lock.hpp>
-#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/xml/crypto/XSEInitializer.hpp>
 
 #include <boost/bind.hpp>
@@ -155,17 +155,17 @@ static sal_uInt16 makeStatusCode( const rtl::OUString & rStatusText )
 }
 
 // -------------------------------------------------------------------
-static bool noKeepAlive( const uno::Sequence< beans::PropertyValue >& rFlags )
+static bool noKeepAlive( const uno::Sequence< beans::NamedValue >& rFlags )
 {
     if ( !rFlags.hasElements() )
         return false;
 
     // find "KeepAlive" property
-    const beans::PropertyValue* pAry(rFlags.getConstArray());
-    const sal_Int32             nLen(rFlags.getLength());
-    const beans::PropertyValue* pValue(
+    const beans::NamedValue* pAry(rFlags.getConstArray());
+    const sal_Int32          nLen(rFlags.getLength());
+    const beans::NamedValue* pValue(
         std::find_if(pAry,pAry+nLen,
-                     boost::bind(comphelper::TPropertyValueEqualFunctor(),
+                     boost::bind(comphelper::TNamedValueEqualFunctor(),
                                  _1,
                                  rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KeepAlive")))));
     if ( pValue != pAry+nLen && !pValue->Value.get<sal_Bool>() )
@@ -643,7 +643,7 @@ NeonLockStore NeonSession::m_aNeonLockStore;
 NeonSession::NeonSession(
         const rtl::Reference< DAVSessionFactory > & rSessionFactory,
         const rtl::OUString& inUri,
-        const uno::Sequence< beans::PropertyValue >& rFlags,
+        const uno::Sequence< beans::NamedValue >& rFlags,
         const ucbhelper::InternetProxyDecider & rProxyDecider )
     throw ( DAVException )
 : DAVSession( rSessionFactory ),
@@ -855,7 +855,7 @@ void NeonSession::Init()
 // -------------------------------------------------------------------
 // virtual
 sal_Bool NeonSession::CanUse( const rtl::OUString & inUri,
-                              const uno::Sequence< beans::PropertyValue >& rFlags )
+                              const uno::Sequence< beans::NamedValue >& rFlags )
 {
     try
     {
diff --git a/ucb/source/ucp/webdav/NeonSession.hxx b/ucb/source/ucp/webdav/NeonSession.hxx
index 4ed7603..f15eac4 100644
--- a/ucb/source/ucp/webdav/NeonSession.hxx
+++ b/ucb/source/ucp/webdav/NeonSession.hxx
@@ -55,7 +55,7 @@ private:
     rtl::OUString     m_aProxyName;
     sal_Int32         m_nPort;
     sal_Int32         m_nProxyPort;
-    ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > m_aFlags;
+    ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > m_aFlags;
     HttpSession *     m_pHttpSession;
     void *            m_pRequestData;
     const ucbhelper::InternetProxyDecider & m_rProxyDecider;
@@ -76,13 +76,13 @@ protected:
 public:
     NeonSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory,
                  const rtl::OUString& inUri,
-                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rFlags,
+                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rFlags,
                  const ucbhelper::InternetProxyDecider & rProxyDecider )
         throw ( DAVException );
 
     // DAVSession methods
     virtual sal_Bool CanUse( const ::rtl::OUString & inPath,
-                             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rFlags );
+                             const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& rFlags );
 
     virtual sal_Bool UsesProxy();
 


More information about the Libreoffice-commits mailing list