diff options
-rw-r--r-- | oox/source/drawingml/textcharacterproperties.cxx | 6 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf148685.pptx | bin | 0 -> 23760 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests2.cxx | 43 |
3 files changed, 49 insertions, 0 deletions
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx index 7ffeaeba8da2..be2409f5795c 100644 --- a/oox/source/drawingml/textcharacterproperties.cxx +++ b/oox/source/drawingml/textcharacterproperties.cxx @@ -195,6 +195,12 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil rPropMap.setProperty( PROP_CharUnderlineHasColor, true); rPropMap.setProperty( PROP_CharUnderlineColor, maUnderlineColor.getColor( rFilter.getGraphicHelper() )); } + else + { + rPropMap.setProperty( PROP_CharUnderlineHasColor, false); + rPropMap.setProperty( PROP_CharUnderlineColor, sal_Int32(-1)); + } + // TODO If bUnderlineFillFollowText uFillTx (CT_TextUnderlineFillFollowText) is set, fill color of the underline should be the same color as the text if (maHighlightColor.isUsed() && maHighlightColor.getTransparency() != 100) diff --git a/sd/qa/unit/data/pptx/tdf148685.pptx b/sd/qa/unit/data/pptx/tdf148685.pptx Binary files differnew file mode 100644 index 000000000000..80af5a9bbf46 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf148685.pptx diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx index 3ecbec200c6e..ee0d110df24d 100644 --- a/sd/qa/unit/import-tests2.cxx +++ b/sd/qa/unit/import-tests2.cxx @@ -116,6 +116,7 @@ public: void testAoo124143(); void testTdf103567(); void testTdf103792(); + void testTdf148685(); void testTdf103876(); void testTdf79007(); void testTdf118776(); @@ -184,6 +185,7 @@ public: CPPUNIT_TEST(testAoo124143); CPPUNIT_TEST(testTdf103567); CPPUNIT_TEST(testTdf103792); + CPPUNIT_TEST(testTdf148685); CPPUNIT_TEST(testTdf103876); CPPUNIT_TEST(testTdf79007); CPPUNIT_TEST(testTdf118776); @@ -476,6 +478,47 @@ void SdImportTest2::testTdf103792() xDocShRef->DoClose(); } +void SdImportTest2::testTdf148685() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf148685.pptx"), PPTX); + uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(1, 0, xDocShRef)); + + uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, xShape)); + + uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph)); + CPPUNIT_ASSERT_EQUAL(OUString("TEXT "), xRun->getString()); + + uno::Reference<beans::XPropertySet> xPropSet(xRun, uno::UNO_QUERY_THROW); + + Color nCharUnderlineColor; + xPropSet->getPropertyValue("CharUnderlineColor") >>= nCharUnderlineColor; + CPPUNIT_ASSERT_EQUAL(Color(0xA1467E), nCharUnderlineColor); + + xRun.set(getRunFromParagraph(1, xParagraph)); + + CPPUNIT_ASSERT_EQUAL(OUString("TE"), xRun->getString()); + + xPropSet.set(xRun, uno::UNO_QUERY_THROW); + + xPropSet->getPropertyValue("CharUnderlineColor") >>= nCharUnderlineColor; + + // Without the fix in place, this test would have failed with + // - Expected: Color: R:255 G:255 B:255 A:255 + // - Actual : Color: R:161 G:70 B:126 A:0 + CPPUNIT_ASSERT_EQUAL(COL_AUTO, nCharUnderlineColor); + + xRun.set(getRunFromParagraph(2, xParagraph)); + CPPUNIT_ASSERT_EQUAL(OUString("XT"), xRun->getString()); + + xPropSet.set(xRun, uno::UNO_QUERY_THROW); + + xPropSet->getPropertyValue("CharUnderlineColor") >>= nCharUnderlineColor; + CPPUNIT_ASSERT_EQUAL(COL_AUTO, nCharUnderlineColor); + + xDocShRef->DoClose(); +} + void SdImportTest2::testTdf103876() { // Title text shape's placeholder text did not inherit the corresponding text properties |