https://bugs.freedesktop.org/show_bug.cgi?id=70843

--- Comment #1 from Ariel David Moya Sequeira <[email protected]> ---
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));
    }
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to