Bug 159817

Summary: Form controls coordinates scrambled when exporting to pdf with uncheked form creation in Writer
Product: LibreOffice Reporter: floconsdepaques
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: noelgrandin, raal, rafael.palma.lima
Priority: medium Keywords: bibisected, bisected, regression
Version: 24.2.0.3 release   
Hardware: x86-64 (AMD64)   
OS: All   
Whiteboard: target:24.8.0 target:24.2.2
Crash report or crash signature: Regression By: Noel Grandin
Bug Depends on:    
Bug Blocks: 107742    
Attachments: Sample .odt for test
PDF result when "Create a pdf form" is checked
PDF result when "Create a pdf form" is checked (image)
PDF result when "Create a pdf form" is un-checked
PDF result when "Create a pdf form" is un-checked (Image)

Description floconsdepaques 2024-02-21 10:11:30 UTC
Description:
Form controls are exported to their native position on page when the writer document is exported to pdf with the form creation option is checked. To the contrary, form controls coordinates are scrambled when this option is unchecked. See samples.
As fara as i remember, did not happened with 7.x branch, at least not with the early 7.x branch (7.1, 7.2 ...).

Steps to Reproduce:
1. Open provided .odt
2. Export to pdf either with option "Create a pdf form" checked or unchecked;
3. See the difference

Actual Results:
See samples. If option unchecked, formd are not at their proper place on page.

Expected Results:
There should be no difference.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: da48488a73ddd66ea24cf16bbc4f7b9c08e9bea1
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded
Comment 1 floconsdepaques 2024-02-21 10:12:40 UTC
Created attachment 192680 [details]
Sample .odt for test
Comment 2 floconsdepaques 2024-02-21 10:14:14 UTC
Created attachment 192681 [details]
PDF result when "Create a pdf form" is checked
Comment 3 floconsdepaques 2024-02-21 10:15:10 UTC
Created attachment 192682 [details]
PDF result when "Create a pdf form" is checked (image)

Image of the pdf result for control
Comment 4 floconsdepaques 2024-02-21 10:16:06 UTC
Created attachment 192683 [details]
PDF result when "Create a pdf form" is un-checked
Comment 5 floconsdepaques 2024-02-21 10:16:43 UTC
Created attachment 192684 [details]
PDF result when "Create a pdf form" is un-checked (Image)

Image for control
Comment 6 Rafael Lima 2024-02-21 12:34:42 UTC
I can reproduce the issue with

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8a44e6148b7b2ecc3a14e246105b828651d275d4
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL threaded

The issue does not happen with

Version: 7.6.4.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 4:7.6.4-0ubuntu0.23.10.1
Calc: threaded

This seems to be a regression.
Comment 7 raal 2024-02-21 16:36:02 UTC
This seems to have begun at the below commit in bibisect repository/OS linux-64-24.2.
Adding Cc: to Noel Grandin ; Could you possibly take a look at this one?
Thanks
 7c7bdf963cd38aa3454c1aef299685f47e96207f is the first bad commit
commit 7c7bdf963cd38aa3454c1aef299685f47e96207f
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Tue Jul 4 19:23:17 2023 +0200

    source 7441aaa4c5b2215e369c62e22af098184e8ce807

153967: unnecessary LogicToPixel in RadioButton::Draw | https://gerrit.libreoffice.org/c/core/+/153967
Comment 8 Commit Notification 2024-03-04 08:27:55 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

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

tdf#159817 tdf#159802 Form controls coordinates wrong when export to pdf

It will be available in 24.8.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 2024-03-04 11:18:21 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/10346f5ff6f0ab6e3b2deb709e4f3e9cc49bf80c

tdf#159817 tdf#159802 Form controls coordinates wrong when export to pdf

It will be available in 24.2.2.

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 10 floconsdepaques 2024-03-06 13:45:07 UTC
Tested today with dev build 2024-03-05.
As far as I tested, the bug is resolved. Many thanks ! 

Version: 24.2.2.0.0+ (X86_64) / LibreOffice Community
Build ID: aa438e3b00ad1377a6451d88e71b6370a0a210d9
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Vulkan; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: threaded