summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-01-21 18:20:12 +0100
committerDavid Tardon <dtardon@redhat.com>2016-01-27 09:14:01 +0000
commit623cc2aba9d747572e5bcc9a443253456791c684 (patch)
tree4d75405b50a8043e208e3c553233b5080e08239a /sd
parent32ac2b153abc078a65634aff12660a5e67864d66 (diff)
starmath: fix OOXML export of non-BMP Unicode
(cherry picked from commit 331a0a347e2ed238ff41c8cd7815b946cc95ac0f) Change-Id: Iafaeb9ea2e96ee6d8cc96174731ba3845c230b5e Reviewed-on: https://gerrit.libreoffice.org/21785 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/Math.pptxbin0 -> 35240 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx31
2 files changed, 31 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/Math.pptx b/sd/qa/unit/data/pptx/Math.pptx
new file mode 100644
index 000000000000..fef20675b59e
--- /dev/null
+++ b/sd/qa/unit/data/pptx/Math.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 33e1ba5a98b7..e07693b0ff79 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -142,6 +142,7 @@ public:
void testTdf91378();
void testBnc822341();
void testMathObject();
+ void testMathObjectPPT2010();
void testTdf80224();
void testTdf92527();
@@ -182,6 +183,7 @@ public:
CPPUNIT_TEST(testBnc822341);
CPPUNIT_TEST(testMathObject);
+ CPPUNIT_TEST(testMathObjectPPT2010);
CPPUNIT_TEST(testTdf80224);
CPPUNIT_TEST(testExportTransitionsPPTX);
@@ -1179,6 +1181,35 @@ void SdExportTest::testMathObject()
xDocShRef->DoClose();
}
+void SdExportTest::testMathObjectPPT2010()
+{
+ // Check import / export of math object
+#if 0 // disabled on release branch, needs 332a796366b7cb91dff41de4b9ffb17843112a3e
+ ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("sd/qa/unit/data/pptx/Math.pptx"), PPTX);
+ utl::TempFile tempFile1;
+ xDocShRef = saveAndReload(xDocShRef, PPTX, &tempFile1);
+
+ // Export an MS specific ole object (imported from a PPTX document)
+ {
+ xmlDocPtr pXmlDocContent = parseExport(tempFile1, "ppt/slides/slide1.xml");
+ assertXPath(pXmlDocContent,
+ "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice",
+ "Requires",
+ "a14");
+ assertXPathContent(pXmlDocContent,
+ "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice/p:sp/p:txBody/a:p/a14:m/m:oMath/m:sSup/m:e/m:r[1]/m:t",
+ OUString::fromUtf8("\xf0\x9d\x91\x8e")); // non-BMP char
+
+ const SdrPage *pPage = GetPage(1, xDocShRef);
+ const SdrObject* pObj = dynamic_cast<SdrObject*>(pPage->GetObj(0));
+ CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(OBJ_OLE2), pObj->GetObjIdentifier());
+ }
+
+ xDocShRef->DoClose();
+#endif
+}
+
void SdExportTest::testBulletMarginAndIndentation()
{
::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bulletMarginAndIndent.pptx"), PPTX );