diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-05-25 20:06:36 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-05-26 08:16:29 +0200 |
commit | 645413a14a91a72bc06acf0fb4703ff7b9fffec9 (patch) | |
tree | 2f8dfdffb94950b571289732a8df3ae35d1a03ba /sd | |
parent | 29dcafb5700938502cf62de27265f9d5d3920a8d (diff) |
sd theme: add UI (sidebar) for shape fill color effects
Which was perhaps the last missing piece of the "sd theme: shape fill
color" story.
Change-Id: Ice75d91412aa56afe0c9995086097d491ebf7299
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134952
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/uiimpress.cxx | 16 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 10 |
2 files changed, 25 insertions, 1 deletions
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index f035c1f68fac..f67d8fa32e4e 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -973,10 +973,12 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme) uno::UNO_QUERY); xController->select(uno::Any(xShape)); - // When setting the fill color of that shape, with theme metadata: + // When setting the fill color of that shape, with theme metadata & effects: uno::Sequence<beans::PropertyValue> aColorArgs = { comphelper::makePropertyValue("FillColor", static_cast<sal_Int32>(0xed7d31)), // orange comphelper::makePropertyValue("ColorThemeIndex", static_cast<sal_Int16>(4)), // accent 1 + comphelper::makePropertyValue("ColorLumMod", static_cast<sal_Int16>(4000)), + comphelper::makePropertyValue("ColorLumOff", static_cast<sal_Int16>(6000)), }; dispatchCommand(mxComponent, ".uno:FillColor", aColorArgs); Scheduler::ProcessEventsToIdle(); @@ -989,6 +991,18 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme) // - Actual : -1 // i.e. the theme index was lost during the dispatch of the command. CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(4), nFillColorTheme); + + // Then also verify the effects: + sal_Int16 nFillColorLumMod = 10000; + xShape->getPropertyValue("FillColorLumMod") >>= nFillColorLumMod; + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 4000 + // - Actual : 10000 + // i.e. the theme index was set, but not the effects. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(4000), nFillColorLumMod); + sal_Int16 nFillColorLumOff = 0; + xShape->getPropertyValue("FillColorLumOff") >>= nFillColorLumOff; + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(6000), nFillColorLumOff); } CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf127696) diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 591b90afc3f4..a8906acfc40c 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -606,6 +606,16 @@ public: auto pIntItem = static_cast<const SfxInt16Item*>(pItem); aColorItem.GetThemeColor().SetThemeIndex(pIntItem->GetValue()); } + if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_MOD, false, &pItem) == SfxItemState::SET) + { + auto pIntItem = static_cast<const SfxInt16Item*>(pItem); + aColorItem.GetThemeColor().SetLumMod(pIntItem->GetValue()); + } + if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_OFF, false, &pItem) == SfxItemState::SET) + { + auto pIntItem = static_cast<const SfxInt16Item*>(pItem); + aColorItem.GetThemeColor().SetLumOff(pIntItem->GetValue()); + } pArgs->Put(aColorItem); } } |