Bug 139373 - Private variables are not only available in the module in which they are defined.
Summary: Private variables are not only available in the module in which they are defi...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
7.0.4.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro
  Show dependency treegraph
 
Reported: 2021-01-02 17:17 UTC by Nukool Chompuparn
Modified: 2024-11-05 03:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file with macros (12.17 KB, application/vnd.oasis.opendocument.text)
2021-12-01 10:08 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nukool Chompuparn 2021-01-02 17:17:52 UTC
Description:
Private variables are not only available in the Module in which they are defined. but even in all Modules of all Libraries except Standard Library.

Steps to Reproduce:
1. Create Module1 in Standard Library
						'Option Explicit	
						Public  varPublicS      As Integer	
'Library: Standard							
						Global  varGlobalS      As Integer	
		'Module: Module1					
						Private varPrivateS     As Integer	
						Dim     varDimPrivateS  As Integer	
							
						Sub Main	
						End Sub

2. Create Library1 & Module3 in Library1
						'Option Explicit	
						Public  varPublicL1     As Integer	
'Library: Library1							
						Global  varGlobalL1     As Integer	
		'Module: Module3					
						Private varPrivateL1    As Integer	
						Dim     varDimPrivateL1 As Integer	
							
						Sub Main
						End Sub
3. Create Library2 & Module5 in Libray2
'Library: Library2							
							
		'Module: Module5					
							
						Sub Show_var_LL2M5_2	
							MsgBox  _
							“varDimPrivateS  = “ & varDimPrivateS  & Chr(10) &  _
							“varPrivateS     = “ & varPrivateS     & Chr(10) &  _
							“varGlobalS      = “ & varGlobalS      & Chr(10) &  _
							“varPublicS      = “ & varPublicS      & Chr(10) &  _
							“varDimPrivateL1 = “ & varDimPrivateL1 & Chr(10) &  _
							“varPrivateL1    = “ & varPrivateL1    & Chr(10) &  _
							“varGlobalL1     = “ & varGlobalL1     & Chr(10) &  _
							“varPublicL1     = “ & varPublicL1                  _
							,,"Sub Show_var_LL2M5_2"
						End Sub	


Actual Results:
Sub Show_var_LL2M5_2
varDimPrivateL1 = 0
varPrivateS     = 0
varGlobalS      = 0
varPublicS      = 0
varDimPrivateL1 = 0
varPrivateL1    = 0
varGlobalL1     = 0
varPublicL1     = 0


Expected Results:
varDimPrivateL1 = 
varPrivateS     =
varDimPrivateL1 = 
varPrivateL1    = 






Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 4; OS: Linux 5.9; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Nukool Chompuparn 2021-01-03 06:12:00 UTC
Sorry for typo.

Editted:

Actual Results:
Sub Show_var_LL2M5_2
varDimPrivateS  = 0
varPrivateS     = 0
varGlobalS      = 0
varPublicS      = 0
varDimPrivateL1 = 0
varPrivateL1    = 0
varGlobalL1     = 0
varPublicL1     = 0


Expected Results:
varDimPrivateS  = 
varPrivateS     =
varDimPrivateL1 = 
varPrivateL1    =
Comment 2 Buovjaga 2021-12-01 10:08:33 UTC
Created attachment 176615 [details]
Example file with macros

Run Module5 from Library2

Reproduced with

Arch Linux 64-bit
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: d8a526eabe3a7256c1637307e8de74c54e5df4eb
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 1 December 2021
Comment 3 Buovjaga 2021-12-01 10:10:16 UTC
Indeed, our help promises:

Private VarName As TYPENAME
The variable is only valid in this module.

https://help.libreoffice.org/latest/en-US/text/sbasic/shared/01020300.html?DbPAR=BASIC#bm_id3149456
Comment 4 QA Administrators 2024-11-05 03:16:02 UTC
Dear Nukool Chompuparn,

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