From 04a3e68aece9ad6a0f96b66c2fcb22d26ca4780c Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 21 Sep 2010 15:50:18 +0200 Subject: #i114622# - Fixed wrong arguments for InteractiveLockingLockedExceptions- --- ucb/source/ucp/webdav/webdavcontent.cxx | 56 ++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 21 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 26b2a044e7b6..b679b81b5d52 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -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,32 @@ 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 ) + else 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 +1429,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 +1480,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 +2947,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 +2968,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 +3058,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 +3085,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 +3095,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 +3104,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: -- cgit