<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - FilePicker crashes LO when using setDisplayDirectory method"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=107269">107269</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FilePicker crashes LO when using setDisplayDirectory method
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.3.2.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>BASIC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cguth@free.fr
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>