Assignment within BASIC WITH declaration has v.24 break?

This worked, solidly and in production in LibreOffice Calc 7:

	Rem handle the range specification and criteria
	Cursor = SheetObject.createCursor()
	Cursor.gotoEndOfUsedArea(True)
	EndCellRange = Cursor.RangeAddress

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

In LO 24 (see below) it makes no assignments. All values remain 0. However,

	Rem handle the range specification and criteria
	Cursor = SheetObject.createCursor()
	Cursor.gotoEndOfUsedArea(True)
	EndCellRange = Cursor.RangeAddress

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

appears to work. Other functions are still broken, so at least it works as far as I can tell.

Anyone else seeing similar issues with With?

Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 87fa9aec1a63e70835390b81c40bb8993f1d4ff6
CPU threads: 20; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

I confirm the problem with Width structure 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

Please always copy all the code you need to try.

	SheetObject = ThisComponent.CurrentController.ActiveSheet
	RangeAddress = CreateUnoStruct("com.sun.star.table.CellRangeAddress")
	
	Cursor = SheetObject.createCursor()
	Cursor.gotoEndOfUsedArea(True)
	EndCellRange = Cursor.RangeAddress
	
	StartColumn = 0
	StartRow = 1

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

Yes, of course. I was focused on the WITH block and should have posted the entire function. Thanks for posting the rest.

Thank you for the confirmation. I’ll double check Bugzilla then post back here.

https://bugs.documentfoundation.org/show_bug.cgi?id=162935

Edit: Now resolved. Targeted for release in 24.8.2. Thanks to @elmau for confirming, and a very big thanks to Mike Kaganski for the remarkably quick fix! What a community!

2 Likes