diff options
author | nd101 <Fong@nd.com.cn> | 2020-05-09 11:45:25 +0800 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-07-29 12:03:34 +0200 |
commit | 2b19cd84f10552c438dace0a4c52a70ccd440369 (patch) | |
tree | 8aa6e793074cf336b115f4c06f543aacb92e4cf5 /sd | |
parent | 5ad17c85dc93973c0cbb1d633b9eed144f0677de (diff) |
tdf#115753 fix table border missing when there are merged cells
Remove code that ignores merged cells.
Change-Id: I907220e9ffc9d18561171efd7d6b39d14a8341fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93836
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/pptx/tdf115753.pptx | bin | 0 -> 34324 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 45 |
2 files changed, 45 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf115753.pptx b/sd/qa/unit/data/pptx/tdf115753.pptx Binary files differnew file mode 100755 index 000000000000..0350ddaad44c --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf115753.pptx diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index a6ad545b3221..eb97da60fd1f 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -18,13 +18,16 @@ #include <svx/svdograf.hxx> #include <svx/svdomedia.hxx> #include <unotools/mediadescriptor.hxx> +#include <unotools/streamwrap.hxx> #include <rtl/ustring.hxx> +#include <comphelper/propertysequence.hxx> #include <vcl/opengl/OpenGLWrapper.hxx> #include <vcl/skia/SkiaHelper.hxx> #include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> +#include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/graphic/XGraphic.hpp> @@ -77,6 +80,7 @@ public: void testGlow(); void testSoftEdges(); void testShadowBlur(); + void testTdf115753(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -114,6 +118,7 @@ public: CPPUNIT_TEST(testGlow); CPPUNIT_TEST(testSoftEdges); CPPUNIT_TEST(testShadowBlur); + CPPUNIT_TEST(testTdf115753); CPPUNIT_TEST_SUITE_END(); @@ -549,6 +554,46 @@ void SdExportTest::testBnc480256() xDocShRef->DoClose(); } +void SdExportTest::testTdf115753() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115753.pptx"), PPTX); + xDocShRef = saveAndReload(xDocShRef.get(), PPTX); + uno::Reference< drawing::XDrawPagesSupplier > xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW); + uno::Reference< drawing::XDrawPage > xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); + uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW); + + // Save the first shape to a metafile. + uno::Reference<drawing::XGraphicExportFilter> xGraphicExporter = drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext()); + uno::Reference<lang::XComponent> xSourceDoc(xShape, uno::UNO_QUERY); + xGraphicExporter->setSourceDocument(xSourceDoc); + + SvMemoryStream aStream; + uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(aStream)); + uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence({ + { "OutputStream", uno::Any(xOutputStream) }, + { "FilterName", uno::Any(OUString("SVM")) } + })); + xGraphicExporter->filter(aDescriptor); + aStream.Seek(STREAM_SEEK_TO_BEGIN); + + // Read it back and dump it as an XML file. + Graphic aGraphic; + ReadGraphic(aStream, aGraphic); + const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile(); + MetafileXmlDump dumper; + + xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, rMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + // Without the fix in place, it will print: + // - Expected: 21180 + // - Actual : 12714 + // because without the fix, one of the border lines is missing, + // and the value, which is where the line ends, will be shorter + // than it should be. + assertXPath(pXmlDoc, "/metafile/push[6]/polyline/point[2]", "x", "21180"); + xDocShRef->DoClose(); +} + void SdExportTest::testUnknownAttributes() { ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/unknown-attribute.fodp"), FODP); |