summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-15 14:49:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-16 10:07:07 +0100
commit63a68064bb33f180b8a231f7524d99405d910226 (patch)
tree7ecf05b057c5ca4d80a48af045998a4b34484561 /sw/source/filter/xml
parentd534a4c7b45ff254b339e806c6a11f13d9ff0043 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/xml')
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 2d0ea2bc046d..bfb29a7af264 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -694,7 +694,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
{
SvxBrushItem& rBrush = dynamic_cast<SvxBrushItem&>(rItem);
- sal_Int32 nTempColor(0);
+ Color aTempColor;
switch( nMemberId )
{
case MID_BACK_COLOR:
@@ -703,9 +703,8 @@ bool SvXMLImportItemMapper::PutXMLValue(
rBrush.GetColor().SetAlpha(0);
bOk = true;
}
- else if (::sax::Converter::convertColor(nTempColor, rValue))
+ else if (::sax::Converter::convertColor(aTempColor, rValue))
{
- Color aTempColor(nTempColor);
aTempColor.SetAlpha(255);
rBrush.SetColor( aTempColor );
bOk = true;