Kaydet (Commit) d11b244b authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Noel Grandin

getFiles: truncate to 1 file only

See http://nabble.documentfoundation.org/Multiselection-needs-work-td4153207.html
for details

Change-Id: I7f855a067349381e2567bd15a8daa56aad412774
Reviewed-on: https://gerrit.libreoffice.org/16959Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 7f0161d8
......@@ -261,7 +261,11 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getFiles()
m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED);
const css::uno::Sequence< OUString > lFiles = rRequest->getArgumentOrDefault(PROP_SELECTED_FILES, css::uno::Sequence< OUString >());
css::uno::Sequence< OUString > lFiles = rRequest->getArgumentOrDefault(PROP_SELECTED_FILES, css::uno::Sequence< OUString >());
// multiselection doesn't really work
// so just retrieve the first url
if (lFiles.getLength() > 1)
lFiles.realloc(1);
m_lLastFiles = lFiles;
return lFiles;
}
......
......@@ -96,9 +96,8 @@ published interface XFilePicker: com::sun::star::ui::dialogs::XExecutableDialog
<li>Multi-selection is enabled:
If only one file is selected, the first entry
of the sequence contains the complete path/filename in URL format.
If multiple files are selected, the first entry of the sequence contains
the path in URL format, and the other entries contains the names of the selected
files without path information.</li>
If multiple files are selected, only the first entry is retrieved with
the path in URL format.</li>
</ol>
<br/>
......
......@@ -336,9 +336,12 @@ uno::Sequence< OUString > SAL_CALL KDE4FilePicker::getFiles()
KUrl::List urls = _dialog->selectedUrls();
uno::Sequence< OUString > seq( urls.size());
int i = 0;
foreach( const KUrl& url, urls )
seq[ i++ ]= toOUString( url.url());
// multiselection doesn't really work
// so just retrieve the first url
if (seq.getLength() > 1)
seq.realloc(1);
if (seq.getLength() == 1)
seq[0] = urls.front();
return seq;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment