diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-09 12:23:56 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-09 12:50:58 +0200 |
commit | 71c54997119dd6484b86032f273f0aeb7eaca05b (patch) | |
tree | 9c4972adedb32cb167c7a771be249dd781d0a8c7 /writerfilter | |
parent | 1452907c14bfec282b3f54e42389a2de6c085d3e (diff) |
detect start elements pointing to non-existing defines
Change-Id: I0ac0d77bccfa4e69af11df3019bd8dec920bfad3
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/ooxml/model.xml | 1 | ||||
-rw-r--r-- | writerfilter/source/ooxml/modelpreprocess.py | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 509014e41cb6..8333c0839a03 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -7309,7 +7309,6 @@ </grammar> </namespace> <namespace name="shared-math" file="shared-math.rng"> - <start name="mathPar"/> <start name="oMathPara"/> <start name="oMath"/> <grammar xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2006/xpath-functions" xmlns="http://relaxng.org/ns/structure/1.0" ns="http://schemas.openxmlformats.org/officeDocument/2006/math" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" attributeFormDefault="qualified"> diff --git a/writerfilter/source/ooxml/modelpreprocess.py b/writerfilter/source/ooxml/modelpreprocess.py index 850a704adf43..e20401b57746 100644 --- a/writerfilter/source/ooxml/modelpreprocess.py +++ b/writerfilter/source/ooxml/modelpreprocess.py @@ -61,7 +61,10 @@ def check(model): defines = [i.getAttribute("name") for i in model.getElementsByTagName("define")] for reference in [i.getAttribute("name") for i in model.getElementsByTagName("ref")]: if not reference in defines: - raise Exception("Unknown define with name '%s'" % reference) + raise Exception("Unknown define element with name '%s'" % reference) + for start in [i.getAttribute("name") for i in model.getElementsByTagName("start")]: + if not start in defines: + raise Exception("Unknown start element with name '%s'" % start) def preprocess(model): |