Apache OpenOffice (AOO) Bugzilla – Issue 50102
Basic : Private Sub not correctly handled
Last modified: 2017-05-20 11:31:32 UTC
OOo 2.0 introduces Private (and Public) keywords in a Sub (or Function) definition. This is described nowhere but some programmers begin to use it. This bug occurs during macro development and can be very disturbing. Steps to reproduce: The following macros are defined in Standard library of a Writer document. - in Module 1 create this: Option Explicit Private Sub Main1 MsgBox("macro Main1") End Sub - in Module 2 create this: Option Explicit Sub Main2 CompatibilityMode(True) Main1 End Sub - run macro Main2. Of course there is an error "Variable not defined" because Main1 is Private. - suppress "Private" in the definition of Main1. Run the macro Main2 : still an error "Variable not defined". This is incorrect because Main1 is now implicitly Public. - add "Public" in the definition of Main1. Run the macro Main2 : still an error "Variable not defined". This is incorrect because Main1 is explicitly Public. - save the document now, close it, reopen it. Run the macro Main2 : no error. This is correct now!
In fact the problem already exists with OOo 1.1.3 (I cannot tested earlier version).
reassign to ab
This is already covered by the StarOffice internal task #115166. But I will prefer this one as it can be better tracked for OOo and mark the other one as duplicate.
Reset assigne to the default "issues@openoffice.apache.org".