Description: Changing and saving the "pet" document in iOS leads to a "broken" document. Steps to Reproduce: 1.) configure the iOS App to use templates from: https://nicu.winebarrel.ch/tpl/00_index.txt 2.) open Collabora Office Mobile 3.) create a new document and use "homework_my_pet" as the template 4.) edit the title "PERSÖNLICHKEIT" -> "PERSÖNLICHKEIT 2" 5.) click the "save" icon 6.) close the document using the "<" Button (top left corner) 7.) Open the document again Actual Results: The string "PERSÖNLICHKEIT 2" is not defined as "heading 1"-style anymore it seems like the column break is lost as well. Expected Results: The string "PERSÖNLICHKEIT 2" should still be a "heading 1", there should be a column break before the string "PERSÖNLICHKEIT 2" Reproducible: Sometimes User Profile Reset: No Additional Info:
Created attachment 149631 [details] Video showing the issue
Could be related to translated style names? I could reproduce, and when I checked the saved document in desktop LibreOffice, the edited heading had style "Heading 1" but the other headings had style "Überschrift 1". I had edited the document with the app in the Swiss German locale.
But if I do the creation of the document from the template in an English locale, the formatting does not break, and all the styles show up as "Heading 1" in the desktop LO.
Created attachment 154497 [details] Buggy ODT Attaching a buggy sample created with the steps. iPad language had to be switched to German first.
Still present in 4.1.63 Just mentioning it, because I thought it could be a dup of #125575 (#125575 is fixed in 4.1.63 - so this issue probably has a different root cause).
I think I found the pattern. This bug only happens, if one does "create new from template" and "save the document" in the same "session". To be very precise, some more comments: The following always triggers the issue for me: 1a.) Configure the app to use the templates from https://nicu.winebarrel.ch/tpl/00_index.txt 2a.) Open the iOS app 3a.) Use "Create from template" function to create a new document from the template 4a.) Chose "homework_my_pet" 5a.) edit the title "PERSÖNLICHKEIT" -> "PERSÖNLICHKEIT 2" 6a.) click the "save" icon 7a.) close the document using the "<" Button (top left corner) 8a.) Open the document again The following workaround helps to *not* trigger the issue: 1b.) Configure the app to use the templates from https://nicu.winebarrel.ch/tpl/00_index.txt 2b.) Open the iOS app 3b.) Use "Create from template" function to create a new document from the template 4b.) Chose "homework_my_pet" 5b.) Now properly close the app through the iOS mechanism 6b.) Open the app again and open the file which was created in the previous "session" 7b.) Edit and save the file This leads to my naive conclusion, that creating "from template" somehow screws up the "state" of the running app and a subsequent "save file"-call will result in a broken document. Maybe a temporary solution could be to instantiate the file from the template and then instead of loading the new file directly, go back to the file browser and the user has to open the file manually. This way we would probably have the same effect as closing the app manually like in step "5b.)" (at least that's my naive understanding, sorry if this is wrong).
*** Bug 124898 has been marked as a duplicate of this bug. ***
Going to look into this now.
Tor Lillqvist committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/online/commit/1cf3bec303bc8b3d10e5dd673731906d3704b7b3 tdf#123741: Call LibreOfficeKit::setLanguageTag() also when loading a template
The corresponding fix in the collabora-online-4 branch seems to have fixed the problem. Sadly I didn't achieve a full understanding of the mechanism that caused the problem before I came up with the fix. But clearly it is related to using two different settings for the LibreOfficeKit "language tag" during the lifetime of the same process, first without setting it explicitly when loading the template, then after setting it when loading the document that was saved from the template.
Fixed. I testes with 4.1.66 and I can't reproduce the issue anymore. I think this issue can be closed. Thanks a lot to the Collabora team and especially Tor for fixing this issue!