summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-01-21 18:20:12 +0100
committerMichael Stahl <mstahl@redhat.com>2016-01-21 19:42:57 +0100
commit331a0a347e2ed238ff41c8cd7815b946cc95ac0f (patch)
treefa79096f376872d710e1f9c46d5501693f67a66e /sd
parentfefd1221be844a033e409a18e05e8c6e98f6d1a7 (diff)
starmath: fix OOXML export of non-BMP Unicode
Change-Id: Iafaeb9ea2e96ee6d8cc96174731ba3845c230b5e
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/Math.pptxbin0 -> 35240 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx29
2 files changed, 29 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 2f9550afda5e..211cff25eb4d 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);
@@ -1202,6 +1204,33 @@ void SdExportTest::testMathObject()
xDocShRef->DoClose();
}
+void SdExportTest::testMathObjectPPT2010()
+{
+ // Check import / export of math object
+ ::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();
+}
+
void SdExportTest::testBulletMarginAndIndentation()
{
::sd::DrawDocShellRef xDocShRef = loadURL( getURLFromSrc("/sd/qa/unit/data/pptx/bulletMarginAndIndent.pptx"), PPTX );