Bug 164885 - XDispatchProviderInterceptor doesn't intercept .uno:Open since 24.2
Summary: XDispatchProviderInterceptor doesn't intercept .uno:Open since 24.2
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0 target:25.2.1
Keywords: bisected, regression
Depends on:
Blocks:
 
Reported: 2025-01-28 07:36 UTC by Mike Kaganski
Modified: 2025-01-30 08:24 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
A hyperlink and an interceptor (3.77 KB, application/vnd.oasis.opendocument.text)
2025-01-28 07:36 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2025-01-28 07:36:55 UTC
Created attachment 198795 [details]
A hyperlink and an interceptor

Enable document macros (macro security level medium or lower).
Open the attached document, allowing macros. It contains a single hyperlink to libreoffice.org, and an implementation of XDispatchProviderInterceptor, that only intercepts .uno:Open, and instead of opening the target, shows a message. The interceptor is registered in "View created" document event, and is deregistered in "View is going to be closed" document event.

Opening the document shows "Interceptor registered successfully" message; closing it shows "Interceptor deregistered successfully" message, showing that respective code has run successfully.

In v.7.6 and older, clicking the hyperlink would emit two messages: "queryDispatch: .uno:Open", then "dispatch: .uno:Open". This is the expected behavior.

In v.24.2 and later, clicking the hyperlink bypasses the interceptor, and opens the webpage. This is wrong.

Regression after commit 502f7958d99e3aa27f4c1c1f33f4827055459da8.
Comment 1 Rafael Lima 2025-01-28 18:48:49 UTC
> In v.24.2 and later, clicking the hyperlink bypasses the interceptor, and opens 
> the webpage. This is wrong.

Repro with:

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a812a683f702fadb295ac84e275082699edc8b8f
CPU threads: 16; OS: Linux 6.11; UI render: default; VCL: kf6 (cairo+wayland)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded

Setting to NEW

@Mike one interesting side note... I can reproduce your issue using the standard toolbar. If I use the Tabbed interface, this file crashes LO upon opening.

@Caolan, can you please take a look?
Comment 2 Mike Kaganski 2025-01-29 17:17:07 UTC
https://gerrit.libreoffice.org/c/core/+/180909
Comment 3 Commit Notification 2025-01-29 17:40:23 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0e9785ef0a3f0c350f8e719d2062f1c7beb801ad

tdf#164885: use SfxBindings::Execute instead of SfxDispatcher::ExecuteList

It will be available in 25.8.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 2025-01-30 08:24:48 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/339f3173e09434fdc49046cc2277b864167dedd3

tdf#164885: use SfxBindings::Execute instead of SfxDispatcher::ExecuteList

It will be available in 25.2.1.

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.