diff options
Diffstat (limited to 'sd/qa/unit')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf104722.pptx | bin | 0 -> 40497 bytes | |||
-rw-r--r-- | sd/qa/unit/layout-tests.cxx | 48 |
2 files changed, 48 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf104722.pptx b/sd/qa/unit/data/pptx/tdf104722.pptx Binary files differnew file mode 100644 index 000000000000..27ea41958029 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf104722.pptx diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx new file mode 100644 index 000000000000..d6643f82420a --- /dev/null +++ b/sd/qa/unit/layout-tests.cxx @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include "sdmodeltestbase.hxx" + +class SdLayoutTest : public SdModelTestBaseXML +{ +public: + void testTdf104722(); + + CPPUNIT_TEST_SUITE(SdLayoutTest); + + CPPUNIT_TEST(testTdf104722); + + CPPUNIT_TEST_SUITE_END(); +}; + +void SdLayoutTest::testTdf104722() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf104722.pptx"), PPTX); + + std::shared_ptr<GDIMetaFile> xMetaFile = xDocShRef->GetPreviewMetaFile(); + MetafileXmlDump dumper; + + xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the fix in place, this would have failed with + // - Expected: 2093 + // - Actual : -10276 + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]", "x", "2093"); + + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]", "y", "9273"); + + xDocShRef->DoClose(); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(SdLayoutTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |