summaryrefslogtreecommitdiff
path: root/xmloff/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-12-13 08:41:10 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-12-13 10:10:10 +0100
commit7d1e4d12baa85d47f5945872a3bc186dd6ce1889 (patch)
tree8a93e32e5bf381addea2aefac964b2b0a48b1869 /xmloff/qa
parent416e38c589635b6817a550cb9272e68ddc9bc9e9 (diff)
ODP import/export: refer to theme from shape text color with effects
Handle luminance modulation and offset (i.e. lighter and darker colors). Change-Id: I536bbca1ed994e991c7ceac153d6a47cb6ef35f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126722 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'xmloff/qa')
-rw-r--r--xmloff/qa/unit/data/refer-to-theme.odpbin14488 -> 14547 bytes
-rw-r--r--xmloff/qa/unit/draw.cxx17
2 files changed, 17 insertions, 0 deletions
diff --git a/xmloff/qa/unit/data/refer-to-theme.odp b/xmloff/qa/unit/data/refer-to-theme.odp
index 83bad49b5f56..cba4bfda1538 100644
--- a/xmloff/qa/unit/data/refer-to-theme.odp
+++ b/xmloff/qa/unit/data/refer-to-theme.odp
Binary files differ
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index a61ef6de2717..f13a60082d7d 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -195,10 +195,27 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testReferToTheme)
// i.e. only the direct color was written, but not the theme reference.
assertXPath(pXmlDoc, "//style:style[@style:name='T1']/style:text-properties", "theme-color",
"accent1");
+ assertXPathNoAttribute(pXmlDoc, "//style:style[@style:name='T1']/style:text-properties",
+ "color-lum-mod");
+ assertXPathNoAttribute(pXmlDoc, "//style:style[@style:name='T1']/style:text-properties",
+ "color-lum-off");
+
assertXPath(pXmlDoc, "//style:style[@style:name='T2']/style:text-properties", "theme-color",
"accent1");
+ // Without the accompanying fix in place, this test would have failed with:
+ // - XPath '//style:style[@style:name='T2']/style:text-properties' no attribute 'color-lum-mod' exist
+ // i.e. effects on a referenced theme color were lost.
+ assertXPath(pXmlDoc, "//style:style[@style:name='T2']/style:text-properties", "color-lum-mod",
+ "40%");
+ assertXPath(pXmlDoc, "//style:style[@style:name='T2']/style:text-properties", "color-lum-off",
+ "60%");
+
assertXPath(pXmlDoc, "//style:style[@style:name='T3']/style:text-properties", "theme-color",
"accent1");
+ assertXPath(pXmlDoc, "//style:style[@style:name='T3']/style:text-properties", "color-lum-mod",
+ "75%");
+ assertXPathNoAttribute(pXmlDoc, "//style:style[@style:name='T3']/style:text-properties",
+ "color-lum-off");
}
CPPUNIT_PLUGIN_IMPLEMENT();