From e0daa8a142387494d8f8b331d0802da552622073 Mon Sep 17 00:00:00 2001 From: Gülşah Köse Date: Fri, 24 May 2024 14:34:15 +0300 Subject: ONLINE: Add Invert document background color command. Change-Id: Ia8868a80e4eba9a9a1c0b31077d9eca0c5b00466 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171633 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sfx2/source/appl/appserv.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sfx2/source') diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 1505e3944d55..23358e7f8cfe 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -732,7 +732,24 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) Invalidate(FN_CHANGE_THEME); break; } + case FN_INVERT_BACKGROUND: + { + svtools::EditableColorConfig aColorConfig; + ::Color aCurrentColor = aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor; + ::Color aDefLightColor = svtools::ColorConfig::GetDefaultColor(svtools::DOCCOLOR, 0); + ::Color aDefDarkColor = svtools::ColorConfig::GetDefaultColor(svtools::DOCCOLOR, 1); + + svtools::ColorConfigValue aValue; + aValue.bIsVisible = true; + + if(aCurrentColor == aDefLightColor) + aValue.nColor = aDefDarkColor; + else + aValue.nColor = aDefLightColor; + aColorConfig.SetColorValue(svtools::DOCCOLOR, aValue); + break; + } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case SID_HELPINDEX: { -- cgit