/* -*- 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/.
*/
class SdOOXMLExportTest2 : public SdModelTestBase
{ public:
SdOOXMLExportTest2()
: SdModelTestBase(u"/sd/qa/unit/data/"_ustr)
{
}
};
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testRepeatBitmapMode)
{ // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. if (!IsDefaultDPI()) return;
createSdImpressDoc("odp/repeatBitmapMode.odp");
save(u"Impress Office Open XML"_ustr);
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testBnc822341)
{ // Check import / export of embedded text document
createSdImpressDoc("odp/bnc822341.odp");
save(u"Impress Office Open XML"_ustr);
// Export an LO specific ole object (imported from an ODP document)
{
xmlDocUniquePtr pXmlDocCT = parseExport(u"[Content_Types].xml"_ustr);
assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@ContentType='application/" "vnd.openxmlformats-officedocument.wordprocessingml.document']", "PartName", u"/ppt/embeddings/oleObject1.docx");
// Export an MS specific ole object (imported from a PPTX document)
{
xmlDocUniquePtr pXmlDocCT = parseExport(u"[Content_Types].xml"_ustr);
assertXPath(pXmlDocCT, "/ContentType:Types/ContentType:Override[@ContentType='application/" "vnd.openxmlformats-officedocument.wordprocessingml.document']", "PartName", u"/ppt/embeddings/oleObject1.docx");
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testMathObject)
{ // Check import / export of math object
createSdImpressDoc("odp/math.odp");
save(u"Impress Office Open XML"_ustr);
// Export an LO specific ole object (imported from an ODP document)
{
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice", "Requires", u"a14");
assertXPathContent(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice/p:sp/p:txBody/a:p/" "a14:m/m:oMath/m:r[1]/m:t",
u"a");
// Export an MS specific ole object (imported from a PPTX document)
{
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice", "Requires", u"a14");
assertXPathContent(pXmlDocContent, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Choice/p:sp/p:txBody/a:p/" "a14:m/m:oMath/m:r[1]/m:t",
u"a");
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf119015)
{
createSdImpressDoc("pptx/tdf119015.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
const SdrPage* pPage = GetPage(1);
sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0));
CPPUNIT_ASSERT(pTableObj); // The position was previously not properly initialized: (0, 0, 100, 100)
CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(6991, 6902), Size(14099, 2000)),
pTableObj->GetLogicRect());
uno::Reference<table::XTable> xTable(pTableObj->getTable());
// Test that we actually have three cells: this threw css.lang.IndexOutOfBoundsException
uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(u"A3"_ustr, xTextRange->getString());
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf123090)
{
createSdImpressDoc("pptx/tdf123090.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
// Test that we actually have two cells: this threw css.lang.IndexOutOfBoundsException
uno::Reference<text::XTextRange> xTextRange(xTable->getCellByPosition(1, 0),
uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(u"aaa"_ustr, xTextRange->getString());
// Without the fix in place, this test would have failed with // - Expected: Color: R:0 G:0 B:0 A:0 // - Actual : Color: R:255 G:255 B:255 A:0
CPPUNIT_ASSERT_EQUAL(COL_BLACK, nColor);
}
// OVAL VERTICAL - cannot be exported to PPTX so fallback to circle //CPPUNIT_ASSERT(checkTransitionOnPage(xDoc, 76, TransitionType::ELLIPSEWIPE, TransitionSubType::VERTICAL));
CPPUNIT_ASSERT(
checkTransitionOnPage(xDoc, 76, TransitionType::ELLIPSEWIPE, TransitionSubType::CIRCLE));
}
size_t i = 0; while (i < SAL_N_ELEMENTS(sShapeTypeAndValues))
{
OString sType(sShapeTypeAndValues[i++]); for (size_t j = 1; i < SAL_N_ELEMENTS(sShapeTypeAndValues)
&& o3tl::starts_with(sShapeTypeAndValues[i], "adj");
++j)
{
OString sXPath
= "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom[@prst='_T_']/a:avLst/a:gd[_N_]"_ostr
.replaceFirst(sT, sType)
.replaceFirst(sN, OString::number(j));
assertXPath(pXmlDocCT, sXPath, "name",
OUString::createFromAscii(sShapeTypeAndValues[i++]));
assertXPath(pXmlDocCT, sXPath, "fmla",
OUString::createFromAscii(sShapeTypeAndValues[i++]));
}
}
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf92527)
{ // We draw a diamond in an empty document. // If custom shape has name and preset information in OOXML, should be export as preset shape.
createSdImpressDoc("empty.fodp");
uno::Reference<drawing::XDrawPage> xPage1(getPage(0));
uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XShape> xShape1(
xFactory->createInstance(u"com.sun.star.drawing.CustomShape"_ustr), uno::UNO_QUERY);
xPage1->add(xShape1);
xShape1->setSize(awt::Size(10000, 10000));
xShape1->setPosition(awt::Point(1000, 1000));
uno::Sequence<beans::PropertyValue> aShapeGeometry(comphelper::InitPropertySequence({
{ "Type", uno::Any(u"diamond"_ustr) },
}));
uno::Reference<beans::XPropertySet> xPropertySet1(xShape1, uno::UNO_QUERY);
xPropertySet1->setPropertyValue(u"CustomShapeGeometry"_ustr, uno::Any(aShapeGeometry));
for (sal_uInt16 i = 0; i <= 3; ++i)
{
uno::Reference<text::XTextField> xField = getTextFieldFromPage(0, 0, i, 0);
CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is());
uno::Reference<beans::XPropertySet> xPropSet(xField, uno::UNO_QUERY_THROW);
sal_Int32 nNumFmt;
xPropSet->getPropertyValue(u"FileFormat"_ustr) >>= nNumFmt; switch (i)
{ case 0: // Path/File name
CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(0), nNumFmt); break; case 1: // Path
CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(1), nNumFmt); break; case 2: // File name without extension
CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(2), nNumFmt); break; case 3: // File name with extension
CPPUNIT_ASSERT_EQUAL_MESSAGE("File formats don't match", sal_Int32(3), nNumFmt);
}
}
}
uno::Reference<text::XTextField> xField = getTextFieldFromPage(0, 0, 0, 0);
CPPUNIT_ASSERT_MESSAGE("Where is the text field?", xField.is());
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf99224)
{
createSdImpressDoc("odp/tdf99224.odp");
saveAndReload(u"Impress Office Open XML"_ustr);
uno::Reference<drawing::XDrawPage> xPage = getPage(0); // This was 0: the image with text was lost on export.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xPage->getCount());
}
// Without the fix to tdf#168754 the special characters would cause errors during parsing
assertXPathContent(pXmlDocRels, "/p:cmLst/p:cm/p:text",
u"Test for creator-initials\n< > & \"'");
// Without the fix in place, the comment position would have been 0,0
assertXPath(pXmlDocRels, "/p:cmLst/p:cm/p:pos", "x", u"2032");
assertXPath(pXmlDocRels, "/p:cmLst/p:cm/p:pos", "y", u"1029");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf105739)
{ // Gradient was lost during saving to ODP
createSdImpressDoc("pptx/tdf105739.pptx");
save(u"impress8"_ustr);
uno::Reference<drawing::XDrawPage> xPage = getPage(0);
uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
uno::Any aAny = xPropSet->getPropertyValue(u"Background"_ustr);
CPPUNIT_ASSERT(aAny.hasValue()); if (aAny.hasValue())
{
uno::Reference<beans::XPropertySet> aXBackgroundPropSet;
aAny >>= aXBackgroundPropSet;
// Test fill type
drawing::FillStyle aFillStyle(drawing::FillStyle_NONE);
aXBackgroundPropSet->getPropertyValue(u"FillStyle"_ustr) >>= aFillStyle;
CPPUNIT_ASSERT_EQUAL(int(drawing::FillStyle_GRADIENT), static_cast<int>(aFillStyle));
// Test gradient properties
css::awt::Gradient2 aFillGradient;
aXBackgroundPropSet->getPropertyValue(u"FillGradient"_ustr) >>= aFillGradient;
// MCGR: Use the completely imported gradient to check for correctness const basegfx::BColorStops aColorStops
= model::gradient::getColorStopsFromUno(aFillGradient.ColorStops);
saveAndReload(u"impress8"_ustr);
uno::Reference<drawing::XDrawPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL_MESSAGE("There should be exactly one page", static_cast<sal_Int32>(1),
xDoc->getDrawPages()->getCount());
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPptmContentType)
{
createSdImpressDoc("pptm/macro.pptm");
save(u"Impress MS PowerPoint 2007 XML VBA"_ustr);
// Assert that the content type is the one of PPTM
xmlDocUniquePtr pXmlContentType = parseExport(u"[Content_Types].xml"_ustr);
assertXPath(pXmlContentType, "/ContentType:Types/ContentType:Override[@PartName='/ppt/presentation.xml']", "ContentType", u"application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testPptmVBAStream)
{
createSdImpressDoc("pptm/macro.pptm");
save(u"Impress MS PowerPoint 2007 XML VBA"_ustr);
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess
= packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
maTempFile.GetURL()); // This failed: VBA stream was not roundtripped
CPPUNIT_ASSERT(xNameAccess->hasByName(u"ppt/vbaProject.bin"_ustr));
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111863)
{
createSdImpressDoc("pptx/tdf111863.pptx");
save(u"Impress Office Open XML"_ustr);
// check that transition attribute didn't change from 'out' to 'in'
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animEffect", "transition", u"out");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf111518)
{
createSdImpressDoc("pptx/tdf111518.pptx");
save(u"Impress Office Open XML"_ustr);
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0);
assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln", "cap"); // by default it is "flat" cap style
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln/a:bevel", 1);
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:spPr/a:custGeom/a:pathLst/a:path/a:close", 0);
assertXPathNoAttribute(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[5]/p:spPr/a:ln", "cap"); // by default it is "flat" cap style
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[6]/p:spPr/a:ln/a:round", 1);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867)
{
createSdImpressDoc("pptx/tdf106867.pptx");
save(u"Impress Office Open XML"_ustr);
const SdrPage* pPage = GetPage(1);
// first check that we have the media object const SdrMediaObj* pMediaObj = dynamic_cast<SdrMediaObj*>(pPage->GetObj(2));
CPPUNIT_ASSERT_MESSAGE("no media object", pMediaObj != nullptr);
CPPUNIT_ASSERT_EQUAL(u"vnd.sun.star.Package:ppt/media/media1.avi"_ustr, pMediaObj->getURL());
// additional checks of the output file
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess
= packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
maTempFile.GetURL()); // check that the document contains the video stream
CPPUNIT_ASSERT(xNameAccess->hasByName(u"ppt/media/media1.avi"_ustr));
// both the ooxml and the extended markup
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/a:videoFile");
assertXPath(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:nvPr/p:extLst/p:ext/p14:media");
// target the shape with the video in the command
assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/" "p:cBhvr/p:tgtEl/p:spTgt", "spid", u"61");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280)
{
createSdImpressDoc("pptx/tdf112280.pptx");
save(u"Impress Office Open XML"_ustr);
// check the animRot value
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDocContent, "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:animRot", "by", u"21600000");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112088)
{
createSdImpressDoc("pptx/tdf112088.pptx");
save(u"Impress Office Open XML"_ustr);
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112552)
{ // Background fill was not displayed, but it was because of the wrong geometry
createSdImpressDoc("odp/tdf112552.odp");
save(u"Impress Office Open XML"_ustr);
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112557)
{ // Subtitle shape should be skipped by export.
createSdImpressDoc("odp/tdf112557.odp");
save(u"Impress Office Open XML"_ustr);
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slideMasters/slideMaster1.xml"_ustr);
assertXPath(pXmlDocContent, "/p:sldMaster/p:cSld/p:spTree/p:sp", 2); // title and object
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf128049)
{
createSdImpressDoc("odp/tdf128049.odp");
save(u"Impress Office Open XML"_ustr);
// clear SmartArt data to check how group shapes with double-rotated children are exported, not smartart // NOTE: Resetting the GrabBag data is a *very* indirect way to reset the SmartArt functionality. // Since this worked before and there is not (yet?) a better way to do it using UNO API, I added // code to support this for now
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
uno::Sequence<beans::PropertyValue> aInteropGrabBag;
xShape->setPropertyValue(u"InteropGrabBag"_ustr, uno::Any(aInteropGrabBag));
// Without the accompanying fix in place, this test would have failed with: // - Expected: Motyw pakietu Office // - Actual : Office Theme // i.e. the theme and color scheme name was lost on export.
assertXPath(pXmlDocTheme1, "/a:theme", "name", u"Motyw pakietu Office");
assertXPath(pXmlDocTheme1, "/a:theme/a:themeElements/a:clrScheme", "name", u"Pakiet Office");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors)
{
createSdImpressDoc("pptx/tdf84205.pptx");
save(u"Impress Office Open XML"_ustr);
// Without the fix in place, this test would have failed with // - Expected: ed1c24 // - Actual : ffffff
assertXPath(pXmlDocRels, "/p:sld/p:cSld/p:spTree/p:sp[1]/p:spPr/a:pattFill/a:bgClr/a:srgbClr", "val", u"ed1c24");
}
CPPUNIT_ASSERT_MOTIONPATH(
u"M 0.0449285714285714 0.00368253968253968 C 0.0575714285714285 -0.00095238095238096 "
u"0.0704264795523803 -0.00370117418637049 0.0831071428571428 -0.00819047619047622 C "
u"0.0953550597998766 -0.0125265741339082 0.107821870086751 -0.010397536991717 "
u"0.120321428571429 -0.0115555555555556 C 0.133179018681433 -0.0127467438724762 "
u"0.151318627483861 -0.0158700272533852 0.1585 0.00539682539682542 C 0.16478291361998 "
u"0.0240029898688431 0.15828642886492 0.0483806254341085 0.161392857142857 "
u"0.0698412698412698 C 0.165179286017685 0.0959996731216037 0.17453898927982 "
u"0.119735912694626 0.187142857142857 0.132634920634921 C 0.199788991845377 "
u"0.145577185161529 0.215607110490848 0.142889773028431 0.230107142857143 "
u"0.142857142857143 C 0.243821417584191 0.142826280916829 0.257716514999779 "
u"0.142685979556724 0.271142857142857 0.137777777777778 C 0.286895094567923 "
u"0.132019309914514 0.302318190711873 0.122962218306185 0.317928571428571 0.11568253968254 "
u"C 0.333496771884548 0.108422531222479 0.348787823719556 0.0990570571890929 "
u"0.363714285714286 0.0885079365079364 C 0.374930683062651 0.080580865157908 "
u"0.385357142857143 0.0693333333333332 0.396178571428571 0.0596825396825396 L "
u"0.404785714285714 0.0410158730158729 L 0.401892857142857 0.0342222222222221 E",
getXPath(pXmlDocContent, "(//p:animMotion)[1]", "path"));
CPPUNIT_ASSERT_MOTIONPATH(u"M 0.025 0.0571428571428571 L 0.0821428571428571 0.184126984126984 "
u"L -0.175 0.234920634920635 L -0.246428571428571 "
u"-0.0190476190476191 L -0.0821428571428573 -0.133333333333333 E",
getXPath(pXmlDocContent, "(//p:animMotion)[2]", "path"));
CPPUNIT_ASSERT_MOTIONPATH(
u"M -0.0107142857142857 0.00634920634920635 C -0.110714285714286 0.501587301587301 "
u"-0.153571428571429 -0.00634920634920635 -0.246428571428572 0.184126984126984 C "
u"-0.339285714285715 0.374603174603175 -0.296428571428572 0.514285714285714 "
u"-0.267857142857143 0.603174603174603 C -0.239285714285715 0.692063492063492 "
u"0.0607142857142858 0.590476190476191 0.0607142857142858 0.590476190476191 E",
getXPath(pXmlDocContent, "(//p:animMotion)[3]", "path"));
CPPUNIT_ASSERT_MOTIONPATH(u"M 0.0535714285714286 -0.0444444444444444 L 0.132142857142857 "
u"-0.0444444444444444 L 0.132142857142857 -0.146031746031746 L "
u"0.0964285714285715 -0.146031746031746 E",
getXPath(pXmlDocContent, "(//p:animMotion)[4]", "path"));
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTextColumns_tdf140852)
{ // The document defines two columns in slideLayout12.xml, but explicitly redefines // in slide1.xml. Here we check that the redefinition in the slide takes precedence.
createSdImpressDoc("pptx/tdf140852.pptx");
{
uno::Reference<drawing::XDrawPage> xPage(getPage(0));
uno::Reference<container::XIndexAccess> xIndexAccess(xPage, uno::UNO_QUERY_THROW);
uno::Reference<drawing::XShape> xShape(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xProps(xShape, uno::UNO_QUERY_THROW);
uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xProps));
CPPUNIT_ASSERT_EQUAL(u"Training will be treated as part of sharing the sweet when " "it comes to serving ice cream"_ustr,
xParagraph->getString());
uno::Reference<text::XTextColumns> xCols(xProps->getPropertyValue(u"TextColumns"_ustr),
uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCols->getColumnCount());
uno::Reference<beans::XPropertySet> xColProps(xCols, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(1000)),
xColProps->getPropertyValue(u"AutomaticDistance"_ustr));
}
save(u"Impress Office Open XML"_ustr);
{
uno::Reference<drawing::XDrawPage> xPage(getPage(0));
uno::Reference<container::XIndexAccess> xIndexAccess(xPage, uno::UNO_QUERY_THROW);
uno::Reference<drawing::XShape> xShape(xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xProps(xShape, uno::UNO_QUERY_THROW);
uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xProps));
CPPUNIT_ASSERT_EQUAL(u"Training will be treated as part of sharing the sweet when " "it comes to serving ice cream"_ustr,
xParagraph->getString());
uno::Reference<text::XTextColumns> xCols(xProps->getPropertyValue(u"TextColumns"_ustr),
uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCols->getColumnCount());
uno::Reference<beans::XPropertySet> xColProps(xCols, uno::UNO_QUERY_THROW);
CPPUNIT_ASSERT_EQUAL(uno::Any(sal_Int32(1000)),
xColProps->getPropertyValue(u"AutomaticDistance"_ustr));
}
// Test if datetime fields have text in them // This is needed for backwards compatibility
assertXPath(pXmlDocSlide1, "//a:fld [@type='datetime1']/a:t");
// tdf#143316: Without the fix in place, this test would have failed with // - Expected: 1 // - Actual : 0
assertXPath(pXmlDocSlide1, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:fld/a:rPr");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf53970)
{ // Embedded media file
{
createSdImpressDoc("odp/tdf53970.odp");
saveAndReload(u"Impress Office Open XML"_ustr);
// Without fix in place, the media shape was lost on export.
CPPUNIT_ASSERT(getPage(0)->hasElements());
}
// Linked media file
{
createSdImpressDoc("odp/tdf53970_linked.odp");
save(u"Impress Office Open XML"_ustr);
// Without fix in place, the media shape was imported as an image after export // and this test would have failed with exception of type com.sun.star.beans.UnknownPropertyException
CPPUNIT_ASSERT_MESSAGE("MediaURL property is not set",
xShape->getPropertyValue(u"MediaURL"_ustr) >>= sVideoURL);
CPPUNIT_ASSERT_MESSAGE("MediaURL is empty", !sVideoURL.isEmpty());
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.