Bug 151510

Summary: No access to doc-based dialogs using ScriptForge
Product: LibreOffice Reporter: Alain Romedenne <alain.romedenne>
Component: BASICAssignee: Jean-Pierre Ledure <jp>
Status: RESOLVED FIXED    
Severity: normal CC: alain.romedenne, jp
Priority: medium    
Version: 7.3.0.3 release   
Hardware: All   
OS: All   
Whiteboard: target:7.5.0 target:7.4.3
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 159638    
Attachments: evidence file with example

Description Alain Romedenne 2022-10-13 15:10:46 UTC
Description:
Programmatic access to doc-based dialog is not possible using ScriptForge.Dialog service

Steps to Reproduce:
1. open attached doc and follow instructions

Actual Results:
an error message 

Expected Results:
"Options" in attached doc should be displayed


Reproducible: Always


User Profile Reset: No



Additional Info:
.
Comment 1 Alain Romedenne 2022-10-13 15:12:30 UTC
Created attachment 183017 [details]
evidence file with example
Comment 2 Jean-Pierre Ledure 2022-10-13 16:07:37 UTC
I confirm the abnormal behaviour.

An easy workaround is by replacing the statement
    Set oDlg = CreateScriptService("dialog", "", "PoC", "Options")

by
    Set oDlg = CreateScriptService("dialog", ThisComponent, "PoC", "Options")

This solves the issue in the first place.

I'll post a commit to fix the incident definitively.
Comment 3 Commit Notification 2022-10-14 07:20:06 UTC
Jean-Pierre Ledure committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/06933af12a34aa07068c38af0ce196a7037f5119

ScriptForge - (Dialogs) tdf#151510 fix CreateScriptService("dialog")

It will be available in 7.5.0.

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 4 Commit Notification 2022-10-17 09:12:51 UTC
Jean-Pierre Ledure committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/1bce5209a93b4313e7b39932eabe5f84c39ee0ea

ScriptForge - (Dialogs) tdf#151510 fix CreateScriptService("dialog")

It will be available in 7.4.3.

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.