summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/webdav/LockEntrySequence.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/webdav/LockEntrySequence.cxx')
-rw-r--r--ucb/source/ucp/webdav/LockEntrySequence.cxx43
1 files changed, 32 insertions, 11 deletions
diff --git a/ucb/source/ucp/webdav/LockEntrySequence.cxx b/ucb/source/ucp/webdav/LockEntrySequence.cxx
index 353ff6f875d7..762170e7e057 100644
--- a/ucb/source/ucp/webdav/LockEntrySequence.cxx
+++ b/ucb/source/ucp/webdav/LockEntrySequence.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: LockEntrySequence.cxx,v $
- * $Revision: 1.16 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -64,12 +61,11 @@ struct LockEntrySequenceParseContext
extern "C" int LockEntrySequence_startelement_callback(
void *,
int parent,
- const char *nspace,
+ const char * /*nspace*/,
const char *name,
const char ** )
{
- if ( ( name != 0 ) &&
- ( ( nspace == 0 ) || ( strcmp( nspace, "" ) == 0 ) ) )
+ if ( name != 0 )
{
switch ( parent )
{
@@ -83,6 +79,31 @@ extern "C" int LockEntrySequence_startelement_callback(
return STATE_LOCKSCOPE;
else if ( strcmp( name, "locktype" ) == 0 )
return STATE_LOCKTYPE;
+
+#define IIS_BUGS_WORKAROUND
+
+#ifdef IIS_BUGS_WORKAROUND
+ /* IIS (6) returns XML violating RFC 4918
+ for DAV:supportedlock property value.
+
+ <lockentry>
+ <write></write>
+ <shared></shared>
+ </lockentry>
+ <lockentry>
+ <write></write>
+ <exclusive></exclusive>
+ </lockentry>
+
+ Bother...
+ */
+ else if ( strcmp( name, "exclusive" ) == 0 )
+ return STATE_EXCLUSIVE;
+ else if ( strcmp( name, "shared" ) == 0 )
+ return STATE_SHARED;
+ else if ( strcmp( name, "write" ) == 0 )
+ return STATE_WRITE;
+#endif
break;
case STATE_LOCKSCOPE:
@@ -165,7 +186,7 @@ extern "C" int LockEntrySequence_endelement_callback(
// static
bool LockEntrySequence::createFromXML( const rtl::OString & rInData,
uno::Sequence<
- ucb::LockEntry > & rOutData )
+ ucb::LockEntry > & rOutData )
{
const sal_Int32 TOKEN_LENGTH = 12; // </lockentry>
bool success = true;
@@ -191,8 +212,8 @@ bool LockEntrySequence::createFromXML( const rtl::OString & rInData,
&aCtx );
ne_xml_parse( parser,
- rInData.getStr() + nStart,
- nEnd - nStart + TOKEN_LENGTH );
+ rInData.getStr() + nStart,
+ nEnd - nStart + TOKEN_LENGTH );
#if NEON_VERSION >= 0x0250
success = !ne_xml_failed( parser );
@@ -214,7 +235,7 @@ bool LockEntrySequence::createFromXML( const rtl::OString & rInData,
rOutData[ nCount - 1 ] = *aCtx.pEntry;
}
- nStart = nEnd + TOKEN_LENGTH + 1;
+ nStart = nEnd + TOKEN_LENGTH;
nEnd = rInData.indexOf( "</lockentry>", nStart );
}