Multiselection needs work?

julien2412 serval2412 at yahoo.fr
Tue Jun 30 12:13:13 PDT 2015


Hello,

Giving a try to tdf#92404, I didn't reproduce the problem when I selected 2
files but I noticed that only 1 file was added on the interface.
Searching a bit, I found it was because list of files was always truncated
to first element, 
    699 uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getFiles() throw(
uno::RuntimeException, std::exception )
    700 {
    701     // no member access => no mutex needed
    702 
    703     uno::Sequence< OUString > aFiles = getSelectedFiles();
    704     /*
    705       The previous multiselection API design was completely broken
    706       and unimplementable for some hetrogenous pseudo-URIs eg.
search:
    707       Thus crop unconditionally to a single selection.
    708     */
    709     aFiles.realloc (1);
    710     return aFiles;
    711 }
(see
http://opengrok.libreoffice.org/xref/core/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx#699)

Git log history about this realloc gives this:
commit c441024fadfad8d8366307615d157b70e9ebe29c
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date:   Mon Nov 19 15:25:09 2007 +0000

    INTEGRATION: CWS as6 (1.22.24); FILE MERGED
    2007/09/05 09:22:17 as 1.22.24.4: RESYNC: (1.22-1.23); FILE MERGED
    2007/08/28 07:03:01 as 1.22.24.3: #i73876# remove AUTOEXTENSION check
box
    2007/07/24 13:03:18 as 1.22.24.2: #i63263# support new optional
interface XFilePicker2
    2007/07/24 12:46:08 as 1.22.24.1: #i63263# support new optional
interface XFilePicker2

commit b04c2937bbc5b3db538e9523e078b469f9899b67
Author: Vladimir Glazounov <vg at openoffice.org>
Date:   Mon Aug 7 13:00:34 2006 +0000

    #i10000# Deintegrate cws fpicker6

commit 31b6adb8f40afeab7d16c58b6a58d4e03c6d321d
Author: Ivo Hinkelmann <ihi at openoffice.org>
Date:   Thu Aug 3 12:20:02 2006 +0000

    INTEGRATION: CWS fpicker6 (1.11.28); FILE MERGED
    2006/08/01 17:45:25 cmc 1.11.28.3: #i63263# multiselect support
    2006/07/27 13:16:17 cmc 1.11.28.2: RESYNC: (1.11-1.14); FILE MERGED
    2006/05/24 12:28:11 cmc 1.11.28.1: #i65330# filter on URIs not filenames

So I kept on and found this:
http://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/ui/dialogs/XFilePicker.idl#77
     85         <p>If the dialog is in execution mode and multiple files are
selected
     86         an empty sequence will be returned.</p>
...
     98                 <li>Multi-selection is enabled:
     99                 If only one file is selected, the first entry
    100                 of the sequence contains the complete path/filename
in URL format.
    101                 If multiple files are selected, the first entry of
the sequence contains
    102                 the path in URL format, and the other entries
contains the names of the selected
    103                 files without path information.</li>

opposite description!

I didn't test but kde4 seems to implement the second part, see
http://opengrok.libreoffice.org/xref/core/vcl/unx/kde4/KDE4FilePicker.cxx#326

About Vista (and >versions I suppose)
http://opengrok.libreoffice.org/xref/core/fpicker/source/win32/filepicker/VistaFilePicker.cxx#255
    255 // @deprecated can't be supported any longer ... see IDL description
for further details
    256 css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getFiles()

Did I miss something or there's a pb here and this part needs some rework
(beginning with a description in idl of what we really expect from
getFiles)? 

Julien



--
View this message in context: http://nabble.documentfoundation.org/Multiselection-needs-work-tp4153207.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list