diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2021-09-13 09:47:11 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-11-18 17:17:43 +0100 |
commit | 6ce8066af743b172d36046a8dc8b17ebe010b6cf (patch) | |
tree | c27c1699e29f0a3a8340adbbf1c7704ebb54c866 /sd/source/ui | |
parent | f4d59ec73682f06fff9f718b3347726f1d53d263 (diff) |
import pptx color schemes as color sets
initial import work for color sets.
Themes (which we get the color schemes from) in MSO can
be different for each master - will need to support that too.
[ Miklos: actually added that per-master-page support. ]
(cherry picked from commit 3b21d166f585dcdf8d576d166aeff3cfd4694aab,
from the feature/themesupport2 branch)
Change-Id: Ia06d2645018e6bfa70817bbddba2374641ae13dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125477
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 984b5fd0df2c..656ca7d8a234 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -98,7 +98,7 @@ enum WID_PAGE WID_PAGE_PAGENUMBERVISIBLE, WID_PAGE_DATETIMEVISIBLE, WID_PAGE_DATETIMEFIXED, WID_PAGE_DATETIMETEXT, WID_PAGE_DATETIMEFORMAT, WID_TRANSITION_TYPE, WID_TRANSITION_SUBTYPE, WID_TRANSITION_DIRECTION, WID_TRANSITION_FADE_COLOR, WID_TRANSITION_DURATION, WID_LOOP_SOUND, - WID_NAVORDER, WID_PAGE_PREVIEWMETAFILE + WID_NAVORDER, WID_PAGE_PREVIEWMETAFILE, WID_PAGE_THEME }; } @@ -280,6 +280,7 @@ static const SvxItemPropertySet* ImplGetMasterPagePropertySet( PageKind ePageKin { u"BackgroundFullSize", WID_PAGE_BACKFULL, cppu::UnoType<bool>::get(), 0, 0}, { sUNO_Prop_UserDefinedAttributes,WID_PAGE_USERATTRIBS, cppu::UnoType<css::container::XNameContainer>::get(), 0, 0}, { u"IsBackgroundDark", WID_PAGE_ISDARK, cppu::UnoType<bool>::get(), beans::PropertyAttribute::READONLY, 0}, + { u"Theme", WID_PAGE_THEME, cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get(), 0, 0}, { u"", 0, css::uno::Type(), 0, 0 } }; @@ -972,6 +973,14 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName break; } + case WID_PAGE_THEME: + { + SdrPage* pPage = GetPage(); + std::unique_ptr<svx::Theme> pTheme = svx::Theme::FromAny(aValue); + pPage->getSdrPageProperties().SetTheme(std::move(pTheme)); + break; + } + default: throw beans::UnknownPropertyException( aPropertyName, static_cast<cppu::OWeakObject*>(this)); } @@ -1286,6 +1295,22 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) aAny <<= GetPage()->getTransitionDuration(); break; + case WID_PAGE_THEME: + { + SdrPage* pPage = GetPage(); + svx::Theme* pTheme = pPage->getSdrPageProperties().GetTheme(); + if (pTheme) + { + pTheme->ToAny(aAny); + } + else + { + beans::PropertyValues aValues; + aAny <<= aValues; + } + break; + } + default: throw beans::UnknownPropertyException( PropertyName, static_cast<cppu::OWeakObject*>(this)); } |