Created attachment 129813 [details] screenshots for every step Hi, our company is going to migrate from OpenOffice to LibreOffice and we have got some problems with conditions for hiding sections. When the section is at the end of the document and the userfield is changing the condition will be lost. A. Step 1 (picture 1 in attachement) 1. open new writer document 2. insert some paragraphs 3. at the end of the document insert a section and the condition "Test G 0" (after the section there should be nothing, no following paragraph) B. Step 2 (picture 2 in attachement) 4. add the userfield "Test" to the textfieldmaster with the value 2 5. insert the userfield into the document or only insert it into the textfieldmaster C. Result (picture 3 in attachement) The section is still visible and the condition is corrupt. The value of the condition of the section is set to "0" The problem only appears when the section is at the end of the document and nothing will follow it. Maybe a duplicate of 101803
Sven: so you have been using Apache OpenOffice and the problem is not present in it? In bug 101803 it is said that the problem is already present in LibreOffice 3.3, which is inherited from OpenOffice.org.
Hello Buovjaga, thanks for your reply. I wish you a happy new year. In our company we are using OpenOffice 3.2.1 - OOo320m18 (Build:9502). I have tested it now with AOO412m3(Build:9782) - Rev. 1709696 (2015-10-21 09:53:29 (Mi, 21 Okt 2015)) and the problem doesn't exist in this version. The problem only occurs in LibreOffice. Best regards, Sven
Created attachment 130074 [details] File with conditional section It works ok in 3.5.0 (good news), broken already in 3.6.7.2. Steps: 1. Open attached document 2. While in the empty paragraph before the section, Insert - Field - More Fields (or Fields - Other in older versions) 3. Variables tab, User field with Format: Standard, Name: Test, Value: 2. Insert. Correct result: section disappears Incorrect result: section does not disappear. Go to Format - Sections and see the changed condition. Tested with: Arch Linux 64-bit, KDE Plasma 5 Version: 5.4.0.0.alpha0+ Build ID: fc0d4e6bc43d5f982452df07930f5ecf5927ad22 CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; Locale: fi-FI (fi_FI.UTF-8); Calc: group Built on December 31st 2016 Arch Linux 64-bit Version 3.6.7.2 (Build ID: e183d5b) Win 10 LibreOffice 3.5.0rc3 Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
confirming with lo 5.3.2.2 and lo 5.4.0.0.alpha0+ (Build ID: c2511f27768341e33b452429b6dac38efa039804) adding variable "Test" with a value greater "0" will destory the condition.
Still repro. Arch Linux 64-bit Version: 6.1.0.0.alpha1+ Build ID: 5956828c88501ef1366e60010b05053a8e1e642e CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: kde4; Locale: fi-FI (fi_FI.UTF-8); Calc: group Built on May 23rd 2018
Bibisected with Linux 43all and blamed range is https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=57c3b583f1f69edd32b2a54253850e1b3b202255...75df7739309ccc5342084e668d9d869620cb3233 The commit that stands out is https://cgit.freedesktop.org/libreoffice/core/commit/?id=bb6bd1ff9cd3eecec7eb2cd7bd0a4dcef584c903 commit bb6bd1ff9cd3eecec7eb2cd7bd0a4dcef584c903 (patch) tree 673e5844d1b9f146557d8870678d6f076f38271b parent 369da987d373bdf5bdabfeb11d4b2562c916f372 (diff) fdo#53210 SwDoc::UpdateExpFlds don't crash when hiding all sections Adding Cc: to Miklos Vajna
still reproducible in LO 6.0.6.1 and 6.2.0.0.alpha0+ (x64) Build ID: cbc992e7370ab006ea7c0f8520896845f79f7749
confirmed that comment 6 has identified the correct commit. The code is now found in sw/source/core/doc/DocumentFieldsManager.cxx DocumentFieldsManager::UpdateExpFieldsImpl(). confirmed that without that fix, Writer still crashes if every part of the document belongs to hidden sections. The trick here will be to find out if any of the document is NOT covered by sections (which would be the normal case) and then allow all the sections to be hidden.
Created attachment 148200 [details] hidden_section_crash.odt: solution test document - make sure deleting all visible paragraphs doesn't crash Writer Currently this document does not crash, because it refuses to allow you to delete the paragraph entirely. However, if comment 6's fix is reverted, then deleting all non-section content results in a crash. That makes this a bit more complicated, because even if the document is currently OK to allow all of the sections to be hidden, the possibility of a crash is again opened up.
proposed fix at https://gerrit.libreoffice.org/66128 The (In reply to Justin L from comment #9) > make sure deleting all visible paragraphs doesn't crash Writer This was from an assert, so it doesn't crash non-debug builds.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/+/85bd9d81e1dafdef5b868637ebb34f22282befab%5E%21 tdf#104816 sw: if non-section content, let all sections hide. It will be available in 6.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.
A temporary work-around is to ensure that the section is not at the end of the document. You can insert a space after the section with an alt-enter.
*** Bug 125658 has been marked as a duplicate of this bug. ***