diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ff740f47eb..f8390c077e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-02-27 12:37 UTC+0100 Viktor Szakats + + * source/rtl/teditor.prg + ! Fixed a Bound error in GetParagraph which came up when + using in wrap mode, in the last line I guess. + Note that this just fixed the bound error, not the possible + real problem. + 2004-02-21 8:14 UTC+0100 Viktor Szakats * source/common/hbffind.c diff --git a/harbour/source/rtl/teditor.prg b/harbour/source/rtl/teditor.prg index 74d675e2c3..efa6ff15eb 100644 --- a/harbour/source/rtl/teditor.prg +++ b/harbour/source/rtl/teditor.prg @@ -491,16 +491,18 @@ STATIC function GetParagraph(oSelf, nRow) LOCAL cLine := "" - while oSelf:aText[nRow]:lSoftCR + while nRow <= Len(oSelf:aText) .and. oSelf:aText[nRow]:lSoftCR cLine += oSelf:aText[nRow]:cText // I don't need to increment nRow since I'm removing lines, ie line n is // a different line each time I add it to cLine oSelf:RemoveLine(nRow) enddo - // Last line, or only one line - cLine += oSelf:aText[nRow]:cText - oSelf:RemoveLine(nRow) + if nRow <= Len(oSelf:aText) + // Last line, or only one line + cLine += oSelf:aText[nRow]:cText + oSelf:RemoveLine(nRow) + endif return cLine