From 78a6cffca03eff6e8c9ffd221661912c5856849e Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Tue, 29 Dec 2020 18:51:33 +0000 Subject: [PATCH] fpspreadsheet: Fix (?) display issue with text cells containing incorrect html parts (such as '<'), https://forum.lazarus.freepascal.org/index.php/topic,52694.0.html git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7944 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/source/common/fpshtmlutils.pas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/fpspreadsheet/source/common/fpshtmlutils.pas b/components/fpspreadsheet/source/common/fpshtmlutils.pas index 12b08a1c8..300a52771 100644 --- a/components/fpspreadsheet/source/common/fpshtmlutils.pas +++ b/components/fpspreadsheet/source/common/fpshtmlutils.pas @@ -958,6 +958,15 @@ begin analyzer.Prefix := APrefix; analyzer.Exec; APlainText := analyzer.PlainText; + + // HTML text has an error --> take the input text literally + if (AHtmlText <> '') and (APlainText = '') then + begin + APlainText := AHtmlText; + ARichTextParams := nil; + exit; + end; + nrtp := Length(analyzer.RichTextParams); if nrtp > 0 then begin // Avoid rich-text parameters beyond text end.