Description: An unexpected runtime error when the argument of a sub procedure is a Variant that can be an object or not. Steps to Reproduce: Sub Main Test("One") End Sub Sub Test(pvArg As Variant) On Local Error GoTo Erreur If IsObject(pvArg) then Print pvArg.SupportsService("com.sun.star.table.Cell") Else Print "pvArg is not an object" EndIf Exit Sub Erreur: Print "Error" End Sub Actual Results: Raises a runtime error on the first line of the sub procedure. The 'On Local Error instruction' is ignored Expected Results: No runtime error. The argument should be tested by IsObject. Reproducible: Always User Profile Reset: No Additional Info: [Information automatically included from LibreOffice] Locale: en-US Module: BasicIDE [Information guessed from browser] OS: Mac OS X (All) OS is 64bit: no
You couldn't print pvArg.SupportsService("com.sun.star.table.Cell") You could print "Object" instead.
With your example, the Local Error is triggered. It seems the example is incomplete and not testable by others. If I comment out On Local Error GoTo Erreur I get BASIC runtime error. Argument is not optional. pointing to line If IsObject(pvArg) then Please advise. Arch Linux 64-bit Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 180f0c1ec8e195043b5f4298737a219026a8b944 CPU threads: 8; OS: Linux 6.9; UI render: default; VCL: kf6 (cairo+wayland) Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: CL threaded Built on 22 July 2024
Dear Jean-Pierre Sanchez, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping
(In reply to Buovjaga from comment #2) > Please advise. It looks like you are trying to run 'Test', instead of 'Main' that calls 'Test'.
(In reply to Mike Kaganski from comment #4) > (In reply to Buovjaga from comment #2) > > Please advise. > > It looks like you are trying to run 'Test', instead of 'Main' that calls > 'Test'. Thanks, then I repro. Arch Linux 64-bit Version: 24.8.4.2 (X86_64) / LibreOffice Community Build ID: 480(Build:2) CPU threads: 8; OS: Linux 6.12; UI render: default; VCL: kf6 (cairo+wayland) Locale: fi-FI (fi_FI.UTF-8); UI: en-US 24.8.4-1 Calc: threaded
Already in 7.0.
Note that the problem is the line Print pvArg.SupportsService("com.sun.star.table.Cell") commenting that line out makes it work.
Already in OOo 2.2.0.
https://gerrit.libreoffice.org/c/core/+/180665
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f071292a5af10f4718302a1bf9cc9cdc37528225 tdf#160578: do not modify procedure argument type based on its use 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.
Mike Kaganski committed a patch related to this issue. It has been pushed to "libreoffice-25-2": https://git.libreoffice.org/core/commit/ba0a55592a93de3f22888dc49b74509fd1d8f08c tdf#160578: do not modify procedure argument type based on its use 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.