Created attachment 74892 [details] screenshot of Format Cells dialog Problem description: Date formatting with "[~buddhist]" always show the year with 4 digits, regardless of format code "YY" or "YYYY" Steps to reproduce: 1. New Spreadsheet 2. Type "01/01/2013" without quotes into A1 (or type any dates) 3. Right-click A1 > Format Cells... 4. Select Language "Thai", and Category "Date" 5. Select Format "31 ธ.ค. 2542", which has Format Code "[~buddhist]D MMM YY" 6. Click OK Current behavior: The date is formatted as "31 ธ.ค. 2542". The year is shown as 4 digits. Expected behavior: The date is formatted as "31 ธ.ค. 42". The year should be shown as 2 digits, regarding to format code "YY". You can compare with the next format code "[~buddhist]D MMM YYYY". They both show same formatting, which should not. Operating System: All Version: 3.4.0 Beta1 Last worked in: 3.3.4 release
Created attachment 74893 [details] sample file To reproduce using an attached sample file: 1. Open attached file 2. Notice that the cells A1 and A2 both show same result, which should not -- cell A1 should shown the year with only 2 digits. Cell A2 (4 digits year) is already correct. 3. Right-click at cell A1 > Format Cells ... 4. Notice that the format code is "[~buddhist]D MMM YY" 5. Right-click at cell A2 > Format Cells ... 6. Notice that the format code is "[~buddhist]D MMM YYYY"
Hello Eike, Unfortunately, I think this bug is caused by the fix for https://issues.apache.org/ooo/show_bug.cgi?id=116701, which is at http://cgit.freedesktop.org/libreoffice/core/commit/?id=4cdb854219094904e033428006fbaed6221d74b5 Could you please have a look at this bug? Thanks in advanced :)
Thanks for the pointer, that indeed seems to be the cause. Note: to reproduce the bug one has to either load the testcase file in a Thai locale or explicitly select a format from the Thai locale in the number formatter dialog, the formats applied in the file use the default locale, the [~buddhist] calendar has no effect if loaded in for example an en-US locale.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=be16dba682b8ab1c244f8d24f1bab3a539096962 resolved fdo#60915 force long year only for ROC calendar The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Change pending review for 4-0 as https://gerrit.libreoffice.org/2474 for 3-6 as https://gerrit.libreoffice.org/2477
Thanks for the fix :-) Also, I'd like to make this into unit test [but still busy until after next weeks :( ] Anyway could you please give some code pointers? Thanks again.
Yes, great! :-) Such a test could be added to svl/qa/unit/svl.cxx As the behavior depends on the Thai locale you'd need a SvNumberFormatter constructed with LANGUAGE_THAI, there are other means to switch a formatter's locale but that would be easiest. You could also use a locale modifier for a single format in an English formatter as can be seen at around line 277 and use such a format, instead of the Excel notation I'd suggest our notation though, e.g. [$-41E][~buddhist]D/MM/YYYY
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-3-6": http://cgit.freedesktop.org/libreoffice/core/commit/?id=07b2b5ee619e123652bca2d18d4b61a94f94e00a&h=libreoffice-3-6 resolved fdo#60915 force long year only for ROC calendar It will be available in LibreOffice 3.6.6. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-4-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=38fed1b25a1679ed4384ef0ed9ff4669f67a6723&h=libreoffice-4-0 resolved fdo#60915 force long year only for ROC calendar It will be available in LibreOffice 4.0.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Korrawit Pruegsanusak committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0c4a20ad9ce9b3b9db8f4ad458bd742f84e1b903 unit test for fdo#60915 The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.