Bug 151510 - No access to doc-based dialogs using ScriptForge
Summary: No access to doc-based dialogs using ScriptForge
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: All All
: medium normal
Assignee: Jean-Pierre Ledure
URL:
Whiteboard: target:7.5.0 target:7.4.3
Keywords:
Depends on:
Blocks: ScriptForge
  Show dependency treegraph
 
Reported: 2022-10-13 15:10 UTC by Alain Romedenne
Modified: 2024-02-08 12:20 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
evidence file with example (15.86 KB, application/vnd.oasis.opendocument.text)
2022-10-13 15:12 UTC, Alain Romedenne
Details

Note You need to log in before you can comment on or make changes to this bug.
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.