Pb Description 1 - Open Calc, open The IDE. Write the folowing code Sub GetAFileName Dim oFileDialog as Object Dim iAccept as Integer Dim sPath as String Dim InitPath as String Dim RefControlName as String Dim oUcb as object oFileDialog = createUnoService("com.sun.star.ui.dialogs.FilePicker") oFileDialog.SetMultiSelectionMode(True) oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess") If InitPath = "" Then 'InitPath = GetPathSettings("Work") End If If oUcb.Exists(InitPath) Then oFileDialog.SetDisplayDirectory(InitPath) End If iAccept = oFileDialog.Execute() If iAccept = 1 Then a=Ubound(oFileDialog.Files) Redim FichiersSources(Ubound(oFileDialog.Files)) FichiersSources=oFileDialog.Files End If oFileDialog.Dispose() End Sub 2- With LibreOffice 3.3 it was OK, With the LibreOffice 3.4.5 OOO340m1 (Build:502), you can select several files but only the first files url is memorised
Hi, I tested this on a Macbook Pro with Mac OSX 10.6.8 (Snow Leopard) : NeoOffice 3.1.2 patch 8 : works NeoOffice 3.2.1 patch 3 : works LibreOffice 3.3.4 : single file selection only LibreOffice 3.4.3 : single file selection only LibreOffice 3.4.4 : single file selection only LibreOffice 3.4.5 : single file selection only LibreOffice 3.5 RC2 : single file selection only Lotus Symphony 3.0.1 : macro fails to execute, nothing happens OpenOffice.org 3.2.1 : single file selection only OpenOffice.org 3.3.0 : single file selection only OpenOffice.org 3.4-dev : single file selection only So for me, this macro only worked properly with NeoOffice. Confirming as regression with regard to that, at least. Alex
Changing title to better reflect problem Alex
So - nothing changed in this area, that I'm aware of in recent memory. I did the work on this interface when the gtk+ file-selector was implemented. The XFilePicker interface is hideously broken - in it's multi-select mode it returns a common path prefix as the first entry and then a list of file-names that can be appended that that URL. That sound sensible - until you hit things like a 'search' meta-URL where each and every multi-selected filename can be a totally different URL. Also the code to use this multi-selection feature is horribly tangled everywhere and spends extra time and code unwinding this damage. Hence the XFilePicker2::getSelectedFiles() method - which returns all the selection as clean URLs. Of course, not all fpickers implement that - patches to fix that much appreciated; it shouldn't be hard. But the gtk+ file picker cannot return more than one file reliably via this legacy / back-compat method. I wonder if that is your issue. Can you confirm that like-for-like - ie. using the gtk+ file-picker in LibreOffice 3.3 this really does work ? :-) since very little has changed there.