From d5b19100ca4d3670d1b5367e8000739af60a6892 Mon Sep 17 00:00:00 2001 From: Vasily Melenchuk Date: Tue, 20 Jun 2017 14:20:31 +0300 Subject: tdf#100075 DOCX frame height rule updated According to "[MS-OE376]: Office Implementation Information for ECMA-376 Standards Support" Word treats default value for hRule attribute in a different way: if frame height is missing it is "auto" (as in specification), but if frame height exist, then default value for hRule is "atLeast". Change-Id: I0ce30b61d1a6b85febbbd8a6bf5af3eb1bb2767f Reviewed-on: https://gerrit.libreoffice.org/39065 Tested-by: Jenkins Reviewed-by: Katarina Behrens --- sw/qa/extras/ooxmlexport/data/tdf100075.docx | Bin 0 -> 11834 bytes sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 sw/qa/extras/ooxmlexport/data/tdf100075.docx (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/data/tdf100075.docx b/sw/qa/extras/ooxmlexport/data/tdf100075.docx new file mode 100644 index 000000000000..6312050aaf2f Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf100075.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index f628aab82670..55582cce7800 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -711,6 +711,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf108682, "tdf108682.docx") CPPUNIT_ASSERT_EQUAL(static_cast(459), aLineSpacing.Height); } +DECLARE_OOXMLEXPORT_TEST(testTdf100075, "tdf100075.docx") +{ + uno::Reference xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + + // There are two frames in document + CPPUNIT_ASSERT_EQUAL(static_cast(2), xIndexAccess->getCount()); + + uno::Reference xFrame1(xIndexAccess->getByIndex(0), uno::UNO_QUERY); + uno::Reference xFrame2(xIndexAccess->getByIndex(1), uno::UNO_QUERY); + + // Ensure that frame#1 height is more that frame#2: if no hRul attribute + // defined, MS Word will use hRul=auto if height is not defined, + // and hRul=atLeast if height is provided. So frame#1 should be higher + CPPUNIT_ASSERT(getProperty(xFrame1, "Height") > getProperty(xFrame2, "Height")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit