open file dialog returns unusable network path

Bug #1466085 reported by xoristzatziki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libreoffice (Ubuntu)
Expired
Low
Unassigned

Bug Description

using a macro to open an open file dialog and trying to catch the filename and path I get an unusable path.
I open the file dialog in the directory where the odb file is (a network place) using:
 oDBDoc = ThisComponent.Parent
 oDBDoc = ThisComponent.Parent
 If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then
  GlobalScope.BasicLibraries.LoadLibrary("Tools")
 End If
 If (oDBDoc.hasLocation()) Then
  sDocURL = oDBDoc.getURL()
  uDocPath = DirectoryNameoutofPath(sDocURL, "/")
  sDocPath = ConvertFromUrl(uDocPath)
  MsgBox sDocPath
 Else
  MsgBox "No running component! Exiting!"
 End if

msgbox shows:
/run/user/1000/gvfs/smb-share:server=fserver,share=XXX/YYY/ZZZ

    file_dialog = CreateUnoService("com.sun.star.ui.dialogs.FilePicker")
    ucb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
 AddFiltersToDialog(FilterNames(), file_dialog)
 'init_path = ConvertToUrl("/usr")
    If ucb.Exists(init_path) Then
       file_dialog.SetDisplayDirectory(uDocPath)
    End If
 open_status = file_dialog.Execute()
 If open_status = 1 Then
  selectedfile = file_dialog.Files(0)
 End If
 file_dialog.Dispose()

After selecting in that directory any file the returned name is

smb://myservername/myservershare/thenameofthefileinURLnotation

ConvertFromUrl returns the exact same filename (with smb and in URL notation).

1
lsb_release -rd
Description: Ubuntu 14.04.2 LTS
Release: 14.04

2
apt-cache policy libreoffice
libreoffice:
  Εγκατεστημένα: 1:4.2.8-0ubuntu2
  Υποψήφιο: 1:4.2.8-0ubuntu2
  Πίνακας Έκδοσης:
 *** 1:4.2.8-0ubuntu2 0
        500 http://gr.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     1:4.2.3~rc3-0ubuntu2 0
        500 http://gr.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

Revision history for this message
penalvch (penalvch) wrote :

xoristzatziki, thank you for reporting this and helping make Ubuntu better.

Could you please provide the macro that demonstrates this problem?

Changed in libreoffice (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
xoristzatziki (simsonbike-bugs) wrote :

The macro by itself is not problematic if used in local files.
You can use any macro for selecting-opening a file with CreateUnoService("com.sun.star.ui.dialogs.FilePicker")

opening an odb and getting the name using in a macro:
oDBDoc = ThisComponent.Parent
sDocURL = oDBDoc.getURL()

returns something like:
/run/user/1000/gvfs/smb-share:server=myservername,share=XXX/YYY/ZZZ)

but using in a macro the file dialog and selecting the same .odb:
selectedfile = file_dialog.Files(0)

returns something like
smb://myservername/myservershare/thenameofthefileinURLnotation)

which is a totally different "path to file" (the one contains a URI but the other not).

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for libreoffice (Ubuntu) because there has been no activity for 60 days.]

Changed in libreoffice (Ubuntu):
status: Incomplete → Expired
penalvch (penalvch)
Changed in libreoffice (Ubuntu):
status: Expired → New
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

I'm setting this bug to Incomplete as it's not seen any activity since the official release of Ubuntu 16.04 LTS. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in libreoffice (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for libreoffice (Ubuntu) because there has been no activity for 60 days.]

Changed in libreoffice (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.