mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-31 06:12:38 +02:00
Qt5: fixed behaviour of TMemo.Lines.Add(), still slower than gtk or win32, but have correct behaviour when last line of memo is line break. For faster inserts remove last line break. issue #39444
This commit is contained in:
parent
38f4119540
commit
6a197ad3ca
@ -437,11 +437,22 @@ begin
|
||||
// simplified because of issue #29670
|
||||
// allow insert invalid index like others do
|
||||
if Index >= FStringList.Count then
|
||||
Index := FStringList.Add(S)
|
||||
else
|
||||
begin
|
||||
Index := FStringList.Add(S);
|
||||
if FHasTrailingLineBreak then
|
||||
W := GetUTF8String(S + LineBreak)
|
||||
else
|
||||
W := GetUTF8String(S);
|
||||
if FHasTrailingLineBreak then
|
||||
TQtTextEdit(FOwner.Handle).setLineText(Index, W)
|
||||
else
|
||||
TQtTextEdit(FOwner.Handle).Append(W);
|
||||
end else
|
||||
begin
|
||||
FStringList.Insert(Index, S);
|
||||
W := GetUTF8String(S);
|
||||
TQtTextEdit(FOwner.Handle).insertLine(Index, W);
|
||||
W := GetUTF8String(S);
|
||||
TQtTextEdit(FOwner.Handle).insertLine(Index, W);
|
||||
end;
|
||||
FTextChanged := False; // FStringList is already updated, no need to update from WS.
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user