mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-01 03:17:36 +02:00
Qt6: 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.
This commit is contained in:
parent
ffb0b0034e
commit
38f4119540
@ -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