Bug 140645 - Undo breaks bookmark fields
Summary: Undo breaks bookmark fields
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected)
3.4.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Undo-Redo Bookmarks
  Show dependency treegraph
Reported: 2021-02-24 15:09 UTC by Telesto
Modified: 2022-06-12 10:03 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:

2021-02-26_0-43-14.png (30.94 KB, image/png)
2021-02-27 05:27 UTC, melody cercenia

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-02-24 15:09:01 UTC
Undo breaks bookmark fields

Steps to Reproduce:
1. Open attachment 163654 [details]
4. CTRL+Z -> Scroll up to first page

Actual Results:
Fields broken

Expected Results:
As initial layout

Reproducible: Always

User Profile Reset: No

Additional Info:
Version: (x64) / LibreOffice Community
Build ID: 385808a2dff7300ec0120fdd5e8acfad8f86e50d
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL

and in

and in

and in

and in
Build ID: a4d4fbeb623013f6377b30711ceedb38ea4b49f8
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; 
TinderBox: Win-x86@62-merge-TDF, Branch:libreoffice-5-2, Time: 2016-12-24_14:43:55
Locale: nl-NL (nl_NL); Calc: group

and in
Versie: (x64)
Build ID: 490fc03b25318460cfc54456516ea2519c11d1aa
Locale: nl-NL (nl_NL)

not in
Comment 1 melody cercenia 2021-02-27 05:27:36 UTC
Created attachment 170101 [details]
Comment 2 melody cercenia 2021-02-27 05:29:38 UTC
Comment on attachment 170101 [details]

Confirming I was able to reproduce the issue by following the steps provided.
Also did some further check and found few related behaviours:
Observation 1: It still occurs even if I removed all the bookmark fields.
Observation 2: It went back to the original layout when I (Ctrl + X) and (Ctrl + Z) just the whole bookmark/table of content after following the steps provided.
Step to reproduce:
1. Follow Steps 1 - 4
2. CTRL+X just the table of content
3. CTRL+Z -> document returns to the original layout
Observation 3: Layout is broken but not the functionality.  Once you click the bookmark even though it says “Error: Reference source not found” it will still go to the correct page.
Observation 4:  When you hover your mouse over the word it will still populate the correct linked page (example: General Knowledge) see image: 2021-02-26_0-43-14.png (image/png)
Observation 5: Closing the file/document did not prompt the “Save changes before closing” dialog box.  It seems identified as it is not changed.
Additional Info:
Version: (x64) / LibreOffice Community
Build ID: 575c5867c4cc13d7ae78f9ce39a54a52ed38c769
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: en-NZ (en_NZ); UI: en-US
Calc: threaded
Comment 3 Alessia 2021-03-19 00:01:56 UTC
I was able to reproduce the issue with steps 1-4 and with the additional steps 1-3 (cutting and copying back only the table of contents, like in Observation 2).

The bookmarks still work even if the text says "Error: Reference source not found" (Observation 3) and hovering over the bookmark the correct name of the section appears (observation 4).

If I perform all the seven steps together, the file asks me if I want to save the new version.
If I just perform the first 3, the file closes. If I re-open it, the table of contents is fine.
Additional information:
Version: (x64) / LibreOffice Community
Build ID: 005adbefc746f9024adcf572c287dc061acbcf00
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL


Version: (x64) / LibreOffice Community
Build ID: fe0b08f4af1bacafe4c7ecc87ce55bb426164676
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 4 Harshita Nag 2021-06-10 07:42:31 UTC
CONFIRMED on Ubuntu 18.04 LTS and LibreOffice

Build ID: 1:6.0.7-0ubuntu0.18.04.10
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: gtk3; 
Locale: en-IN (en_IN); Calc: group
Comment 5 Harshita Nag 2021-06-18 06:47:31 UTC
I tested it with the oldest commit of 5.0 max repo and the bug occurs in it.
Comment 6 BogdanB 2021-07-31 05:23:32 UTC
Repro in 
Version: / LibreOffice Community
Build ID: 5aa74aa1e6fac571f99146ebcb6adc9feb1459ad
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-07-28_19:35:14
Calc: threaded
Comment 7 Aron Budea 2022-06-12 10:03:42 UTC
I can already reproduce this with 3.4.0. You have to wait a bit after Ctrl+X (a few seconds after content is gone), else if you undo quickly, there's a chance that it'll be fine.

In 3.3.0 it opens with errors in the bookmark field.

Can't confirm this is a regression.