diff options
author | Bartosz Kosiorek <gang65@poczta.onet.pl> | 2017-05-24 01:13:26 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-06-01 14:08:42 +0200 |
commit | 0b0cc6a3306a03798fdbe766976480160d0d5c22 (patch) | |
tree | b963fbcaba1ebda43986b9c48697ae7ac647c449 /sc | |
parent | bd8b8ccd3110a9f6fa7fb4f2aec3275f7b650052 (diff) |
tdf#104219 Don't export color information when color is automatic
In LibreOffice and MS Office, there are two types of colors:
- Automatic (which is taken from settings) and Fixed (which is set by RGB value).
OOXML is setting automatic color by default, by not providing any RGB color.
To preserve automatic color we need to not export
RGB color during OOXML export.
Change-Id: I8895230c4fffc9d8741f3eff37e64c4823d71da8
Reviewed-on: https://gerrit.libreoffice.org/37970
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 8129ad7b22dceeb2fef13741aa509c2229cf03de)
Reviewed-on: https://gerrit.libreoffice.org/38285
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/xlsx/underlineColor.xlsx | bin | 9605 -> 9915 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 18 |
2 files changed, 13 insertions, 5 deletions
diff --git a/sc/qa/unit/data/xlsx/underlineColor.xlsx b/sc/qa/unit/data/xlsx/underlineColor.xlsx Binary files differindex 30346ce733db..124391b3bc11 100644 --- a/sc/qa/unit/data/xlsx/underlineColor.xlsx +++ 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 253134d5d29f..fb4d496243bf 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -3452,16 +3452,24 @@ void ScExportTest::testSheetCondensedCharacterSpaceXLSX() void ScExportTest::testTextUnderlineColorXLSX() { - ScDocShellRef xDocSh = loadDoc("underlineColor.", FORMAT_XLSX); CPPUNIT_ASSERT(xDocSh.is()); xmlDocPtr pDoc = XPathHelper::parseExport(*xDocSh, m_xSFactory, "xl/drawings/drawing1.xml", FORMAT_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_EQUAL(OUString("ff0000"), color); + // Make sure the underline type is double line + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr", "u", "dbl"); + + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr", "b", "1"); + // Make sure that the underline color is RED + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[1]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr/a:uFill/a:solidFill/a:srgbClr", "val", "ff0000"); + + // Make sure the underline type is drawn with heavy line + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr", "u", "heavy"); + // tdf#104219 Make sure that uFill is not existing and uFillTx is set. + // It mean that color is automatic, should be the same color as the text. + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr/a:uFill", 0); + assertXPath(pDoc, "/xdr:wsDr/xdr:twoCellAnchor[2]/xdr:sp[1]/xdr:txBody/a:p[1]/a:r[1]/a:rPr/a:uFillTx", 1); } void ScExportTest::testSheetRunParagraphPropertyXLSX() |