Bug 153330 - The XFilePickerControlAccess.setLabel method does not change the name of the "Open" button (when LO Open/Save dialogs are not used).
Summary: The XFilePickerControlAccess.setLabel method does not change the name of the ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.6
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2023-02-02 17:19 UTC by Vladimir Sokolinskiy
Modified: 2023-02-06 14:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
the gtk case should be working in 7.5, seems to work in trunk for me at least (155.27 KB, image/png)
2023-02-03 14:14 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Sokolinskiy 2023-02-02 17:19:58 UTC
1. Menu / Option / LibreOffice / General, uncheck "Use LibreOffice dialogs".
2. Run the next macro:

Sub TestGetFileOpen()
  Dim oFilePicker
  oFilePicker = createUnoService("com.sun.star.ui.dialogs.FilePicker")
  oFilePicker.initialize(Array(com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_SIMPLE))
  With oFilePicker
    .setLabel com.sun.star.ui.dialogs.CommonFilePickerElementIds.PUSHBUTTON_OK, "Select"
    If .execute() = 1 Then
       Msgbox "Selected file: " & ConvertFromUrl(oFilePicker.getSelectedFiles()(0))
    End If
  End With   
End Sub

Result: the name of the "Open" button has not changed, but should have changed.

Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 6; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 1 Xisco Faulí 2023-02-02 19:49:50 UTC
I can't reproduce it in

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b052ec2f2fbe0f3044ba824c064a280a5ee9cd7f
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: de-DE (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 2 Mike Kaganski 2023-02-03 07:06:37 UTC
Repro using Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL threaded

and also on gtk3 (the button label is "Open", not the requested "Select").

Code pointer specific for Windows:

In VistaFilePickerImpl::impl_sta_SetControlLabel, the constant css::ui::dialogs::CommonFilePickerElementIds::PUSHBUTTON_OK should be handled explicitly, and instead of IFileDialogCustomize::SetControlLabel, another function should be called: IFileDialog::SetOkButtonLabel.

A similar handling is possible for filename box label: IFileDialog::SetFileNameLabel.

Other integrations (like gtk3) need their own fixes (if possible).
Comment 3 Caolán McNamara 2023-02-03 14:14:22 UTC
Created attachment 185083 [details]
the gtk case should be working in 7.5, seems to work in trunk for me at least

The gtk case should be working in the 7-5 series since
https://git.libreoffice.org/core/+/1da3406a8e97934615b5b644cbb81bf3108143ec%5E%21
of https://bugs.documentfoundation.org/show_bug.cgi?id=150706#c7
Comment 4 Mike Kaganski 2023-02-04 06:44:48 UTC
(In reply to Caolán McNamara from comment #3)

Thanks - I must had been tested with an older version (even though I thought I checked that, but likely I confused myself). Yes, I see this in current master.

Let's mark it Windows-only; any other VCL plugin, if it happens to not implement this, would need to have a separate bug, preferably with this in See Also.
Comment 5 Commit Notification 2023-02-06 12:24:58 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/4f6cabae397424caa1edf7cc084f5f458b9e5cb7

Related: tdf#150706 & tdf#153330 add OK and CANCEL to known controls

It will be available in 7.4.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Vladimir Sokolinskiy 2023-02-06 14:24:27 UTC
Thanks a lot for the fix!