diff options
-rw-r--r-- | oox/source/export/drawingml.cxx | 9 | ||||
-rw-r--r-- | sc/qa/unit/data/xlsx/underlineColor.xlsx | bin | 0 -> 9605 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 17 |
3 files changed, 26 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 9ede46300ce4..d2691cc24853 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1362,6 +1362,15 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel WriteSolidFill( color ); } + if( GETAD( CharUnderlineColor ) ) + { + sal_uInt32 color = *static_cast<sal_uInt32 const *>(mAny.getValue()); + + mpFS->startElementNS( XML_a, XML_uFill,FSEND); + WriteSolidFill( color ); + mpFS->endElementNS( XML_a, XML_uFill ); + } + if( GETA( CharFontName ) ) { const char* pitch = NULL; diff --git a/sc/qa/unit/data/xlsx/underlineColor.xlsx b/sc/qa/unit/data/xlsx/underlineColor.xlsx Binary files differnew file mode 100644 index 000000000000..30346ce733db --- /dev/null +++ b/sc/qa/unit/data/xlsx/underlineColor.xlsx diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 4924adcb78a6..4256253a73ec 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -141,6 +141,7 @@ public: void testFontSize(); void testSheetCharacterKerningSpace(); void testSheetCondensedCharacterSpace(); + void testTextUnderlineColor(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -192,6 +193,7 @@ public: CPPUNIT_TEST(testFontSize); CPPUNIT_TEST(testSheetCharacterKerningSpace); CPPUNIT_TEST(testSheetCondensedCharacterSpace); + CPPUNIT_TEST(testTextUnderlineColor); CPPUNIT_TEST_SUITE_END(); @@ -2595,6 +2597,21 @@ void ScExportTest::testSheetCondensedCharacterSpace() xDocSh->DoClose(); } +void ScExportTest::testTextUnderlineColor() +{ + + ScDocShellRef xDocSh = loadDoc("underlineColor.", XLSX); + CPPUNIT_ASSERT(xDocSh.Is()); + + xmlDocPtr pDoc = XPathHelper::parseExport(&(*xDocSh), m_xSFactory, "xl/drawings/drawing1.xml", XLSX); + CPPUNIT_ASSERT(pDoc); + OUString color = getXPath(pDoc, + "/xdr:wsDr/xdr:twoCellAnchor/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr/a:uFill/a:solidFill/a:srgbClr", "val"); + // make sure that the underline color is RED + CPPUNIT_ASSERT(color.equals("ff0000")); +} + + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |