Problem description: When a file picker is created using the following code, the directory and filename are not set when the file picker is shown. This happens only in Windows; in Ubuntu 12.10 (using LibreOffice 3.6 from APT) it works as expected. Steps to reproduce: 1. Create a new extension which shows a file picker using the code mentioned above. 2. Install the extension in LibreOffice in Windows. 2. Run LibreOffice in Windows. 3. Open an LibreOffice-compatible document. 4. Run the extension. Current behavior: The file picker doesn't start where the opened document is saved nor the filename of the document is set as default filename. Expected behavior: The default directory and filename of the file picker is the same as the opened document. Operating System: Windows 7 Version: Inherited From OOo
The code in Java is as follows. Here, "originalUrl" is the URL taken from the currently open document; "Environment" is just a helper class to retrieve some information about the opened document. Object oFilePicker = component_factory.createInstanceWithContext("com.sun.star.ui.dialogs.FilePicker", Environment.getContext()); XFilePicker xFilePicker = (XFilePicker) UnoRuntime.queryInterface(XFilePicker.class, oFilePicker); xFilePicker.setMultiSelectionMode(false); if (originalUrl == null) { xFilePicker.setDisplayDirectory(Environment.getHomeDir()); xFilePicker.setDefaultName(""); } else { int idx = originalUrl.lastIndexOf('/'); if (idx >= 0) { xFilePicker.setDisplayDirectory(originalUrl.substring(0, idx)); xFilePicker.setDefaultName(originalUrl.substring(idx+1)); } }
According to https://issues.apache.org/ooo/show_bug.cgi?id=123544, it's a problem with system dialogs. A solution can be found in the link provided above.
(In reply to comment #2) > According to https://issues.apache.org/ooo/show_bug.cgi?id=123544, it's a > problem with system dialogs. A solution can be found in the link provided > above. Comments in the AOO bug confirm this issue. Status set to NEW. There is also a possible solution posted: https://issues.apache.org/ooo/show_bug.cgi?id=123544#c18 If this can be confirmed to work we may be able to RESOLVE this bug.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.