From 63a68064bb33f180b8a231f7524d99405d910226 Mon Sep 17 00:00:00 2001 From: Noel Date: Fri, 15 Jan 2021 14:49:12 +0200 Subject: make the Color constructors explicitly specify transparency to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin --- extensions/source/propctrlr/fontdialog.cxx | 4 ++-- extensions/source/propctrlr/standardcontrol.cxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'extensions/source') diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx index 995f0b94f25f..af276592fc41 100644 --- a/extensions/source/propctrlr/fontdialog.cxx +++ b/extensions/source/propctrlr/fontdialog.cxx @@ -233,9 +233,9 @@ namespace pcr SvxWordLineModeItem aWordLineModeItem(bWordLineMode, CFID_WORDLINEMODE); SvxUnderlineItem aUnderlineItem(eUnderline,CFID_UNDERLINE); - aUnderlineItem.SetColor(Color(nTextLineColor)); + aUnderlineItem.SetColor(Color(ColorTransparency, nTextLineColor)); - SvxColorItem aSvxColorItem(Color(nColor32),CFID_CHARCOLOR); + SvxColorItem aSvxColorItem(Color(ColorTransparency, nColor32),CFID_CHARCOLOR); SvxLanguageItem aLanguageItem(Application::GetSettings().GetUILanguageTag().getLanguageType(), CFID_LANGUAGE); // the 2 CJK props diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index c5b03aa270e5..c20f6287fe8d 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -478,7 +478,7 @@ namespace pcr css::util::Color nColor = sal_uInt32(COL_TRANSPARENT); if (_rValue.hasValue()) _rValue >>= nColor; - getTypedControlWindow()->SelectEntry(nColor); + getTypedControlWindow()->SelectEntry(::Color(ColorTransparency, nColor)); } Any SAL_CALL OColorControl::getValue() -- cgit