Summary: | Other: XFilePicker's setDisplayDirectory and setDefaultName do not work | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Ariel David Moya Sequeira <ardamose123> |
Component: | Extensions | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | ardamose123 |
Version: | Inherited From OOo | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Windows (All) | ||
Whiteboard: | BSA | ||
i915 platform: | i915 features: |
Description
Ariel David Moya Sequeira
2013-10-24 15:49:28 UTC
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.