sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx |binary sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx | 43 ++++++++++ 2 files changed, 43 insertions(+)
New commits: commit 353c135c81bdf64fa6e19af4f123c7ce0ee95f1b Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Mon Jun 19 15:48:56 2023 +0900 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Aug 11 09:07:20 2023 +0200 sw: Test paragraph level text background Change-Id: Icea365ae036cae49749dd24bb8412775fafbd6c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153247 Tested-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155512 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx new file mode 100644 index 000000000000..5b012f01333b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/Test_ThemeTextParaBackgroundColor.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx index f9e7155859ea..45bd8014f1d3 100644 --- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx @@ -97,6 +97,49 @@ DECLARE_SW_ROUNDTRIP_TEST(testCharUnderlineTheme_DOCX, "Test_CharUnderlineThemeC CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue); } +DECLARE_SW_ROUNDTRIP_TEST(testParaBackgroundTheme_DOCX, "Test_ThemeTextParaBackgroundColor.docx", + nullptr, Test) +{ + { + auto xParagraph = getParagraph(1); + CPPUNIT_ASSERT(xParagraph.is()); + auto xComplexColor = getProperty<uno::Reference<util::XComplexColor>>( + xParagraph, "ParaBackgroundComplexColor"); + auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); + CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aComplexColor.getSchemeType()); + auto const& rTransforms = aComplexColor.getTransformations(); + CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size()); + CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTransforms[0].meType); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTransforms[0].mnValue); + } + + { + auto xParagraph = getParagraph(2); + CPPUNIT_ASSERT(xParagraph.is()); + auto xComplexColor = getProperty<uno::Reference<util::XComplexColor>>( + xParagraph, "ParaBackgroundComplexColor"); + auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); + CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, aComplexColor.getSchemeType()); + auto const& rTransforms = aComplexColor.getTransformations(); + CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size()); + CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTransforms[0].meType); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTransforms[0].mnValue); + } + + { + auto xParagraph = getParagraph(3); + CPPUNIT_ASSERT(xParagraph.is()); + auto xComplexColor = getProperty<uno::Reference<util::XComplexColor>>( + xParagraph, "ParaBackgroundComplexColor"); + auto aComplexColor = model::color::getFromXComplexColor(xComplexColor); + CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aComplexColor.getSchemeType()); + auto const& rTransforms = aComplexColor.getTransformations(); + CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size()); + CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTransforms[0].meType); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTransforms[0].mnValue); + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */