Bug 162935 - Variable assignment within a BASIC WITH block fails
Summary: Variable assignment within a BASIC WITH block fails
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
24.8.1.2 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.2.0 target:24.8.2
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks:
 
Reported: 2024-09-12 19:20 UTC by Joshua Coppersmith
Modified: 2024-09-22 22:02 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Failing example using WITH block (1.10 KB, text/plain)
2024-09-12 19:20 UTC, Joshua Coppersmith
Details
Working example using WITH block (1.12 KB, text/plain)
2024-09-12 19:21 UTC, Joshua Coppersmith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Coppersmith 2024-09-12 19:20:29 UTC
Created attachment 196409 [details]
Failing example using WITH block

In LO 7.x assignment to struct members worked in LO BASIC within a WITH block. Assignment fails in LO 24.8.1.2.

WITH BLOCK Example 1: Worked in LO 7.x, failed in LO 24.8.1.2

	With RangeAddress
		.StartColumn = StartColumn
		.StartRow = StartRow
		.EndColumn = EndCellRange.EndColumn
		.EndRow = EndCellRange.EndRow
		.Sheet = EndCellRange.Sheet
	End With

WITH BLOCK Example 2: Works in LO 24.8.1.2 and presumably in LO 7.x

	RangeAddress.StartColumn = StartColumn
	RangeAddress.StartRow = StartRow
	RangeAddress.EndColumn = EndCellRange.EndColumn
	RangeAddress.EndRow = EndCellRange.EndRow
	RangeAddress.Sheet = EndCellRange.Sheet

See attachments for full working examples
Comment 1 Joshua Coppersmith 2024-09-12 19:21:54 UTC
Created attachment 196410 [details]
Working example using WITH block
Comment 2 elmau 2024-09-12 19:27:39 UTC
I confirm this error in my system.

Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 16; OS: Linux 6.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
24.8.1-1
Calc: threaded
Comment 3 Mike Kaganski 2024-09-12 22:56:36 UTC
https://gerrit.libreoffice.org/c/core/+/173305
Comment 4 Commit Notification 2024-09-12 23:55:16 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/47a348bb0fd6dfdd93c1975d216daadc4f6b9b6f

tdf#162935: use PUTC for WITH variable assignment: it doesn't copy value

It will be available in 25.2.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.
Comment 5 Commit Notification 2024-09-13 08:26:39 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/ffd39976cb982f0f32e802b43364de8f29653a2e

tdf#162935: use PUTC for WITH variable assignment: it doesn't copy value

It will be available in 24.8.2.

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.