Multiselection needs work?

Julien Nabet serval2412 at yahoo.fr
Tue Jun 30 13:20:34 PDT 2015


On 30/06/2015 21:54, Michael Meeks wrote:
> Hi Julien,
>
> On Tue, 2015-06-30 at 12:13 -0700, julien2412 wrote:
>> 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
> 	Good =) you're using the wrong API method.
not me, web page wizard in this case :-)
>   
>>      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 }
> 	The semantics here were -impossibly- awful - multi-selection used to
> have a first-base-url and then relative URL fragments in slots 1->N on
> top of it which was just busted.
For some like kde4 file picker it seems so, but not for SalGtkFilePicker 
which uses getSelectedFiles method and then just truncates the result
(see 
http://opengrok.libreoffice.org/xref/core/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx#699)
But this part gives you right since it reuses the method you talked 
about :-)
> ...
>
> opposite description!
> 	We should fix the description =) the basic problem is that some paths
> like 'recent files' or whatever we can't play this above trick.
>
> 	The method should be marked deprecated in the API with a reference to
> XFilePicker2 =)
I submitted a patch to review about description/deprecated part, see 
https://gerrit.libreoffice.org/#/c/16630/

Thank you for your quick feedback about this! :-)

Julien


More information about the LibreOffice mailing list