From d80c8eab1992dd82a197755e9c8e5c35eaff1be5 Mon Sep 17 00:00:00 2001 From: Alain Romedenne Date: Thu, 20 Mar 2025 09:11:05 +0100 Subject: Code sample fix Change-Id: I3150817f6ba40184f84f9fdaa743dc2c8435789c Reviewed-on: https://gerrit.libreoffice.org/c/help/+/183149 Tested-by: Jenkins Reviewed-by: Alain Romedenne --- source/text/sbasic/shared/03131600.xhp | 5 +++-- source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'source') diff --git a/source/text/sbasic/shared/03131600.xhp b/source/text/sbasic/shared/03131600.xhp index 5cffdfadaf..6a7ad4dee0 100644 --- a/source/text/sbasic/shared/03131600.xhp +++ b/source/text/sbasic/shared/03131600.xhp @@ -54,7 +54,7 @@ filepicker;API service -The following code uses the service com.sun.star.ui.dialogs.FilePicker to show a file open dialog: +The following code uses the service com.sun.star.ui.dialogs.FilePicker to show an open file dialog: Sub Main fName = FileOpenDialog ("Please select a file") @@ -65,11 +65,12 @@ res = com.sun.star.ui.dialogs.ExecutableDialogResults filepicker = CreateUnoService("com.sun.star.ui.dialogs.FilePicker") filepicker.Title = title + filepicker.MultiSelectionMode = True If res.OK = filepicker.execute() Then files = filepicker.getSelectedFiles() FileOpenDialog=files(0) EndIf -End Function ' Main +End Function ' FileOpenDialog
diff --git a/source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp b/source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp index 4494038244..611f04e462 100644 --- a/source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp +++ b/source/text/sbasic/shared/CreateUnoSvcWithArgs.xhp @@ -44,7 +44,7 @@ An instance of the given UNO service name, otherwise Null value. For a list of available services, visit the com::sun::star Module reference page. - The com.sun.star.ui.dialogs.FilePicker example below displays a Save As dialog with two extra controls: a listbox and a checkbox. + The com.sun.star.ui.dialogs.FilePicker example below displays a built-in %PRODUCTNAME Save As dialog with two extra controls: a listbox and a checkbox. Sub FileSaveAsDialog() td = com.sun.star.ui.dialogs.TemplateDescription @@ -52,8 +52,10 @@ dlg = CreateUnoServiceWithArguments( _ "com.sun.star.ui.dialogs.FilePicker", _ Array(options)) + dlg.execute() End Sub ' FileSaveAsDialog + UNO services have an extensive online documentation in the api.libreoffice.org website. Visit the FilePicker Service reference page to learn more about the methods provided by the service used in the example above. -- cgit