Bug 95699 - Form field vnd.oasis.opendocument.field.FORMCHECKBOX and FORMDROPDOWN cannot be copy-pasted or used in AutoText
Summary: Form field vnd.oasis.opendocument.field.FORMCHECKBOX and FORMDROPDOWN cannot ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:5.3.0
Keywords:
Depends on:
Blocks: 104032
  Show dependency treegraph
 
Reported: 2015-11-09 12:42 UTC by Cor Nouws
Modified: 2018-09-27 14:10 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
file with fields FORMTEXT and FORMCHECKBOX (14.88 KB, text/odt)
2015-11-09 12:44 UTC, Cor Nouws
Details
file with fields FORMTEXT and FORMCHECKBOX (14.88 KB, text/odt)
2015-11-12 12:08 UTC, Cor Nouws
Details
FORM example that also hase a DROPDOWN (9.99 KB, text/odt)
2015-11-12 12:08 UTC, Cor Nouws
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2015-11-09 12:42:54 UTC
A form field vnd.oasis.opendocument.field.FORMCHECKBOX comes in MsWord files that have form fields & protection.

It can be used in Writer, also when saved as odt, but it cannot be copy-pasted or used in AutoText. Whereas that is possible with the vnd.oasis.opendocument.field.FORMTEXT.

I'll attach a simple test file.
Comment 1 Cor Nouws 2015-11-09 12:44:24 UTC
Created attachment 120411 [details]
file with fields FORMTEXT and FORMCHECKBOX
Comment 2 Cor Nouws 2015-11-09 12:56:06 UTC
the same applies for FORMDROPDOWN
Comment 3 Julien Nabet 2015-11-09 21:25:18 UTC
I can't even insert text, I got a popup:
"
Read only content
Write-protected content cannot be changed.
No modifications will be accepted.
"
Comment 4 Buovjaga 2015-11-12 11:33:41 UTC
(In reply to Julien Nabet from comment #3)
> I can't even insert text, I got a popup:
> "
> Read only content
> Write-protected content cannot be changed.
> No modifications will be accepted.
> "

Same here, what's up with that, Cor?
Comment 5 Cor Nouws 2015-11-12 12:08:09 UTC
Created attachment 120495 [details]
file with fields FORMTEXT and FORMCHECKBOX

:)
Tools > Options > Writer > Formatting Aids > Ignore protection (down right)
Sometimes you also have to check/uncheck Use cursor (behaves a bit buggy)

And the attached version did not have a form text field. Apologies for that.
Comment 6 Cor Nouws 2015-11-12 12:08:56 UTC
Created attachment 120496 [details]
FORM example that also hase a DROPDOWN
Comment 7 Buovjaga 2015-11-12 12:17:11 UTC
When I copy the name field, is it supposed to paste without the grey background?

I guess I reproduce anyway.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: b216cc1b8096eb60c27f67e8c27b7cd756c75e38
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-11-12_00:06:20
Locale: fi-FI (fi_FI)
Comment 8 Cor Nouws 2015-11-12 13:14:22 UTC
(In reply to Beluga from comment #7)
> When I copy the name field, is it supposed to paste without the grey
> background?

FORMTEXT can be copied > pasted. This reused.
FORMDROPDOWN and FORMCHECKBOX can not.

Reusing is nice, since LibreOffice itself has no way to insert this type of field (nor in the UI, nor in the API, so not in the code either I guess)

> I guess I reproduce anyway.

thanks!
Comment 9 Mike Kaganski 2016-11-19 06:31:23 UTC
A patch is submitted for review: https://gerrit.libreoffice.org/30954/

(In reply to Julien Nabet from comment #3, Buovjaga from comment #4)
FYI: the old MS Word "Protect Form" option can be set/unset on the Writer Compatibility Options page (since https://bz.apache.org/ooo/show_bug.cgi?id=78591).
Comment 10 Commit Notification 2016-11-21 08:52:25 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#95699: allow copy FORMCHECKBOX and FORMDROPDOWN ...

It will be available in 5.3.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 11 Xisco Faulí 2017-01-13 12:34:33 UTC
Hello,
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?
Comment 12 Cor Nouws 2017-01-13 13:02:30 UTC
@xisco: thanks for asking.

@mike: thanks for the patch!
It works, with two minor issues. Minor, since they do not hinder the reuse of those form elements.

The minor issues are:
1. more then one field at a line causes problems. 
In attachment 120495 [details] there are two FORMCHECKBOX fields in one line. Copy&Paste only pastes the second.
Two FORMTEXT fields separated with only space/tabs, are merged, When separated with text, the second field is pasted/put on top of the last three characters (tab after not counted)
Two FORMDROPDOWN field are merged, unless separated with character, in which case the second is omitted.

2. Stored and used as autotext, the line with the FORMDROPDOWN places the selected item also as plain text right before the field.

I suggest that I make one separate issue for these combined issues.
@Mike: OK?
Comment 13 Mike Kaganski 2017-01-13 13:10:14 UTC
(In reply to Cor Nouws from comment #12)

Hm... yes, please create another issue please.
Comment 14 Cor Nouws 2018-09-27 14:10:55 UTC
(In reply to Mike Kaganski from comment #13)

> Hm... yes, please create another issue please.

see bug 120156