Bug 52238 - Document templates get formated differently depending on user interface language setting
Summary: Document templates get formated differently depending on user interface langu...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
4.1.4.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks: Templates Writer-Styles-Paragraph User-Locale
  Show dependency treegraph
 
Reported: 2012-07-18 16:36 UTC by Michael P.
Modified: 2023-01-06 00:24 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
example template showing the bug. (9.00 KB, application/vnd.oasis.opendocument.text-template)
2012-07-18 16:36 UTC, Michael P.
Details
example update for 4.1.4.2 (9.51 KB, application/vnd.oasis.opendocument.text-template)
2013-12-31 15:01 UTC, Michael P.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael P. 2012-07-18 16:36:39 UTC
Created attachment 64355 [details]
example template showing the bug.

Problem description: 
Due to this bug, it is possible to create a template which looks completely different depending on which user interface language is set. This is highly problematic as you have no guarantee that a template will look the same on all office installations.

Steps to reproduce:
1. Change interface language to German and restart office.
2. Create a new document, add some text.
3. Add a new user defined style called "Default". Change its font to "Verdana". Note that this don't change anything in your document as in german the default style is called "Standard".
4. Save the document as .ott.
5. Change interface language to English and restart office.
6. Open the .ott file. Your document default style now has "Verdana" set as font.

Current behavior:
Predefined styles are named differently depending on user interface language. Opening a template with a different user interface language set than it was created opens the possibility that there are name conflicts between user defined styles and predefined styles. This leads to different styles being used depending on which language is set.

Expected behavior:
It should not be possible to define user defined styles which conflict with predefined style names.

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Comment 1 Michael P. 2012-07-18 21:29:37 UTC
Same problem reported to OpenOffice.org here: https://issues.apache.org/ooo/show_bug.cgi?id=120311
Comment 2 A (Andy) 2013-12-28 14:30:20 UTC
I could not reproduce it with LO 4.1.4.2 (Win8). Maybe I am doing something wrong. Could you please give more information about the steps especially step 3.
Does this issue still also persit for you with the latest release of LO?
Comment 3 Michael P. 2013-12-31 15:00:50 UTC
I can confirm that this issue still exists in the current 4.1.4.2 release. Apparently the default style in LibreOffice was renamed from "Default" to "Default Style" since this bug reported in LibreOffice 3.5.5.3. In order to reproduce this bug with the new version, a slight modification to the above "Steps to reproduce" is required:

1. Change interface language to German and restart office.
2. Create a new text document, add some text.
3. Add a new user defined style called "Default Style". Do this by opening the "Styles and formating" window (F11). Right click on the style called "Standard" and click "New..." ("Neu..." in german). Set the style name to "Default Style". Then change this new style's font to "Verdana". Note that this don't change anything in your document as in german the default style is called "Standard".
4. Save the document as .ott.
5. Change interface language to English and restart office.
6. Open the .ott file. Your document default style now has "Verdana" set as font.
Comment 4 Michael P. 2013-12-31 15:01:56 UTC
Created attachment 91369 [details]
example update for 4.1.4.2

Also note that the attached example file does not show the error due the rename of "Default" style to "Default Style", so I've attached a new version that shows the error with LibreOffice 4.1.4.2. Just compare the document with english and german interface languages set. In german, the template will display correctly with "Times New Roman" text. With english as interface language, the same document will show in Verdana Bold instead.
Comment 5 sophie 2014-01-08 12:24:20 UTC
Confirmed using Version: 4.2.0.1
Build ID: 7bf567613a536ded11709b952950c9e8f7181a4a and FR lang pack. Set to New Sophie
Comment 6 Joel Madero 2015-05-02 15:40:51 UTC Comment hidden (obsolete)
Comment 7 Michael P. 2015-05-03 10:36:17 UTC
Confirmed using Version: 4.4.2.2
Build ID: c4c7d32d0d49397cad38d62472b0bc8acff48dd6 and DE lang pack.
Comment 8 QA Administrators 2016-09-20 09:36:40 UTC Comment hidden (obsolete)
Comment 9 Michael P. 2016-09-21 20:41:34 UTC
Confirmed using Version: 5.2.1.2, Build ID: 5.2.1-2
OS Version: Linux 4.7, Locale: de-DE (de_DE.UTF-8)
Comment 10 Thomas Lendo 2017-08-21 07:49:59 UTC
Reproduced with Version: 5.4.0.3
Build ID: 7556cbc6811c9d992f4064ab9287069087d7f62c
CPU threads: 8; OS: Windows 6.2; UI render: default; Locale: de-DE (de_DE); Calc: CL

And in my test it doesn't matter whether the saved file is an odt or an ott.
Comment 11 QA Administrators 2018-09-23 02:50:17 UTC Comment hidden (obsolete)
Comment 12 Michael P. 2018-09-23 13:49:46 UTC
Reproduced with

Version: 6.1.1.2
Build-ID: 6.1.1-3
CPU-Threads: 8; BS: Linux 4.18; UI-Render: Standard; VCL: gtk3_kde5; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group threaded
Comment 13 QA Administrators 2019-10-20 02:33:08 UTC Comment hidden (obsolete)
Comment 14 Michael P. 2019-10-24 18:17:48 UTC
Reproduced with

Version: 6.3.2.2
Build ID: 6.3.2-2
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kde5; 
Locale: de-DE (de_DE.UTF-8); UI-Language: en-US
Calc: threaded
Comment 15 BogdanB 2023-01-05 21:09:00 UTC
The bug can be reproduce only if we rename the style "Default Paragraph Style". 

Meanwhile, the default paragraph style have been renamed: "Default Paragraph Style".
I supose no one will create a new style exactly with this long name. Everyone should create styles based on what they want to create.

Indeed, IF someone with any other language creates a new style with the name "Default Paragraph Style" and change to English user interface, the bug persist. But who would do that? I understanded when was a short name, like "Default". But now?

Tested with
Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 16 Michael P. 2023-01-06 00:24:27 UTC
Thanks for the heads-up. So the old repro attachment will not work anymore due to another rename of the style.

Note that I reported the issue because this bug actually occurred in practice at a company that used LibreOffice. So this not a theoretical issue.

Maybe it becomes less likely the more complicated the default names become, not sure. Ideally, style identification would be decoupled from localization. However I'm no expert here, maybe someone else has an idea.