summaryrefslogtreecommitdiff
path: root/oox/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-11-11 14:08:14 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-11-11 15:09:07 +0100
commitb280c02d584ad403417db0e8840f8ae6de245883 (patch)
tree80119208af0894bc3a03673049fd6bb3bebc6cd2 /oox/qa
parentec2a8205519bd546fe75c1b98bc1d8add8f2f2ec (diff)
Related: tdf#117658 PPTX import: ignore math text outside <m:t>
This way a pretty-printed bug document doesn't assert on import with: soffice.bin: /home/vmiklos/git/libreoffice/master/oox/source/mathml/importutils.cxx:335: void oox::formulaimport::XmlStreamBuilder::appendCharacters(const rtl::OUString&): Assertion `!tags.empty()' failed. Change-Id: Icf8b11f3c56076b1ad2dddad196260ee87540020 Reviewed-on: https://gerrit.libreoffice.org/82437 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'oox/qa')
-rw-r--r--oox/qa/unit/data/import-characters.pptxbin0 -> 33620 bytes
-rw-r--r--oox/qa/unit/mathml.cxx65
2 files changed, 65 insertions, 0 deletions
diff --git a/oox/qa/unit/data/import-characters.pptx b/oox/qa/unit/data/import-characters.pptx
new file mode 100644
index 000000000000..29338023641c
--- /dev/null
+++ b/oox/qa/unit/data/import-characters.pptx
Binary files differ
diff --git a/oox/qa/unit/mathml.cxx b/oox/qa/unit/mathml.cxx
new file mode 100644
index 000000000000..632fc566ddb7
--- /dev/null
+++ b/oox/qa/unit/mathml.cxx
@@ -0,0 +1,65 @@
+/* -*- 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 <test/bootstrapfixture.hxx>
+#include <unotest/macros_test.hxx>
+
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/embed/XStorage.hpp>
+
+#include <comphelper/embeddedobjectcontainer.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/propertyvalue.hxx>
+#include <comphelper/scopeguard.hxx>
+#include <comphelper/storagehelper.hxx>
+
+using namespace ::com::sun::star;
+
+/// oox mathml tests.
+class OoxMathmlTest : public test::BootstrapFixture, public unotest::MacrosTest
+{
+private:
+ uno::Reference<uno::XComponentContext> mxComponentContext;
+ uno::Reference<lang::XComponent> mxComponent;
+
+public:
+ void setUp() override;
+ void tearDown() override;
+ uno::Reference<lang::XComponent>& getComponent() { return mxComponent; }
+};
+
+void OoxMathmlTest::setUp()
+{
+ test::BootstrapFixture::setUp();
+
+ mxComponentContext.set(comphelper::getComponentContext(getMultiServiceFactory()));
+ mxDesktop.set(frame::Desktop::create(mxComponentContext));
+}
+
+void OoxMathmlTest::tearDown()
+{
+ if (mxComponent.is())
+ mxComponent->dispose();
+
+ test::BootstrapFixture::tearDown();
+}
+
+char const DATA_DIRECTORY[] = "/oox/qa/unit/data/";
+
+CPPUNIT_TEST_FIXTURE(OoxMathmlTest, testImportCharacters)
+{
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "import-characters.pptx";
+ // Without the accompanying fix in place, this failed with an assertion failure on import.
+ getComponent() = loadFromDesktop(aURL);
+ CPPUNIT_ASSERT(getComponent().is());
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */