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 @@
#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;
......
......@@ -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;
......
......@@ -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;
};
}; }; }; };
......
......@@ -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 );
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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 )
{
......
......@@ -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 )
......
......@@ -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 beans::NamedValue* pAry(rFlags.getConstArray());
const sal_Int32 nLen(rFlags.getLength());
const beans::PropertyValue* pValue(
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
{
......
......@@ -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();
......
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