Created attachment 151026 [details] demo doxc file opening a *.docx file with "text:variable-set" fields adds a trailing quotation mark to attribute "office:string-value" xml representation after *.docx import: <text:p text:style-name="P1"> <text:variable-set text:name="_marker_start" text:display="none" text:formula="ooow:demo"" office:value-type="string" office:string-value="demo""/> Hello <text:variable-set text:name="_marker_ende" text:display="none" text:formula="ooow:demo"" office:value-type="string" office:string-value="demo""/> </text:p> no problem with *.doc import
Created attachment 155233 [details] comparison MSO 2010 and LibreOffice 6.4 Master
Dear Oliver, Could you please try to reproduce it with a master build from http://dev-builds.libreoffice.org/daily/master/ ? You can install it alongside the standard version. I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the master build
Created attachment 155243 [details] screenshot_word_2016_vs_lo_master (In reply to Xisco Faulí from comment #2) yes it's still reproducible with: Version: 6.4.0.0.alpha1+ (x64) Build ID: 2e81c006b85214d28927ae4e3e18eda5f3be944a CPU threads: 4; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; Locale: de-DE (de_DE); UI-Language: en-US Calc: threaded
[Automated Action] NeedInfo-To-Unconfirmed
Created attachment 155447 [details] demo with and without trailing space the problem seems to be the trailing space
this seems to have started with: https://gerrit.libreoffice.org/plugins/gitiles/core/+/4d5ce76d894d2335b551f8c2b29437e2049894f0 commit 4d5ce76d894d2335b551f8c2b29437e2049894f0 [log] author Jean-Sebastien Bevilacqua <realitix@gmail.com> Thu Feb 16 10:16:50 2017 +0100 committer Miklos Vajna <vmiklos@collabora.co.uk> Tue Mar 28 07:05:30 2017 +0000 tree 152ac7f5dabfc7f7cb1df385dac8ed63a3afa1d1 parent b3549aacabffad3c4c66d901938d59e4789eef22 [diff] tdf#105975 Add Set field parsing (docx) in LibreOffice Writer Introduction ------------ In MSWord, you can create a variable with `SET` field and then reference it later in a formula. When you save your file as `docx`, this `SET` field is registered in you file. In its current state, LibreOffice can't parse the `SET` 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 `SET` support by adding it to the `aFields[]` variable. Next, to handle the `SET` constant, we add a condition (swith case) in `DomainMapper_Impl::CloseFieldCommand()` to call `handleFieldSet`. Finally, `handleFieldSet` works like `handleFieldAsk` with small differences. Note ---- I have renamed `lcl_ExctractAskVariableAndHint` to `lcl_ExctractVariableAndHint` because this function is used for both `ASK` and `SET` fields. Change-Id: I2bf948e26e8506ac151d1d0bc8556721bbe0392b Reviewed-on: https://gerrit.libreoffice.org/34333 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> /cygdrive/d/sources/bibisect/bibisect-win32-5.4 $ git bisect good c20d8357a586fc4616a4352d0f39117492da0bc0 is the first bad commit commit c20d8357a586fc4616a4352d0f39117492da0bc0 Author: Norbert Thiebaud <nthiebaud@gmail.com> Date: Tue Mar 28 00:50:59 2017 -0700 source 4d5ce76d894d2335b551f8c2b29437e2049894f0 source 4d5ce76d894d2335b551f8c2b29437e2049894f0 :040000 040000 bf860248cec2620dfeeda7b75779bc849fd54475 cfc1f8b4ae15560de2dabfeb868973df7a2c303a M instdir /cygdrive/d/sources/bibisect/bibisect-win32-5.4 $ git bisect log # bad: [5b9390199c309eb0f061804e45031da85989a8ef] source 534fd9aacd3eea10070a3ee88fc654eb9791aa24 # good: [633bfe84509c1953415e5dd0f564098a16890131] source 4136757b4e51c4e6f7cb4132c95538a7f831ef2c git bisect start 'master' 'oldest' # good: [fb6ad3d5a416ac122c263bb29a8d1b90a0750432] source 055c8cc676921176e2b9df76bd0e09bacab1d80b git bisect good fb6ad3d5a416ac122c263bb29a8d1b90a0750432 # bad: [e4ec339892e747e2dfd56126e74a90411fced190] source a917902c48f21d04039da86048c5c36555137d7e git bisect bad e4ec339892e747e2dfd56126e74a90411fced190 # good: [374673a7108c11f5a2d352f522597414093decbc] source dfdf256d828e29b430e41d1b82899680664259f5 git bisect good 374673a7108c11f5a2d352f522597414093decbc # bad: [a868c68624daf768ba20fb4f4acf5d0fef543edd] source 8005237d71a75fe9bcfd860111bb0fe1fa6064d6 git bisect bad a868c68624daf768ba20fb4f4acf5d0fef543edd # bad: [6ce293ed08bec72f7ae1a219f81c35a85b5b84ed] source 0e261a6908c2521a9967069095239eeb02810b8c git bisect bad 6ce293ed08bec72f7ae1a219f81c35a85b5b84ed # bad: [5757440d796f875b1392b645825b1f9ea08e56f8] source 2f2296d2c328fa8bf3671f8d3591d3a2bdf2752f git bisect bad 5757440d796f875b1392b645825b1f9ea08e56f8 # bad: [cab5d9b720db39f4b1f8701695cf34195b17cb55] source 799824565b783ec0b2323bd609a0e69a70182ac1 git bisect bad cab5d9b720db39f4b1f8701695cf34195b17cb55 # good: [ac97714fa1fd6359420656e6e0591954e4038576] source 2fc5ef74c5200bdb82cdbbc812d7ac05a9a489dd git bisect good ac97714fa1fd6359420656e6e0591954e4038576 # bad: [741fb160c0ac3408f5b02b0c4f98119573ecfc17] source 0cb5435dd35674b6e55e22922a0819d2a755fc10 git bisect bad 741fb160c0ac3408f5b02b0c4f98119573ecfc17 # bad: [8bef32fdac27565c8ddd500424359c5654be6368] source 65aa28cc1c8a90865c3a9ea379722730c40ecb53 git bisect bad 8bef32fdac27565c8ddd500424359c5654be6368 # bad: [b1140d3e2c8263b05bb80c3f5bfabe6901037754] source 157cb703888f4187c2c6709b13ebf9f779580fe2 git bisect bad b1140d3e2c8263b05bb80c3f5bfabe6901037754 # bad: [c20d8357a586fc4616a4352d0f39117492da0bc0] source 4d5ce76d894d2335b551f8c2b29437e2049894f0 git bisect bad c20d8357a586fc4616a4352d0f39117492da0bc0 # good: [3482471497813663a77c7baa97558d0b8b0dd933] source b3549aacabffad3c4c66d901938d59e4789eef22 git bisect good 3482471497813663a77c7baa97558d0b8b0dd933 # first bad commit: [c20d8357a586fc4616a4352d0f39117492da0bc0] source 4d5ce76d894d2335b551f8c2b29437e2049894f0
i think, i found the problem in "DomainMapper_Impl.cxx", will try to fix
Created attachment 155450 [details] DomainMapper_Impl.PNG
Created attachment 155453 [details] demo with and without trailing/leading spaces
added a patch: tdf#124986: docx: remove trailing quotation marks and spaces from set fields https://gerrit.libreoffice.org/#/c/81892/ waiting for review
Created attachment 155509 [details] set_var_test.bas - macro for testcase
Created attachment 155510 [details] set_var_test.docx - data file for testcase
brinzing committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fea5c10e222b10d83e0081dc1d1b2e678689d250 tdf#124986: docx: remove trailing quotation marks and spaces from set fields It will be available in 6.4.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.
Looks good for me at master. Is there a chance to backport to LO 6.3?
brinzing committed a patch related to this issue. It has been pushed to "libreoffice-6-3": https://git.libreoffice.org/core/commit/0c4c7452671b137dc70c329a34ba271428caab9a tdf#124986: docx: remove trailing quotation marks and spaces from set fields It will be available in 6.3.4. 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.