Table sort fails with unpredictable behavior

Using Writer, I’m trying to sort some rows in a table, where there are also some referenced fields.
The result is messy and sometimes unpredictable, too. I tried to copy the table with some text into a new document, and it still doesn’t work, with a different behavior.

Let me describe what happens with the clean document, with just a short table in it - I attach it here too.
The table has 5 rows, the first is a header (in my intentions), and the last is empty. I select the three in the middle and then Menu > Table > Sort…, Key 1/Column 1 as Descending order.
Only the rows with fixed text are sorted, and the row with fields is ignored, as the text from the field isn’t considered.

The more stunning result comes instead when I’m doing the same thing, on the same table, in the original document: two rows are sorted, and the fields from the third are pasted in the first. Moreover, pressing Ctrl-Z doesn’t undo everything; I have to manually delete the inserted fields. If I insist a few times repeating the same actions (with more Ctrl-Z) Writer crashes.

Something is broken, is it?
table_sort.odt (13.3 KB)

Version: 25.8.0.4 (X86_64)
Build ID: 48f00303701489684e67c38c28aff00cd5929e67
CPU threads: 12; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: it-IT (it_IT); UI: en-US
Calc: threaded

It might be a graphics issue in the original document, I get something vaguely similar with wandering cell references in Calc address bar if I have just Skia/Vulkan.

Try this, click Tools > Options > LibreOffice > View and tick the box Force Skia software rendering. Allow LibreOffice to restart and see if the problems persists. About LibreOffice will read, at the relevant part, Skia/Raster

From what I see, the sort order for Writer is

  1. Blank cells
  2. Fields
  3. Some special characters
  4. Numbers
  5. Text

You might wish to add another column for sorting

It’s not a graphical artifact, but a copy of the field that I can only remove with a delete operation (Canc/Backspace).

Anyway, will try software rendering, if not too slow.

Besides, the only text relevant to sorting is in column 1.
Now, that is at least nonsense: what does that order mean?
If I want to sort ascending and have a field with text “Z” below a text of “A”, will the field be sorted as first?
This is far from the meaning of sorting.

Note also that in the mess where the field was pasted on the first line, some sense of sorting still came through.

Anyway, crashes were too many, so I trashed version 25.8 and went back to 25.2, which has other nasty bugs that I can tolerate for now.

[EDIT]
I can confirm that the insane “ordering method” is the same also on version 25.2 - now I know that LO doesn’t have any idea of what sorting means, and is unreliable by design, not cause of a bug.

I am now not sure that fields are sorted separately from blank cells. You might like to make an enhancement bug report asking for the contents of fields to be sorted on, How to Report Bugs in LibreOffice - The Document Foundation Wiki

Ticking the Force Skia software rendering box might fix those crashes too, see First steps to take before submitting a bug - The Document Foundation Wiki(Skia)

I just did that, and it has been linked by maintainers to a similar report from 2013 (yes, twelve years ago).
I seriously doubt it will ever be considered for a change.

Thanks anyways

1 Like

Bug tdf#168222 I presume

Yes, the next to sweep under the carpet