[Libreoffice-commits] core.git: desktop/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Feb 15 10:10:49 UTC 2019


 desktop/source/app/dispatchwatcher.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit d9f9a9e56d558174cb5ff96c3bb78a5692a26570
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Feb 15 06:38:32 2019 +0300
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Feb 15 11:10:19 2019 +0100

    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/67850
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 3a8b2d9961a0..872d98333982 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -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 )


More information about the Libreoffice-commits mailing list