diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:27:54 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 09:27:54 +0000 |
commit | adb203bc05e3e36173cbd46b9951f79821a81799 (patch) | |
tree | 6e6739df9b3f0a567330a0dd7ee0e03ae70876a3 /sd/qa | |
parent | Adding debian version 4:24.2.0-3. (diff) | |
download | libreoffice-adb203bc05e3e36173cbd46b9951f79821a81799.tar.xz libreoffice-adb203bc05e3e36173cbd46b9951f79821a81799.zip |
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf156718.pptx | bin | 0 -> 14422 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml4.cxx | 22 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 70 |
3 files changed, 79 insertions, 13 deletions
diff --git a/sd/qa/unit/data/pptx/tdf156718.pptx b/sd/qa/unit/data/pptx/tdf156718.pptx Binary files differnew file mode 100644 index 0000000000..8aeafa1557 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf156718.pptx diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index b09614454d..c4c061c50d 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -751,22 +751,18 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf147121) CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf140912_PicturePlaceholder) { - // 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. - // -8490 in the test below turns into -8014 on my Windows box with 150% scaling. - if (!IsDefaultDPI()) - return; - + // Given a graphic placeholder with a custom prompt: createSdImpressDoc("pptx/tdfpictureplaceholder.pptx"); uno::Reference<beans::XPropertySet> xShapeProps(getShapeFromPage(0, 0)); - bool bTextContourFrame = true; - xShapeProps->getPropertyValue("TextContourFrame") >>= bTextContourFrame; - CPPUNIT_ASSERT_EQUAL(false, bTextContourFrame); - - text::GraphicCrop aGraphicCrop; - xShapeProps->getPropertyValue("GraphicCrop") >>= aGraphicCrop; - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-8490), aGraphicCrop.Top); + 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("IsEmptyPresentationObject") >>= 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) diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index c08e44ea26..d6beee8769 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -34,6 +34,7 @@ #include <sax/tools/converter.hxx> #include <com/sun/star/awt/Gradient.hpp> +#include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/presentation/ClickAction.hpp> @@ -203,6 +204,75 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testDocumentLayout) } } +CPPUNIT_TEST_FIXTURE(SdImportTest, testTableStyle) +{ + createSdImpressDoc("pptx/tdf156718.pptx"); + const SdrPage* pPage = GetPage(1); + + sdr::table::SdrTableObj* pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0)); + CPPUNIT_ASSERT(pTableObj); + + uno::Reference<table::XCellRange> xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xCellPropSet; + uno::Reference<beans::XPropertySet> xRunPropSet; + uno::Reference<text::XTextRange> xParagraph; + uno::Reference<text::XTextRange> xRun; + table::BorderLine2 aBorderLine; + Color nFillColor, nCharColor; + float nFontWeight; + + xCellPropSet.set(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + xCellPropSet->getPropertyValue("BottomBorder") >>= aBorderLine; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + CPPUNIT_ASSERT_EQUAL_MESSAGE("The bottom border is missing!", true, aBorderLine.LineWidth > 0); + + xCellPropSet.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + + xCellPropSet.set(xTable->getCellByPosition(2, 0), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + + xCellPropSet.set(xTable->getCellByPosition(0, 1), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + xCellPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nFillColor); + + xCellPropSet.set(xTable->getCellByPosition(2, 1), uno::UNO_QUERY_THROW); + xParagraph.set(getParagraphFromShape(0, xCellPropSet)); + xRun.set(getRunFromParagraph(0, xParagraph)); + xRunPropSet.set(xRun, uno::UNO_QUERY_THROW); + xRunPropSet->getPropertyValue("CharColor") >>= nCharColor; + xRunPropSet->getPropertyValue("CharWeight") >>= nFontWeight; + xCellPropSet->getPropertyValue("FillColor") >>= nFillColor; + CPPUNIT_ASSERT_EQUAL(Color(0x000000), nCharColor); + CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, nFontWeight); + CPPUNIT_ASSERT_EQUAL(Color(0x5b9bd5), nFillColor); +} + CPPUNIT_TEST_FIXTURE(SdImportTest, testFreeformShapeGluePoints) { createSdImpressDoc("pptx/tdf156829.pptx"); |