summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-01-28 08:34:00 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-01-28 14:34:47 +0100
commit69acbf1994a2fd8606b119e7716996fb103b75c8 (patch)
tree24b0de80008c6a2ce353844b4ed3aa209fb902d0
parentf679fb89b6d021f12ebeb543a1efe519bd44f96b (diff)
tdf#111786: PPTX export: Shape's line transparency is not exported
Change-Id: Iab11906e6ed79e1e39bba1b07b50a25887517f3a Reviewed-on: https://gerrit.libreoffice.org/48763 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--oox/source/export/drawingml.cxx9
-rwxr-xr-xsd/qa/unit/data/pptx/tdf111786.pptxbin0 -> 24566 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx23
3 files changed, 30 insertions, 2 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 5af5dce2d12f..1deec7c82f74 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -577,6 +577,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet )
sal_uInt32 nLineWidth = 0;
sal_uInt32 nColor = 0;
+ sal_Int32 nColorAlpha = MAX_PERCENT;
bool bColorSet = false;
const char* cap = nullptr;
drawing::LineDash aLineDash;
@@ -656,6 +657,10 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet )
nColor = mAny.get<sal_uInt32>() & 0xffffff;
bColorSet = true;
}
+ if ( GETA( LineTransparence ) )
+ {
+ nColorAlpha = MAX_PERCENT - (mAny.get<sal_Int16>() * PER_PERCENT);
+ }
break;
}
@@ -670,7 +675,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet )
if( nColor != nOriginalColor )
{
// the user has set a different color for the line
- WriteSolidFill( nColor );
+ WriteSolidFill( nColor, nColorAlpha );
}
else if( !sColorFillScheme.isEmpty() )
{
@@ -687,7 +692,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet )
}
else
{
- WriteSolidFill( nColor );
+ WriteSolidFill( nColor, nColorAlpha );
}
}
diff --git a/sd/qa/unit/data/pptx/tdf111786.pptx b/sd/qa/unit/data/pptx/tdf111786.pptx
new file mode 100755
index 000000000000..5d8f62b24a40
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf111786.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index acb6256c0c40..b530790b038a 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -127,6 +127,7 @@ public:
void testTdf68759();
void testTdf90626();
void testTdf107608();
+ void testTdf111786();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -179,6 +180,7 @@ public:
CPPUNIT_TEST(testTdf68759);
CPPUNIT_TEST(testTdf90626);
CPPUNIT_TEST(testTdf107608);
+ CPPUNIT_TEST(testTdf111786);
CPPUNIT_TEST_SUITE_END();
@@ -1379,6 +1381,27 @@ void SdOOXMLExportTest2::testTdf107608()
xDocShRef->DoClose();
}
+void SdOOXMLExportTest2::testTdf111786()
+{
+ // Export line transparency with the color
+ ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf111786.pptx"), PPTX);
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ uno::Reference< beans::XPropertySet > xShape( getShapeFromPage( 0, 0, xDocShRef ) );
+ uno::Reference< beans::XPropertySet > xPropSet( xShape, uno::UNO_QUERY_THROW );
+
+ sal_uInt32 nLineColor;
+ xPropSet->getPropertyValue("LineColor") >>= nLineColor;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0x3465A4), nLineColor);
+
+ sal_Int16 nTransparency;
+ xPropSet->getPropertyValue("LineTransparence") >>= nTransparency;
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(33), nTransparency);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();