Repeated after my post https://ask.libreoffice.org/t/defobj-in-conflict-with-elements-predefinded-structures/74331 I am using the DefObj o statement. Unexpectedly, this declaration is applied also to elements of predefined structures. The example below fails with an error. DefObj o Sub Main oSheet = ThisComponent.Sheets(0) '... Dim Constraints(1) as new com.sun.star.sheet.SolverConstraint With Constraints(0) .Left = oSheet.getCellRangeByName("G15").CellAddress .Operator = com.sun.star.sheet.SolverConstraintOperator.LESS_EQUAL .Right = 1.5 End With '... End Sub The error is that the .Operator element is interpreted as an object. After removing the statement DefObj everything is OK. Is this behavior consistent with the intention to use the DefObj statement?
Repro using Version: 7.3.1.1 (x64) / LibreOffice Community Build ID: 349cd3ad57dce98d6b54b76f8e9f456ac7d7edb7 CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: default; VCL: win Locale: en-US (ru_RU); UI: en-US Calc: CL and also using OOo 3.2.0. An even simpler reproducer could be DefObj o Sub test o = 1 ' gives "Object variable not set." runtime error End Sub
(In reply to Mike Kaganski from comment #1) > An even simpler reproducer could be > > DefObj o > Sub test > o = 1 ' gives "Object variable not set." runtime error > End Sub Oh, please scrap that piece - of course, it's a thinko. The original code from comment 0 is relevant.
Hi Mike, You have inspired me to check it out: DefObj o Sub Main Dim o As Integer o = 1 End Sub The above declaration precedence is OK. Can't we apply this principle to predefined structures like in my example? Antoni
One more example that partially contradicts my previous comment. DefObj o Sub Test Dim Constraints As New com.sun.star.sheet.SolverConstraint MsgBox(TypeName(Constraints.Operator)) Constraints.Operator = 1 End Sub Whether we apply the DefObj declaration or not, TypeName reports the type as Long according to expectation. However, setting a value of 1 to the Operator element stops working only in case when declaring DefObj.
Dear profagrzanka, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug