[Libreoffice-bugs] [Bug 107269] New: FilePicker crashes LO when using setDisplayDirectory method
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Wed Apr 19 12:02:20 UTC 2017
https://bugs.documentfoundation.org/show_bug.cgi?id=107269
Bug ID: 107269
Summary: FilePicker crashes LO when using setDisplayDirectory
method
Product: LibreOffice
Version: 5.3.2.2 release
Hardware: x86-64 (AMD64)
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: cguth at free.fr
Hello,
I have macros which worked fine since Lo 5.3.2.1. When I installed Lo 5.3.2.1,
one of my macros crashes Calc at every attempt.
Executing my macros step by step, i've found that using setDisplayDirectory
causes the crash.
here's the code of my function to let the user to choose a file (with extension
TXT) :
public function PAQOuvrirDialogueFichierTXT( url as String ) as string
dim oFilePicker as object,oPathSettings as object,oSimpleFileAccess as
object,sFiles as variant,fichierchoisi as string
fichierchoisi=""
oFilePicker = CreateUnoService("com.sun.star.ui.dialogs.FilePicker")
oFilePicker.AppendFilter("fichiers TXT (*.TXT)","*.txt")
oFilePicker.AppendFilter("tous les fichiers (*.*)","*.*")
oFilePicker.SetCurrentFilter("fichiers TXT (*.TXT)")
if url="" then
oPathSettings = CreateUnoService("com.sun.star.util.PathSettings")
url = oPathSettings.Work
endif
oSimpleFileAccess = CreateUnoService("com.sun.star.ucb.SimpleFileAccess")
if oSimpleFileAccess.exists(url) and oSimpleFileAccess.isFolder(url) then
oFilePicker.setDisplayDirectory(url)
endif
if oFilePicker.execute() then
sFiles = oFilePicker.getFiles()
fichierchoisi = sFiles(0)
if not oSimpleFileAccess.exists(fichierchoisi) then
fichierchoisi = ""
endif
endif
PAQOuvrirDialogueFichierTXT = fichierchoisi
end function
what it should do :
- if url is a directory and exists, the dialog sould open this directory and
list all TXT files.
- the user should choose one file
- the function return the file choosen.
when i call it with the url : "file://serveur/archives/180/1801701522_001"
(which is a directory on my Linux server with samba),
the function came at the line "oFilePicker.setDisplayDirectory(url)", (it mean
that the url is a directory and exists).
When this method call is executed, Calc crashes, and Lo goes in recovery mode
(to recover open documents).
I used it until Lo version 5.3.2.1 and tested it on Lo 5.3.2.2 (with crash)
Thanks
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170419/6e45527e/attachment.html>
More information about the Libreoffice-bugs
mailing list