Kaydet (Commit) 24be7ef5 authored tarafından PriyankaGaikwad's avatar PriyankaGaikwad Kaydeden (comit) Caolán McNamara

tdf#90828 FILESAVE:XLSX export of underline color for text inside textbox

Problem Description:
Unable to save .xlsx with underline color for text inside textbox.

Current behavior:
After RT text underline color was not exported

Expected behaviour:
After RT text underline color should export

Added export support for <a:uFill>

Change-Id: If8ffeb07f2f5e0b768689647e480792ea9c8540a
Reviewed-on: https://gerrit.libreoffice.org/15514Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 3e4d2043
...@@ -1362,6 +1362,15 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel ...@@ -1362,6 +1362,15 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel
WriteSolidFill( color ); 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 ) ) if( GETA( CharFontName ) )
{ {
const char* pitch = NULL; const char* pitch = NULL;
......
...@@ -141,6 +141,7 @@ public: ...@@ -141,6 +141,7 @@ public:
void testFontSize(); void testFontSize();
void testSheetCharacterKerningSpace(); void testSheetCharacterKerningSpace();
void testSheetCondensedCharacterSpace(); void testSheetCondensedCharacterSpace();
void testTextUnderlineColor();
CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test); CPPUNIT_TEST(test);
...@@ -192,6 +193,7 @@ public: ...@@ -192,6 +193,7 @@ public:
CPPUNIT_TEST(testFontSize); CPPUNIT_TEST(testFontSize);
CPPUNIT_TEST(testSheetCharacterKerningSpace); CPPUNIT_TEST(testSheetCharacterKerningSpace);
CPPUNIT_TEST(testSheetCondensedCharacterSpace); CPPUNIT_TEST(testSheetCondensedCharacterSpace);
CPPUNIT_TEST(testTextUnderlineColor);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
...@@ -2595,6 +2597,21 @@ void ScExportTest::testSheetCondensedCharacterSpace() ...@@ -2595,6 +2597,21 @@ void ScExportTest::testSheetCondensedCharacterSpace()
xDocSh->DoClose(); 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_TEST_SUITE_REGISTRATION(ScExportTest);
CPPUNIT_PLUGIN_IMPLEMENT(); 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