| Summary: | DocX Import - Word merge fields lose "=" character | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Paul <paul.jowett> |
| Component: | Writer | Assignee: | Not Assigned <libreoffice-bugs> |
| Status: | VERIFIED FIXED | ||
| Severity: | major | CC: | aron.budea, jluth, paul.jowett, realitix, serval2412, vmiklos, xiscofauli |
| Priority: | medium | Keywords: | bibisected, bisected, regression |
| Version: | 5.4.0.0.alpha0+ | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.documentfoundation.org/show_bug.cgi?id=123357 | ||
| Whiteboard: | target:7.2.0 target:7.0.5 target:7.1.0 | ||
| Crash report or crash signature: | Regression By: | ||
| Bug Depends on: | |||
| Bug Blocks: | 112969, 123370 | ||
| Attachments: | Minimal DOCX file showing 1 affected merge field. | ||
|
Description
Paul
2018-03-14 04:12:23 UTC
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 <realitix@gmail.com> 2017-02-16 10:54:33 +0100 committer Miklos Vajna <vmiklos@collabora.co.uk> 2017-03-30 17:39:00 +0000 commit c568eb7d3bb4584867f0a1f0a7965f73097f009b (patch) tree ea7e6fb1e0d77369a90bc69dd8756f589bb352e4 parent 53c2507bf97867011fd2bfbbac6c86b7fc494338 (diff) tdf#105975 Add Formula field parsing (docx) in SWriter Introduction ------------ 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`. Note ---- In function `lcl_ExtractToken`, if command starts with `=`, it's a `FORMULA` field. 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())
2527 {
2528 rHaveToken = true;
2529 ++rIndex;
2530 return OUString("FORMULA");
2531 }
2532 break;
in writerfilter/source/dmapper/DomainMapper_Impl.cxx
Miklos/Jean-Sebastien: thought you might be interested in this one following Xisco's comment
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b232b422a3cfe3b410bbc75e0fffdfc238fd10e7 tdf#116394 writerfilter: append '=' if not a formula marker It will be available in 7.2.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. Julien, you did almost all the work, so you deserve the credit for this one. (In reply to Justin L from comment #5) > Julien, you did almost all the work, so you deserve the credit for this one. Just some great team work, Xisco found the commit, I made some hypothesis, you made the fix! :-) Thank you! Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/1b5ff41ae250ccd6b0e73b412ab7bd655f489d74 tdf#116394 writerfilter: append '=' if not a formula marker It will be available in 7.0.5. 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. Verified in Version: 7.2.0.0.alpha0+ / LibreOffice Community Build ID: 6ce66560c59470a9eb76fbf80f439b452166d3e4 CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded @Justin Luth, thanks for fixing this issue!! Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-7-1": https://git.libreoffice.org/core/commit/d864b799e0460c2c8ada62fd598e7adcb1ac6700 tdf#116394 writerfilter: append '=' if not a formula marker It will be available in 7.1.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. Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/63239749683ad718e10a5f561f17ca3c41ab4466 tdf#116394: sw_ooxmlexport15: Add unittest It will be available in 7.2.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. Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-7-1-0": https://git.libreoffice.org/core/commit/9218b1f71ee522b69d09b9a62a3a2f04a6f9f543 tdf#116394 writerfilter: append '=' if not a formula marker It will be available in 7.1.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. |