Kaydet (Commit) 2359e5a0 authored tarafından Giuseppe Castagno's avatar Giuseppe Castagno

tdf#101094 (16) OPTIONS: Options cache removal: MOVE

Change-Id: I7a610003295aa174d655f1e847e6d9a19d84a197
Reviewed-on: https://gerrit.libreoffice.org/27695Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarGiuseppe Castagno <giuseppe.castagno@acca-esse.eu>
üst 1596379b
......@@ -1908,14 +1908,18 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
uno::Reference< ucb::XContentIdentifier > xNewId
= new ::ucbhelper::ContentIdentifier( aNewURL );
NeonUri sourceURI( xIdentifier->getContentIdentifier() );
NeonUri targetURI( xNewId->getContentIdentifier() );
try
{
NeonUri sourceURI( xIdentifier->getContentIdentifier() );
NeonUri targetURI( xNewId->getContentIdentifier() );
targetURI.SetScheme( sourceURI.GetScheme() );
xResAccess->MOVE(
sourceURI.GetPath(), targetURI.GetURI(), false, xEnv );
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// @@@ Should check for resources that could not be moved
// (due to source access or target overwrite) and send
// this information through the interaction handler.
......@@ -1949,6 +1953,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
}
catch ( DAVException const & e )
{
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// Do not set new title!
aNewTitle.clear();
......@@ -2578,11 +2584,12 @@ void Content::transfer(
xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
}
NeonUri sourceURI( rArgs.SourceURL );
NeonUri targetURI( xIdentifier->getContentIdentifier() );
OUString aTargetURI;
try
{
NeonUri sourceURI( rArgs.SourceURL );
NeonUri targetURI( xIdentifier->getContentIdentifier() );
aTargetURI = targetURI.GetPathBaseNameUnescaped();
// Check source's and target's URL scheme
......@@ -2703,6 +2710,8 @@ void Content::transfer(
rArgs.NameClash
== ucb::NameClash::OVERWRITE,
Environment );
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
if ( xSource.is() )
{
......@@ -2749,10 +2758,14 @@ void Content::transfer(
}
catch ( ucb::IllegalIdentifierException const & )
{
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// queryContent
}
catch ( DAVException const & e )
{
aStaticDAVOptionsCache.removeDAVOptions( sourceURI.GetURI() );
aStaticDAVOptionsCache.removeDAVOptions( targetURI.GetURI() );
// [RFC 2518] - WebDAV
// 412 (Precondition Failed) - The server was unable to maintain
// the liveness of the properties listed in the propertybehavior
......
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