Description: In the Writer template the user-defined field date format is not preserved after closing and opening back the file. Steps to Reproduce: 1. Create a template file 2. Add date field 3. Define own format of the date field eg D MM YYYY 4. Save the template in the dotx format 5. Open back it and observe that the date field settings are reset to standard, while the user defined format is not saved Actual Results: Open saved template and observe that the date field settings are reset to standard, while the user defined format is not saved Expected Results: The user defined format should be saved, as well as the user defined field format. Reproducible: Always User Profile Reset: No Additional Info: n/a
Created attachment 184456 [details] How I am setting user defined date format
(In reply to Oleksa Stasevych from comment #0) > Steps to Reproduce: > 1. Create a template file > 2. Add date field > 3. Define own format of the date field eg D MM YYYY > 4. Save the template in the dotx format > 5. Open back it and observe that the date field settings are reset to > standard, while the user defined format is not saved > > Actual Results: > Open saved template and observe that the date field settings are reset to > standard, while the user defined format is not saved Not reproducible using Version: 7.5.0.1 (X86_64) / LibreOffice Community Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: CL threaded (In reply to Oleksa Stasevych from comment #1) > Created attachment 184456 [details] > How I am setting user defined date format But the screenshot shows that you used not a "date field", but a mail merge field? So what did you use actually? And if that's a mail merge field, please attach a sample database with a date field, and an ODT with the mail merge field having a custom format, so that people could test if saving the ODT to DOTX would result in the described problem on their system.
Created attachment 184502 [details] Date field is saved when used OO native format
Created attachment 184503 [details] date field is not saved if the format is MS DOTX
(In reply to Mike Kaganski from comment #2) > (In reply to Oleksa Stasevych from comment #0) > > Steps to Reproduce: > > 1. Create a template file > > 2. Add date field > > 3. Define own format of the date field eg D MM YYYY > > 4. Save the template in the dotx format > > 5. Open back it and observe that the date field settings are reset to > > standard, while the user defined format is not saved > > > > Actual Results: > > Open saved template and observe that the date field settings are reset to > > standard, while the user defined format is not saved > > Not reproducible using Version: 7.5.0.1 (X86_64) / LibreOffice Community > Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df > CPU threads: 12; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: > win > Locale: ru-RU (ru_RU); UI: en-US > Calc: CL threaded > > (In reply to Oleksa Stasevych from comment #1) > > Created attachment 184456 [details] > > How I am setting user defined date format > > But the screenshot shows that you used not a "date field", but a mail merge > field? So what did you use actually? And if that's a mail merge field, > please attach a sample database with a date field, and an ODT with the mail > merge field having a custom format, so that people could test if saving the > ODT to DOTX would result in the described problem on their system. Yes, indeed, that was about the mail merge functionality (I think, quite obsolete title, as it is not about mail merge but preparing the set of typical documents based on some template). I have re-checked, and found that the issue is related ONLY to DOTX format: so the values are lost if the template is saved in MS format, moreover the date format from the database is not imported properly. I may assume it may be a part of compatibility issues, eg language document property is lost when saved in MS compatible format and re-opened back.
(In reply to Mike Kaganski from comment #2) > please attach a sample database with a date field, and an ODT with the mail > merge field having a custom format, so that people could test if saving the > ODT to DOTX would result in the described problem on their system. (In reply to Oleksa Stasevych from comment #3) > Created attachment 184502 [details] > Date field is saved when used OO native format (In reply to Oleksa Stasevych from comment #4) > Created attachment 184503 [details] > date field is not saved if the format is MS DOTX I tried both screenshots you attached, and surprisingly, I couldn't check the document structure ;) Please provide the *document* (a database and the ODT), which allows others to see it in action. It's not a matter of providing "proofs" (like in "don't you believe me - I show you the screenshots!"), but a matter of seeing which OTF markup results in which OOXML markup, with a way for tester to play with different file formats (e.g., DOCX vs DOTX), see the difference, check the code that writes specific XML elements... And expecting testers to invent their own database and mail merge documents is wrong, because the problem could e.g. be specific to some locales, or some database types, or to an OS, etc.
Aha, I was able to repro locally. And this is not specific to DOTX, it happens with DOCX, DOC, RTF. And this is inevitable, because MS Word file formats have *absolutely no* provisions to store the merge field format: https://support.microsoft.com/en-us/office/field-codes-mergefield-field-7a6d24a1-68a6-4b05-8359-1dc087daf4e6 It allows to store prefix/suffix, but not the format code or anything else. The field format is always taken from the database.
Created attachment 184504 [details] A sample ODT with a single mail merge field having an extended date format