sc/qa/unit/data/xlsx/tdf134459_HeaderFooterColor.xlsx |binary sc/qa/unit/subsequent_export-test.cxx | 20 ++++++++++++++++++ sc/source/filter/excel/xehelper.cxx | 7 ++++++ 3 files changed, 27 insertions(+)
New commits: commit a8856d9b32c23151c7031282ba87dcdda4bbad89 Author: Attila Szűcs <szucs.atti...@nisz.hu> AuthorDate: Thu Jul 16 09:34:31 2020 +0200 Commit: Gabor Kelemen <kelemen.gab...@nisz.hu> CommitDate: Fri Jul 31 19:22:46 2020 +0200 tdf#134459 XLSX export: fix missing font color in header/footer Co-authored-by: Tibor Nagy (NISZ) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98873 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit 2abaaf97e95bf6149378c6cd5e58cdb2ce78dc4b) Change-Id: I7aacbad1c4052b2480630d0b98175b46cf2aeed0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99839 Tested-by: Gabor Kelemen <kelemen.gab...@nisz.hu> Reviewed-by: Gabor Kelemen <kelemen.gab...@nisz.hu> diff --git a/sc/qa/unit/data/xlsx/tdf134459_HeaderFooterColor.xlsx b/sc/qa/unit/data/xlsx/tdf134459_HeaderFooterColor.xlsx new file mode 100644 index 000000000000..fe799886c062 Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf134459_HeaderFooterColor.xlsx differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index e220803967cb..1d0a3c83ee54 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -232,6 +232,7 @@ public: void testRotatedImageODS(); void testTdf128976(); void testTdf120502(); + void testTdf134459_HeaderFooterColorXLSX(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -364,6 +365,7 @@ public: CPPUNIT_TEST(testRotatedImageODS); CPPUNIT_TEST(testTdf128976); CPPUNIT_TEST(testTdf120502); + CPPUNIT_TEST(testTdf134459_HeaderFooterColorXLSX); CPPUNIT_TEST_SUITE_END(); @@ -4628,6 +4630,24 @@ void ScExportTest::testTdf120502() assertXPath(pSheet1, "/x:worksheet/x:cols/x:col", "max", OUString::number(nMaxCol + 1)); } +void ScExportTest::testTdf134459_HeaderFooterColorXLSX() +{ + // Colors in header and footer should be exported, and imported properly + ScDocShellRef xShell = loadDoc("tdf134459_HeaderFooterColor.", FORMAT_XLSX); + CPPUNIT_ASSERT(xShell.is()); + + ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX); + CPPUNIT_ASSERT(xDocSh.is()); + + xmlDocPtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/worksheets/sheet1.xml", FORMAT_XLSX); + CPPUNIT_ASSERT(pDoc); + + assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddHeader", "&L&Kc06040l&C&K4c3789c&Rr"); + assertXPathContent(pDoc, "/x:worksheet/x:headerFooter/x:oddFooter", "&Ll&C&K64cf5fc&R&Kcd15aar"); + + xDocSh->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index e75958935d69..4e0cdc58f275 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -780,6 +780,13 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico (nTmpUnderl == EXC_FONTUNDERL_SINGLE)? aParaText.append("&U") : aParaText.append("&E"); } + // font color + aNewData.maColor = aFont.GetColor(); + if ( !aFontData.maColor.IsRGBEqual( aNewData.maColor ) ) + { + aParaText.append("&K").append(aNewData.maColor.AsRGBHexString()); + } + // strikeout aNewData.mbStrikeout = (aFont.GetStrikeout() != STRIKEOUT_NONE); if( aFontData.mbStrikeout != aNewData.mbStrikeout ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits