• Justin Luth's avatar
    tdf#104816 sw: if non-section content, let all sections hide. · 85bd9d81
    Justin Luth yazdı
    If all of the document is contained inside of sections, then at
    least one section must be visible or writer crashes. The 2012
    fix seemed to assume that all content would be in a section,
    and thus required at least one section be visible.
    
    Instead, check for non-section content at the start and end of the
    document, and for gaps between sections, and count those
    as "virtual", visible sections, which would allow all real sections
    to be marked as hidden.
    
    The example document HiddenSection.odt in tdf#55814 is a really
    nice test document. With this patch, that test now works
    even if you remove the last non-section paragraph.
    
    Even nicer is finding that a (very unclear) "did you fix me?"
    unit test entry gives a unit test for patch.
    
    Change-Id: I6cac5e6df8dff7fbb78828ae2521a1b02e305a27
    Reviewed-on: https://gerrit.libreoffice.org/66128Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
    Tested-by: Jenkins
    Tested-by: 's avatarSerge Krot (CIB) <Serge.Krot@cib.de>
    Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
    85bd9d81