fpspreadsheet: Fix incorrect handling of <br> tag in html cell text. Cells with line-breaks are now automatically word-wrapped.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9005 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-11-01 22:00:11 +00:00
parent 3fc925936c
commit 13ac26a52b
2 changed files with 10 additions and 2 deletions

View File

@ -842,9 +842,15 @@ begin
AddRichTextParam(FCurrFont); AddRichTextParam(FCurrFont);
end; end;
'<BR>', '<BR>',
'<BR/>': FPlainText := FPlainText + FPS_LINE_ENDING; '<BR/>': begin
else if (pos('<BR ', NoCaseTag) = 1) then
FPlainText := FPlainText + FPS_LINE_ENDING; FPlainText := FPlainText + FPS_LINE_ENDING;
FHandled := True;
end;
else if (pos('<BR ', NoCaseTag) = 1) then
begin
FPlainText := FPlainText + FPS_LINE_ENDING;
FHandled := True;
end;
end; end;
'D': if (NoCaseTag = '<DEL>') then 'D': if (NoCaseTag = '<DEL>') then
begin begin

View File

@ -4122,6 +4122,8 @@ begin
if Length(ARichTextParams) > 0 then if Length(ARichTextParams) > 0 then
for i:=0 to High(ARichTextParams) do for i:=0 to High(ARichTextParams) do
ACell^.RichTextParams[i] := ARichTextParams[i]; ACell^.RichTextParams[i] := ARichTextParams[i];
if pos(FPS_LINE_ENDING, AText) > 0 then
WriteWordWrap(ACell, true);
end; end;
ChangedCell(ACell^.Row, ACell^.Col); ChangedCell(ACell^.Row, ACell^.Col);