summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSkyler Grey <skyler.grey@collabora.com>2024-07-29 09:52:18 +0000
committerMiklos Vajna <vmiklos@collabora.com>2024-08-16 21:56:41 +0200
commit8d9a96fca21118da6676f56b4abd48594fc1956e (patch)
tree6f1db83a7052905903e26a27e35d435dc3542758 /sw
parent7a08c89b5af8f98045ad825ace6be2f035ad91af (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 'sw')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index e963b890bbfd..6262416a480f 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3763,6 +3763,7 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
aViewOption.SetUseHeaderFooterMenu(false);
OUString sThemeName;
+ OUString sBackgroundThemeName;
OUString sOrigAuthor = SW_MOD()->GetRedlineAuthor(SW_MOD()->GetRedlineAuthor());
OUString sAuthor;
@@ -3786,6 +3787,8 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
aViewOption.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>();
}
if (!sAuthor.isEmpty() && sAuthor != sOrigAuthor)
@@ -3844,6 +3847,14 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
}));
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 SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode)