Is everything correct here as intended?
IMHO, the sheet should always be complete, without pieces. This is absurd.
I assume that after deleting a range of cells, it is replaced by other cells with the same addresses as those just deleted.
oSheet = ThisComponent.CurrentController.ActiveSheet
With oSheet
' NOTE: oAddress covers B522:O522.
.removeRange(oAddress, com.sun.star.sheet.CellDeleteMode.UP)
End With
After removal, the sheet is broken into pieces. The above range (oAddress) is excluded from it. Why?
oSheet.AbsoluteName (see screenshot):
As a result, the sheet reference becomes broken too.
Calc hangs in stop mode. If you do not interrupt the execution of the program, then getting a cell that is not on the sheet leads to an out-of-range error. And I just need the cell that took the place of the deleted one (B522).
I have to set again the reference to the sheet.
oSheet = ThisComponent.CurrentController.ActiveSheet
'Okay
oSheet = .Spreadsheet
'leads to hang
Or is there another way? And is there a bug here?
See the oSheet reference state in break mode after deleting a range of cells (below). Pay attention to the Value column in the screenshot. It’s blank.
Version: 7.2.3.1 / LibreOffice Community Build ID: 7b257967b9cd574cb72598999edde852baa10d80 CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3 Locale: ru-RU (ru_RU.UTF-8); UI: en-US Calc: threaded
UPDATED: I can understand that when deleting, the indexing in the loop (access by index) is violated, but so that the whole sheet disintegrates into parts… I don’t understand. This does not correspond to the real situation. We still have the entire sheet. The reference to the sheet should have been updated automatically. Or am I wrong?