Bug 151190 - content control: picking date doesn't replace previous date
Summary: content control: picking date doesn't replace previous date
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: low minor
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.5.0 target:7.4.3
Keywords: bisected, filter:docx, implementationError
Depends on:
Blocks: DOCX-Content_Control
  Show dependency treegraph
 
Reported: 2022-09-26 17:34 UTC by Justin L
Modified: 2022-10-13 09:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
contentControlMacros.docm: example of macros modifying content controls (30.64 KB, application/vnd.ms-word.document.macroEnabled.12)
2022-09-26 17:34 UTC, Justin L
Details
Macro-free reproducer (19.41 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-09-28 07:25 UTC, Miklos Vajna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2022-09-26 17:34:42 UTC
Created attachment 182683 [details]
contentControlMacros.docm: example of macros modifying content controls

The date control doesn't replace the existing contents when a new date is chosen.

Broken with 7.4's commit 5ee8670f18cb8b1913a23d04590d6a31ac9730de
Author: Miklos Vajna on Mon May 30 09:00:25 2022 +0200
    sw content controls, date: add DOCX import

This is all fairly new stuff. (Before it was mapped/converted into an activeX control? It worked fairly well, so this looks like a regression.)

Marking as ImplementationError since this is work-in-progress. For example, one improvement of being a content control is that the dropdown disappears until the control is clicked on.

To reproduce:
A.) open contentControlMacros.docm (no need to enable macros)
B.) change the date.
Notice that "Click here to enter a date." is not replaced. Dates are just added on in front every time a change is made.
Comment 1 Justin L 2022-09-26 17:52:51 UTC
The example file was created in Excel 2010. I wonder if that tends to cause problems with our import compared to perhaps newer MSO output.

Let me just add that a similar problem is seen with the check-boxes. They also duplicate instead of replacing each other. That also started in 7.4, with
commit c53d3a1f4b8430507d54f5fac336870df7a700af
Author: Miklos Vajna on Fri Apr 29 08:12:25 2022 +0200
    sw content controls, checkbox: add DOCX import

If these two are unrelated, a separate bug report can be split off to handle this - but I expect they end up being the same bug.
Comment 2 raal 2022-09-27 14:41:29 UTC
Confirm Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: bb47ffbc9d36e83695aa0d01767d3f83533c04e0
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 3 Miklos Vajna 2022-09-28 07:25:45 UTC
Created attachment 182702 [details]
Macro-free reproducer

Yes, I can reproduce the problem. Both checkboxes and date pickers seem to work fine in normal text, but not in protected sections. I attach a macro-free reproducer. Probably I should go through all types and make sure they work in protected sections.
Comment 4 Commit Notification 2022-10-12 11:56:28 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#151190 sw content controls: make them read-write in protected sections

It will be available in 7.5.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 5 Commit Notification 2022-10-13 09:06:15 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/7cb6be3e866bad39a37844802d49b1f5c7031910

tdf#151190 sw content controls: make them read-write in protected sections

It will be available in 7.4.3.

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.