Description: I habitually format date cells as `YYYY-MM""MMM-DDNN` (where the `""` acts as a separator between `MM` and `MMM`), so today appears as `2021-08Aug-20Fri` In some files, every time I close and reopen the file the date cell formats have reverted to `YYYY-MMMMM-DDNN` (where `MMMMM` is expanded to the first letter of `MMM`), so today appears as `2021-A-20Fri` The format it saved with also does not appear in the list of formats in the Format Cells dialog Steps to Reproduce: 1. Format some dates with `YYYY-MM""MMM-DDNN` 2. Save and close 3. Reopen For some files it does it every time, for other files it never does it, I have no idea what the difference is Actual Results: All my dates got reformatted Expected Results: All my formats should be preserved Reproducible: Always User Profile Reset: No Additional Info: Version: 7.1.4.2 / LibreOffice Community Build ID: a529a4fab45b75fefc5b6226684193eb000654f6 CPU threads: 16; OS: Mac OS X 10.16; UI render: default; VCL: osx Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
Seems the empty string is eliminated while saving the format description and that ends up as <number:month number:style="long"/> <number:month number:textual="true"/> i.e. two consecutive month elements for MM and MMM which when read in correctly form MMMMM. Workaround: use U+200B ZERO WIDTH SPACE, ZWSP in your quotes. This looks the same YYYY-MM""MMM-DDNN but if you copy-paste it and travel through with the cursor you'll notice one extra character where the cursor does not move. that is saved and preserved when loaded: <number:month number:style="long"/> <number:text><200b></number:text> <number:month number:textual="true"/>
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c6f15d228489ccfd0628ca80b45a5c2faaacc7d3 Resolves: tdf#143979 Write and read empty text element in number formats It will be available in 7.3.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.
Pending review https://gerrit.libreoffice.org/c/core/+/120728 for 7-2
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/39a11e3287febeb9dd56f43da6f6612afeb0f512 tdf#143979: sc_uicalc: Add unittest It will be available in 7.3.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.
The unittest commit in comment 4 is not for this issue but for bug 144022
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/5d6a91b8ea40ec79c746e5c1d486be6e25a2856d Resolves: tdf#143979 Write and read empty text element in number formats It will be available in 7.2.1. 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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fba08b85183ee8a71f6b7044d6fa4492c0cc1be8 tdf#143979: sc_subsequent_export-test2: Add unittest It will be available in 7.3.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.
This does appear to be fixed in build 559850da1f48fd7ea521c78a1867255212f7aee9 In the current release, I can also get dates to render as intended with `YYYY-MM""MMM-DD""NN`, apparently the second `""` makes it work. The zero-width space is rendered as a grey shading which overlaps the neighboring characters, which is far enough from rendering as intended that I tried using the `""`