[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - wizards/com

Michael Stahl mstahl at redhat.com
Wed Aug 5 01:11:22 PDT 2015


 wizards/com/sun/star/wizards/common/FileAccess.py |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 4fab83e1e12246a7183e5da090087ab65c0ccb3a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Aug 4 22:44:06 2015 +0200

    wizards: FileAccess.getURL does not work on Windows
    
    The hard-coded "/" separator causes getFileURLFromSystemPath to fail,
    and it's not obvious why the URL is being converted to a system path
    in the first place.
    
    Change-Id: I06ebe6d92954c4f3c884ae6f0b327ea8a36c10a4
    (cherry picked from commit 8bf374b98d07c24a37933b8c03a53abb3a8ff5c6)
    Reviewed-on: https://gerrit.libreoffice.org/17512
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/wizards/com/sun/star/wizards/common/FileAccess.py b/wizards/com/sun/star/wizards/common/FileAccess.py
index 0e67851..7ff92c3 100644
--- a/wizards/com/sun/star/wizards/common/FileAccess.py
+++ b/wizards/com/sun/star/wizards/common/FileAccess.py
@@ -303,10 +303,12 @@ class FileAccess(object):
             i += 1
         return url
 
-    def getURL(self, parentPath, childPath):
-        parent = self.filenameConverter.getSystemPathFromFileURL(parentPath);
-        path = parent + "/" + childPath
-        return self.filenameConverter.getFileURLFromSystemPath(parentPath, path)
+    def getURL(self, parentURL, childPath):
+        if len(childPath) > 0 and childPath[0] == "/":
+            path = parentURL + childPath
+        else:
+            path = parentURL + "/" + childPath
+        return path
 
     def getURL1(self, path):
         f = "/"


More information about the Libreoffice-commits mailing list