diff options
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 5 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf118776.pptx | bin | 0 -> 31591 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests2.cxx | 23 |
3 files changed, 28 insertions, 0 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 9200e9666cbf..a34cb14af639 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -111,6 +111,11 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil if ( maFillProperties.moFillType.has() ) { Color aColor = maFillProperties.getBestSolidColor(); + + // noFill doesn't exist for characters. Map noFill to 99% transparency + if (maFillProperties.moFillType.get() == XML_noFill) + aColor.addTransformation(XML_alpha, 1000); + // tdf#137438 Emulate text outline color/transparency. // If the outline color dominates, then use it as the text color. if (moTextOutlineProperties.has() diff --git a/sd/qa/unit/data/pptx/tdf118776.pptx b/sd/qa/unit/data/pptx/tdf118776.pptx Binary files differnew file mode 100644 index 000000000000..8df94522ab29 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf118776.pptx diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 9a5021f533b6..c299ad4303dd 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -118,6 +118,7 @@ public: void testTdf103792(); void testTdf103876(); void testTdf79007(); + void testTdf118776(); void testTdf129686(); void testTdf104015(); void testTdf104201(); @@ -183,6 +184,7 @@ public: CPPUNIT_TEST(testTdf103792); CPPUNIT_TEST(testTdf103876); CPPUNIT_TEST(testTdf79007); + CPPUNIT_TEST(testTdf118776); CPPUNIT_TEST(testTdf129686); CPPUNIT_TEST(testTdf104015); CPPUNIT_TEST(testTdf104201); @@ -547,6 +549,27 @@ void SdImportTest2::testTdf79007() xDocShRef->DoClose(); } +void SdImportTest2::testTdf118776() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf118776.pptx"), PPTX); + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, xDocShRef)); + + // Get first paragraph of the text + uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape)); + + // Get first run of the paragraph + uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph)); + uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW); + sal_Int16 nTransparency = 0; + xPropSet->getPropertyValue("CharTransparence") >>= nTransparency; + + // Import noFill color as 99% transparency + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(99), nTransparency); + + xDocShRef->DoClose(); +} + void SdImportTest2::testTdf129686() { sd::DrawDocShellRef xDocShRef |