Bug 112679 - Copied FORMTEXT field in DOC is corrupted when file is saved and reopened
Summary: Copied FORMTEXT field in DOC is corrupted when file is saved and reopened
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:6.0.0 target:5.4.3 target:5.3.7
Keywords: bibisected, bisected, filter:doc, regression
Depends on:
Blocks: DOC-Forms
  Show dependency treegraph
 
Reported: 2017-09-26 22:34 UTC by Aron Budea
Modified: 2017-09-30 10:17 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Sample DOC with form field (26.50 KB, application/msword)
2017-09-27 10:56 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-09-26 22:34:57 UTC
The attached DOC file, created in Word 2013 contains a Text Form Field (Legacy Form).
Copy the line of text, and paste it as a second line.
Save and reopen the document.

=> The pasted field shows multiple of text "FORMTEXT" over it.

I'm not sure what this kind of field corresponds to in LibreOffice, in Word the field has a bunch of properties (none of them have been set or changed in Word).

Observed with LO 6.0 daily build (2017-09-22_22:54:52, 0db08432c69adc36ed464c1f7c8e672acb3752d) & 5.3.0.3 / Windows 7.
Not reproducible with LO 5.2.0.4.
=> regression
Comment 1 Aron Budea 2017-09-26 22:37:47 UTC
Bibisected to the commit referenced below using repo bibisect-win32-5.3. Adding Cc: to Michael Stahl, please take a look sometimes.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=bb069fe7b8b6a24f9ff4df4c7052961e17ea3a8c
author  	Michael Stahl <mstahl@redhat.com>	2016-09-28 08:41:07 (GMT)
committer	Michael Stahl <mstahl@redhat.com>	2016-09-28 09:04:19 (GMT)

"sw: remove defensive programming bullshit in lcl_AssureFieldMarksSet"
Comment 2 Michael Stahl (allotropia) 2017-09-27 10:45:28 UTC
"The attached DOC file" - isn't, currently.
Comment 3 Aron Budea 2017-09-27 10:56:55 UTC
Created attachment 136564 [details]
Sample DOC with form field

My bad, forgot to attach it, here it is now.
Comment 4 Aron Budea 2017-09-27 10:58:34 UTC
By the way, interestingly there's no issue with a similar DOCX file, so it only seems to affect DOCs.
Comment 5 Michael Stahl (allotropia) 2017-09-27 14:42:01 UTC
fixed on master
Comment 6 Commit Notification 2017-09-27 14:42:31 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=421a23bb36bbf51edfabc58b7d2cd28ad37719d0

tdf#112679 sw: fix copying of fieldmarks

It will be available in 6.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Aron Budea 2017-09-28 12:36:43 UTC
Verified with daily build from 09-28, thanks for the fix, Michael!
Comment 8 Commit Notification 2017-09-30 10:17:44 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=10fe1a4b7b408ce8322d65c6e0701e67e4d0f25b&h=libreoffice-5-4

tdf#112679 sw: fix copying of fieldmarks

It will be available in 5.4.3.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2017-09-30 10:17:52 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fb741b48a4d11c1f91702a73ef600c7df976a298&h=libreoffice-5-3

tdf#112679 sw: fix copying of fieldmarks

It will be available in 5.3.7.

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

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