summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-05-23 17:17:09 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-05-24 19:33:20 +0000
commitdfe24cc4b1eb623753840523efb62c73e2b44afa (patch)
treeedaed645fbbd2d00d5cc21f4cf6a506204d666a4 /sfx2
parent84093cceb624eab7d956caebdaaf2ac10397900b (diff)
rhbz#961460: Don't needlessly pass URLs through INetURLObject
The WebDAV UCP uses https/davs URLs that may contain a userinfo (cf. RFC 3986) part, and INetURLObject does not support that (in accordance with RFCs 2818 and 2616) and thus creates an empty INET_PROT_NOT_VALID INetURLObject for such a URL, leading to failure when trying to save a document to such a URL. (Regression introduced with 966d20e35d5a2be2fce6c204af5c156c3ead7063 "CMIS ucp: write documents back to CMIS server.") Change-Id: Ifd396852b211cab1d29575da7fccb32306479f93 (cherry picked from commit 3f5c45b70864af95a6362acf4684fb57eb85e348) Reviewed-on: https://gerrit.libreoffice.org/4019 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 3ce8ab77b360..d08f3fcdb514 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1936,6 +1936,7 @@ void SfxMedium::Transfer_Impl()
::ucbhelper::Content aDestContent;
::ucbhelper::Content::create( aDestURL, xComEnv, comphelper::getProcessComponentContext(), aDestContent );
+ // For checkin, we need the object URL, not the parent folder:
if ( !IsInCheckIn( ) )
{
// Get the parent URL from the XChild if possible: why would the URL necessarily have
@@ -1951,13 +1952,11 @@ void SfxMedium::Transfer_Impl()
}
}
- if ( !sParentUrl.isEmpty() )
- aDest = INetURLObject( sParentUrl );
- }
- else
- {
- // For checkin, we need the object URL, not the parent folder
- aDest = INetURLObject( aDestURL );
+ if ( sParentUrl.isEmpty() )
+ aDestURL = aDest.GetMainURL( INetURLObject::NO_DECODE );
+ // adjust to above aDest.removeSegment()
+ else
+ aDestURL = sParentUrl;
}
// LongName wasn't defined anywhere, only used here... get the Title instead
@@ -1970,7 +1969,7 @@ void SfxMedium::Transfer_Impl()
try
{
- aTransferContent = ::ucbhelper::Content( aDest.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() );
+ aTransferContent = ::ucbhelper::Content( aDestURL, xComEnv, comphelper::getProcessComponentContext() );
}
catch (const ::com::sun::star::ucb::ContentCreationException& ex)
{