From 6a1b03adfae3365b5d2878041586546a849fceda Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 12 Dec 2019 10:17:39 +0000 Subject: [PATCH] fpspreadsheet: Fix ooxml reader choking on files written by Adobe Acrobat X which writes HTML colors with # prefix. https://forum.lazarus.freepascal.org/index.php/topic,47749.msg342501.html. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7207 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/source/common/xlsxooxml.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/fpspreadsheet/source/common/xlsxooxml.pas b/components/fpspreadsheet/source/common/xlsxooxml.pas index be40f64a1..dbd8e7c72 100644 --- a/components/fpspreadsheet/source/common/xlsxooxml.pas +++ b/components/fpspreadsheet/source/common/xlsxooxml.pas @@ -1118,7 +1118,10 @@ begin s := GetAttrValue(ANode, 'rgb'); if s <> '' then begin - Result := HTMLColorStrToColor('#' + s); + if s[1] = '#' then + Result := HTMLColorStrToColor(s) + else + Result := HTMLColorStrToColor('#' + s); exit; end;