summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2019-09-30 23:18:14 +0200
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2019-10-02 00:14:05 +0200
commit727ca36e83868acbe40aaa239cefc69659b9bc39 (patch)
tree50e7d78c5b9a07d2627dd23fca1b1bef266c71d5 /sd/qa
parent62808ef28e05eee4945a6a15d981350d1306b848 (diff)
tdf#79007: PPTX: reset Contrast and Brightness when we map...
...MSO 'washout' to our watermark colormode After d151ed35ad4c4e7aa9fbb807930fcf91dea2eba7, Contrast and Brightness was reset only in writer, so do it earlier for Impress and Writer Change-Id: Icaf2b565880e31d86e09e2f56bac25eba52c8467 Reviewed-on: https://gerrit.libreoffice.org/79905 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/pptx/tdf79007.pptxbin0 -> 46828 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx58
2 files changed, 58 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf79007.pptx b/sd/qa/unit/data/pptx/tdf79007.pptx
new file mode 100644
index 000000000000..65e94f1a9d9e
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf79007.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 97f3345975ea..1fd0d5ef5e8c 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -49,6 +49,7 @@
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/drawing/BitmapMode.hpp>
+#include <com/sun/star/drawing/ColorMode.hpp>
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
@@ -167,6 +168,7 @@ public:
void testTdf103567();
void testTdf103792();
void testTdf103876();
+ void testTdf79007();
void testTdf104015();
void testTdf104201();
void testTdf103477();
@@ -263,6 +265,7 @@ public:
CPPUNIT_TEST(testTdf103567);
CPPUNIT_TEST(testTdf103792);
CPPUNIT_TEST(testTdf103876);
+ CPPUNIT_TEST(testTdf79007);
CPPUNIT_TEST(testTdf104015);
CPPUNIT_TEST(testTdf104201);
CPPUNIT_TEST(testTdf103477);
@@ -1745,6 +1748,61 @@ void SdImportTest::testTdf103876()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf79007()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf79007.pptx"), PPTX);
+
+ uno::Reference<beans::XPropertySet> xShape1(getShapeFromPage(0, 0, xDocShRef));
+ CPPUNIT_ASSERT_MESSAGE("Not a shape", xShape1.is());
+
+ // Check we map mso washout to our watermark
+ drawing::ColorMode aColorMode1;
+ xShape1->getPropertyValue("GraphicColorMode") >>= aColorMode1;
+ CPPUNIT_ASSERT_EQUAL(drawing::ColorMode_WATERMARK, aColorMode1);
+
+ sal_Int16 nContrast1;
+ xShape1->getPropertyValue("AdjustContrast") >>= nContrast1;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), nContrast1);
+
+ sal_Int16 nLuminance1;
+ xShape1->getPropertyValue("AdjustLuminance") >>= nLuminance1;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), nLuminance1);
+
+ uno::Reference<beans::XPropertySet> xShape2(getShapeFromPage(1, 0, xDocShRef));
+ CPPUNIT_ASSERT_MESSAGE("Not a shape", xShape2.is());
+
+ // Check we map mso grayscale to our grayscale
+ drawing::ColorMode aColorMode2;
+ xShape2->getPropertyValue("GraphicColorMode") >>= aColorMode2;
+ CPPUNIT_ASSERT_EQUAL(drawing::ColorMode_GREYS, aColorMode2);
+
+ sal_Int16 nContrast2;
+ xShape2->getPropertyValue("AdjustContrast") >>= nContrast2;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), nContrast2);
+
+ sal_Int16 nLuminance2;
+ xShape2->getPropertyValue("AdjustLuminance") >>= nLuminance2;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), nLuminance2);
+
+ uno::Reference<beans::XPropertySet> xShape3(getShapeFromPage(2, 0, xDocShRef));
+ CPPUNIT_ASSERT_MESSAGE("Not a shape", xShape3.is());
+
+ // Check we map mso black/white to our black/white
+ drawing::ColorMode aColorMode3;
+ xShape3->getPropertyValue("GraphicColorMode") >>= aColorMode3;
+ CPPUNIT_ASSERT_EQUAL(drawing::ColorMode_MONO, aColorMode3);
+
+ sal_Int16 nContrast3;
+ xShape3->getPropertyValue("AdjustContrast") >>= nContrast3;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), nContrast3);
+
+ sal_Int16 nLuminance3;
+ xShape3->getPropertyValue("AdjustLuminance") >>= nLuminance3;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), nLuminance3);
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testTdf104015()
{
// Shape fill, line and effect properties were not inherited from master slide shape