Bug 171783 - Writer: Cross-table formulas break if the source table name contains a trailing dot
Summary: Writer: Cross-table formulas break if the source table name contains a traili...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 171881
Blocks: Writer-Tables-Formulas
  Show dependency treegraph
 
Reported: 2026-04-16 21:15 UTC by Jakub Trzebiatowski
Modified: 2026-04-27 07:59 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo document (10.84 KB, application/vnd.oasis.opendocument.text)
2026-04-20 14:25 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Trzebiatowski 2026-04-16 21:15:14 UTC
Description:
Cross-table references in Writer formulas break if the source table name contains a trailing dot.

Disallowing dots in table names might seem like a simple fix, but it's a significant breaking change. A more robust approach would be improving the parser to correctly handle trailing dots in table references.

Steps to Reproduce:
1. Create a new Writer document
2. Create two tables: "Table1" and "Table2"
3. Rename "Table1" to "Table1."
3. Select "Table2" and "Insert or Edit Formula (F2)" and click on "Table1."

Actual Results:
1. The cell in "Table2" shows "** Expression is faulty **"
2. The formula is set to "=<?>"

Expected Results:
1. "Table2" shows the referenced value from "Table1."
2. The formula is correctly added


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.8.3.2 (AARCH64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 10; OS: macOS 15.7.4; UI render: Skia/Metal; VCL: osx
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Jakub Trzebiatowski 2026-04-19 05:23:48 UTC
Including dots in table names breaks formula references.

The easiest fix is to disallow dots in table names via UI validation. I suggest this approach as it's simple and avoids risky parser changes.

Does UI/UX agree with this, or is allowing dots in table names a requirement?
Comment 2 Heiko Tietze 2026-04-20 12:12:29 UTC
I cannot confirm the issue. =<Table1.A1> works for me - but the reference breaks of course if you delete the dot or rename the table. And renaming the "Table1" to anything with a dot like "Table.1" or "Table1." does not for me (trying via Rename at the Navigator).

(In reply to Jakub Trzebiatowski from comment #1)
> Does UI/UX agree with this, or is allowing dots in table names a requirement?

I am not aware of a Buzilla ticket requesting dots in table names. But I don't see why certain characters should be excluded from references. How about colons or slashes?
However, if the dot is used to split the table name from the cell name I see no alternative (except to add a type-safe variable).
Comment 3 Heiko Tietze 2026-04-20 12:12:47 UTC Comment hidden (off-topic)
Comment 4 BogdanB 2026-04-20 14:25:53 UTC
Created attachment 206750 [details]
Demo document

I had a Table1 and a Table2

The formula in Table2 was 
=sum(<Table1.A1:A5>)

After renaming Table2 to Table2. (Table - Properties) became:

=sum(<Table1.A1:A5>)
or
=sum(<Table1.?:?>)
or
=sum<?:A5>
or
=sum(<Table1.?:?>)

Depending of the cell from Table2 from where I copied the formula.
The formula get corrupted.
Comment 5 BogdanB 2026-04-20 14:29:16 UTC
But now I made another test. On my demo document, I renamed the table from Table1 to Table11, and I get the same ** Expression is faulty **. So, it is not about the dot, is about changing the references. In the second table I get =sum(<Table1.A1:A5>), so it is not updating. 

Even if I go to Tools - Update - Update all nothing is updating.

Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 279c07f4b4a9e195fe90cd49e18e601e9060513c
CPU threads: 16; OS: Linux 6.17; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 6 BogdanB 2026-04-20 14:30:24 UTC
The same is happening on master
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 279c07f4b4a9e195fe90cd49e18e601e9060513c
CPU threads: 16; OS: Linux 6.17; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 7 Jakub Trzebiatowski 2026-04-20 14:42:44 UTC
Thank you, Heiko Tietze, for your reply.

I think the reason you cannot reproduce it is that you didn't rename "Table1" to "Table1.".

The formula to reference "Table1." would be =<Table1..A1>.

Any name with a dot (".") breaks the formula. For example, "Table.1" would result in the formula =<Table.1.A1>, and this doesn't work doesn't work either.

It is not necessary to rename the table after creating the formula; the issue is reproducible for me when the table is renamed before adding the formula.
The fact that renaming a table breaks existing formulas is a separate issue: https://bugs.documentfoundation.org/show_bug.cgi?id=83196.

> How about colons or slashes?
Colons and slashes work. The formula "=<Table/\:.A1>" works, but there are more special characters that break the formula. Unfortunately, I don't have time now to investigate, but the table name "Table/;!@#$%^&*(Ą" breaks the formula as well.

I believe whoever works on the issue should ideally approach it more holistically: understanding which characters break the formula and why, and, if possible, preventing the user from naming the table with 'illegal' characters by defining a legal set of characters.
Comment 8 Jakub Trzebiatowski 2026-04-20 14:50:35 UTC
(In reply to BogdanB from comment #5)
> But now I made another test. On my demo document, I renamed the table from
> Table1 to Table11, and I get the same ** Expression is faulty **. So, it is
> not about the dot, is about changing the references. In the second table I
> get =sum(<Table1.A1:A5>), so it is not updating. 
> 
> Even if I go to Tools - Update - Update all nothing is updating.


Renaming a table after it is used in a formula is a separate issue: https://bugs.documentfoundation.org/show_bug.cgi?id=83196.

I fixed it in https://gerrit.libreoffice.org/c/core/+/203803.

I see you changed the name of tdf#171783; please revert it and make it more specific. I intentionally created a separate issue to highlight that fixing tdf#83196 does not fix tdf#171783.

Unless you suggest a different process here. Thanks.
Comment 9 Heiko Tietze 2026-04-20 15:49:42 UTC
(In reply to Jakub Trzebiatowski from comment #7)
> I think the reason you cannot reproduce it is that you didn't rename
> "Table1" to "Table1.".

(In reply to BogdanB from comment #4)
> After renaming ... (Table - Properties)...

Indeed, the sidebar rename function prevents dots right now while the properties dialog allows adding it.