diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2015-07-12 00:57:16 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-07-13 06:57:29 +0000 |
commit | d11b244bf9b9115f5384d6ff43bdffc7f1289d71 (patch) | |
tree | 0dffceb6d8f40bf568408ddd019a7627e77b1006 /vcl | |
parent | 7f0161d88e3a496361e2209d31cc7e9ef42a677e (diff) |
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/16959
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/kde4/KDE4FilePicker.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx index a638955dd6ae..94777329bcab 100644 --- a/vcl/unx/kde4/KDE4FilePicker.cxx +++ b/vcl/unx/kde4/KDE4FilePicker.cxx @@ -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; } |