Created attachment 65229 [details] Template containing sections hidden through a condition A document has sections and all of them are hidden through a condition. When all sections are hidden and "Tools - Update - Update all" or "Save" actions are triggered Writer crashes. I saw this behaviour with OpenOffice 3.2 upto LibreOffice 3.5.5-3 and tested it under OS X 10.8, Debian GNU/Linux and FreeBSD 8.2.
Created attachment 65230 [details] OS X crash log
Created attachment 65231 [details] gdb log
On pc Debian x86-64 with master sources updated today or with 3.5.4.2 Debian packages, I don't reproduce the pb (tried update, update all). Did you install specific extensions ? Could you try to reproduce with a brand new LO profile ? (seehttp://wiki.documentfoundation.org/UserProfile)
Sorry, forgot steps to reproduce: 1. Open attached template 2. Open dialog for settings userfield values (Strg-F2) 3. Set all _CS_* userfields to value 0 4. In the menu Tools - Update - Update all or File - Save Writer will crash. On FreeBSD compiled LibreOffice 3.5 using /usr/ports/editors/libreoffice, on Linux I installed .debs from the download site (dpkg -i *.deb). I can reproduce it on my Mac, on FreeBSD and on Linux. No matter running as desktop version or on server side using soffice -env:UserInstallation="file:///..." --accept= --headless, Writer crashes when setting all conditions of all sections to "false" and refresh/save. No special setup...no extensions installed... and reproducible with vanilla profiles (deleting .libreoffice or -env:UserInstallation).
Created attachment 65311 [details] bt with symbols Thank you for comment 4, I finally succeeded in reproducing the problem with pc Debian x86-64 and master sources updated today. Here is a slight more detailed process to reproduce the problem: 1. Open attached template 2. Open dialog for settings userfield values (Ctrl-F2) (for non German speakers, "Strg" means "Ctrl" at least here :-)) 3. Select "Variables" tab 4. In Type part, select "User Field" 5. For all the 4 _CS_* userfields, put the value to 0 and click on apply icon for each (just next to value field) 6. In the menu Tools - Update - Update all or File - Save
Following my last comment, I update the status to "New".
Miklos: one for you ?
The problem seems to be that there are no paragraphs outside sections in the document. If one creates a document from scratch, inserts a section, delete the "outer" paragraph then sets the section as hidden, it won't be hidden, as (I guess) Writer core doesn't really handle pages not having any paragraph. I think we could do something similar here. Just need to find the code pointers: 1) where is the code that blocks hiding the last section in my example. 2) where is the code that removes sections from the layout (which could do a similar trick).
Thinking a bit more about this: I think the consistent behavior here would be: instead of leaving the last page without a single paragraph, unhide the last section -- this way the doc model and the layout will be in sync, and we won't crash, either.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=bb6bd1ff9cd3eecec7eb2cd7bd0a4dcef584c903 fdo#53210 SwDoc::UpdateExpFlds don't crash when hiding all sections
Miklos, I think the other way round would be the best: insert/display an empty page. When all conditions are false and no section "should" be displayed, I think nothing should/empty page should be there. I think it's more idiomatic. My use case is a server application and even for desktop users I think it would be hard to understand why something is displayed, when all conditions are false.
Hi, Try a daily build, and see how it works now. :-) Having all conditions as false and still displaying something would be indeed confusing. However what currently happens is that in such a situation the condition of the last section is changed to "0" (which is always false), so the section will be shown for a reason. Miklos
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=10e02dfdffb5ef3a02a40b52c6cda176f7f4447c fdo#53210 testcase
Fixed in master, -3-6 and -3-5 reviews: https://gerrit.libreoffice.org/403 https://gerrit.libreoffice.org/404
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-3-6": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b5edfe152737650772504dc6464dbbb2f607f453&g=libreoffice-3-6 fdo#53210 SwDoc::UpdateExpFlds don't crash when hiding all sections It will be available in LibreOffice 3.6.1.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-3-5": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d2a5e4bb705673119b13c2e203562fecfd386be8&g=libreoffice-3-5 fdo#53210 SwDoc::UpdateExpFlds don't crash when hiding all sections It will be available in LibreOffice 3.5.7.