Kaydet (Commit) d9f9a9e5 authored tarafından Mike Kaganski's avatar Mike Kaganski Kaydeden (comit) Stephan Bergmann

tdf#123474: use INetURLObject methods to construct valid URI

This ensures that no extra slashes are added to the path when it
already ends with a slash; for Windows drive root path (e.g. C:\)
the trailing slash is always kept to not change the meaning to
"current path on the drive", which is different from "root of the
drive". Our IsValidFilePath does not allow more than one slash
after <drive:>.

Change-Id: Ife3cd9e146573a0c278834f795f0d7318c2d303a
Reviewed-on: https://gerrit.libreoffice.org/67850Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 465939fe
......@@ -575,10 +575,13 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
else
aFilterOut = aParam.copy( nPathIndex+1 );
INetURLObject aOutFilename( aObj );
aOutFilename.SetExtension( aFilterExt );
FileBase::getFileURLFromSystemPath( aFilterOut, aFilterOut );
OUString aOutFile = aFilterOut + "/" + aOutFilename.getName();
INetURLObject aOutFilename(aFilterOut);
aOutFilename.Append(aObj.getName(INetURLObject::LAST_SEGMENT, true,
INetURLObject::DecodeMechanism::NONE));
aOutFilename.SetExtension(aFilterExt);
OUString aOutFile
= aOutFilename.GetMainURL(INetURLObject::DecodeMechanism::NONE);
std::unique_ptr<utl::TempFile> fileForCat;
if( aDispatchRequest.aRequestType == REQUEST_CAT )
......
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