Kaydet (Commit) 69acbf19 authored tarafından Tamás Zolnai's avatar Tamás Zolnai

tdf#111786: PPTX export: Shape's line transparency is not exported

Change-Id: Iab11906e6ed79e1e39bba1b07b50a25887517f3a
Reviewed-on: https://gerrit.libreoffice.org/48763Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst f679fb89
......@@ -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 );
}
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment