Bug 143612 - Option Buttons Do Not Have the Expected "Default Value" and the "Reference value (off)" Option Appears to Serve No Purpose
Summary: Option Buttons Do Not Have the Expected "Default Value" and the "Reference va...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.1.4.2 release
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:7.4.0 target:7.3.4
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-29 19:05 UTC by westley.h.bennett
Modified: 2023-05-10 13:49 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example Document with three different example option buttons (10.04 KB, application/vnd.oasis.opendocument.text)
2021-08-13 15:13 UTC, westley.h.bennett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description westley.h.bennett 2021-07-29 19:05:18 UTC
Description:
I was trying to create a PDF form using LibreOffice, as is described in this URL:

https://www.linuxuprising.com/2019/02/how-to-create-fillable-pdf-forms-with.html

And it works great, with one exception - Option Buttons. Now, the Properties window > Data tab seems to suggest that if left blank, the "Reference values" will show as "on" and "off" respectively. And the existence of these two fields in the UI suggests that I should be able to change this behavior by entering a value in the textboxes, right? And each option button should have two possible "values", the "on" value and the "off" value, right?

However, there's two problems that I've noticed with this:

1. When the "Reference value (on)" field is left blank, the value that displays is also blank (a null value). I've confirmed this by investigating the field using both iText7 programming library, as well as viewing the field's properties in Adobe Pro DC. Please see the below screenshots for reference (also note that the second value found in iText7 is "off", which is what I would expect to see here):

In OpenOffice - https://i.imgur.com/bdCxoHI.png
In Adobe Pro - https://i.imgur.com/W7F3bil.png
In iText7 - https://i.imgur.com/oJJ88oY.png

Thus, it appears that the "Reference value (on)" field does NOT set the value to "on" by default as the UI suggests when there is no value entered.

However, I should note here that when a value IS set in that field, it appears to be populating correctly in both Acrobat Pro and iText7, so this appears to be working as intended.

2. The second issue is that the "Reference value (off)" field is either non-functional, or doesn't appear to be serving what I believe it's purpose should be. If I leave the field blank, I'd expect to see "off" as the value of the radio button. However, Adobe Pro confirms that if you set no value in this field in the UI, there is no value option that appears at ALL in the list of acceptable values for this option button. However, iText7 strangely lists the value as "off", no matter WHAT you put into this field, thus suggesting that this field right now does absolutely nothing. Please see the screenshots below:

In OpenOffice - https://i.imgur.com/cFGfXhV.png
In Adobe Pro - https://i.imgur.com/PfsIIHL.png
In iText7 - https://i.imgur.com/bpPrxbU.png

It's my opinion that this field should have both "on" and "off" as the default values for the option button being pressed or not pressed, AND that for both the on and off state, the user be able to set explicit values for each state.

Steps to Reproduce:
For the two issues:

Issue 1 (no default "on" value)
1. Add an option button onto the document
2. Ensure that the "Reference value (on)" value is blank
3. Export the document to PDF, then check the value in both Acrobat Pro and iText7

Issue 2 (the "Reference value(off)" textbox having no purpose)
1. Add an option button onto the document
2. Try to set a value for the "off" reference value
3. Export the document as a PDF, then check the value in both Acrobat Pro and iText7

Actual Results:
Issue 1 - The value will be "blank"

Issue 2 - The value will always be "off"

Expected Results:
Issue 1 - The value will be "on" by default, as the UI suggests

Issue 2 - The value will reflect whatever you placed into the "Reference value (off)" field


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.5.2 (x64) / LibreOffice Community
Build ID: 85f04e9f809797b8199d13c421bd8a2b025d52b5
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 1 Dieter 2021-08-13 06:38:56 UTC
Thank you for reporting the bug. Please attach a sample document, as this makes it easier for us to verify the bug.  I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
(Please note that the attachment will be public, remove any sensitive information before attaching it).
Comment 2 westley.h.bennett 2021-08-13 15:13:20 UTC
Created attachment 174259 [details]
Example Document with three different example option buttons

First example shows an option button with no Data Values Set
Second example shows one with values set of Yes and No
Third example shows one with values set of True and False
Comment 3 Dieter 2021-08-16 09:56:22 UTC
(In reply to westley.h.bennett from comment #2)
> Created attachment 174259 [details]
> Example Document with three different example option buttons
> 
> First example shows an option button with no Data Values Set
> Second example shows one with values set of Yes and No
> Third example shows one with values set of True and False

Yes, I can see those entries when I open design mode in form control toolbar and then oopen control properties => Tab "Data"
But I'm afraid, I'm not familiar enoughwith form controls to reproduce the bug. I hope, that somebody else can help.
Comment 4 Xisco Faulí 2022-05-12 09:13:42 UTC
Reproduced in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 4b693a0c594fb3b73f4a4c1e03e9916f1a107012
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

This is similar to bug 148442 <https://cgit.freedesktop.org/libreoffice/core/commit/?id=6ee5fb6d32147e180552f66e615d1de932fdcf9c>
The problem here is that the checkboxes and radiobuttons use RefValue for the 'reference value (on)' but there is nothing for the 'reference value (off)'
Comment 5 Xisco Faulí 2022-05-12 09:54:51 UTC
Actually I know how to fix it
Comment 6 Commit Notification 2022-05-12 11:55:44 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fe000080c514891f7cd65c3dd1c6f38732d78e7d

tdf#143612: map SecondaryRefValue in form pdf export

It will be available in 7.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.
Comment 7 westley.h.bennett 2022-05-12 20:09:47 UTC
Unfortunately, I don't have time to test this fix, but I do appreciate you looking into it and fixing it!

Much better service than DevExpress' AjaxControlToolkit, which still has issues untouched that were reported almost two years ago, ugh:

https://github.com/DevExpress/AjaxControlToolkit/issues?page=2&q=is%3Aissue+is%3Aopen
Comment 8 Commit Notification 2022-05-16 08:54:01 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/50fd91de9babf7c043759f13d8064ce5c22f307d

tdf#143612: map SecondaryRefValue in form pdf export

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