Accepting request 703558 from LibreOffice:6.2

fixup of bsc1124869.patch

OBS-URL: https://build.opensuse.org/request/show/703558
OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=787
This commit is contained in:
Tomáš Chvátal 2019-05-16 21:13:57 +00:00 committed by Git OBS Bridge
parent bb35210846
commit 99166396b0

View File

@ -38,7 +38,7 @@ index b255116..a2fb6ee 100644
+ }
}
rPropMap.setProperty(PROP_GraphicColorMode, eColorMode);
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index a797adb..23065ec 100644
--- a/oox/source/export/drawingml.cxx
@ -49,7 +49,7 @@ index a797adb..23065ec 100644
sal_Int32 nContrast = 0;
- sal_Int32 nTransparence = 0;
+ sal_Int16 nTransparence = 0;
if (GetProperty(rXPropSet, "AdjustLuminance"))
nBright = mAny.get<sal_Int16>();
if (GetProperty(rXPropSet, "AdjustContrast"))
@ -58,64 +58,6 @@ index a797adb..23065ec 100644
- nTransparence = mAny.get<sal_Int32>();
+ if (GetProperty(rXPropSet, "Transparency"))
+ nTransparence = mAny.get<sal_Int16>();
if (nBright || nContrast)
diff --git a/sd/qa/unit/data/odp/image_transparency.odp b/sd/qa/unit/data/odp/image_transparency.odp
new file mode 100644
index 0000000..6d3f6c2
Binary files /dev/null and b/sd/qa/unit/data/odp/image_transparency.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index f649d27..7cc50e2 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -101,6 +101,7 @@ public:
void testTdf111884();
void testTdf112633();
void testCustomXml();
+ void testPictureTransparency();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
@@ -131,6 +132,7 @@ public:
CPPUNIT_TEST(testTdf111884);
CPPUNIT_TEST(testTdf112633);
CPPUNIT_TEST(testCustomXml);
+ CPPUNIT_TEST(testPictureTransparency);
CPPUNIT_TEST_SUITE_END();
@@ -853,6 +855,30 @@ void SdOOXMLExportTest1::testCustomXml()
CPPUNIT_ASSERT(pStream);
}
+void SdOOXMLExportTest1::testPictureTransparency()
+{
+ // Load document and export it to a temporary file.
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/odp/image_transparency.odp"), ODP);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xDoc.is());
+
+ uno::Reference<drawing::XDrawPage> xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT(xPage.is());
+
+ uno::Reference<beans::XPropertySet> xGraphicShape(getShape(0, xPage));
+ CPPUNIT_ASSERT(xGraphicShape.is());
+
+ sal_Int16 nTransparency = 0;
+ CPPUNIT_ASSERT(xGraphicShape->getPropertyValue("Transparency") >>= nTransparency);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(51), nTransparency);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
CPPUNIT_PLUGIN_IMPLEMENT();
--
cgit v1.1
if (nBright || nContrast)