Kaydet (Commit) 29bd62fd authored tarafından Thorsten Behrens's avatar Thorsten Behrens

Switch flag sequence of OpenCommandArg3 to NamedValue.

Based on feedback for 09954fc8,
using the less-bulky NamedValue type instead of PropertyValue.
üst 0e163ead
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
//... namespace comphelper ................................................ //... namespace comphelper ................................................
namespace comphelper namespace comphelper
...@@ -130,6 +131,17 @@ public: ...@@ -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 class UStringMixHash
{ {
sal_Bool m_bCaseSensitive; sal_Bool m_bCaseSensitive;
......
...@@ -484,10 +484,9 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) ...@@ -484,10 +484,9 @@ UpdateInformationProvider::load(const rtl::OUString& rURL)
// Disable KeepAlive in webdav - don't want millions of office // Disable KeepAlive in webdav - don't want millions of office
// instances phone home & clog up servers // instances phone home & clog up servers
uno::Sequence< beans::PropertyValue > aProps( 1 ); uno::Sequence< beans::NamedValue > aProps( 1 );
aProps[ 0 ] = beans::PropertyValue( aProps[ 0 ] = beans::NamedValue(
UNISTRING("KeepAlive"), -1, UNISTRING("KeepAlive"), uno::makeAny(sal_False));
uno::makeAny(sal_False), beans::PropertyState_DIRECT_VALUE);
ucb::OpenCommandArgument3 aOpenArgument; ucb::OpenCommandArgument3 aOpenArgument;
aOpenArgument.Mode = ucb::OpenMode::DOCUMENT; aOpenArgument.Mode = ucb::OpenMode::DOCUMENT;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define __com_sun_star_ucb_OpenCommandArgument3_idl__ #define __com_sun_star_ucb_OpenCommandArgument3_idl__
#include <com/sun/star/ucb/OpenCommandArgument2.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 { module com { module sun { module star { module ucb {
...@@ -46,7 +46,7 @@ published struct OpenCommandArgument3 : OpenCommandArgument2 ...@@ -46,7 +46,7 @@ published struct OpenCommandArgument3 : OpenCommandArgument2
<p>WebDav e.g. uses "KeepAlive" to enable/disable the respective http feature. <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;
}; };
}; }; }; }; }; }; }; };
......
...@@ -1045,7 +1045,7 @@ void DAVResourceAccess::UNLOCK( ...@@ -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 ) throw ( DAVException )
{ {
osl::Guard< osl::Mutex > aGuard( m_aMutex ); osl::Guard< osl::Mutex > aGuard( m_aMutex );
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.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/Lock.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp> #include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include "DAVAuthListener.hxx" #include "DAVAuthListener.hxx"
...@@ -55,7 +55,7 @@ class DAVResourceAccess ...@@ -55,7 +55,7 @@ class DAVResourceAccess
osl::Mutex m_aMutex; osl::Mutex m_aMutex;
rtl::OUString m_aURL; rtl::OUString m_aURL;
rtl::OUString m_aPath; 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< DAVSession > m_xSession;
rtl::Reference< DAVSessionFactory > m_xSessionFactory; rtl::Reference< DAVSessionFactory > m_xSessionFactory;
com::sun::star::uno::Reference< com::sun::star::uno::Reference<
...@@ -73,7 +73,7 @@ public: ...@@ -73,7 +73,7 @@ public:
DAVResourceAccess & operator=( const DAVResourceAccess & rOther ); 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 ); throw ( DAVException );
void setURL( const rtl::OUString & rNewURL ) void setURL( const rtl::OUString & rNewURL )
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include "DAVRequestEnvironment.hxx" #include "DAVRequestEnvironment.hxx"
namespace com { namespace sun { namespace star { namespace beans { namespace com { namespace sun { namespace star { namespace beans {
struct PropertyValue; struct NamedValue;
} } } } } } } }
namespace com { namespace sun { namespace star { namespace ucb { namespace com { namespace sun { namespace star { namespace ucb {
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
} }
virtual sal_Bool CanUse( const ::rtl::OUString & inPath, 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; virtual sal_Bool UsesProxy() = 0;
......
...@@ -40,7 +40,7 @@ DAVSessionFactory::~DAVSessionFactory() ...@@ -40,7 +40,7 @@ DAVSessionFactory::~DAVSessionFactory()
rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
const ::rtl::OUString & inUri, const ::rtl::OUString & inUri,
const uno::Sequence< beans::PropertyValue >& rFlags, const uno::Sequence< beans::NamedValue >& rFlags,
const uno::Reference< lang::XMultiServiceFactory > & rxSMgr ) const uno::Reference< lang::XMultiServiceFactory > & rxSMgr )
throw( DAVException ) throw( DAVException )
{ {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
using namespace com::sun::star; using namespace com::sun::star;
namespace com { namespace sun { namespace star { namespace beans { namespace com { namespace sun { namespace star { namespace beans {
struct PropertyValue; struct NamedValue;
} } } } } } } }
namespace com { namespace sun { namespace star { namespace lang { namespace com { namespace sun { namespace star { namespace lang {
...@@ -62,7 +62,7 @@ public: ...@@ -62,7 +62,7 @@ public:
rtl::Reference< DAVSession > rtl::Reference< DAVSession >
createDAVSession( const ::rtl::OUString & inUri, 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< const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory >& ::com::sun::star::lang::XMultiServiceFactory >&
rxSMgr ) rxSMgr )
......
...@@ -70,7 +70,7 @@ extern "C" { ...@@ -70,7 +70,7 @@ extern "C" {
#include <com/sun/star/security/CertificateContainer.hpp> #include <com/sun/star/security/CertificateContainer.hpp>
#include <com/sun/star/security/XCertificateContainer.hpp> #include <com/sun/star/security/XCertificateContainer.hpp>
#include <com/sun/star/ucb/Lock.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 <com/sun/star/xml/crypto/XSEInitializer.hpp>
#include <boost/bind.hpp> #include <boost/bind.hpp>
...@@ -155,17 +155,17 @@ static sal_uInt16 makeStatusCode( const rtl::OUString & rStatusText ) ...@@ -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() ) if ( !rFlags.hasElements() )
return false; return false;
// find "KeepAlive" property // find "KeepAlive" property
const beans::PropertyValue* pAry(rFlags.getConstArray()); const beans::NamedValue* pAry(rFlags.getConstArray());
const sal_Int32 nLen(rFlags.getLength()); const sal_Int32 nLen(rFlags.getLength());
const beans::PropertyValue* pValue( const beans::NamedValue* pValue(
std::find_if(pAry,pAry+nLen, std::find_if(pAry,pAry+nLen,
boost::bind(comphelper::TPropertyValueEqualFunctor(), boost::bind(comphelper::TNamedValueEqualFunctor(),
_1, _1,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KeepAlive"))))); rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("KeepAlive")))));
if ( pValue != pAry+nLen && !pValue->Value.get<sal_Bool>() ) if ( pValue != pAry+nLen && !pValue->Value.get<sal_Bool>() )
...@@ -643,7 +643,7 @@ NeonLockStore NeonSession::m_aNeonLockStore; ...@@ -643,7 +643,7 @@ NeonLockStore NeonSession::m_aNeonLockStore;
NeonSession::NeonSession( NeonSession::NeonSession(
const rtl::Reference< DAVSessionFactory > & rSessionFactory, const rtl::Reference< DAVSessionFactory > & rSessionFactory,
const rtl::OUString& inUri, const rtl::OUString& inUri,
const uno::Sequence< beans::PropertyValue >& rFlags, const uno::Sequence< beans::NamedValue >& rFlags,
const ucbhelper::InternetProxyDecider & rProxyDecider ) const ucbhelper::InternetProxyDecider & rProxyDecider )
throw ( DAVException ) throw ( DAVException )
: DAVSession( rSessionFactory ), : DAVSession( rSessionFactory ),
...@@ -855,7 +855,7 @@ void NeonSession::Init() ...@@ -855,7 +855,7 @@ void NeonSession::Init()
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// virtual // virtual
sal_Bool NeonSession::CanUse( const rtl::OUString & inUri, sal_Bool NeonSession::CanUse( const rtl::OUString & inUri,
const uno::Sequence< beans::PropertyValue >& rFlags ) const uno::Sequence< beans::NamedValue >& rFlags )
{ {
try try
{ {
......
...@@ -55,7 +55,7 @@ private: ...@@ -55,7 +55,7 @@ private:
rtl::OUString m_aProxyName; rtl::OUString m_aProxyName;
sal_Int32 m_nPort; sal_Int32 m_nPort;
sal_Int32 m_nProxyPort; 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; HttpSession * m_pHttpSession;
void * m_pRequestData; void * m_pRequestData;
const ucbhelper::InternetProxyDecider & m_rProxyDecider; const ucbhelper::InternetProxyDecider & m_rProxyDecider;
...@@ -76,13 +76,13 @@ protected: ...@@ -76,13 +76,13 @@ protected:
public: public:
NeonSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory, NeonSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory,
const rtl::OUString& inUri, 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 ) const ucbhelper::InternetProxyDecider & rProxyDecider )
throw ( DAVException ); throw ( DAVException );
// DAVSession methods // DAVSession methods
virtual sal_Bool CanUse( const ::rtl::OUString & inPath, 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(); virtual sal_Bool UsesProxy();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment