diff options
-rw-r--r-- | include/editeng/unoprnms.hxx | 2 | ||||
-rw-r--r-- | include/svx/unoshprp.hxx | 2 | ||||
-rw-r--r-- | svx/qa/unit/xoutdev.cxx | 14 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 26 |
4 files changed, 44 insertions, 0 deletions
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx index d7045b5b56be..8d02798ea4e2 100644 --- a/include/editeng/unoprnms.hxx +++ b/include/editeng/unoprnms.hxx @@ -32,6 +32,8 @@ inline constexpr OUStringLiteral UNO_NAME_CHAR_WEIGHT = u"CharWeight"; inline constexpr OUStringLiteral UNO_NAME_FILLSTYLE = u"FillStyle"; inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR = u"FillColor"; inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR_THEME = u"FillColorTheme"; +inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR_LUM_MOD = u"FillColorLumMod"; +inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR_LUM_OFF = u"FillColorLumOff"; inline constexpr OUStringLiteral UNO_NAME_FILLGRADIENT = u"FillGradient"; inline constexpr OUStringLiteral UNO_NAME_FILLGRADIENTNAME = u"FillGradientName"; inline constexpr OUStringLiteral UNO_NAME_FILLHATCH = u"FillHatch"; diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index 4dba8617f7a2..bd08927d5039 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -290,6 +290,8 @@ { UNO_NAME_FILLTRANSPARENCEGRADIENTNAME, XATTR_FILLFLOATTRANSPARENCE, ::cppu::UnoType<OUString>::get(), 0, MID_NAME }, \ { UNO_NAME_FILLCOLOR_2, XATTR_SECONDARYFILLCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, \ { UNO_NAME_FILLCOLOR_THEME, XATTR_FILLCOLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_THEME_INDEX}, \ + { UNO_NAME_FILLCOLOR_LUM_MOD, XATTR_FILLCOLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_MOD}, \ + { UNO_NAME_FILLCOLOR_LUM_OFF, XATTR_FILLCOLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_OFF}, \ { UNO_NAME_GRAPHIC_GRAPHICCROP, SDRATTR_GRAFCROP , ::cppu::UnoType<css::text::GraphicCrop>::get(), 0, 0 }, #define EDGERADIUS_PROPERTIES \ diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx index ed5b75189c3a..78af484555de 100644 --- a/svx/qa/unit/xoutdev.cxx +++ b/svx/qa/unit/xoutdev.cxx @@ -129,6 +129,12 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testFillColorThemeUnoApi) sal_Int16 nExpected = 4; // Accent 1 xShape->setPropertyValue("FillColorTheme", uno::makeAny(nExpected)); + // 80% lighter + sal_Int16 nExpectedLumMod = 2000; + xShape->setPropertyValue("FillColorLumMod", uno::makeAny(nExpectedLumMod)); + sal_Int16 nExpectedLumOff = 8000; + xShape->setPropertyValue("FillColorLumOff", uno::makeAny(nExpectedLumOff)); + // Then make sure the value we read back is the expected one: sal_Int16 nActual = -1; xShape->getPropertyValue("FillColorTheme") >>= nActual; @@ -137,6 +143,14 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testFillColorThemeUnoApi) // - Actual : -1 // i.e. setting the value was broken. CPPUNIT_ASSERT_EQUAL(nExpected, nActual); + xShape->getPropertyValue("FillColorLumMod") >>= nActual; + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 2000 + // - Actual : 8000 + // i.e. FillColorLumOff was set as FillColor, then getting FillColorLumMod returned FillColor. + CPPUNIT_ASSERT_EQUAL(nExpectedLumMod, nActual); + xShape->getPropertyValue("FillColorLumOff") >>= nActual; + CPPUNIT_ASSERT_EQUAL(nExpectedLumOff, nActual); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index d94d51a398a8..aceba42bbb61 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -1911,6 +1911,16 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons rVal <<= GetThemeColor().GetThemeIndex(); break; } + case MID_COLOR_LUM_MOD: + { + rVal <<= GetThemeColor().GetLumMod(); + break; + } + case MID_COLOR_LUM_OFF: + { + rVal <<= GetThemeColor().GetLumOff(); + break; + } default: { rVal <<= GetColorValue().GetRGBColor(); @@ -1934,6 +1944,22 @@ bool XFillColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) GetThemeColor().SetThemeIndex(nIndex); break; } + case MID_COLOR_LUM_MOD: + { + sal_Int16 nLumMod = -1; + if (!(rVal >>= nLumMod)) + return false; + GetThemeColor().SetLumMod(nLumMod); + } + break; + case MID_COLOR_LUM_OFF: + { + sal_Int16 nLumOff = -1; + if (!(rVal >>= nLumOff)) + return false; + GetThemeColor().SetLumOff(nLumOff); + } + break; default: { Color nValue; |