/* -*- 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/.
*/
Color nFillColor;
xPropSet->getPropertyValue(u"FillColor"_ustr) >>= nFillColor;
CPPUNIT_ASSERT_EQUAL(Color(0x90C226), nFillColor);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125346_2)
{ // There are two themes in the test document, make sure we use the right theme // Test more slides with different themes
createSdImpressDoc("pptx/tdf125346_2.pptx");
save(u"Impress Office Open XML"_ustr);
Color nFillColor;
xPropSet->getPropertyValue(u"FillColor"_ustr) >>= nFillColor;
CPPUNIT_ASSERT_EQUAL(Color(0x90C226), nFillColor);
}
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125360)
{ // Check whether the changed fill transparency is exported correctly. // Color is defined by shape style
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125360_1)
{ // Check whether the changed fill transparency is exported correctly. // Color is defined by color scheme
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf125360_2)
{ // Check whether the changed fill transparency is exported correctly. // Color is defined by color scheme with a transparency
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf136830)
{
createSdImpressDoc("pptx/tdf136830.pptx");
save(u"Impress Office Open XML"_ustr);
// Without the fix in place, the X position of the shapes would have been 0
uno::Reference<drawing::XShapes> xGroupShape(getShapeFromPage(0, 0), uno::UNO_QUERY);
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf126234)
{
createSdImpressDoc("pptx/tdf126234.pptx");
save(u"Impress Office Open XML"_ustr);
// check relative size of the bullet, 400% is a legitimate value for MS Office document // Without a fix, it will fail to set the size correctly const SdrPage* pPage = GetPage(1);
SdrTextObj* pTxtObj = DynCastSdrTextObj(pPage->GetObj(0));
CPPUNIT_ASSERT_MESSAGE("no text object", pTxtObj != nullptr); const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); const SvxNumBulletItem* pNumFmt = aEdit.GetParaAttribs(0).GetItem(EE_PARA_NUMBULLET);
CPPUNIT_ASSERT(pNumFmt);
CPPUNIT_ASSERT_EQUAL(sal_uInt16(400), pNumFmt->GetNumRule().GetLevel(0).GetBulletRelSize());
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf126741)
{
createSdImpressDoc("pptx/tdf126741.pptx");
save(u"Impress Office Open XML"_ustr);
// dash dot dot line style import fix // The original fixed values are replaced with the percent values, because // with fix for tdf#127166 the MS Office preset styles are correctly detected. const SdrPage* pPage = GetPage(1);
SdrObject* const pObj = pPage->GetObj(0);
CPPUNIT_ASSERT(pObj);
// MCGR: Use the completely imported gradient to check for correctness const basegfx::BColorStops aColorStops
= model::gradient::getColorStopsFromUno(aTransparenceGradient.ColorStops);
// MCGR: Use the completely imported gradient to check for correctness const basegfx::BColorStops aColorStops
= model::gradient::getColorStopsFromUno(aGradient.ColorStops);
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf119087)
{
createSdImpressDoc("pptx/tdf119087.pptx");
saveAndReload(u"Impress Office Open XML"_ustr); // This would fail both on export validation, and reloading the saved pptx file.
// Get first paragraph of the text
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape)); // Get first run of the paragraph
uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW);
Color nColor = COL_AUTO;
xPropSet->getPropertyValue(u"CharColor"_ustr) >>= nColor;
CPPUNIT_ASSERT_EQUAL(Color(0x00B050), nColor);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf132282)
{
createSdImpressDoc("pptx/tdf132282.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
uno::Reference<drawing::XShape> xShape(getShapeFromPage(0, 0), uno::UNO_QUERY); // Without the fix in place, the position would be 0,0, height = 1 and width = 1
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1736), xShape->getPosition().X);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(763), xShape->getPosition().Y);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(30523), xShape->getSize().Width);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2604), xShape->getSize().Height);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf132201EffectOrder)
{
createSdImpressDoc("pptx/effectOrder.pptx");
save(u"Impress Office Open XML"_ustr);
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPathChildren(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst", 2); // The relative order of effects is important: glow must be before shadow
CPPUNIT_ASSERT_EQUAL(0, getXPathPosition(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst", "glow"));
CPPUNIT_ASSERT_EQUAL(1, getXPathPosition(pXmlDocContent, "/p:sld/p:cSld/p:spTree/p:sp[3]/p:spPr/a:effectLst", "outerShdw"));
}
// Without the fix we lost the graphic of ole object. const Graphic* pGraphic = pOleObj->GetGraphic();
CPPUNIT_ASSERT_MESSAGE("no graphic", pGraphic != nullptr);
CPPUNIT_ASSERT_MESSAGE("no graphic", !pGraphic->IsNone());
// Check export of embedded worksheet in slide.
saveAndReload(u"Impress Office Open XML"_ustr);
pPage = GetPage(1);
pOleObj = static_cast<SdrOle2Obj*>(pPage->GetObj(0));
CPPUNIT_ASSERT_MESSAGE("no object after the export", pOleObj != nullptr);
pGraphic = pOleObj->GetGraphic();
CPPUNIT_ASSERT_MESSAGE("no graphic after the export", pGraphic != nullptr);
CPPUNIT_ASSERT_MESSAGE("no graphic after the export", !pGraphic->IsNone());
}
// Without the fix in place, this would have failed with // - Expected: // - Actual : 216000 // - In <file:///tmp/lu161922zcvd.tmp>, XPath '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr' unexpected 'marL' attribute
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf147121)
{ // Get the bugdoc
createSdImpressDoc("pptx/tdf147121.pptx");
// Get the second line props of the placeholder
uno::Reference<drawing::XDrawPage> xPage(getPage(0));
uno::Reference<beans::XPropertySet> xShape(xPage->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xRun(
getRunFromParagraph(2, getParagraphFromShape(0, xShape)), uno::UNO_QUERY_THROW);
// Save the font size constauto nFontSizeBefore = xRun->getPropertyValue(u"CharHeight"_ustr).get<float>() * 100;
// The font size was not saved before now it must be equal with the saved one.
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected font size", nFontSizeBefore, nFontSizeAfter);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf140912_PicturePlaceholder)
{ // Given a graphic placeholder with a custom prompt:
createSdImpressDoc("pptx/tdfpictureplaceholder.pptx");
uno::Reference<beans::XPropertySet> xShapeProps(getShapeFromPage(0, 0)); bool isEmptyPresentationObject = false; // Without the fix, it would not be imported as empty presentation object; // the text would be treated as its content.
xShapeProps->getPropertyValue(u"IsEmptyPresentationObject"_ustr) >>= isEmptyPresentationObject;
CPPUNIT_ASSERT(isEmptyPresentationObject);
// If we supported custom prompt text, here we would also test "String" property, // which would be equal to "Insert Image".
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testEnhancedPathViewBox)
{
createSdImpressDoc("odp/tdf147978_enhancedPath_viewBox.odp");
saveAndReload(u"Impress Office Open XML"_ustr); auto xShapeProps(getShapeFromPage(0, 0));
awt::Rectangle aBoundRectangle;
xShapeProps->getPropertyValue(u"BoundRect"_ustr) >>= aBoundRectangle; // The shape has a Bézier curve which does not touch the right edge. Prior to the fix the curve // was stretched to touch the edge, resulting in 5098 curve width instead of 2045.
CPPUNIT_ASSERT_EQUAL(sal_Int32(2045), aBoundRectangle.Width);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf74670)
{
createSdImpressDoc("odp/tdf74670.odp");
save(u"Impress Office Open XML"_ustr);
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess
= packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory),
maTempFile.GetURL()); const uno::Sequence<OUString> aNames(xNameAccess->getElementNames()); int nImageFiles = 0; for (constauto& rElementName : aNames) if (rElementName.startsWith("ppt/media/image"))
nImageFiles++;
// Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 2 // i.e. the embedded picture would have been saved twice.
CPPUNIT_ASSERT_EQUAL(1, nImageFiles);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf109169_OctagonBevel)
{ // The document has a shape 'Octagon Bevel'. It consists of an octagon with 8 points and eight // facets with 4 points each, total 8+8*4=40 points. Without the patch it was exported as // rectangle and thus had 4 points.
createSdImpressDoc("odp/tdf109169_Octagon.odp");
saveAndReload(u"Impress Office Open XML"_ustr);
auto xPropSet(getShapeFromPage(0, 0)); auto aGeomPropSeq = xPropSet->getPropertyValue(u"CustomShapeGeometry"_ustr)
.get<uno::Sequence<beans::PropertyValue>>();
comphelper::SequenceAsHashMap aCustomShapeGeometry(aGeomPropSeq); auto aPathSeq((aCustomShapeGeometry[u"Path"_ustr]).get<uno::Sequence<beans::PropertyValue>>());
comphelper::SequenceAsHashMap aPath(aPathSeq); auto aCoordinates((aPath[u"Coordinates"_ustr])
.get<uno::Sequence<drawing::EnhancedCustomShapeParameterPair>>());
CPPUNIT_ASSERT_EQUAL(sal_Int32(40), aCoordinates.getLength());
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf109169_DiamondBevel)
{ // The document has a shape 'Diamond Bevel'. It consists of a diamond with 4 points and four // facets with 4 points each, total 4+4*4=20 points. Without the patch it was exported as // rectangle and thus had 4 points.
createSdImpressDoc("odp/tdf109169_Diamond.odp");
saveAndReload(u"Impress Office Open XML"_ustr);
auto xPropSet(getShapeFromPage(0, 0)); auto aGeomPropSeq = xPropSet->getPropertyValue(u"CustomShapeGeometry"_ustr)
.get<uno::Sequence<beans::PropertyValue>>();
comphelper::SequenceAsHashMap aCustomShapeGeometry(aGeomPropSeq); auto aPathSeq((aCustomShapeGeometry[u"Path"_ustr]).get<uno::Sequence<beans::PropertyValue>>());
comphelper::SequenceAsHashMap aPath(aPathSeq); auto aCoordinates((aPath[u"Coordinates"_ustr])
.get<uno::Sequence<drawing::EnhancedCustomShapeParameterPair>>());
CPPUNIT_ASSERT_EQUAL(sal_Int32(20), aCoordinates.getLength());
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf144092_emptyShapeTextProps)
{ // Document contains one shape and one table. Both without any text but with // text properties contained inside endParaRPr - The import and export // of endParaRPr for empty cells and shapes are tested here
createSdImpressDoc("pptx/tdf144092-emptyShapeTextProps.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
Color aColor; // check text properties of empty shape
uno::Reference<beans::XPropertySet> xRectShapeProps(getShapeFromPage(1, 0));
CPPUNIT_ASSERT_EQUAL(u"Calibri"_ustr,
xRectShapeProps->getPropertyValue(u"CharFontName"_ustr).get<OUString>());
CPPUNIT_ASSERT_EQUAL(float(196),
xRectShapeProps->getPropertyValue(u"CharHeight"_ustr).get<float>());
xRectShapeProps->getPropertyValue(u"CharColor"_ustr) >>= aColor;
CPPUNIT_ASSERT_EQUAL(Color(0x70AD47), aColor);
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf149551_tbrl90)
{ // The document contains a shape with writing mode TB_RL90. That is the same as vert="vert" in // OOXML. Without the patch it was not possible to use this writing mode at all.
createSdImpressDoc("odp/tdf149551_tbrl90.odp");
// Test, that the shape has writing mode TB_RL90.
uno::Reference<beans::XPropertySet> xShapeProps(getShapeFromPage(0, 0));
sal_Int16 eWritingMode;
xShapeProps->getPropertyValue(u"WritingMode"_ustr) >>= eWritingMode;
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL90, eWritingMode);
// Test, that it is exported to vert="vert"
save(u"Impress Office Open XML"_ustr);
xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDoc, "//a:bodyPr", "vert", u"vert");
// Test, that the shape has writing mode TB_RL90 after read from pptx
uno::Reference<beans::XPropertySet> xShapeProps2(getShapeFromPage(0, 0));
sal_Int16 eWritingMode2;
xShapeProps2->getPropertyValue(u"WritingMode"_ustr) >>= eWritingMode2;
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::TB_RL90, eWritingMode2);
// Test, that it is written to odp with loext:writing-mode="tb-rl90"
save(u"impress8"_ustr);
pXmlDoc = parseExport(u"content.xml"_ustr);
assertXPath(
pXmlDoc, "//style:style[@style:name='gr1']/style:graphic-properties[@loext:writing-mode='tb-rl90']");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf149551_btlr)
{ // The document contains a shape with writing mode BT_LR. That is the same as vert="vert270" in // OOXML. Without the patch it was not possible to use this writing mode at all for shapes.
createSdImpressDoc("odp/tdf149551_btlr.odp");
// Test, that the shape has writing mode BT_LR.
uno::Reference<beans::XPropertySet> xShapeProps(getShapeFromPage(0, 0));
sal_Int16 eWritingMode;
xShapeProps->getPropertyValue(u"WritingMode"_ustr) >>= eWritingMode;
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, eWritingMode);
// Test, that it is exported to vert="vert270"
save(u"Impress Office Open XML"_ustr);
xmlDocUniquePtr pXmlDoc = parseExport(u"ppt/slides/slide1.xml"_ustr);
assertXPath(pXmlDoc, "//a:bodyPr", "vert", u"vert270");
// Test, that the shape has writing mode BT_LR after read from pptx
uno::Reference<beans::XPropertySet> xShapeProps2(getShapeFromPage(0, 0));
sal_Int16 eWritingMode2;
xShapeProps2->getPropertyValue(u"WritingMode"_ustr) >>= eWritingMode2;
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::BT_LR, eWritingMode2);
// Test, that it is written to odp with loext:writing-mode="bt-lr"
save(u"impress8"_ustr);
pXmlDoc = parseExport(u"content.xml"_ustr);
assertXPath(
pXmlDoc, "//style:style[@style:name='gr1']/style:graphic-properties[@loext:writing-mode='bt-lr']");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf94122_autoColor)
{ // Document contains three pages, with different scenarios for automatic // color export to pptx. // - First page: Page background light, automatic colored text on a FillType_NONE shape // - Second page: Page background dark, automatic colored text on a FillType_NONE shape // - Third page: Page background light, automatic colored text on a dark colored fill // and another automatic colored text on a light colored fill
createSdImpressDoc("odp/tdf94122_autocolor.odp");
save(u"Impress Office Open XML"_ustr);
// Without the accompanying fix in place, these tests would have failed with: // - Expected: 1 // - Actual : 0 // - In ..., XPath '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:srgbClr' number of nodes is incorrect // i.e. automatic color wasn't resolved & exported
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf124333)
{ // Document contains one rectangle and one embedded OLE object.
createSdImpressDoc("pptx/ole.pptx");
// Without the fix in place, the number of shapes was 3.
CPPUNIT_ASSERT_EQUAL_MESSAGE("number of shapes is incorrect", sal_Int32(2),
getPage(0)->getCount());
saveAndReload(u"Impress Office Open XML"_ustr);
// Check number of shapes after export.
CPPUNIT_ASSERT_EQUAL_MESSAGE("number of shapes is incorrect after export", sal_Int32(2),
getPage(0)->getCount());
}
// Without the accompanying fix in place, this test would have failed with: // - Expression: prop // - In ..., XPath '//p:oleObj' no attribute 'showAsIcon' exist // i.e. show as icon option wasn't exported.
assertXPath(pXml, "//p:oleObj", "showAsIcon", u"1");
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf152436)
{
createSdImpressDoc("pptx/ole-emf_min.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
// Check number of shapes after export.
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getPage(0)->getCount());
}
// Without the accompanying fix in place, this test would have failed with: // - Expected: 1 // - Actual : 0 // - In<>, XPath '//p:oleObj' number of nodes is incorrect // i.e. the linked ole object wasn't exported.
assertXPath(pXml, "//p:oleObj", 1);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf102261_testParaTabStopDefaultDistance)
{
createSdImpressDoc("pptx/tdf102261_testParaTabStopDefaultDistance.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
auto pBatch(comphelper::ConfigurationChanges::create()); // 1. Remove all personal info, but keep note info
officecfg::Office::Common::Security::Scripting::RemovePersonalInfoOnSaving::set(true, pBatch);
officecfg::Office::Common::Security::Scripting::KeepNoteAuthorDateInfoOnSaving::set(true,
pBatch);
pBatch->commit();
// 2. Remove all personal info
officecfg::Office::Common::Security::Scripting::KeepNoteAuthorDateInfoOnSaving::set(false,
pBatch);
pBatch->commit();
saveAndReload(u"Impress Office Open XML"_ustr);
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf157740_slideMasters)
{
createSdImpressDoc("pptx/tdf157740.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
// The original file has 1 slide master and 7 slide layouts in that master
xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/presentation.xml"_ustr);
assertXPath(pXmlDocContent, "/p:presentation/p:sldMasterIdLst/p:sldMasterId", 1);
// Check that the referenced slideLayout files exist // Without the accompanying fix in place, this test would have failed with: // equality assertion failed // - Expected: 1 // - Actual : 0 // i.e. the referenced slideLayout file was missing on export.
OUString sSlideLayoutName1 = sRelativeLayoutPath1.getToken(2, '/');
OUString sSlideLayoutName2 = sRelativeLayoutPath2.getToken(2, '/');
// Before export-and-reload, there is a formula on page.
{ auto xProps = getShapeFromPage(0, 0); auto xInfo = xProps->getPropertyValue(u"Model"_ustr).queryThrow<css::lang::XServiceInfo>();
CPPUNIT_ASSERT(xInfo->supportsService(u"com.sun.star.formula.FormulaProperties"_ustr));
// tdf#164101: check that the size is imported correctly
css::awt::Size formulaSize = xProps.queryThrow<css::drawing::XShape>()->getSize();
CPPUNIT_ASSERT_EQUAL(sal_Int32(1553), formulaSize.Width);
CPPUNIT_ASSERT_EQUAL(sal_Int32(528), formulaSize.Height);
CPPUNIT_ASSERT_THROW(getShapeFromPage(0, 1),
css::lang::IndexOutOfBoundsException); // Only one shape on page
}
saveAndReload(u"Impress Office Open XML"_ustr);
// After save-and-reload, there must still be a single shape; now it's a fallback image. // When we start to import formulas from PPTX, that will be formula.
{ // Without the fix, this threw IndexOutOfBoundsException, because there was no fallback, // and no shape got imported. auto xInfo = getShapeFromPage(0, 0).queryThrow<css::lang::XServiceInfo>();
CPPUNIT_ASSERT(xInfo->supportsService(u"com.sun.star.drawing.CustomShape"_ustr));
css::awt::Size formulaSize = xInfo.queryThrow<css::drawing::XShape>()->getSize(); // The fallback image size after the roundtrip may be a bit different - allow some tolerance
CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(1553), formulaSize.Width, 1);
CPPUNIT_ASSERT_DOUBLES_EQUAL(sal_Int32(528), formulaSize.Height, 1);
CPPUNIT_ASSERT_THROW(getShapeFromPage(0, 1),
css::lang::IndexOutOfBoundsException); // Only one shape on page
}
// Check that the alternate content is exported
assertXPath(
pXmlDoc, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Fallback/p:sp/p:spPr/a:blipFill/a:blip", "embed", u"rId1");
// Its cNvPr_id must be the same
assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/mc:AlternateContent/mc:Fallback/p:sp/p:nvSpPr/p:cNvPr", "id", cNvPr_id);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testPlaceHolderFitHeightToText)
{
createSdImpressDoc("pptx/tdf160487.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(1, 0)); bool bTextAutoGrowHeight = false;
xShape->getPropertyValue(u"TextAutoGrowHeight"_ustr) >>= bTextAutoGrowHeight;
CPPUNIT_ASSERT_MESSAGE("PlaceHolder Fit height to text should be true.", bTextAutoGrowHeight);
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testDeduplicateMasters)
{
createSdImpressDoc("pptx/onemaster-twolayouts.pptx");
saveAndReload("Impress Office Open XML");
// Check that the document still has one master and two layouts
xmlDocUniquePtr pXmlDocContent = parseExport("ppt/presentation.xml");
assertXPath(pXmlDocContent, "/p:presentation/p:sldMasterIdLst/p:sldMasterId"_ostr, 1);
pXmlDocContent = parseExport("ppt/slideMasters/slideMaster1.xml");
assertXPath(pXmlDocContent, "/p:sldMaster/p:sldLayoutIdLst/p:sldLayoutId"_ostr, 2);
// Check that both background colors have been preserved
uno::Reference<drawing::XMasterPagesSupplier> xDoc(mxComponent, uno::UNO_QUERY);
CPPUNIT_ASSERT(xDoc.is());
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xDoc->getMasterPages()->getCount());
// For each slide check that it's layout exists for (int i = 1; i <= 4; ++i)
{
xmlDocUniquePtr pXmlDocRels
= parseExport("ppt/slides/_rels/slide" + OUString::number(i) + ".xml.rels");
// Check that the referenced slideLayout files exist // Without the accompanying fix in place, this test would have failed with: // equality assertion failed // - Expected: 1 // - Actual : 0 // i.e. the referenced slideLayout file was missing on export.
OUString sSlideLayoutName = sRelativeLayoutPath.getToken(2, '/');
CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("ppt/slideLayouts/" + sSlideLayoutName)));
}
}
CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf162571HorzAnchor)
{
createSdImpressDoc("pptx/tdf165261.pptx");
saveAndReload(u"Impress Office Open XML"_ustr);
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.