summaryrefslogtreecommitdiff
path: root/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-06-23 14:48:03 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-06-27 16:39:34 +0200
commit304dcd15d5ea5bac750249d5688372123565f9df (patch)
treef6829e0d0a82f00e51eb8b9197dcda4c30d0ba21 /writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
parent8c85d8bb24995a271ec47bfe45756216a095ac0d (diff)
tdf#108714: allow <w:br> as direct child of <w:body>
LibreOffice doesn't accept <w:br> element as a child of <w:body>. ECMA-376-1:2016 17.3.3.1 describes br as element of a run content, and points to CT_Br in §A.1. CT_Br may appear only as part of EG_RunInnerContent. In turn, EG_RunInnerContent may appear only inside CT_R. So, using <w:br> outside of <w:r> produces ill-formed OOXML. Open XML SDK 2.5 Productivity Tool for Microsoft Office confirms that, showing OpenXmlUnknownElement error. However, Word accepts it as direct child of <w:body>. It behaves as if the <w:br> were used as first element in first run of the following <w:p> (thus creating page break after next paragraph). Another Word bug that provokes third-parties to create ill-formed documents, and requires LibreOffice to be bug-to-bug compatible. This commit makes the following changes: 1. Registers a dedicated complex type CT_Br_OutOfOrder to handle those unusual breaks, with corresponding handler function. 2. In the handler function, saves the gathered property set to parser state to use later in next paragraph group handler. This reproduces Word behaviour. Change-Id: I5df6927e2de9266b58f87807319ad1c4977e45a7 Reviewed-on: https://gerrit.libreoffice.org/39168 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit a4a1467bc47b81ad68ecad0d5e2e163670582919) Reviewed-on: https://gerrit.libreoffice.org/39303 Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'writerfilter/source/ooxml/OOXMLFastContextHandler.hxx')
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.hxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
index f986c76029ae..e4e3e563fad5 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx
@@ -278,6 +278,7 @@ public:
void handleComment();
void handlePicture();
void handleBreak();
+ void handleOutOfOrderBreak();
void handleOLE();
void handleFontRel();
void handleHyperlinkURL();