From 79c4c0701205a8eb35c7cca76849ab4a5de22a32 Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 26 Nov 2007 15:01:44 +0000 Subject: [PATCH] LazDE: fixed possible range error from Wanderlan (bug #10221) git-svn-id: trunk@13037 - --- doceditor/eleditor.pp | 4 ++-- doceditor/frmmain.pp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doceditor/eleditor.pp b/doceditor/eleditor.pp index 73c8ad8ad1..9ed966feb8 100644 --- a/doceditor/eleditor.pp +++ b/doceditor/eleditor.pp @@ -440,7 +440,6 @@ begin end; Procedure TElementEditor.DeleteElement; - begin Element:=Nil; end; @@ -456,7 +455,7 @@ Procedure TElementEditor.Refresh; Remove := pos(Tag, S); while Remove <> 0 do begin inc(Remove, LenTag); - while S[Remove] in [#10, #13] do + while (Remove <= length(S)) and (S[Remove] in [#10, #13]) do delete(S, Remove, 1); Remove := PosEx(Tag, S, Remove); end; @@ -951,3 +950,4 @@ initialization end. + diff --git a/doceditor/frmmain.pp b/doceditor/frmmain.pp index fd8abcaa59..2c73a34480 100644 --- a/doceditor/frmmain.pp +++ b/doceditor/frmmain.pp @@ -905,10 +905,10 @@ begin TToolButton(Components[i]).ShowHint:=ShowHelpHints; end; - initialization {$I frmmain.lrs} end. +