diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-03-07 14:44:10 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-03-07 15:10:26 +0100 |
commit | 37cc7e7471ba3b11cefcb0218c27e2c745886a6d (patch) | |
tree | 95c10ba8670d79130fa682f05eab08fde1b1cc50 /sw/qa/extras/ooxmlimport | |
parent | d5d7c7d3b281e1a9060d60bc4ac7738ae616f167 (diff) |
DOCX import: handle points in ST_TwipsMeasure and ST_SignedTwipsMeasure
This fixes page size and margins in case of strict DOCX.
Change-Id: I65894eeef191a0f4bd92d1fa69a17e820aae3a43
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/strict.docx | bin | 0 -> 11408 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/strict.docx b/sw/qa/extras/ooxmlimport/data/strict.docx Binary files differnew file mode 100644 index 000000000000..41953981766e --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/strict.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 4f384d8ea13b..2503c81509c8 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1903,6 +1903,18 @@ DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeRunFonts, "dml-groupshape-runfonts.doc CPPUNIT_ASSERT_EQUAL(OUString("Arial Unicode MS"), getProperty<OUString>(xRun, "CharFontNameComplex")); CPPUNIT_ASSERT_EQUAL(OUString("MS Mincho"), getProperty<OUString>(xRun, "CharFontNameAsian")); } + +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")); + // 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!"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); |