https://bugs.documentfoundation.org/show_bug.cgi?id=162986
Bug ID: 162986
Summary: In VBASupport mode, it's possible to close a PROPERTY
SET/PUT as SUB or FUNCTION
Product: LibreOffice
Version: Inherited From OOo
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: difficultyBeginner, easyHack, skillCpp, topicDebug
Severity: normal
Priority: medium
Component: BASIC
Assignee: [email protected]
Reporter: [email protected]
Depends on: 162983
After bug 162983 is fixed, this bug is about this Basic code:
Option VBASupport 1
Property Set foo(x)
End Function
Function Let bar(x)
End Sub
This should be two error; both Property Set and Property Let must be terminated
with End Property.
However, this code should work:
Option VBASupport 1
Property Get foo
End Function
Function Get bar
End Sub
For some strange reason, VBA allows that. And i#109075
(https://bz.apache.org/ooo/show_bug.cgi?id=109075) implemented the support for
these latter cases, see SbiParser::Parse (basic/source/comp/parser.cxx). The
existing implementation is too forgiving; it must only allow the closing "End
Sub/Function" for the Property Get case.
See SbiParser::DefProc (basic/source/comp/dim.cxx), which handles the
Get/Set/Let distinction, and calls SbiProcDef::setPropertyMode to store that
distinction in the definition. That stored information should be used in
SbiParser::Parse to filter out the invalid cases.
Referenced Bugs:
https://bugs.documentfoundation.org/show_bug.cgi?id=162983
[Bug 162983] In VBASupport mode, it's possible to close a SUB as a FUNCTION, or
close a FUNCTION as a PROPERTY
--
You are receiving this mail because:
You are the assignee for the bug.