diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-12-31 20:59:03 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-13 13:44:09 +0000 |
commit | 3eb53d327fb5d9689b799ff991a6c53c05eff496 (patch) | |
tree | 91a11362d23ef451d89b5efdcc4ec0e7866e5c72 /oox/qa | |
parent | a6d44c4684f9b037e5c762430df78af2fc85cf34 (diff) |
xmloff: use XThemeColor in ODF, change the format for themes
Change the xmloff filter to use XThemeColor and the associated
proprties (CharColorThemeReference and FillColorThemeReference).
Change the ODF format for referencing a theme color - make it an
element instead a series of attributes on the *-properties style
element.
Change-Id: I0fa7d8ebffecc02897b7fe9824d6f1776ef36380
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144923
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox/qa')
-rw-r--r-- | oox/qa/unit/data/ReferenceShapeFill.odp | bin | 0 -> 13329 bytes | |||
-rw-r--r-- | oox/qa/unit/data/refer-to-theme-shape-fill.odp | bin | 14638 -> 0 bytes | |||
-rw-r--r-- | oox/qa/unit/export.cxx | 21 |
3 files changed, 7 insertions, 14 deletions
diff --git a/oox/qa/unit/data/ReferenceShapeFill.odp b/oox/qa/unit/data/ReferenceShapeFill.odp Binary files differnew file mode 100644 index 000000000000..91544d20b302 --- /dev/null +++ b/oox/qa/unit/data/ReferenceShapeFill.odp diff --git a/oox/qa/unit/data/refer-to-theme-shape-fill.odp b/oox/qa/unit/data/refer-to-theme-shape-fill.odp Binary files differdeleted file mode 100644 index 3a32aa71690a..000000000000 --- a/oox/qa/unit/data/refer-to-theme-shape-fill.odp +++ /dev/null diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx index 289bdf49611c..fdf97b328f45 100644 --- a/oox/qa/unit/export.cxx +++ b/oox/qa/unit/export.cxx @@ -353,27 +353,20 @@ CPPUNIT_TEST_FIXTURE(Test, testReferToTheme) assertXPath(pXmlDoc, "//p:sp[3]/p:txBody/a:p/a:r/a:rPr/a:solidFill/a:schemeClr/a:lumOff", 0); } -CPPUNIT_TEST_FIXTURE(Test, testReferToThemeShapeFill) +CPPUNIT_TEST_FIXTURE(Test, testThemeColor_ShapeFill) { // Given an ODP file that contains references to a theme for shape fill: - loadFromURL(u"refer-to-theme-shape-fill.odp"); + loadFromURL(u"ReferenceShapeFill.odp"); // When saving that document: save("Impress Office Open XML"); - // Then make sure the shape fill color is a scheme color: - // Without the accompanying fix in place, this test would have failed with: - // - Expected: 1 - // - Actual : 0 - // i.e. the <a:schemeClr> element was not written. Note that this was already working from PPTX - // files via grab-bags, so this test intentionally uses an ODP file as input. + // Then make sure the shape fill color is a scheme color. + // Note that this was already working from PPTX files via grab-bags, + //so this test intentionally uses an ODP file as input. xmlDocUniquePtr pXmlDoc = parseExport("ppt/slides/slide1.xml"); - assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr", "val", "accent1"); - // Without the accompanying fix in place, this test would have failed with: - // - XPath '//p:sp[1]/p:spPr/a:solidFill/a:schemeClr/a:lumMod' number of nodes is incorrect - // i.e. the effects of the themed color were lost. - assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr/a:lumMod", "val", "40000"); - assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr/a:lumOff", "val", "60000"); + assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr", "val", "accent6"); + assertXPath(pXmlDoc, "//p:sp[1]/p:spPr/a:solidFill/a:schemeClr/a:lumMod", "val", "75000"); } CPPUNIT_TEST_FIXTURE(Test, testTdf146690_endParagraphRunPropertiesNewLinesTextSize) |