DocX files lose the "=" symbol from merge fields when importing.
Works in version 188.8.131.52
Fails in version 184.108.40.206 and later onwards
Steps to Reproduce:
1.Load attached DocX
2.Examine the tool tip when hovering over the field (the = symbol is missing)
3.Save as ODT, examine content.xml - '=' symbol has been lost from "text:column-name" attribute
= symbol is lost
= symbol is retained
User Profile Reset: No
This regression also means that when saving to DOCX the merge DocX file shows the incorrect text.
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Created attachment 140626 [details]
Minimal DOCX file showing 1 affected merge field.
Good import (content.xml) looks like:
<text:database-display ... text:column-name="ab=cd">
Bab import (content.xml) looks like:
<text:database-display ... text:column-name="abcd">
Regression introduced by:
author Jean-Sebastien Bevilacqua <email@example.com> 2017-02-16 10:54:33 +0100
committer Miklos Vajna <firstname.lastname@example.org> 2017-03-30 17:39:00 +0000
commit c568eb7d3bb4584867f0a1f0a7965f73097f009b (patch)
parent 53c2507bf97867011fd2bfbbac6c86b7fc494338 (diff)
tdf#105975 Add Formula field parsing (docx) in SWriter
In MSWord, you can create a formula field (starting with =).
When you save your file as `docx`, this `FORMULA` field is registered
in you file (a field starting with `=`). In its current state,
LibreOffice can't parse the `FORMULA` field in `docx` file.
Context of this fix
This fix is entirely located in the `DomainMapper_Impl.cxx` file
because it's where the parsing is done.
How this fix works
First, we add `FORMULA` support by adding it to the `aFields` variable.
Next, to handle the `FORMULA` constant, we add a condition (swith case) in
`DomainMapper_Impl::CloseFieldCommand()` to call `handleFieldFormula`.
In function `lcl_ExtractToken`, if command starts with `=`, it's a
Bisected with: bibisect-linux-64-5.4
Adding Cc: to Jean-Sebastien Bevilacqua
On pc Debian x86-64 with master sources updated today, I could reproduce this.
The pb is in these lines:
2525 case '=':
2526 if (token.isEmpty())
2528 rHaveToken = true;
2530 return OUString("FORMULA");
Miklos/Jean-Sebastien: thought you might be interested in this one following Xisco's comment