summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-09-11 12:57:25 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-09-11 15:50:01 +0200
commit7cfff4751befd678b3db4b6f16b020d38f4e9c32 (patch)
treead0a84fc70102cb72e487886f73903312dcdad5b /sd
parentf7c6394bf21a3311cbfb5e80f87e6067e09add0b (diff)
Related: tdf#129061 Avoid formula import and use fallback for now
Until we support the correct inline formulas, their import fails badly in Impress, because we completely lose them in boxes with other content, and even where they are the sole content, they stretch to the size of the box incorrectly. Commit 4038d6c393c3cf6330671124ba69cdba98b24960 (tdf#117658 PPTX import: fix duplicated math object handling, 2019-11-13) opted to enable the Choice variant from the AlternateContent representing formula boxes. This change switches to Fallback graphic, losing the option to edit standalone imported formulas, but instead, allowing to see the formulas as they were created in PowerPoint. Unit test in sd/qa/unit/export-tests-ooxml2.cxx, created in commit 331a0a347e2ed238ff41c8cd7815b946cc95ac0f (starmath: fix OOXML export of non-BMP Unicode, 2016-01-21) was changed, because it depended on importing the formula from PPTX, which is disabled here. Since it was fixing the export part, the FODP source seems to be a reasonable replacement. Change-Id: Ibd0e2bcd68296020c3bc057cb6a563918926cf2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173163 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/odp/Math.fodp70
-rw-r--r--sd/qa/unit/data/pptx/Math.pptxbin35240 -> 0 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx6
-rw-r--r--sd/qa/unit/export-tests-ooxml4.cxx2
4 files changed, 74 insertions, 4 deletions
diff --git a/sd/qa/unit/data/odp/Math.fodp b/sd/qa/unit/data/odp/Math.fodp
new file mode 100644
index 000000000000..676fc84475a2
--- /dev/null
+++ b/sd/qa/unit/data/odp/Math.fodp
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.presentation">
+ <office:font-face-decls>
+ <style:font-face style:name="Liberation Sans" svg:font-family="&apos;Liberation Sans&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Liberation Serif" svg:font-family="&apos;Liberation Serif&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+ <style:style style:name="Object_20_with_20_no_20_fill_20_and_20_no_20_line" style:display-name="Object with no fill and no line" style:family="graphic" style:parent-style-name="standard">
+ <style:graphic-properties draw:stroke="none" draw:fill="none"/>
+ </style:style>
+ <style:presentation-page-layout style:name="AL1T0">
+ <presentation:placeholder presentation:object="title" svg:x="2cm" svg:y="1.7cm" svg:width="24cm" svg:height="3.5cm"/>
+ <presentation:placeholder presentation:object="subtitle" svg:x="2cm" svg:y="5.8cm" svg:width="24cm" svg:height="13cm"/>
+ </style:presentation-page-layout>
+ </office:styles>
+ <office:automatic-styles>
+ <style:page-layout style:name="PM1">
+ <style:page-layout-properties fo:margin-top="0" fo:margin-bottom="0" fo:margin-left="0" fo:margin-right="0" fo:page-width="254mm" fo:page-height="190.5mm" style:print-orientation="landscape"/>
+ </style:page-layout>
+ <style:style style:name="dp1" style:family="drawing-page">
+ <style:drawing-page-properties presentation:background-visible="true" presentation:background-objects-visible="true" presentation:display-footer="false" presentation:display-page-number="false" presentation:display-date-time="false"/>
+ </style:style>
+ <style:style style:name="gr1" style:family="graphic" style:parent-style-name="Object_20_with_20_no_20_fill_20_and_20_no_20_line">
+ <style:graphic-properties draw:stroke="none" svg:stroke-width="0" draw:fill="none" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="top" draw:auto-grow-height="true" draw:fit-to-size="false" style:shrink-to-fit="false" fo:padding-top="0.125cm" fo:padding-bottom="0.125cm" fo:padding-left="0.25cm" fo:padding-right="0.25cm" fo:wrap-option="no-wrap" draw:ole-draw-aspect="1" style:protect="size"/>
+ </style:style>
+ </office:automatic-styles>
+ <office:master-styles>
+ <draw:layer-set>
+ <draw:layer draw:name="layout"/>
+ <draw:layer draw:name="background"/>
+ <draw:layer draw:name="backgroundobjects"/>
+ <draw:layer draw:name="controls"/>
+ <draw:layer draw:name="measurelines"/>
+ </draw:layer-set>
+ <style:master-page style:name="Title_20_Slide" style:display-name="Title Slide" style:page-layout-name="PM1" draw:style-name="dp1"/>
+ </office:master-styles>
+ <office:body>
+ <office:presentation>
+ <draw:page draw:name="page1" draw:master-page-name="Title_20_Slide" presentation:presentation-page-layout-name="AL1T0">
+ <draw:frame draw:name="Formula" draw:style-name="gr1" draw:layer="layout" svg:width="14cm" svg:height="2cm" svg:x="8cm" svg:y="8cm">
+ <draw:object>
+ <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <semantics>
+ <mrow>
+ <mrow>
+ <msup>
+ <mi mathvariant="italic">𝑎</mi>
+ <mn>2</mn>
+ </msup>
+ <mo stretchy="false">+</mo>
+ <msup>
+ <mi mathvariant="italic">𝑏</mi>
+ <mn>2</mn>
+ </msup>
+ </mrow>
+ <mo stretchy="false">=</mo>
+ <msup>
+ <mi mathvariant="italic">𝑐</mi>
+ <mn>2</mn>
+ </msup>
+ </mrow>
+ </semantics>
+ </math>
+ </draw:object>
+ </draw:frame>
+ </draw:page>
+ </office:presentation>
+ </office:body>
+</office:document> \ No newline at end of file
diff --git a/sd/qa/unit/data/pptx/Math.pptx b/sd/qa/unit/data/pptx/Math.pptx
deleted file mode 100644
index fef20675b59e..000000000000
--- a/sd/qa/unit/data/pptx/Math.pptx
+++ /dev/null
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index 24295879c087..61c07c0612b3 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -378,13 +378,13 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathObject)
}
}
-CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathObjectPPT2010)
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathExportNonBMP)
{
// Check import / export of math object
- createSdImpressDoc("pptx/Math.pptx");
+ createSdImpressDoc("odp/Math.fodp");
save(u"Impress Office Open XML"_ustr);
- // Export an MS specific ole object (imported from a PPTX document)
+ // Export an MS specific ole object
{
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice"_ostr,
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx
index 38afc68be086..0382792afe45 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -455,7 +455,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf129372)
const SdrObject* pObj = pPage->GetObj(0);
CPPUNIT_ASSERT_MESSAGE("no object", pObj != nullptr);
- CPPUNIT_ASSERT_EQUAL(SdrObjKind::OLE2, pObj->GetObjIdentifier());
+ CPPUNIT_ASSERT_EQUAL(SdrObjKind::CustomShape, pObj->GetObjIdentifier());
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testShapeGlowEffect)