From 65afb65cf7442cae8e3511a6a58cba7bd51140ce Mon Sep 17 00:00:00 2001 From: blikblum Date: Sat, 23 Jun 2012 18:04:36 +0000 Subject: [PATCH] lazreport: fix draw of empty lines. Issue #22305 git-svn-id: trunk@37750 - --- components/lazreport/source/lr_class.pas | 32 +++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/components/lazreport/source/lr_class.pas b/components/lazreport/source/lr_class.pas index 0775b2ceee..dfd464b8c2 100644 --- a/components/lazreport/source/lr_class.pas +++ b/components/lazreport/source/lr_class.pas @@ -2835,7 +2835,7 @@ var procedure WrapLine(const s: String); var i, cur, beg, last, len: Integer; - WasBreak, CRLF: Boolean; + WasBreak, CRLF, IsCR: Boolean; ch: TUTF8char; begin @@ -2864,21 +2864,25 @@ var Ch := UTF8Char(s, cur, Desc); // check for items with soft-breaks - if (Ch=#10) or (Ch=#13) then + IsCR := Ch=#13; + if IsCR then + begin + //handle composite newline + ch := UTF8Char(s, cur+1, desc); + //dont increase char index if next char is LF (#10) + if ch<>#10 then + Inc(Cur); + end; + if Ch=#10 then begin OutLine(UTF8Range(s, beg, cur - beg, Desc) + #1); - while (cur ' ' then