diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-15 14:49:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-16 10:07:07 +0100 |
commit | 63a68064bb33f180b8a231f7524d99405d910226 (patch) | |
tree | 7ecf05b057c5ca4d80a48af045998a4b34484561 /starmath | |
parent | d534a4c7b45ff254b339e806c6a11f13d9ff0043 (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 'starmath')
-rw-r--r-- | starmath/inc/token.hxx | 2 | ||||
-rw-r--r-- | starmath/source/mathmlexport.cxx | 2 | ||||
-rw-r--r-- | starmath/source/node.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx index cc295cc5fe28..cb485a531ac8 100644 --- a/starmath/inc/token.hxx +++ b/starmath/inc/token.hxx @@ -200,7 +200,7 @@ struct SmColorTokenTableEntry : pIdent(name) , cIdent(codename) , eType(ctype) - , cColor(ncolor) + , cColor(ColorTransparency, ncolor) { } diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 8416dc7ba6c3..de7216f30bc7 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -1159,7 +1159,7 @@ void SmXMLExport::ExportFont(const SmNode* pNode, int nLevel) sStrBuf.append('#'); std::unique_ptr<SmColorTokenTableEntry> aSmColorTokenTableEntry; nc = pNode->GetToken().aText.toUInt32(16); - sStrBuf.append(Color(nc).AsRGBHEXString()); + sStrBuf.append(Color(ColorTransparency, nc).AsRGBHEXString()); OUString ssStr(sStrBuf.makeStringAndClear()); AddAttribute(XML_NAMESPACE_MATH, XML_MATHCOLOR, ssStr); } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 9ab23e172d8d..f6fc8f0aed10 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -1632,7 +1632,7 @@ void SmFontNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) case TICONICCOL : case THEX : nc = GetToken().aText.toUInt32(16); - SetColor(Color(nc)); + SetColor(Color(ColorTransparency, nc)); break; default: |