include/docmodel/color/ComplexColor.hxx | 16 +++++----- include/docmodel/color/Transformation.hxx | 8 ++++- oox/qa/unit/drawingml.cxx | 16 +++++----- oox/qa/unit/wpc_drawing_canvas.cxx | 4 +- sd/qa/unit/ThemeTest.cxx | 6 ++- sd/qa/unit/uiimpress.cxx | 12 +++++-- svx/qa/unit/xoutdev.cxx | 6 ++- sw/qa/core/theme/ThemeTest.cxx | 39 ++++++++++++------------- sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx | 16 +++++----- xmloff/qa/unit/draw.cxx | 31 ++++++++++--------- 10 files changed, 86 insertions(+), 68 deletions(-)
New commits: commit c1535d1368bc1b67a462b71ae91484bf2220080e Author: Kurt Nordback <[email protected]> AuthorDate: Wed Nov 19 21:39:52 2025 +0900 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Tue Dec 9 01:51:01 2025 +0100 tdf#167941 Extend Transformation value from sal_Int16 to sal_Int32 Needed to make it compatible with oox::drawingml::Color. Change-Id: I129c03c0510822682afc1eca35c5b912c5d94b3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194203 Reviewed-by: Tomaž Vajngerl <[email protected]> Tested-by: Jenkins (cherry picked from commit 6195f52e3ff1ce5a658fa634717c066be370dc9f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195046 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/include/docmodel/color/ComplexColor.hxx b/include/docmodel/color/ComplexColor.hxx index 01709b12f0a3..bd149b67a518 100644 --- a/include/docmodel/color/ComplexColor.hxx +++ b/include/docmodel/color/ComplexColor.hxx @@ -22,14 +22,14 @@ namespace model { enum class ColorType { - Unused, - RGB, - CRGB, - HSL, - Theme, - Palette, - System, - Placeholder + Unused, /// Color is not used, or undefined. + RGB, /// Absolute RGB (r/g/b: 0...255). + CRGB, /// Relative RGB (r/g/b: 0...100000) + HSL, /// HSL (hue: 0...21600000, sat/lum: 0...100000). + Theme, /// Color from scheme. + Palette, /// Color from application defined palette. + System, /// Color from system palette. + Placeholder, /// Placeholder color in theme style lists. }; enum class SystemColorType diff --git a/include/docmodel/color/Transformation.hxx b/include/docmodel/color/Transformation.hxx index fa98b013d035..bc69e03e941e 100644 --- a/include/docmodel/color/Transformation.hxx +++ b/include/docmodel/color/Transformation.hxx @@ -59,7 +59,13 @@ struct DOCMODEL_DLLPUBLIC Transformation { TransformationType meType = TransformationType::Undefined; - sal_Int16 mnValue = 0; /// percentage value -10000 to +10000 + sal_Int32 mnValue = 0; /// percentage value -10000 to +10000 + + Transformation(TransformationType eType, sal_Int32 nVal) + : meType(eType) + , mnValue(nVal) + { + } bool operator==(const Transformation& rTransformation) const { diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index e5fc762aa12d..429ec491a25b 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -435,10 +435,12 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme) CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, aComplexColor.getTransformations()[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), + aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), + aComplexColor.getTransformations()[1].mnValue); } } @@ -519,7 +521,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColorTint_Table) auto const& rTrans = aComplexColor.getTransformations(); CPPUNIT_ASSERT_EQUAL(size_t(1), rTrans.size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrans[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans[0].mnValue); } } } @@ -548,9 +550,9 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape) auto const& rTrans = aComplexColor.getTransformations(); CPPUNIT_ASSERT_EQUAL(size_t(2), rTrans.size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans[1].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans[1].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), rTrans[1].mnValue); } CPPUNIT_ASSERT(xShape->getPropertyValue(u"LineComplexColor"_ustr) >>= xComplexColor); @@ -562,7 +564,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape) auto const& rTrans = aComplexColor.getTransformations(); CPPUNIT_ASSERT_EQUAL(size_t(1), rTrans.size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5000), rTrans[0].mnValue); } } // check line and fill theme color of shape2 @@ -588,7 +590,7 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape) auto const& rTrans = aComplexColor.getTransformations(); CPPUNIT_ASSERT_EQUAL(size_t(1), rTrans.size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7500), rTrans[0].mnValue); } } } diff --git a/oox/qa/unit/wpc_drawing_canvas.cxx b/oox/qa/unit/wpc_drawing_canvas.cxx index 0e35891835af..8790ceda9d6e 100644 --- a/oox/qa/unit/wpc_drawing_canvas.cxx +++ b/oox/qa/unit/wpc_drawing_canvas.cxx @@ -187,9 +187,9 @@ CPPUNIT_TEST_FIXTURE(TestWPC, WPC_ThemeColor) auto const& rTrans = aComplexColor.getTransformations(); CPPUNIT_ASSERT_EQUAL(size_t(2), rTrans.size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), rTrans[1].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7500), rTrans[1].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans[1].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2500), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2500), rTrans[0].mnValue); } } // Check colors of 'heart' shape diff --git a/sd/qa/unit/ThemeTest.cxx b/sd/qa/unit/ThemeTest.cxx index 7feb6e5588e7..59b9b8891854 100644 --- a/sd/qa/unit/ThemeTest.cxx +++ b/sd/qa/unit/ThemeTest.cxx @@ -115,10 +115,12 @@ CPPUNIT_TEST_FIXTURE(ThemeTest, testThemeChange) CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, aComplexColor.getTransformations()[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), + aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), + aComplexColor.getTransformations()[1].mnValue); } // When changing the master slide of slide 1 to use the theme of the second master slide: diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 7990ee90763d..87e563ed030e 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -1734,10 +1734,12 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testCharColorTheme) CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, aComplexColor.getTransformations()[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2000), + aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), + aComplexColor.getTransformations()[1].mnValue); } } @@ -1782,10 +1784,12 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme) CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, aComplexColor.getTransformations()[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), + aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), + aComplexColor.getTransformations()[1].mnValue); } } diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx index a5412ae8d490..905a379c0cfa 100644 --- a/svx/qa/unit/xoutdev.cxx +++ b/svx/qa/unit/xoutdev.cxx @@ -119,10 +119,12 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testFillColorThemeUnoApi) CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getThemeColorType()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, aComplexColor.getTransformations()[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2000), + aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), + aComplexColor.getTransformations()[1].mnValue); } } diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx index 7ae4e2fa2bbf..2a9fe46fafa4 100644 --- a/sw/qa/core/theme/ThemeTest.cxx +++ b/sw/qa/core/theme/ThemeTest.cxx @@ -98,17 +98,17 @@ void checkFillStyles(std::vector<model::FillStyle> const& rStyleList) { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(11000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10500), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10500), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6700), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6700), rTrasnsformation.mnValue); } } { @@ -120,17 +120,17 @@ void checkFillStyles(std::vector<model::FillStyle> const& rStyleList) { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10500), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10500), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10300), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10300), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(7300), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7300), rTrasnsformation.mnValue); } } { @@ -142,17 +142,17 @@ void checkFillStyles(std::vector<model::FillStyle> const& rStyleList) { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10500), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10500), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10900), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10900), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(8100), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8100), rTrasnsformation.mnValue); } } } @@ -179,17 +179,17 @@ void checkFillStyles(std::vector<model::FillStyle> const& rStyleList) { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10300), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10300), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10200), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10200), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(9400), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(9400), rTrasnsformation.mnValue); } } { @@ -200,17 +200,17 @@ void checkFillStyles(std::vector<model::FillStyle> const& rStyleList) { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(11000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(11000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(10000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10000), rTrasnsformation.mnValue); } } { @@ -221,17 +221,17 @@ void checkFillStyles(std::vector<model::FillStyle> const& rStyleList) { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(9900), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(9900), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(12000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(12000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(7800), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7800), rTrasnsformation.mnValue); } } } @@ -329,7 +329,8 @@ void checkEffects(std::vector<model::EffectStyle> const& rEffectStyleList) CPPUNIT_ASSERT_EQUAL(size_t(1), rEffect.maColor.getTransformations().size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::Alpha, rEffect.maColor.getTransformations()[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6300), rEffect.maColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6300), + rEffect.maColor.getTransformations()[0].mnValue); } } diff --git a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx index da76f6a1c112..e32bf9537a76 100644 --- a/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxml_ThemeExport.cxx @@ -33,7 +33,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePortionLevelCharColor_ODF, 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(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); } DECLARE_OOXMLEXPORT_TEST(testThemePortionLevelCharColor_DOCX, @@ -48,7 +48,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePortionLevelCharColor_DOCX, 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(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); } DECLARE_OOXMLEXPORT_TEST(testThemePortionBorderColor_DOCX, "Test_ThemeBorderColor.docx") @@ -63,7 +63,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePortionBorderColor_DOCX, "Test_ThemeBorderColo 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(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); } { auto xComplexColor = getProperty<uno::Reference<util::XComplexColor>>( @@ -73,7 +73,7 @@ DECLARE_OOXMLEXPORT_TEST(testThemePortionBorderColor_DOCX, "Test_ThemeBorderColo 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(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); } CPPUNIT_ASSERT(isPropertyVoid(xParagraph, u"LeftBorderComplexColor"_ustr)); @@ -92,7 +92,7 @@ DECLARE_OOXMLEXPORT_TEST(testCharUnderlineTheme_DOCX, "Test_CharUnderlineThemeCo auto const& rTransforms = aComplexColor.getTransformations(); CPPUNIT_ASSERT_EQUAL(size_t(1), rTransforms.size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, rTransforms[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2509), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2509), rTransforms[0].mnValue); } DECLARE_OOXMLEXPORT_TEST(testParaBackgroundTheme_DOCX, "Test_ThemeTextParaBackgroundColor.docx") @@ -107,7 +107,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaBackgroundTheme_DOCX, "Test_ThemeTextParaBackgr 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_ASSERT_EQUAL(static_cast<sal_Int32>(8000), rTransforms[0].mnValue); } { @@ -120,7 +120,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaBackgroundTheme_DOCX, "Test_ThemeTextParaBackgr 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_ASSERT_EQUAL(static_cast<sal_Int32>(8000), rTransforms[0].mnValue); } { @@ -133,7 +133,7 @@ DECLARE_OOXMLEXPORT_TEST(testParaBackgroundTheme_DOCX, "Test_ThemeTextParaBackgr 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_ASSERT_EQUAL(static_cast<sal_Int32>(8000), rTransforms[0].mnValue); } } diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index 102c656ef937..e356e95d00a2 100644 --- a/xmloff/qa/unit/draw.cxx +++ b/xmloff/qa/unit/draw.cxx @@ -250,10 +250,10 @@ void checkFillAndLineComplexColors(uno::Reference<drawing::XShape> const& xShape CPPUNIT_ASSERT_EQUAL(size_t(2), aComplexColor.getTransformations().size()); auto const& rTrans1 = aComplexColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), rTrans2.mnValue); } { uno::Reference<util::XComplexColor> xComplexColor; @@ -264,10 +264,10 @@ void checkFillAndLineComplexColors(uno::Reference<drawing::XShape> const& xShape CPPUNIT_ASSERT_EQUAL(size_t(2), aComplexColor.getTransformations().size()); auto const& rTrans1 = aComplexColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans2.mnValue); } } @@ -360,10 +360,10 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_ASSERT_EQUAL(size_t(2), aComplexColor.getTransformations().size()); auto const& rTrans1 = aComplexColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), rTrans2.mnValue); } { uno::Reference<drawing::XShape> xShape(getShape(1)); @@ -377,10 +377,10 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_ASSERT_EQUAL(size_t(2), aComplexColor.getTransformations().size()); auto const& rTrans1 = aComplexColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans2.mnValue); } { uno::Reference<drawing::XShape> xShape(getShape(2)); @@ -394,7 +394,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_ASSERT_EQUAL(size_t(1), aComplexColor.getTransformations().size()); auto const& rTrans1 = aComplexColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5000), rTrans1.mnValue); } // Char color theme @@ -414,10 +414,10 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_ASSERT_EQUAL(size_t(2), rTransforms.size()); auto const& rTrans1 = rTransforms[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2000), rTrans1.mnValue); auto const& rTrans2 = rTransforms[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), rTrans2.mnValue); } // Shape 5 { @@ -435,10 +435,10 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_ASSERT_EQUAL(size_t(2), rTransforms.size()); auto const& rTrans1 = rTransforms[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), rTrans1.mnValue); auto const& rTrans2 = rTransforms[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans2.mnValue); } // Shape 6 { @@ -455,7 +455,7 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTextAndFillThemeColorExportImport) CPPUNIT_ASSERT_EQUAL(size_t(1), aComplexColor.getTransformations().size()); auto const& rTrans1 = aComplexColor.getTransformations()[0]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(5000), rTrans1.mnValue); } } @@ -476,7 +476,8 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColor_ShapeFill) CPPUNIT_ASSERT_EQUAL(size_t(1), aComplexColor.getTransformations().size()); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, aComplexColor.getTransformations()[0].meType); - CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7500), + aComplexColor.getTransformations()[0].mnValue); } CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTableInShape)
