From 8eb1026d0cd4bcfaeca8e8798044381290674160 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 5 Jan 2026 09:22:05 -0600 Subject: [PATCH] vcl: remove unused DrawImageFlags::ColorTransform There's a note in the enum definition for DrawImageFlags that they need to be kept in-sync with com/sun/star/awt/ImageDrawMode but that doesn't have ColorTransform. Furthermore the flag has no effect in Image::Draw() anyway. Change-Id: I7cb3f7061051b8691211bd3a78aaf99b7bb82bd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196584 Tested-by: Jenkins Reviewed-by: Dan Williams --- include/vcl/rendercontext/DrawImageFlags.hxx | 2 +- vcl/source/image/Image.cxx | 4 ++-- vcl/source/window/toolbox.cxx | 12 ------------ 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/include/vcl/rendercontext/DrawImageFlags.hxx b/include/vcl/rendercontext/DrawImageFlags.hxx index 014b552dec15..535ba74162b1 100644 --- a/include/vcl/rendercontext/DrawImageFlags.hxx +++ b/include/vcl/rendercontext/DrawImageFlags.hxx @@ -28,7 +28,7 @@ enum class DrawImageFlags Disable = 0x0001, Highlight = 0x0002, Deactive = 0x0004, - ColorTransform = 0x0008, + // 0x0008 is unused, SemiTransparent = 0x0010, }; namespace o3tl diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx index ebabef440a9b..28506ecf459b 100644 --- a/vcl/source/image/Image.cxx +++ b/vcl/source/image/Image.cxx @@ -134,8 +134,8 @@ void Image::Draw(OutputDevice* pOutDev, const Point& rPos, DrawImageFlags nStyle Bitmap aRenderBmp = mpImplData->getBitmapForHiDPI(bool(nStyle & DrawImageFlags::Disable), pOutDev->GetGraphics()); if (!(nStyle & DrawImageFlags::Disable) && - (nStyle & (DrawImageFlags::ColorTransform | DrawImageFlags::Highlight | - DrawImageFlags::Deactive | DrawImageFlags::SemiTransparent))) + (nStyle & (DrawImageFlags::Highlight | DrawImageFlags::Deactive | + DrawImageFlags::SemiTransparent))) { if (nStyle & (DrawImageFlags::Highlight | DrawImageFlags::Deactive)) { diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 88ba1239ef53..0cf0197f1f2f 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -2549,12 +2549,6 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si // no gradient background for items that have a popup open bool bHasOpenPopup = mpFloatWin && (mnDownItemId==pItem->mnId); - bool bHighContrastWhite = false; - // check the face color as highcontrast indicator - // because the toolbox itself might have a gradient - if (rStyleSettings.GetFaceColor() == COL_WHITE) - bHighContrastWhite = true; - // Compute buttons area. Size aBtnSize = pItem->maRect.GetSize(); @@ -2636,12 +2630,6 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si else ImplDrawButton(rRenderContext, aButtonRect, nHighlight, pItem->meState == TRISTATE_TRUE, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow); - - if( nHighlight != 0 ) - { - if( bHighContrastWhite ) - nImageStyle |= DrawImageFlags::ColorTransform; - } } rRenderContext.DrawImage(Point( nImageOffX, nImageOffY ), *pImage, nImageStyle); }