summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2024-05-24 14:34:15 +0300
committerMiklos Vajna <vmiklos@collabora.com>2024-08-08 16:43:43 +0200
commite0daa8a142387494d8f8b331d0802da552622073 (patch)
treeba036878eba539dea655e0f4dd248bdf1e37956d /sfx2
parent9612789609a74980447cd0309404cecb125374c3 (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/sdi/appslots.sdi4
-rw-r--r--sfx2/sdi/sfx.sdi14
-rw-r--r--sfx2/source/appl/appserv.cxx17
3 files changed, 35 insertions, 0 deletions
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index 14f89dbabf63..45166d3376f6 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -69,6 +69,10 @@ interface Application
ExecMethod = MiscExec_Impl ;
StateMethod = MiscState_Impl ;
]
+ FN_INVERT_BACKGROUND // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
SID_CONFIG // ole(no) api(final/play/rec)
[
ExecMethod = MiscExec_Impl ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 9a341064c970..5aedc10c828f 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -5928,3 +5928,17 @@ SfxVoidItem ChangeTheme FN_CHANGE_THEME
ToolBoxConfig = TRUE,
GroupId = SfxGroupId::Application;
]
+
+SfxVoidItem InvertBackground FN_INVERT_BACKGROUND
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ GroupId = SfxGroupId::Application;
+]
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:
{