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, 68 insertions(+), 86 deletions(-)
New commits: commit 202ee2b6b24d816ebd9c3f1395db39464a9f2f47 Author: Kurt Nordback <[email protected]> AuthorDate: Tue Jan 20 09:46:31 2026 -0700 Commit: Tomaž Vajngerl <[email protected]> CommitDate: Mon Jan 26 08:18:35 2026 +0100 Revert "tdf#167941 Extend Transformation value from sal_Int16 to sal_Int32" This reverts commit c1535d1368bc1b67a462b71ae91484bf2220080e. Change-Id: Ib5f6acbe2c2e1538cdb6fcb6bd7a893613e300e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197896 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Tomaž Vajngerl <[email protected]> diff --git a/include/docmodel/color/ComplexColor.hxx b/include/docmodel/color/ComplexColor.hxx index bd149b67a518..01709b12f0a3 100644 --- a/include/docmodel/color/ComplexColor.hxx +++ b/include/docmodel/color/ComplexColor.hxx @@ -22,14 +22,14 @@ namespace model { enum class ColorType { - 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. + Unused, + RGB, + CRGB, + HSL, + Theme, + Palette, + System, + Placeholder }; enum class SystemColorType diff --git a/include/docmodel/color/Transformation.hxx b/include/docmodel/color/Transformation.hxx index bc69e03e941e..fa98b013d035 100644 --- a/include/docmodel/color/Transformation.hxx +++ b/include/docmodel/color/Transformation.hxx @@ -59,13 +59,7 @@ struct DOCMODEL_DLLPUBLIC Transformation { TransformationType meType = TransformationType::Undefined; - sal_Int32 mnValue = 0; /// percentage value -10000 to +10000 - - Transformation(TransformationType eType, sal_Int32 nVal) - : meType(eType) - , mnValue(nVal) - { - } + sal_Int16 mnValue = 0; /// percentage value -10000 to +10000 bool operator==(const Transformation& rTransformation) const { diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index 429ec491a25b..e5fc762aa12d 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -435,12 +435,10 @@ 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(static_cast<sal_Int32>(6000), - aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), - aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[1].mnValue); } } @@ -521,7 +519,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(static_cast<sal_Int32>(4000), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans[0].mnValue); } } } @@ -550,9 +548,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(static_cast<sal_Int32>(4000), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans[1].meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), rTrans[1].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans[1].mnValue); } CPPUNIT_ASSERT(xShape->getPropertyValue(u"LineComplexColor"_ustr) >>= xComplexColor); @@ -564,7 +562,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(static_cast<sal_Int32>(5000), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans[0].mnValue); } } // check line and fill theme color of shape2 @@ -590,7 +588,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(static_cast<sal_Int32>(7500), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), rTrans[0].mnValue); } } } diff --git a/oox/qa/unit/wpc_drawing_canvas.cxx b/oox/qa/unit/wpc_drawing_canvas.cxx index 8790ceda9d6e..0e35891835af 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(static_cast<sal_Int32>(7500), rTrans[1].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), rTrans[1].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans[1].meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2500), rTrans[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2500), rTrans[0].mnValue); } } // Check colors of 'heart' shape diff --git a/sd/qa/unit/ThemeTest.cxx b/sd/qa/unit/ThemeTest.cxx index 59b9b8891854..7feb6e5588e7 100644 --- a/sd/qa/unit/ThemeTest.cxx +++ b/sd/qa/unit/ThemeTest.cxx @@ -115,12 +115,10 @@ 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(static_cast<sal_Int32>(4000), - aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), - aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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 4de52c2268b6..ee63ee9a8261 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -1715,12 +1715,10 @@ 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(static_cast<sal_Int32>(2000), - aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), - aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aComplexColor.getTransformations()[1].mnValue); } } @@ -1765,12 +1763,10 @@ 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(static_cast<sal_Int32>(4000), - aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), - aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[1].mnValue); } } diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx index 905a379c0cfa..a5412ae8d490 100644 --- a/svx/qa/unit/xoutdev.cxx +++ b/svx/qa/unit/xoutdev.cxx @@ -119,12 +119,10 @@ 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(static_cast<sal_Int32>(2000), - aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aComplexColor.getTransformations()[0].mnValue); CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, aComplexColor.getTransformations()[1].meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), - aComplexColor.getTransformations()[1].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aComplexColor.getTransformations()[1].mnValue); } } diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx index 2a9fe46fafa4..7ae4e2fa2bbf 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(static_cast<sal_Int32>(11000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(11000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10500), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10500), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6700), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(10500), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10500), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10300), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10300), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7300), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(10500), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10500), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10900), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10900), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8100), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(10300), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10300), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10200), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10200), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(9400), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(11000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(11000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(10000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(10000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(9900), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(9900), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::SatMod, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(12000), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(12000), rTrasnsformation.mnValue); } { auto const& rTrasnsformation = rGradientStop.maColor.getTransformations()[2]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::Shade, rTrasnsformation.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(7800), rTrasnsformation.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(7800), rTrasnsformation.mnValue); } } } @@ -329,8 +329,7 @@ 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(static_cast<sal_Int32>(6300), - rEffect.maColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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 e32bf9537a76..da76f6a1c112 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(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(4000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(2509), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(8000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(8000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(8000), rTransforms[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTransforms[0].mnValue); } } diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx index 265b021430cf..799a06d006dd 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(static_cast<sal_Int32>(4000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(6000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(2000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(6000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue); auto const& rTrans2 = aComplexColor.getTransformations()[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(5000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(2000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), rTrans1.mnValue); auto const& rTrans2 = rTransforms[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(8000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(6000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue); auto const& rTrans2 = rTransforms[1]; CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType); - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4000), rTrans2.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(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(static_cast<sal_Int32>(5000), rTrans1.mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans1.mnValue); } } @@ -476,8 +476,7 @@ 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(static_cast<sal_Int32>(7500), - aComplexColor.getTransformations()[0].mnValue); + CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), aComplexColor.getTransformations()[0].mnValue); } CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTableInShape)
