Bug 138661 - FORMCONTROLS: Date in formatted fields is set back to number when saving control properties
Summary: FORMCONTROLS: Date in formatted fields is set back to number when saving cont...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.1.0.0.beta2 target:7.2.0 tar...
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2020-12-04 17:48 UTC by Robert Großkopf
Modified: 2020-12-17 12:55 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2020-12-04 17:48:38 UTC
Open a new Writer document.
Go to Form → Formatted field.
Draw a field, right click on the field and choose Control Properties → General → Formatting.
Choose Date → Dec 31, 99 (in English - choose any other ...)
Have a look at General → Formatting. It will always show 05/18/1927 (or something like this in your language.
Close the editing, switch to Form → Design Mode off.
Try any input.
In will be changed to a number, not a date.

Now write down 36524 in this field.
Switch Form → Design Mode on.
Choose the field and set the formatting for date again. You could see your input 36524 will be changed to any data format you wish, but it won't be saved.

Tested with LO 7.0.4.1 on OpenSUSE 15.1 64bit rpm Linux.
Comment 1 Julien Nabet 2020-12-04 21:28:57 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this (at least the beginning since I stopped then).

I noticed these logs:
warn:comphelper:59591:59591:comphelper/source/misc/numbers.cxx:44: getNumberFormatType : invalid key! (maybe created with another formatter ?)
warn:legacy.tools:59591:59591:extensions/source/propctrlr/usercontrol.cxx:214: OFormattedNumericControl::SetFormatDescription: invalid format key!
warn:legacy.tools:59591:59591:extensions/source/propctrlr/usercontrol.cxx:214: OFormattedNumericControl::SetFormatDescription: invalid format key!
warn:legacy.tools:59591:59591:extensions/source/propctrlr/usercontrol.cxx:214: OFormattedNumericControl::SetFormatDescription: invalid format key!
warn:legacy.osl:59591:59591:extensions/source/propctrlr/usercontrol.cxx:98: OFormatSampleControl::setValue: invalid format entry!
warn:legacy.tools:59591:59591:extensions/source/propctrlr/usercontrol.cxx:141: OFormattedNumericControl::SetFormatDescription: invalid format key!
Comment 2 Julien Nabet 2020-12-05 10:53:03 UTC
Interestingly, I don't reproduce this with gen rendering.
(export SAL_USE_VCLPLUGIN=gen;soffice --writer)

Robert: what's rendering do you use? gtk3, qt? other ? Do you confirm you don't reproduce either with gen rendering?
Comment 3 Julien Nabet 2020-12-05 11:33:56 UTC
Caolán: thought you might be interested in this one since it seems related to vcl rendering more than extensions part.
Comment 4 Robert Großkopf 2020-12-05 16:13:53 UTC
(In reply to Julien Nabet from comment #2)
> Interestingly, I don't reproduce this with gen rendering.
> (export SAL_USE_VCLPLUGIN=gen;soffice --writer)
> 
> Robert: what's rendering do you use? gtk3, qt? other ? Do you confirm you
> don't reproduce either with gen rendering?

This works with VCL kf5.
The field will be formatted right.
The chosen format will be set and if I change back to the formatting it will switch to "Date", not to "Decimal".

General → Formatting shows it wrong. It will always show 05/18/1927 (or something like this in your language.) 
Thought this would be the same bug, but it isn't.
Comment 5 Aron Budea 2020-12-06 07:30:49 UTC
Bibisected to the following commit using repo bibisect-linux-64-7.0.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=1efeb17837c22499f00299c033ae59ba3910f7d7
author		Caolán McNamara <caolanm@redhat.com>	2019-11-04 13:06:04 +0000
committer	Caolán McNamara <caolanm@redhat.com>	2019-12-09 13:28:35 +0100

weld Property Browser
Comment 6 Commit Notification 2020-12-15 19:41:38 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

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

Related: tdf#138661 don't limit OFormatSampleControl to +10000

It will be available in 7.1.0.0.beta2.

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 Commit Notification 2020-12-16 08:45:38 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/56fba55533ed5a555e7ef184c4399e6497b22315

Related: tdf#138661 don't limit OFormatSampleControl to +10000

It will be available in 7.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 8 Commit Notification 2020-12-16 08:46:49 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8b3982681e98818388c09233960ad6eaacee205a

tdf#138661 don't emit value-changed when not changed by user

It will be available in 7.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 Caolán McNamara 2020-12-16 08:47:56 UTC
fixed in master and 7-1, backport to 7-0 in gerrit
Comment 10 Commit Notification 2020-12-16 08:48:11 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/8a6d2cbbec5d3b779bba9003b482c47a3a1d38c2

tdf#138661 don't emit value-changed when not changed by user

It will be available in 7.1.0.0.beta2.

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 11 Xisco Faulí 2020-12-17 12:54:42 UTC
Verified in

Version: 7.2.0.0.alpha0+
Build ID: 4484accf4d331a95ebf8475d6cd91950f4c27bcc
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Caolán, thanks for fixing this issue!!
Comment 12 Commit Notification 2020-12-17 12:55:36 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/5fbd913cf62aa215c66f1f2de47723dc82c83571

tdf#138661 don't emit value-changed when not changed by user

It will be available in 7.0.5.

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.