Bug 149622 - The return value of createUnoService callback is not initialized
Summary: The return value of createUnoService callback is not initialized
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL: https://forumooo.ru/index.php/topic,9...
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-19 18:30 UTC by Mike Kaganski
Modified: 2023-09-15 05:48 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2022-06-19 18:30:30 UTC
Consider the code:

Sub testHandler()
  oHandler = CreateUNoListener("Handler_", "com.sun.star.awt.XEventHandler")

  MsgBox oHandler.handleEvent(0) ' must output "True"
  MsgBox oHandler.handleEvent(1) ' must output "False" as the default return value
End Sub

Function Handler_handleEvent(Event) As Boolean
  If Event = 0 Then Handler_handleEvent = True
End Function

It should give "True" then "False", but actually outputs "True" "True".

This is similar to bug 143582 and bug 146742, but the function call happens in SbxObject::Call.
Comment 1 Commit Notification 2022-06-20 10:47:39 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f4ff0ed55707078868415541c4a1aebd3db1e142

tdf#149622: also clear return value before calling method from SbxObject::Call

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.