Bug 152871 - Editing Date/Time fields have an inverted fixed/variable order
Summary: Editing Date/Time fields have an inverted fixed/variable order
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.1 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectNotNeeded, regression
Depends on:
Blocks: Fields-Dialog
  Show dependency treegraph
 
Reported: 2023-01-04 08:56 UTC by Heiko Tietze
Modified: 2023-01-09 05:40 UTC (History)
3 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 Heiko Tietze 2023-01-04 08:56:36 UTC
This is a regression introduced with bug 139141.

1. Open Writer
2. Insert > Field > More fields
3. Insert Date, and further down insert Date (fixed), close dialog
4. Write-click on each one > Edit Fields...

=> Edit > Fields inverts Date / Date (fixed).

Introduced by https://git.libreoffice.org/core/+/b2c81dad3a0b72d305f1c6967ee4a8069ae11b45%5E%21

Revert for 7.5?
Comment 1 Stéphane Guillou (stragu) 2023-01-04 13:12:29 UTC
As mentioned in bug 139141, repro in:

Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

The fields are inserted correctly, and the name is displayed correctly in the navigator. Only the highlighting in the Edit Fields dialog does not correspond to what is being edited.

Maybe the issue has to do with the condition:

   (nSubType == DATE_VAR) ? 0 : FIXEDFLD

In both:

- https://opengrok.libreoffice.org/xref/core/sw/source/ui/fldui/fldpage.cxx?r=85c2ed8d#179
- https://opengrok.libreoffice.org/xref/core/sw/source/uibase/fldui/fldmgr.cxx?r=16075474#964
Comment 2 Heiko Tietze 2023-01-04 14:32:21 UTC
(In reply to Stéphane Guillou (stragu) from comment #1)
>    (nSubType == DATE_VAR) ? 0 : FIXEDFLD

The complete function is Date|Time mod Fixed. Neither modifying SwDateTimeSubType in sw/inc/fldbas.hxx nor exchanging SwDateSubFormat in sw/inc/flddat.hxx solves the problem resp. introduces other. And since the FIXEDFLD flag is used widely across the application I vote for reverting the patch.
Comment 3 Stéphane Guillou (stragu) 2023-01-05 12:41:30 UTC
Thanks Heiko, happy for a revert.
Comment 4 Heiko Tietze 2023-01-06 12:16:42 UTC
Reverted in master and 7.5
Comment 5 Stéphane Guillou (stragu) 2023-01-09 05:40:39 UTC
Verified fix in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ec2f1d73936c9d8cee83c0887170e9ecb8f044ba
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thanks Heiko!