Skip to content

Commit

Permalink
unsupported things
Browse files Browse the repository at this point in the history
  • Loading branch information
digao-dalpiaz committed Aug 3, 2020
1 parent 22d7868 commit 48fc621
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 5 additions & 4 deletions DzHTMLText.pas
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ constructor TDzHTMLText.Create(AOwner: TComponent);
FAbout := 'Digao Dalpiaz / Version 2.2';

FLines := TStringList.Create;
FLines.TrailingLineBreak := False;
//FLines.TrailingLineBreak := False; -- only supported by Delphi 10.1 and not full funcionally in Lazarus
TStringList(FLines).OnChange := OnLinesChange;

FStyleLinkNormal := TDHStyleLinkProp.Create(Self, tslpNormal);
Expand Down Expand Up @@ -577,6 +577,7 @@ procedure TDzHTMLText.SetLines(const Value: TStrings);
function TDzHTMLText.GetText: String;
begin
Result := FLines.Text;
Result := Result.Substring(0, Result.Length-FLines.LineBreak.Length); //remove last line break
end;

procedure TDzHTMLText.SetText(const Value: String);
Expand Down Expand Up @@ -1179,11 +1180,11 @@ procedure TBuilder.ReadTokens;
CharIni: Char;
I, Jump: Integer;
begin
Text := Lb.FLines.Text;
Text := Lb.FLines.Text; //when is not empty, always comes with a final line break

Text := StringReplace(Text, #13#10'<NBR>', EmptyStr, [rfReplaceAll, rfIgnoreCase]); //ignore next break
Text := StringReplace(Text, #13#10, '<BR>', [rfReplaceAll]);
if not Text.IsEmpty then Text := Text + '<BR>'; //internal final break
//if not Text.IsEmpty then Text := Text + '<BR>'; //internal final break

while not Text.IsEmpty do
begin
Expand Down Expand Up @@ -1859,7 +1860,7 @@ type TSizes = record
LineCount := 0;
CurLine := 0;
PrevLine := -1;
PrevPos := TPoint.Zero;
PrevPos := TPoint.Create(0, 0);
FloatRect := TRect.Empty;
LastTabX := 0;
LastTabF := False;
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@

## What's New

- 08/03/2020

- Fixed Lazarus extra line break (issue #23).
- Fixed Delphi unsupported property TrailingLineBreak (only available in Delphi 10.1).
- Fixed Delphi unsupported method TPoint.Zero (Delphi XE7 and below?).

- 08/02/2020

- Included donate button. Consider making a donation if the project is useful to you.
Expand Down

0 comments on commit 48fc621

Please sign in to comment.