summaryrefslogtreecommitdiff
path: root/sw/qa/python
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2019-01-10 16:42:45 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-01-18 19:44:07 +0100
commit85bd9d81e1dafdef5b868637ebb34f22282befab (patch)
treeaeac68232d87aa64f96c3f3d231165a60cc7393c /sw/qa/python
parent7e01a02b12a9ea3a39b5a627f3b26d94bc1ad921 (diff)
tdf#104816 sw: if non-section content, let all sections hide.
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/66128 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Jenkins Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/qa/python')
-rw-r--r--sw/qa/python/var_fields.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/sw/qa/python/var_fields.py b/sw/qa/python/var_fields.py
index e7c7fbb9adff..e793aaa5f7ec 100644
--- a/sw/qa/python/var_fields.py
+++ b/sw/qa/python/var_fields.py
@@ -132,10 +132,7 @@ class TestVarFields(unittest.TestCase):
read_content = xSection.getPropertyValue("Condition")
# 21. check
- # expected:
- # self.assertEqual("foo EQ 1", readContent)
- # reality:
- self.assertEqual("0", read_content)
+ self.assertEqual("foo EQ 1", read_content)
if __name__ == '__main__':
unittest.main()