summaryrefslogtreecommitdiff
path: root/svx/source/sdr/overlay
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-10-13 10:41:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-10-13 14:52:51 +0200
commit2734d2e058182a34c576e558138d84358c69ca5a (patch)
treed2f9ac6bc945c6aa1d3cc6e2e3b540a828d0e8f7 /svx/source/sdr/overlay
parentee0d5e7bb8614c50e71dd074b8440f412eb62ff3 (diff)
tdf#150622 use high contrast selection fg/bg colors for text selection
with SettingsForSelection SettingsText -> HighlightTextColor SettingsFill -> HighlightColor SettingsLine -> HighlightColor Change-Id: Iaac5834ce0f8b3f1b89376711b564773cfd0bfe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141287 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/sdr/overlay')
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx10
-rw-r--r--svx/source/sdr/overlay/overlayobject.cxx2
-rw-r--r--svx/source/sdr/overlay/overlayrectangle.cxx4
3 files changed, 7 insertions, 9 deletions
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index 3d501b814da5..c29138de8b87 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -51,8 +51,6 @@ namespace sdr::overlay
// but it seems reasonable to allow overlays to use the selection color
// taken from the system High Contrast settings
const DrawModeFlags nOriginalDrawMode(rDestinationDevice.GetDrawMode());
- const DrawModeFlags nForceSettings = DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill |
- DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient;
// create processor
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
@@ -81,16 +79,16 @@ namespace sdr::overlay
rDestinationDevice.SetAntialiasing(nOriginalAA & ~AntialiasingFlags::Enable);
}
- const bool bOverrulesDrawModeSettings = rCandidate.overrulesDrawModeSettings();
- if (bOverrulesDrawModeSettings)
+ const bool bIsHighContrastSelection = rCandidate.isHighContrastSelection();
+ if (bIsHighContrastSelection)
{
// overrule DrawMode settings
- rDestinationDevice.SetDrawMode(nOriginalDrawMode & ~nForceSettings);
+ rDestinationDevice.SetDrawMode(nOriginalDrawMode | DrawModeFlags::SettingsForSelection);
}
pProcessor->process(rSequence);
- if (bOverrulesDrawModeSettings)
+ if (bIsHighContrastSelection)
{
// restore DrawMode settings
rDestinationDevice.SetDrawMode(nOriginalDrawMode);
diff --git a/svx/source/sdr/overlay/overlayobject.cxx b/svx/source/sdr/overlay/overlayobject.cxx
index 6aab4f88068c..5c1de4627396 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -91,7 +91,7 @@ namespace sdr::overlay
mbIsHittable(true),
mbAllowsAnimation(false),
mbAllowsAntiAliase(true),
- mbOverruleDrawModeSettings(false)
+ mbHighContrastSelection(false)
{
}
diff --git a/svx/source/sdr/overlay/overlayrectangle.cxx b/svx/source/sdr/overlay/overlayrectangle.cxx
index ce9c11b51835..3bf04f40d64f 100644
--- a/svx/source/sdr/overlay/overlayrectangle.cxx
+++ b/svx/source/sdr/overlay/overlayrectangle.cxx
@@ -81,8 +81,8 @@ namespace sdr::overlay
// set AllowsAnimation flag to mark this object as animation capable
mbAllowsAnimation = bAnimate;
- // allow use of selection color even in HighContrast mode
- mbOverruleDrawModeSettings = true;
+ // use selection colors in HighContrast mode
+ mbHighContrastSelection = true;
}
void OverlayRectangle::Trigger(sal_uInt32 nTime)