Bug 118244 - FILESAVE PDF The Option Button Form Control lost the “Group Name” setting
Summary: FILESAVE PDF The Option Button Form Control lost the “Group Name” setting
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:6.2.0
Keywords:
Depends on:
Blocks: 116702
  Show dependency treegraph
 
Reported: 2018-06-19 16:00 UTC by Gabor Kelemen (allotropia)
Modified: 2022-06-09 14:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example odt with multiple option buttons (9.88 KB, application/vnd.oasis.opendocument.text)
2018-06-19 16:00 UTC, Gabor Kelemen (allotropia)
Details
Group name is set in the properties (78.51 KB, image/png)
2018-06-19 16:01 UTC, Gabor Kelemen (allotropia)
Details
Exported file in Acrobat Reader XI - all options can be selected (120.76 KB, image/png)
2018-06-19 16:02 UTC, Gabor Kelemen (allotropia)
Details
optionButtons.odt: make sure two option groups still work (and bug 108687 test) (12.55 KB, application/vnd.oasis.opendocument.text)
2018-11-03 13:21 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2018-06-19 16:00:10 UTC
Created attachment 142924 [details]
Example odt with multiple option buttons

Insert some Option Button into the *.odt or *.docx file and set a group name of the option buttons. If we set a group name we can select only one option button, but if we export the document to PDF (to Create PDF form) we can check all of them.

Steps to reproduce:
1. Create a new *.odt or *.docx file with LibreOffice Writer.
2. Insert option buttons into the document.
3. Set a Group name of the option buttons in the “Option Button-Properties”.
4. Select an option button you created.
5. Export the document as PDF with the “Create PDF form” option. (Submit format: FDF)
6. Open the exported PDF with Adobe Reader.

Actual results:
After we opened the file with Adobe Reader, none of the option buttons were selected. All option button can be selected at the same time, because the previously selected option button will not be unchecked, after we selected another option button.

Expected results:
After the export the correct option button should be checked, and we should be able to check only one option button in the same group.

Version: 6.2.0.0.alpha0+
Build ID: fb8e6a6f44839f09fcd19dc500db33232bc4e15a
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-06-11_01:15:16
Locale: hu-HU (hu_HU); Calc: group threaded
Comment 1 Gabor Kelemen (allotropia) 2018-06-19 16:01:19 UTC
Created attachment 142925 [details]
Group name is set in the properties
Comment 2 Gabor Kelemen (allotropia) 2018-06-19 16:02:04 UTC
Created attachment 142926 [details]
Exported file in Acrobat Reader XI - all options can be selected
Comment 3 Buovjaga 2018-06-24 18:46:39 UTC
Repro.

Version: 6.2.0.0.alpha0+ (x64)
Build ID: 2c85607101e2e04e870e3b87362f39f9a9148e6c
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-06-16_00:12:37
Locale: fi-FI (fi_FI); Calc: group threaded

3.3.0
Comment 4 Justin L 2018-10-30 18:40:00 UTC
A workaround is to give each option button NAME to be identical.

The code for this is in toolbox/source/helper/formpdfexport.cxx determineRadioGroupId().  But this is really scary code because it looks like it is doing it all wrong, and did anyone even test this when they coded it? And if this is working for some specific situation, then changes would break that.

Git history doesn't help much - basically unmodified since initial code dump at
commit cda7d3dc154a74cd914bf21bc7eeb8c43bb6e154
Author: Vladimir Glazounov <vg@openoffice.org>
Date:   Tue Aug 19 21:10:58 2008 +0000
  INTEGRATION: CWS aw033 (1.1.2); FILE ADDED
  2008/08/19 16:46:47 cl 1.1.2.2: fixed license files
  2007/08/07 15:40:47 aw 1.1.2.1: #i39532# migrated describePDFControl to toolkit
Comment 5 Justin L 2018-10-30 19:32:16 UTC
I'm going to guess at what happened here. Likely, originally OOo implemented radio button groupping by assigning the same name to each button. Then at some point they added the "GroupName" property to the radio button to store that information, but the PDF export code was never modified. That is the only explanation that I can think of that would make sense of this situation.
Comment 6 Justin L 2018-11-01 15:07:53 UTC
proposed fix at https://gerrit.libreoffice.org/62742
Comment 7 Justin L 2018-11-03 13:21:47 UTC
Created attachment 146267 [details]
optionButtons.odt: make sure two option groups still work (and bug 108687 test)

My proposed patch didn't accept the previous behaviour. That might be OK if necessary, but it should be possible to support both methods, so that people who have spent a lot time figuring out how to work around LibreOffice's poor PDF export of radio buttons don't have to redesign just because GroupNamme is now supported.
Comment 8 Commit Notification 2018-11-05 05:03:28 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/80400973e06e08f0c1ab0b9a86418c1bcc4bbd5c%5E%21

tdf#118244 pdfexport: radio buttons use groupname now

It will be available in 6.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.
Comment 9 Commit Notification 2018-11-05 05:54:25 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/655154e45abfe6c69b97ad5c615f231be4b3827a%5E%21

tdf#118244 pdfexport: radio buttons can group with same name

It will be available in 6.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.