diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-08-12 04:03:57 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-08-23 23:16:38 +0200 |
commit | ad873064b0135e4e00389cd38c7de688286c1fa1 (patch) | |
tree | b40a724847d284cca6332fa18dcbda84f3d7e2f4 /sd/qa | |
parent | bf15445b7102a4e2bea2f96891093bc4bf07c4c6 (diff) |
sd: add ThemeDialog to Impress/Draw, refactor ThemeColorChanger
Add "Theme" menu action, which starts the common ThemeDialog.
Add Impress/Draw specific ThemeColorChanger and remove the one in
svx, so that only the interface and common function remain.
Rename the svx ThemeColorChanger files to THemeColorChangerCommon.
Change-Id: Ibf07a443cadf0452747ab6685f65df37b145c984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155682
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/ThemeTest.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sd/qa/unit/ThemeTest.cxx b/sd/qa/unit/ThemeTest.cxx index 98ffd6c1bbab..65c261f23700 100644 --- a/sd/qa/unit/ThemeTest.cxx +++ b/sd/qa/unit/ThemeTest.cxx @@ -16,6 +16,7 @@ #include <com/sun/star/drawing/XMasterPageTarget.hpp> #include <com/sun/star/text/XTextRange.hpp> #include <docmodel/uno/UnoComplexColor.hxx> +#include <docmodel/theme/Theme.hxx> #include <svx/unoapi.hxx> @@ -23,6 +24,7 @@ #include <unomodel.hxx> #include <sdpage.hxx> #include <ViewShell.hxx> +#include <theme/ThemeColorChanger.hxx> using namespace css; @@ -124,6 +126,14 @@ CPPUNIT_TEST_FIXTURE(ThemeTest, testThemeChange) uno::Reference<beans::XPropertySet> xMasterPage(xDrawPage->getMasterPage(), uno::UNO_QUERY); xMasterPage->setPropertyValue("Theme", aTheme); + css::uno::Reference<css::drawing::XDrawPage> xDrawPageMaster(xMasterPage, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDrawPageMaster.is()); + auto* pMasterPage = GetSdrPageFromXDrawPage(xDrawPageMaster); + auto pTheme = pMasterPage->getSdrPageProperties().GetTheme(); + + sd::ThemeColorChanger aChanger(pMasterPage); + aChanger.apply(pTheme->getColorSet()); + // Then make sure the shape text color is now green: CPPUNIT_ASSERT_EQUAL(Color(0x90c226), GetShapeTextColor(xShape)); // Green, lighter: |