From 73563ad36cc5f3c9b8b967037946fbd0209601f7 Mon Sep 17 00:00:00 2001 From: Aron Budea Date: Tue, 23 Jun 2026 09:50:22 +0200 Subject: [PATCH] oox: export satMod color transformation into themes For more complete OOXML export. satMod (saturation modulation) of colors was already imported and stored, but didn't get exported. Change-Id: I4dd2e58382749c3b3a47647399e48517a41393bf Signed-off-by: Aron Budea Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/5054 Tested-by: Jenkins CPCI Reviewed-by: Mike Kaganski (cherry picked from commit 40aaaeff1d2ff4f6ba5cd2c8fc80356d38996e03) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208066 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- oox/source/export/ThemeExport.cxx | 1 + sw/qa/extras/ooxmlexport/ooxmlw14export.cxx | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/oox/source/export/ThemeExport.cxx b/oox/source/export/ThemeExport.cxx index 3c0806a56eab..6cc4e217e250 100644 --- a/oox/source/export/ThemeExport.cxx +++ b/oox/source/export/ThemeExport.cxx @@ -162,6 +162,7 @@ namespace { constexpr auto constTransformTypeTokenMap = frozen::make_unordered_map({ + { model::TransformationType::SatMod, XML_satMod }, { model::TransformationType::Tint, XML_tint }, { model::TransformationType::Shade, XML_shade }, { model::TransformationType::LumMod, XML_lumMod }, diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx index 3e3a4e928f0b..b4db21ce32de 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx @@ -83,6 +83,18 @@ CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_GlowShadowReflection) CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "kx").match("0")); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "ky").match("0")); CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[7]/w:rPr/w14:reflection", "algn").match("bl")); + + // Some tests on exporting theme color transformations, not specific to w14 + pXmlDoc = parseExport(u"word/theme/theme1.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + OString sBasePath = "/a:theme/a:themeElements/a:fmtScheme/a:fillStyleLst" + "/a:gradFill[1]/a:gsLst/a:gs[1]/a:schemeClr"_ostr; + + /// Same values as in original theme1.xml must remain + assertXPath(pXmlDoc, sBasePath, "val", u"phClr"); + assertXPath(pXmlDoc, sBasePath + "/a:lumMod", "val", u"110000"); + assertXPath(pXmlDoc, sBasePath + "/a:satMod", "val", u"105000"); + assertXPath(pXmlDoc, sBasePath + "/a:tint", "val", u"67000"); } CPPUNIT_TEST_FIXTURE(Test, Test_TextEffects_TextOutline)