Bug 105481 - Formula disappears after file save and re-open for specific ODT with figure frame
Summary: Formula disappears after file save and re-open for specific ODT with figure f...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Dennis Francis
URL:
Whiteboard: target:6.5.0 target:6.4.0.1
Keywords: filter:odt
Depends on:
Blocks:
 
Reported: 2017-01-23 01:26 UTC by john
Modified: 2019-12-04 16:41 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
sample document, partly anonymised (5.28 MB, application/vnd.oasis.opendocument.text)
2017-01-24 02:53 UTC, john
Details
screen shot after the file is saved, before closing the file (19.42 KB, image/png)
2017-01-24 02:54 UTC, john
Details
screenshot after re-opening the file (7.59 KB, image/png)
2017-01-24 02:55 UTC, john
Details
sample document, single page (25.56 KB, text/odt)
2018-05-17 09:48 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description john 2017-01-23 01:26:51 UTC
This bug occurs with both 5.0.6.3 as well as 5.2.4.2.

I have a .odt document containing an academic paper. The figures in this paper are in flames, positioned relative to the page. The first figure caption contains two equations. These are the first equations to appear in the document. The document also makes use of JabRef for the bibliography.

Every time I save my document, then close it, then re-open in, the first *two* equations in the document disappear. They are replaced by a white box of the same size as the equation, but the box is just white and no longer behaves like a formula.

If I re-enter the first equation by deleting the white box and re-typing the first equation, then coincidently, the second equation also re-appears all by itself.

Clearly this document has become corrupted in some way. I don't know how I can uncorrupt it. I don't want to post the whole file here as it is a paper in press, but I will be happy to send it to anyone able to look into this issue for me -- my email address is john.pye@anu.edu.au.

Would really appreciate this, I think this relates to another bug I filed about frames in LO, I think there are some serious bugs in this area relating to behaviour of (indexing of?) objects in frames, so I hope this can be addressed.
Comment 1 john 2017-01-23 01:27:25 UTC
Also wanted to add that the problem occurs on both Windows and Linux.
Comment 2 Xisco Faulí 2017-01-23 11:37:40 UTC Comment hidden (obsolete)
Comment 3 john 2017-01-24 02:53:18 UTC
Created attachment 130647 [details]
sample document, partly anonymised

this file will load with errors, visible as gaps in the caption of the first image.
Comment 4 john 2017-01-24 02:54:19 UTC
Created attachment 130648 [details]
screen shot after the file is saved, before closing the file

Note the equations are visible here.
Comment 5 john 2017-01-24 02:55:16 UTC
Created attachment 130649 [details]
screenshot after re-opening the file

note the missing equations. this happens every time, on windows as well as on Linux.
Comment 6 john 2017-01-24 02:56:06 UTC Comment hidden (obsolete)
Comment 7 Buovjaga 2017-01-25 16:57:40 UTC
(In reply to john from comment #3)
> Created attachment 130647 [details]
> sample document, partly anonymised
> 
> this file will load with errors, visible as gaps in the caption of the first
> image.

The two equations below the images on the first page are already invisible upon opening. If I place my cursor before either of the "white boxes" and use Delete to remove a space, both the formulas immediately appear.

I looked inside the content.xml of the file and this is the markup for the first problematic formula in case someone understands the cause:

<text:span text:style-name="T91">
     <draw:frame draw:style-name="fr12" draw:name="Object27" text:anchor-type="as-char" svg:y="-0.282cm" svg:width="1.266cm" svg:height="0.351cm" draw:z-index="62">
         <draw:object xlink:href="./Object 39" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" />
         <draw:image xlink:href="./ObjectReplacements/Object 39" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" />
     </draw:frame>
</text:span>

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: 63fd4c97118a943c84ba5a666cf8c9cc54b511c7
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on January 22th 2016
Comment 8 john 2017-03-09 22:54:22 UTC
Ping, any thoughts on this issue? Trying to work on this document is infuriating, as the formula disappear every time I re-open it. 

Could the 'importance' of this bug please be increased, since no work-around is known?
Comment 9 Buovjaga 2017-03-10 05:30:03 UTC
(In reply to john from comment #8)
> Could the 'importance' of this bug please be increased, since no work-around
> is known?

I could raise it, if the formulas disappeared for real, but now they are just invisible upon opening.

Confirmed with 3.3 already.

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 10 john 2017-03-16 04:51:14 UTC
They do disappear 'for real'. If I save my document, then re-open it, then print or export as PDF... no formulae! I uploaded my conference paper recently to the conference organisers, and received feedback that my formulas were missing. Embarrassing!

Also, there is no workaround. There is nothing I have been able to do to the document to stop this problem re-occurring. However it is that my document is corrupted (or whatever it is that the bug in LibreOffice might be), the equations just keep disappearing every time I load the file. I have tried deleting them and re-creating them, etc etc, but it keeps happening.
Comment 11 Buovjaga 2017-03-16 05:08:41 UTC
(In reply to john from comment #10)
> They do disappear 'for real'.

I was referring to a case, where one could not get them to reappear.
Comment 12 QA Administrators 2018-05-08 02:32:25 UTC Comment hidden (obsolete)
Comment 13 john 2018-05-17 07:53:20 UTC
Yes, this bug is still present in

Version: 5.4.6.2
Build ID: 1:5.4.6~rc2-0ubuntu0.16.04.1
CPU threads: 8; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group
Comment 14 Timur 2018-05-17 09:48:09 UTC
Created attachment 142149 [details]
sample document, single page

Repro with 6.1+. 
Since sample document is too long, I add just 1st page which shows the problem.
Formulae in frame work if created from scratch, this is something specific to this part of document.
Comment 15 QA Administrators 2019-05-18 03:05:46 UTC Comment hidden (obsolete)
Comment 16 john 2019-09-19 14:21:49 UTC
This big is still present in 6.2.6.2. Additionally, the empty frames now appear in the wrong location, making it harder to use the workaround. Activating one of the formulae, then escaping out of the forumula editor brings back the invisible equations, as before.

Version: 6.2.6.2
Build ID: 1:6.2.6-0ubuntu0.18.04.1~lo1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-AU (en_AU.UTF-8); UI-Language: en-US
Calc: threaded
Comment 17 Commit Notification 2019-12-02 11:17:26 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/318229900fe6d30d9b82256d908dadda8b2f4d61

tdf#105481 : Do not skip invalidation of as-char anchored objects

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2019-12-04 16:41:05 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/7dd84a761202097c3afda7fe8296604791b58d2f

tdf#105481 : Do not skip invalidation of as-char anchored objects

It will be available in 6.4.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.