summaryrefslogtreecommitdiffstats
path: root/sd
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:29:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:29:03 +0000
commit5a7157d319477830426797532e02ac39d3b859f4 (patch)
tree3773f5ce209bee14a5643e98672e0f3828c71434 /sd
parentReleasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff)
downloadlibreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz
libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf156718.pptxbin0 -> 14422 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml4.cxx22
-rw-r--r--sd/qa/unit/import-tests.cxx70
-rw-r--r--sd/source/ui/view/drviewsf.cxx15
4 files changed, 79 insertions, 28 deletions
diff --git a/sd/qa/unit/data/pptx/tdf156718.pptx b/sd/qa/unit/data/pptx/tdf156718.pptx
new file mode 100644
index 0000000000..8aeafa1557
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf156718.pptx
Binary files differ
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");
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 1844d79603..c8c6933c29 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -470,21 +470,6 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
}
break;
- case SID_THEME_DIALOG:
- {
- bool bDisable = true;
- SdrPageView* pPageView = mpDrawView->GetSdrPageView();
- if (pPageView)
- {
- SdPage* pPage = dynamic_cast<SdPage*>(pPageView->GetPage());
- if (pPage && pPage->IsMasterPage())
- bDisable = false;
- }
- if (bDisable)
- rSet.DisableItem(nWhich);
- }
- break;
-
case SID_STYLE_FAMILY2:
case SID_STYLE_FAMILY3:
case SID_STYLE_FAMILY5: