LCL-QT: Prevent deleting an empty line from TQtMemoStrings after it is inserted. Fixes bug in ExtTool dialog. Issue #30929.

git-svn-id: trunk@53375 -
This commit is contained in:
juha 2016-11-16 16:40:29 +00:00
parent e2599966ce
commit 4261afaff7
2 changed files with 3 additions and 2 deletions

View File

@ -904,7 +904,7 @@ begin
else
s:='$'+fTransferMacros[i].Name+'()';
ALine := MemoParameters.CaretPos.Y;
If MemoParameters.Lines.Count = 0 Then
if ALine >= MemoParameters.Lines.Count then
MemoParameters.Lines.Add('');
AStr := MemoParameters.Lines[Aline];
MemoParameters.Lines[Aline] := AStr + s;

View File

@ -428,12 +428,13 @@ begin
// simplified because of issue #29670
// allow insert invalid index like others do
if Index >= FStringlist.Count then
if Index >= FStringList.Count then
Index := FStringList.Add(S)
else
FStringList.Insert(Index, S);
W := GetUTF8String(S);
TQtTextEdit(FOwner.Handle).insertLine(Index, W);
FTextChanged := False; // FStringList is already updated, no need to update from WS.
end;
procedure TQtMemoStrings.LoadFromFile(const FileName: string);