Kaydet (Commit) b0f43c62 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix warnings in ucb/source/ucp/webdav/ (--with-webdav=serf)

Change-Id: I6e45a8b00952dc3ef54f29536cf333bfdcee787d
üst a995f827
......@@ -38,8 +38,8 @@ class DAVAuthListener : public salhelper::SimpleReferenceObject
const OUString & inHostName,
OUString & inoutUserName,
OUString & outPassWord,
sal_Bool bCanUseSystemCredentials,
sal_Bool bUsePreviousCredentials = sal_True ) = 0;
bool bCanUseSystemCredentials,
bool bUsePreviousCredentials = true ) = 0;
};
} // namespace http_dav_ucp
......
......@@ -55,8 +55,8 @@ namespace http_dav_ucp
const OUString & inHostName,
OUString & inoutUserName,
OUString & outPassWord,
sal_Bool bCanUseSystemCredentials,
sal_Bool bUsePreviousCredentials = sal_True ) SAL_OVERRIDE;
bool bCanUseSystemCredentials,
bool bUsePreviousCredentials = true ) SAL_OVERRIDE;
private:
const com::sun::star::uno::Reference<
......
......@@ -157,7 +157,7 @@ class DAVException : public std::exception
, mData( rData )
, mStatusCode( nStatusCode )
{};
~DAVException( ) {};
virtual ~DAVException( ) {};
const ExceptionCode & getError() const { return mExceptionCode; }
const OUString & getData() const { return mData; }
......
......@@ -46,8 +46,8 @@ int DAVAuthListener_Impl::authenticate(
const OUString & inHostName,
OUString & inoutUserName,
OUString & outPassWord,
sal_Bool bCanUseSystemCredentials,
sal_Bool bUsePreviousCredentials )
bool bCanUseSystemCredentials,
bool bUsePreviousCredentials )
{
if ( m_xEnv.is() )
{
......@@ -88,7 +88,7 @@ int DAVAuthListener_Impl::authenticate(
ucbhelper::InteractionSupplyAuthentication > & xSupp
= xRequest->getAuthenticationSupplier();
sal_Bool bUseSystemCredentials = sal_False;
bool bUseSystemCredentials = false;
if ( bCanUseSystemCredentials )
bUseSystemCredentials
......@@ -794,7 +794,7 @@ void DAVResourceAccess::MKCOL(
void DAVResourceAccess::COPY(
const OUString & rSourcePath,
const OUString & rDestinationURI,
sal_Bool bOverwrite,
bool bOverwrite,
const uno::Reference< ucb::XCommandEnvironment > & xEnv )
throw( DAVException )
{
......@@ -836,7 +836,7 @@ void DAVResourceAccess::COPY(
void DAVResourceAccess::MOVE(
const OUString & rSourcePath,
const OUString & rDestinationURI,
sal_Bool bOverwrite,
bool bOverwrite,
const uno::Reference< ucb::XCommandEnvironment > & xEnv )
throw( DAVException )
{
......@@ -1127,7 +1127,7 @@ void DAVResourceAccess::getUserRequestHeaders(
}
sal_Bool DAVResourceAccess::detectRedirectCycle(
bool DAVResourceAccess::detectRedirectCycle(
const OUString& rRedirectURL )
throw ( DAVException )
{
......@@ -1141,12 +1141,12 @@ sal_Bool DAVResourceAccess::detectRedirectCycle(
while ( it != end )
{
if ( aUri == (*it) )
return sal_True;
return true;
++it;
}
return sal_False;
return false;
}
......@@ -1165,7 +1165,7 @@ void DAVResourceAccess::resetUri()
}
sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount )
bool DAVResourceAccess::handleException( DAVException & e, int errorCount )
throw ( DAVException )
{
switch ( e.getError() )
......@@ -1176,9 +1176,9 @@ sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount )
// set new URL and path.
setURL( e.getData() );
initialize();
return sal_True;
return true;
}
return sal_False;
return false;
// --> tkr #67048# copy & paste images doesn't display.
// if we have a bad connection try again. Up to three times.
case DAVException::DAV_HTTP_ERROR:
......@@ -1187,16 +1187,16 @@ sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount )
e.getStatus() == 413 ) &&
errorCount < 3 )
{
return sal_True;
return true;
}
return sal_False;
return false;
// <--
// --> tkr: if connection has said retry then retry!
case DAVException::DAV_HTTP_RETRY:
return sal_True;
return true;
// <--
default:
return sal_False; // Abort
return false; // Abort
}
}
......
......@@ -179,7 +179,7 @@ public:
void
COPY( const OUString & rSourcePath,
const OUString & rDestinationURI,
sal_Bool bOverwrite,
bool bOverwrite,
const com::sun::star::uno::Reference<
com::sun::star::ucb::XCommandEnvironment > & xEnv )
throw ( DAVException );
......@@ -187,7 +187,7 @@ public:
void
MOVE( const OUString & rSourcePath,
const OUString & rDestinationURI,
sal_Bool bOverwrite,
bool bOverwrite,
const com::sun::star::uno::Reference<
com::sun::star::ucb::XCommandEnvironment > & xEnv )
throw ( DAVException );
......@@ -233,9 +233,9 @@ public:
private:
const OUString & getRequestURI() const;
sal_Bool detectRedirectCycle( const OUString& rRedirectURL )
bool detectRedirectCycle( const OUString& rRedirectURL )
throw ( DAVException );
sal_Bool handleException( DAVException & e, int errorCount )
bool handleException( DAVException & e, int errorCount )
throw ( DAVException );
void initialize()
throw ( DAVException );
......
......@@ -59,9 +59,9 @@ public:
}
}
virtual sal_Bool CanUse( const OUString & inPath ) = 0;
virtual bool CanUse( const OUString & inPath ) = 0;
virtual sal_Bool UsesProxy() = 0;
virtual bool UsesProxy() = 0;
// DAV methods
......@@ -158,13 +158,13 @@ public:
virtual void COPY( const OUString & inSource,
const OUString & inDestination,
const DAVRequestEnvironment & rEnv,
sal_Bool inOverwrite = false )
bool inOverwrite = false )
throw( DAVException ) = 0;
virtual void MOVE( const OUString & inSource,
const OUString & inDestination,
const DAVRequestEnvironment & rEnv,
sal_Bool inOverwrite = false )
bool inOverwrite = false )
throw( DAVException ) = 0;
virtual void DESTROY( const OUString & inPath,
......
......@@ -138,7 +138,7 @@ void SerfSession::Init()
// TODO - close_connection callback
apr_status_t status = serf_connection_create2( &m_pSerfConnection,
m_pSerfContext,
*(m_aUri.getAprUri()),
m_aUri.getAprUri(),
Serf_ConnectSetup, this,
0 /* close connection callback */, 0 /* close connection baton */,
getAprPool() );
......@@ -209,13 +209,13 @@ bool SerfSession::isSSLNeeded()
char* SerfSession::getHostinfo()
{
return m_aUri.getAprUri()->hostinfo;
return m_aUri.getAprUri().hostinfo;
}
// virtual
sal_Bool SerfSession::CanUse( const OUString & inUri )
bool SerfSession::CanUse( const OUString & inUri )
{
try
{
......@@ -224,19 +224,19 @@ sal_Bool SerfSession::CanUse( const OUString & inUri )
( theUri.GetHost() == m_aUri.GetHost() ) &&
( theUri.GetScheme() == m_aUri.GetScheme() ) )
{
return sal_True;
return true;
}
}
catch ( DAVException const & )
{
return sal_False;
return false;
}
return sal_False;
return false;
}
// virtual
sal_Bool SerfSession::UsesProxy()
bool SerfSession::UsesProxy()
{
Init();
return ( m_aProxyName.getLength() > 0 );
......@@ -913,7 +913,7 @@ void SerfSession::MKCOL( const OUString & inPath,
void SerfSession::COPY( const OUString & inSourceURL,
const OUString & inDestinationURL,
const DAVRequestEnvironment & rEnv,
sal_Bool inOverWrite )
bool inOverWrite )
throw ( DAVException )
{
osl::Guard< osl::Mutex > theGuard( m_aMutex );
......@@ -936,7 +936,7 @@ void SerfSession::COPY( const OUString & inSourceURL,
void SerfSession::MOVE( const OUString & inSourceURL,
const OUString & inDestinationURL,
const DAVRequestEnvironment & rEnv,
sal_Bool inOverWrite )
bool inOverWrite )
throw ( DAVException )
{
osl::Guard< osl::Mutex > theGuard( m_aMutex );
......@@ -1461,13 +1461,13 @@ SerfSession::getDataFromInputStream(
}
sal_Bool
bool
SerfSession::isDomainMatch( const OUString & certHostName )
{
OUString hostName = getHostName();
if (hostName.equalsIgnoreAsciiCase( certHostName ) )
return sal_True;
return true;
if ( certHostName.startsWith( "*" ) &&
hostName.getLength() >= certHostName.getLength() )
......@@ -1476,9 +1476,9 @@ SerfSession::isDomainMatch( const OUString & certHostName )
if ( hostName.matchIgnoreAsciiCase(
cmpStr, hostName.getLength() - cmpStr.getLength() ) )
return sal_True;
return true;
}
return sal_False;
return false;
}
/*
......
......@@ -108,9 +108,9 @@ public:
serf_connection_t* getSerfConnection();
// DAVSession methods
virtual sal_Bool CanUse( const OUString & inUri ) SAL_OVERRIDE;
virtual bool CanUse( const OUString & inUri ) SAL_OVERRIDE;
virtual sal_Bool UsesProxy() SAL_OVERRIDE;
virtual bool UsesProxy() SAL_OVERRIDE;
const DAVRequestEnvironment & getRequestEnvironment() const
{ return m_aEnv; }
......@@ -211,14 +211,14 @@ public:
COPY( const OUString & inSourceURL,
const OUString & inDestinationURL,
const DAVRequestEnvironment & rEnv,
sal_Bool inOverWrite )
bool inOverWrite )
throw ( DAVException ) SAL_OVERRIDE;
virtual void
MOVE( const OUString & inSourceURL,
const OUString & inDestinationURL,
const DAVRequestEnvironment & rEnv,
sal_Bool inOverWrite )
bool inOverWrite )
throw ( DAVException ) SAL_OVERRIDE;
virtual void DESTROY( const OUString & inPath,
......@@ -248,7 +248,7 @@ public:
const OUString & getHostName() const { return m_aUri.GetHost(); }
int getPort() const { return m_aUri.GetPort(); }
sal_Bool isDomainMatch( const OUString & certHostName );
bool isDomainMatch( const OUString & certHostName );
private:
friend class SerfLockStore;
......
......@@ -58,9 +58,9 @@ class SerfUri
bool operator!= ( const SerfUri & rOther ) const
{ return !operator==( rOther ); }
apr_uri_t* getAprUri()
apr_uri_t& getAprUri()
{
return &mAprUri;
return mAprUri;
}
const OUString & GetURI( void ) const
{ return mURI; };
......
......@@ -274,7 +274,7 @@ bool ContentProvider::getProperty(
uno::Sequence< beans::Property > Content::getProperties(
const uno::Reference< ucb::XCommandEnvironment > & xEnv )
{
sal_Bool bTransient;
bool bTransient;
boost::scoped_ptr< DAVResourceAccess > xResAccess;
boost::scoped_ptr< ContentProperties > xCachedProps;
rtl::Reference< ContentProvider > xProvider;
......@@ -314,21 +314,21 @@ uno::Sequence< beans::Property > Content::getProperties(
}
// Add DAV properties, map DAV properties to UCB properties.
sal_Bool bHasCreationDate = sal_False; // creationdate <-> DateCreated
sal_Bool bHasGetLastModified = sal_False; // getlastmodified <-> DateModified
sal_Bool bHasGetContentType = sal_False; // getcontenttype <-> MediaType
sal_Bool bHasGetContentLength = sal_False; // getcontentlength <-> Size
sal_Bool bHasContentType = sal_False;
sal_Bool bHasIsDocument = sal_False;
sal_Bool bHasIsFolder = sal_False;
sal_Bool bHasTitle = sal_False;
sal_Bool bHasBaseURI = sal_False;
sal_Bool bHasDateCreated = sal_False;
sal_Bool bHasDateModified = sal_False;
sal_Bool bHasMediaType = sal_False;
sal_Bool bHasSize = sal_False;
sal_Bool bHasCreatableInfos = sal_False;
bool bHasCreationDate = false; // creationdate <-> DateCreated
bool bHasGetLastModified = false; // getlastmodified <-> DateModified
bool bHasGetContentType = false; // getcontenttype <-> MediaType
bool bHasGetContentLength = false; // getcontentlength <-> Size
bool bHasContentType = false;
bool bHasIsDocument = false;
bool bHasIsFolder = false;
bool bHasTitle = false;
bool bHasBaseURI = false;
bool bHasDateCreated = false;
bool bHasDateModified = false;
bool bHasMediaType = false;
bool bHasSize = false;
bool bHasCreatableInfos = false;
{
std::set< OUString >::const_iterator it = aPropSet.begin();
......@@ -338,62 +338,62 @@ uno::Sequence< beans::Property > Content::getProperties(
if ( !bHasCreationDate &&
( (*it) == DAVProperties::CREATIONDATE ) )
{
bHasCreationDate = sal_True;
bHasCreationDate = true;
}
else if ( !bHasGetLastModified &&
( (*it) == DAVProperties::GETLASTMODIFIED ) )
{
bHasGetLastModified = sal_True;
bHasGetLastModified = true;
}
else if ( !bHasGetContentType &&
( (*it) == DAVProperties::GETCONTENTTYPE ) )
{
bHasGetContentType = sal_True;
bHasGetContentType = true;
}
else if ( !bHasGetContentLength &&
( (*it) == DAVProperties::GETCONTENTLENGTH ) )
{
bHasGetContentLength = sal_True;
bHasGetContentLength = true;
}
else if ( !bHasContentType && (*it) == "ContentType" )
{
bHasContentType = sal_True;
bHasContentType = true;
}
else if ( !bHasIsDocument && (*it) == "IsDocument" )
{
bHasIsDocument = sal_True;
bHasIsDocument = true;
}
else if ( !bHasIsFolder && (*it) == "IsFolder" )
{
bHasIsFolder = sal_True;
bHasIsFolder = true;
}
else if ( !bHasTitle && (*it) == "Title" )
{
bHasTitle = sal_True;
bHasTitle = true;
}
else if ( !bHasBaseURI && (*it) == "BaseURI" )
{
bHasBaseURI = sal_True;
bHasBaseURI = true;
}
else if ( !bHasDateCreated && (*it) == "DateCreated" )
{
bHasDateCreated = sal_True;
bHasDateCreated = true;
}
else if ( !bHasDateModified && (*it) == "DateModified" )
{
bHasDateModified = sal_True;
bHasDateModified = true;
}
else if ( !bHasMediaType && (*it) == "MediaType" )
{
bHasMediaType = sal_True;
bHasMediaType = true;
}
else if ( !bHasSize && (*it) == "Size" )
{
bHasSize = sal_True;
bHasSize = true;
}
else if ( !bHasCreatableInfos && (*it) == "CreatableContentsInfo" )
{
bHasCreatableInfos = sal_True;
bHasCreatableInfos = true;
}
++it;
}
......@@ -562,7 +562,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands(
-1,
cppu::UnoType<rtl::OUString>::get() );
sal_Bool bFolder = sal_False;
bool bFolder = false;
try
{
......@@ -573,7 +573,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands(
return aCmdInfo;
}
sal_Bool bSupportsLocking = supportsExclusiveWriteLock( xEnv );
bool bSupportsLocking = supportsExclusiveWriteLock( xEnv );
sal_Int32 nPos = aCmdInfo.getLength();
sal_Int32 nMoreCmds = ( bFolder ? 2 : 0 ) + ( bSupportsLocking ? 2 : 0 );
......
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