Bug 159532

Summary: Deleting first or last row from a table referenced in a table function makes it invalid
Product: LibreOffice Reporter: Gabor Kelemen (allotropia) <kelemeng>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: miguelangelrv, stephane.guillou
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 122755    
Attachments: Example file from Writer
Screenshot of the broken formula

Description Gabor Kelemen (allotropia) 2024-02-02 18:25:06 UTC
Created attachment 192358 [details]
Example file from Writer

When a table row that is referenced in a table function is deleted, the function is updated in an invalid way.

1. Open attached document
2. From the first table delete the first or second row
-> the SUM formula in the third row becomes invalid, such as SUM<B1:?>
3. From the third table delete the second row
-> the SUM formula in the fourth row is still valid, changes from SUM<B1:B3> to SUM<B1:B3>
Deleting one more row would make this invalid as well.

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: dfcdef6d94993131b5f150d00d08cc81a987eebb
CPU threads: 15; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded

already in LO 3.3.
Comment 1 Gabor Kelemen (allotropia) 2024-02-02 18:28:51 UTC
Created attachment 192359 [details]
Screenshot of the broken formula
Comment 2 m_a_riosv 2024-02-03 02:15:59 UTC
It works the same as it does in Calc.

Deleting the first or last row (cell) of a range broke the range.

But deleting some row (cell) inside the range doesn't, the range is reduced, to adapt the last row (cell) to the new range.

In the second case, the new range is B1:B2 instead B1:B3.

I think there is not a bug.

Tested with
Version: 24.2.1.0.0+ (X86_64) / LibreOffice Community
Build ID: cafcc50570f9edaaebe74d2152bae5df1cc2edfe
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded
+
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 1647493e5cbb9cf4f06b7d0387d6763a2f30fdae
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: es-ES Calc: CL threaded
Comment 3 Stéphane Guillou (stragu) 2024-02-19 12:33:32 UTC
(In reply to m_a_riosv from comment #2)
> It works the same as it does in Calc.
I don't see the same in Calc: first or last row deletion does not make a sum formula invalid, the range is updated as OP expects.

I agree that how Writer behaves currently is not expected nor elegant. The range should be updated and the formula still valid.