diff options
author | Skyler Grey <skyler.grey@collabora.com> | 2024-07-29 09:52:18 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-08-16 21:56:41 +0200 |
commit | 8d9a96fca21118da6676f56b4abd48594fc1956e (patch) | |
tree | 6f1db83a7052905903e26a27e35d435dc3542758 /sd | |
parent | 7a08c89b5af8f98045ad825ace6be2f035ad91af (diff) |
feat(invert): Allow inverted background on init
Previously for Online there was no way to save the background invert
state and reload it. Worse, when someone changed the state it would
become the default for new document loads.
This patch allows Online to specify whether it wants the background to
be inverted, which should allow smooth tab refreshes while also avoiding
mingling state from different people.
There is a change to online to support this here:
https://github.com/CollaboraOnline/online/pull/9652
Change-Id: I8c22c03d3b4589736d48509004f7789dd5166389
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171955
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index f8f9359d7988..247c4810b9e8 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2730,6 +2730,7 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs SolarMutexGuard aGuard; OUString sThemeName; + OUString sBackgroundThemeName; if (DrawViewShell* pViewShell = GetViewShell()) { @@ -2744,6 +2745,8 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs mpDoc->SetOnlineSpell(rValue.Value.get<bool>()); else if (rValue.Name == ".uno:ChangeTheme" && rValue.Value.has<OUString>()) sThemeName = rValue.Value.get<OUString>(); + else if (rValue.Name == ".uno:InvertBackground" && rValue.Value.has<OUString>()) + sBackgroundThemeName = rValue.Value.get<OUString>(); } // Disable comments if requested @@ -2795,6 +2798,14 @@ void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<cs })); comphelper::dispatchCommand(u".uno:ChangeTheme"_ustr, aPropertyValues); } + if (!sBackgroundThemeName.isEmpty()) + { + css::uno::Sequence<css::beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( + { + { "NewTheme", uno::Any(sBackgroundThemeName) } + })); + comphelper::dispatchCommand(".uno:InvertBackground", aPropertyValues); + } } void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) |