Kaydet (Commit) 195b8491 authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX strict import: fix headers

Now that the document has a header, better to just test the bottom
margin, as in case there is a header, the top margin has different
semantics in Word and Writer.

Change-Id: I11212965ecd364cdc8a205c3ab3b8b71ed12944b
üst 1cded3f8
......@@ -1908,11 +1908,15 @@ DECLARE_OOXMLIMPORT_TEST(testStrict, "strict.docx")
{
uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY);
// This was only 127, pt suffix was ignored, so this got parsed as twips instead of points.
CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(72 * 20)), getProperty<sal_Int32>(xPageStyle, "TopMargin"));
CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(72 * 20)), getProperty<sal_Int32>(xPageStyle, "BottomMargin"));
// This was only 1397, same issue
CPPUNIT_ASSERT_EQUAL(sal_Int32(TWIP_TO_MM100(792 * 20)), getProperty<sal_Int32>(xPageStyle, "Height"));
// Text was missing, due to not handling the strict namespaces.
getParagraph(1, "Hello world!");
// Header in the document caused a crash on import.
uno::Reference<text::XText> xHeaderText(xPageStyle->getPropertyValue("HeaderText"), uno::UNO_QUERY);
getParagraphOfText(1, xHeaderText, "This is a header.");
}
#endif
......
......@@ -19,6 +19,7 @@
<model xmlns:rng="http://relaxng.org/ns/structure/1.0">
<namespace-alias name="http://www.w3.org/XML/1998/namespace" alias="xml" id="xml"/>
<namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships" alias="relationships" id="officeRel"/>
<namespace-alias name="http://purl.oclc.org/ooxml/officeDocument/relationships" alias="relationships" id="officeRel"/>
<namespace-alias name="urn:schemas-microsoft-com:office:office" alias="office" id="vmlOffice"/>
<namespace-alias name="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" alias="theme" id="officeRelTheme"/>
<namespace-alias name="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" alias="wordprocessingDrawing" id="dmlWordDr"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment