summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMikhail Voytenko <mav@openoffice.org>2011-01-06 14:57:12 +0100
committerMikhail Voytenko <mav@openoffice.org>2011-01-06 14:57:12 +0100
commitdf5ccb739bed5666a8e053c90fe03527ecd9a75c (patch)
treecb09777611ba90419dbbe159c783969ce74e6520 /ucb
parent8c3fc316ba4b8ebd3900273c788e98130b3dbe4e (diff)
parent04afdea56a69c2418231e0881dc37a8f490b1147 (diff)
removetooltypes01: rebase to DEV300_m96
Diffstat (limited to 'ucb')
-rw-r--r--ucb/prj/build.lst2
-rw-r--r--ucb/source/ucp/file/shell.cxx38
-rw-r--r--ucb/source/ucp/webdav/LinkSequence.cxx6
-rw-r--r--ucb/source/ucp/webdav/LockEntrySequence.cxx6
-rw-r--r--ucb/source/ucp/webdav/LockSequence.cxx28
-rw-r--r--ucb/source/ucp/webdav/NeonHeadRequest.cxx91
-rw-r--r--ucb/source/ucp/webdav/NeonPropFindRequest.cxx20
-rw-r--r--ucb/source/ucp/webdav/NeonSession.cxx20
-rw-r--r--ucb/source/ucp/webdav/NeonUri.cxx20
-rw-r--r--ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx6
-rw-r--r--ucb/source/ucp/webdav/webdavcontent.cxx59
11 files changed, 95 insertions, 201 deletions
diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst
index 8d8c87f3ae..6f2d146aab 100644
--- a/ucb/prj/build.lst
+++ b/ucb/prj/build.lst
@@ -1,4 +1,4 @@
-uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 offapi sal salhelper ucbhelper udkapi comphelper tools NULL
+uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 LIBXSLT:libxslt offapi sal salhelper ucbhelper udkapi comphelper tools NULL
uc ucb usr1 - all uc_mkout NULL
uc ucb\inc nmake - all uc_inc NULL
uc ucb\source\regexp nmake - all uc_regexp uc_inc NULL
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx
index c0ce3bebad..52f88a4807 100644
--- a/ucb/source/ucp/file/shell.cxx
+++ b/ucb/source/ucp/file/shell.cxx
@@ -1805,14 +1805,26 @@ shell::write( sal_Int32 CommandId,
{
aFile.close();
err = aFile.open( OpenFlag_Write );
- }
- if( err != osl::FileBase::E_None )
- {
- installError( CommandId,
- TASKHANDLING_NO_OPEN_FILE_FOR_OVERWRITE,
- err );
- return sal_False;
+ if( err != osl::FileBase::E_None )
+ {
+ installError( CommandId,
+ TASKHANDLING_NO_OPEN_FILE_FOR_OVERWRITE,
+ err );
+ return sal_False;
+ }
+
+ // the existing file was just opened and should be overwritten now,
+ // truncate it first
+
+ err = aFile.setSize( 0 );
+ if( err != osl::FileBase::E_None )
+ {
+ installError( CommandId,
+ TASKHANDLING_FILESIZE_FOR_WRITE,
+ err );
+ return sal_False;
+ }
}
}
else
@@ -1844,7 +1856,6 @@ shell::write( sal_Int32 CommandId,
sal_Bool bSuccess = sal_True;
- sal_uInt64 nTotalNumberOfBytes = 0;
sal_uInt64 nWrittenBytes;
sal_Int32 nReadBytes = 0, nRequestedBytes = 32768 /*32k*/;
uno::Sequence< sal_Int8 > seq( nRequestedBytes );
@@ -1901,20 +1912,9 @@ shell::write( sal_Int32 CommandId,
bSuccess = sal_False;
break;
}
-
- nTotalNumberOfBytes += nWrittenBytes;
}
} while( nReadBytes == nRequestedBytes );
- err = aFile.setSize( nTotalNumberOfBytes );
- if( err != osl::FileBase::E_None )
- {
- installError( CommandId,
- TASKHANDLING_FILESIZE_FOR_WRITE,
- err );
- bSuccess = sal_False;
- }
-
err = aFile.close();
if( err != osl::FileBase::E_None )
{
diff --git a/ucb/source/ucp/webdav/LinkSequence.cxx b/ucb/source/ucp/webdav/LinkSequence.cxx
index 1d33216b4d..31ec14ba0a 100644
--- a/ucb/source/ucp/webdav/LinkSequence.cxx
+++ b/ucb/source/ucp/webdav/LinkSequence.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -168,11 +168,7 @@ bool LinkSequence::createFromXML( const rtl::OString & rInData,
rInData.getStr() + nStart,
nEnd - nStart + TOKEN_LENGTH );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );
diff --git a/ucb/source/ucp/webdav/LockEntrySequence.cxx b/ucb/source/ucp/webdav/LockEntrySequence.cxx
index 8ed838d720..1e577a4798 100644
--- a/ucb/source/ucp/webdav/LockEntrySequence.cxx
+++ b/ucb/source/ucp/webdav/LockEntrySequence.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -215,11 +215,7 @@ bool LockEntrySequence::createFromXML( const rtl::OString & rInData,
rInData.getStr() + nStart,
nEnd - nStart + TOKEN_LENGTH );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );
diff --git a/ucb/source/ucp/webdav/LockSequence.cxx b/ucb/source/ucp/webdav/LockSequence.cxx
index 2c51d5ce1f..f95badaf19 100644
--- a/ucb/source/ucp/webdav/LockSequence.cxx
+++ b/ucb/source/ucp/webdav/LockSequence.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,6 +35,8 @@
using namespace webdav_ucp;
using namespace com::sun::star;
+#define BEEHIVE_BUGS_WORKAROUND
+
//////////////////////////////////////////////////////////////////////////
struct LockSequenceParseContext
@@ -128,7 +130,11 @@ extern "C" int LockSequence_startelement_callback(
extern "C" int LockSequence_chardata_callback(
void *userdata,
int state,
+#ifdef BEEHIVE_BUGS_WORKAROUND
+ const char *buf1,
+#else
const char *buf,
+#endif
size_t len )
{
LockSequenceParseContext * pCtx
@@ -136,6 +142,15 @@ extern "C" int LockSequence_chardata_callback(
if ( !pCtx->pLock )
pCtx->pLock = new ucb::Lock;
+#ifdef BEEHIVE_BUGS_WORKAROUND
+ // Beehive sends XML values containing trailing newlines.
+ if ( buf1[ len - 1 ] == 0x0a )
+ len--;
+
+ char * buf = new char[ len + 1 ]();
+ strncpy( buf, buf1, len );
+#endif
+
switch ( state )
{
case STATE_DEPTH:
@@ -207,7 +222,7 @@ extern "C" int LockSequence_chardata_callback(
pCtx->pLock->Timeout = sal_Int64( -1 );
pCtx->hasTimeout = true;
OSL_ENSURE( sal_False,
- "LockSequence_chardata_callback - Unknown timeout!" );
+ "LockSequence_chardata_callback - Unknown timeout!" );
}
break;
@@ -223,6 +238,11 @@ extern "C" int LockSequence_chardata_callback(
}
}
+
+#ifdef BEEHIVE_BUGS_WORKAROUND
+ delete [] buf;
+#endif
+
return 0; // zero to continue, non-zero to abort parsing
}
@@ -323,11 +343,7 @@ bool LockSequence::createFromXML( const rtl::OString & rInData,
rInData.getStr() + nStart,
nEnd - nStart + TOKEN_LENGTH );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );
diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
index 4b29afae5a..1e5294882a 100644
--- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -37,16 +37,15 @@ using namespace com::sun::star;
namespace {
-#if NEON_VERSION >= 0x0250
-void process_headers(ne_request *req,
- DAVResource &rResource,
- const std::vector< ::rtl::OUString > &rHeaderNames)
+void process_headers( ne_request * req,
+ DAVResource & rResource,
+ const std::vector< ::rtl::OUString > & rHeaderNames )
{
- void *cursor = NULL;
- const char *name, *value;
+ void * cursor = NULL;
+ const char * name, *value;
- while ((cursor = ne_response_header_iterate(req, cursor,
- &name, &value)) != NULL) {
+ while ( ( cursor = ne_response_header_iterate( req, cursor,
+ &name, &value ) ) != NULL ) {
rtl::OUString aHeaderName( rtl::OUString::createFromAscii( name ) );
rtl::OUString aHeaderValue( rtl::OUString::createFromAscii( value ) );
@@ -86,69 +85,6 @@ void process_headers(ne_request *req,
}
}
}
-#else
-struct NeonHeadRequestContext
-{
- DAVResource * pResource;
- const std::vector< ::rtl::OUString > * pHeaderNames;
-
- NeonHeadRequestContext( DAVResource * p,
- const std::vector< ::rtl::OUString > * pHeaders )
- : pResource( p ), pHeaderNames( pHeaders ) {}
-};
-
-extern "C" void NHR_ResponseHeaderCatcher( void * userdata,
- const char * value )
-{
- rtl::OUString aHeader( rtl::OUString::createFromAscii( value ) );
- sal_Int32 nPos = aHeader.indexOf( ':' );
-
- if ( nPos != -1 )
- {
- rtl::OUString aHeaderName( aHeader.copy( 0, nPos ) );
-
- NeonHeadRequestContext * pCtx
- = static_cast< NeonHeadRequestContext * >( userdata );
-
- // Note: Empty vector means that all headers are requested.
- bool bIncludeIt = ( pCtx->pHeaderNames->size() == 0 );
-
- if ( !bIncludeIt )
- {
- // Check whether this header was requested.
- std::vector< ::rtl::OUString >::const_iterator it(
- pCtx->pHeaderNames->begin() );
- const std::vector< ::rtl::OUString >::const_iterator end(
- pCtx->pHeaderNames->end() );
-
- while ( it != end )
- {
- if ( (*it) == aHeaderName )
- break;
-
- ++it;
- }
-
- if ( it != end )
- bIncludeIt = true;
- }
-
- if ( bIncludeIt )
- {
- // Create & set the PropertyValue
- DAVPropertyValue thePropertyValue;
- thePropertyValue.Name = aHeaderName;
- thePropertyValue.IsCaseSensitive = false;
-
- if ( nPos < aHeader.getLength() )
- thePropertyValue.Value <<= aHeader.copy( nPos + 1 ).trim();
-
- // Add the newly created PropertyValue
- pCtx->pResource->properties.push_back( thePropertyValue );
- }
- }
-}
-#endif
} // namespace
@@ -156,7 +92,7 @@ extern "C" void NHR_ResponseHeaderCatcher( void * userdata,
// Constructor
// -------------------------------------------------------------------
-NeonHeadRequest::NeonHeadRequest( HttpSession* inSession,
+NeonHeadRequest::NeonHeadRequest( HttpSession * inSession,
const rtl::OUString & inPath,
const std::vector< ::rtl::OUString > &
inHeaderNames,
@@ -174,16 +110,9 @@ NeonHeadRequest::NeonHeadRequest( HttpSession* inSession,
inPath,
RTL_TEXTENCODING_UTF8 ) );
-#if NEON_VERSION < 0x0250
- NeonHeadRequestContext aCtx( &ioResource, &inHeaderNames );
- ne_add_response_header_catcher( req, NHR_ResponseHeaderCatcher, &aCtx );
-#endif
-
nError = ne_request_dispatch( req );
-#if NEON_VERSION >= 0x0250
- process_headers(req, ioResource, inHeaderNames);
-#endif
+ process_headers( req, ioResource, inHeaderNames );
if ( nError == NE_OK && ne_get_status( req )->klass != 2 )
nError = NE_ERROR;
diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
index 172e43511b..f794516d20 100644
--- a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -191,22 +191,13 @@ extern "C" int NPFR_propfind_iter( void* userdata,
// -------------------------------------------------------------------
extern "C" void NPFR_propfind_results( void* userdata,
-#if NEON_VERSION >= 0x0260
const ne_uri* uri,
-#else
- const char* href,
-#endif
const NeonPropFindResultSet* set )
{
// @@@ href is not the uri! DAVResource ctor wants uri!
-#if NEON_VERSION >= 0x0260
DAVResource theResource(
OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) );
-#else
- DAVResource theResource(
- OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );
-#endif
ne_propset_iterate( set, NPFR_propfind_iter, &theResource );
@@ -233,22 +224,13 @@ extern "C" int NPFR_propnames_iter( void* userdata,
// -------------------------------------------------------------------
extern "C" void NPFR_propnames_results( void* userdata,
-#if NEON_VERSION >= 0x0260
const ne_uri* uri,
-#else
- const char* href,
-#endif
const NeonPropFindResultSet* results )
{
// @@@ href is not the uri! DAVResourceInfo ctor wants uri!
// Create entry for the resource.
-#if NEON_VERSION >= 0x0260
DAVResourceInfo theResource(
OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) );
-#else
- DAVResourceInfo theResource(
- OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) );
-#endif
// Fill entry.
ne_propset_iterate( results, NPFR_propnames_iter, &theResource );
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 254fae5469..dca92a040a 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -184,11 +184,7 @@ struct NeonRequestContext
// A simple Neon response_block_reader for use with an XInputStream
// -------------------------------------------------------------------
-#if NEON_VERSION >= 0x0250
extern "C" int NeonSession_ResponseBlockReader(void * inUserData,
-#else
-extern "C" void NeonSession_ResponseBlockReader(void * inUserData,
-#endif
const char * inBuf,
size_t inLen )
{
@@ -204,9 +200,7 @@ extern "C" void NeonSession_ResponseBlockReader(void * inUserData,
if ( xInputStream.is() )
xInputStream->AddToStream( inBuf, inLen );
}
-#if NEON_VERSION >= 0x0250
return 0;
-#endif
}
// -------------------------------------------------------------------
@@ -214,11 +208,7 @@ extern "C" void NeonSession_ResponseBlockReader(void * inUserData,
// A simple Neon response_block_reader for use with an XOutputStream
// -------------------------------------------------------------------
-#if NEON_VERSION >= 0x0250
extern "C" int NeonSession_ResponseBlockWriter( void * inUserData,
-#else
-extern "C" void NeonSession_ResponseBlockWriter( void * inUserData,
-#endif
const char * inBuf,
size_t inLen )
{
@@ -236,9 +226,7 @@ extern "C" void NeonSession_ResponseBlockWriter( void * inUserData,
xOutputStream->writeBytes( aSeq );
}
}
-#if NEON_VERSION >= 0x0250
return 0;
-#endif
}
// -------------------------------------------------------------------
@@ -1926,17 +1914,11 @@ int NeonSession::GET( ne_session * sess,
void *cursor = NULL;
const char *name, *value;
-#if NEON_VERSION < 0x0250
- if ( getheaders )
- ne_add_response_header_catcher(
- req, runResponseHeaderHandler, userdata );
-#endif
ne_decompress * dc
= ne_decompress_reader( req, ne_accept_2xx, reader, userdata );
ret = ne_request_dispatch( req );
-#if NEON_VERSION >= 0x0250
if ( getheaders )
{
while ( ( cursor = ne_response_header_iterate(
@@ -1948,7 +1930,7 @@ int NeonSession::GET( ne_session * sess,
runResponseHeaderHandler(userdata, buffer);
}
}
-#endif
+
if ( ret == NE_OK && ne_get_status( req )->klass != 2 )
ret = NE_ERROR;
diff --git a/ucb/source/ucp/webdav/NeonUri.cxx b/ucb/source/ucp/webdav/NeonUri.cxx
index 85b9d1fbfe..27f24c6311 100644
--- a/ucb/source/ucp/webdav/NeonUri.cxx
+++ b/ucb/source/ucp/webdav/NeonUri.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -59,36 +59,24 @@ using namespace webdav_ucp;
namespace {
const ne_uri g_sUriDefaultsHTTP = { "http",
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
DEFAULT_HTTP_PORT,
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
NULL };
const ne_uri g_sUriDefaultsHTTPS = { "https",
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
DEFAULT_HTTPS_PORT,
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
NULL };
const ne_uri g_sUriDefaultsFTP = { "ftp",
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
DEFAULT_FTP_PORT,
-#if NEON_VERSION >= 0x0260
NULL,
-#endif
NULL,
NULL };
} // namespace
@@ -174,11 +162,7 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri )
pUri->scheme ? pUri->scheme : pUriDefs->scheme,
RTL_TEXTENCODING_UTF8 );
mUserInfo = rtl::OStringToOUString(
-#if NEON_VERSION >= 0x0260
pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo,
-#else
- pUri->authinfo ? pUri->authinfo : pUriDefs->authinfo,
-#endif
RTL_TEXTENCODING_UTF8 );
mHostName = rtl::OStringToOUString(
pUri->host ? pUri->host : pUriDefs->host,
@@ -188,7 +172,6 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri )
pUri->path ? pUri->path : pUriDefs->path,
RTL_TEXTENCODING_UTF8 );
-#if NEON_VERSION >= 0x0260
if ( pUri->query )
{
mPath += rtl::OUString::createFromAscii( "?" );
@@ -202,7 +185,6 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri )
mPath += rtl::OStringToOUString(
pUri->fragment, RTL_TEXTENCODING_UTF8 );
}
-#endif
}
// -------------------------------------------------------------------
diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
index f9a36d3113..42f30c665b 100644
--- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
+++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -373,11 +373,7 @@ bool UCBDeadPropertyValue::createFromXML( const rtl::OString & rInData,
ne_xml_parse( parser, rInData.getStr(), rInData.getLength() );
-#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
-#else
- success = !!ne_xml_valid( parser );
-#endif
ne_xml_destroy( parser );
diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index c4aab34aa2..c58ba20719 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -1183,7 +1183,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
std::auto_ptr< ContentProperties > xProps;
std::auto_ptr< ContentProperties > xCachedProps;
std::auto_ptr< DAVResourceAccess > xResAccess;
- rtl::OUString aEscapedTitle;
+ rtl::OUString aUnescapedTitle;
bool bHasAll = false;
uno::Reference< lang::XMultiServiceFactory > xSMgr;
uno::Reference< ucb::XContentIdentifier > xIdentifier;
@@ -1192,7 +1192,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
- aEscapedTitle = NeonUri::unescape( m_aEscapedTitle );
+ aUnescapedTitle = NeonUri::unescape( m_aEscapedTitle );
xSMgr.set( m_xSMgr );
xIdentifier.set( m_xIdentifier );
xProvider.set( m_xProvider.get() );
@@ -1365,7 +1365,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
if ( m_eResourceType == NON_DAV )
xProps->addProperties( aMissingProps,
ContentProperties(
- aEscapedTitle,
+ aUnescapedTitle,
false ) );
}
catch ( DAVException const & e )
@@ -1386,32 +1386,33 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
// might trigger HTTP redirect.
// Therefore, title must be updated here.
NeonUri aUri( xResAccess->getURL() );
- aEscapedTitle = aUri.GetPathBaseName();
+ aUnescapedTitle = aUri.GetPathBaseNameUnescaped();
- if ( UNKNOWN == rType )
+ if ( rType == UNKNOWN )
{
- xProps.reset( new ContentProperties( aEscapedTitle ) );
+ xProps.reset( new ContentProperties( aUnescapedTitle ) );
}
// For DAV resources we only know the Title, for non-DAV
// resources we additionally know that it is a document.
- if ( DAV == rType )
+
+ if ( rType == DAV )
{
//xProps.reset(
- // new ContentProperties( aEscapedTitle ) );
+ // new ContentProperties( aUnescapedTitle ) );
xProps->addProperty(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
- uno::makeAny( aEscapedTitle ),
+ uno::makeAny( aUnescapedTitle ),
true );
}
else
{
if ( !xProps.get() )
- xProps.reset( new ContentProperties( aEscapedTitle, false ) );
+ xProps.reset( new ContentProperties( aUnescapedTitle, false ) );
else
xProps->addProperty(
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
- uno::makeAny( aEscapedTitle ),
+ uno::makeAny( aUnescapedTitle ),
true );
xProps->addProperty(
@@ -1429,7 +1430,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
// No server access for just created (not yet committed) objects.
// Only a minimal set of properties supported at this stage.
if (m_bTransient)
- xProps.reset( new ContentProperties( aEscapedTitle,
+ xProps.reset( new ContentProperties( aUnescapedTitle,
m_bCollection ) );
}
@@ -1480,7 +1481,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
m_xCachedProps->addProperties( *xProps.get() );
m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) );
- m_aEscapedTitle = aEscapedTitle;
+ m_aEscapedTitle = NeonUri::escapeSegment( aUnescapedTitle );
}
return xResultRow;
@@ -2947,6 +2948,20 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite )
// Map DAVException...
uno::Any aException;
+ rtl::OUString aURL;
+ if ( m_bTransient )
+ {
+ aURL = getParentURL();
+ if ( aURL.lastIndexOf( '/' ) != ( aURL.getLength() - 1 ) )
+ aURL += rtl::OUString::createFromAscii( "/" );
+
+ aURL += m_aEscapedTitle;
+ }
+ else
+ {
+ aURL = m_xIdentifier->getContentIdentifier();
+ }
+
switch ( e.getStatus() )
{
case SC_NOT_FOUND:
@@ -2954,7 +2969,7 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite )
uno::Sequence< uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= beans::PropertyValue(
rtl::OUString::createFromAscii("Uri"), -1,
- uno::makeAny(m_xIdentifier->getContentIdentifier()),
+ uno::makeAny(aURL),
beans::PropertyState_DIRECT_VALUE);
aException <<=
@@ -3044,14 +3059,14 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite )
rtl::OUString::createFromAscii( "Locked!" ),
static_cast< cppu::OWeakObject * >( this ),
task::InteractionClassification_ERROR,
- m_xIdentifier->getContentIdentifier(),
- sal_True );
+ aURL,
+ sal_False ); // not SelfOwned
#else
{
uno::Sequence< uno::Any > aArgs( 1 );
aArgs[ 0 ] <<= beans::PropertyValue(
rtl::OUString::createFromAscii("Uri"), -1,
- uno::makeAny(m_xIdentifier->getContentIdentifier()),
+ uno::makeAny(aURL),
beans::PropertyState_DIRECT_VALUE);
aException <<=
@@ -3071,8 +3086,8 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite )
rtl::OUString::createFromAscii( "Locked (self)!" ),
static_cast< cppu::OWeakObject * >( this ),
task::InteractionClassification_ERROR,
- m_xIdentifier->getContentIdentifier(),
- sal_True );
+ aURL,
+ sal_True ); // SelfOwned
break;
case DAVException::DAV_NOT_LOCKED:
@@ -3081,7 +3096,7 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite )
rtl::OUString::createFromAscii( "Not locked!" ),
static_cast< cppu::OWeakObject * >( this ),
task::InteractionClassification_ERROR,
- m_xIdentifier->getContentIdentifier() );
+ aURL );
break;
case DAVException::DAV_LOCK_EXPIRED:
@@ -3090,7 +3105,7 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite )
rtl::OUString::createFromAscii( "Lock expired!" ),
static_cast< cppu::OWeakObject * >( this ),
task::InteractionClassification_ERROR,
- m_xIdentifier->getContentIdentifier() );
+ aURL );
break;
default: