2001-06-10 15:06 GMT+2 Maurilio Longo <maurilio.longo@libero.it>

* source/rtl/memoedit.prg
     ! fixed error in handling of text (EOL delimiters handling was wrong)
   * source/rtl/teditor.prg
     ! fixed error in handling of text (EOL delimiters handling was wrong)
This commit is contained in:
Maurilio Longo
2001-06-10 13:08:14 +00:00
parent 66f0dbdedc
commit a05226fa35
3 changed files with 25 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
2001-06-10 15:06 GMT+2 Maurilio Longo <maurilio.longo@libero.it>
* source/rtl/memoedit.prg
! fixed error in handling of text (EOL delimiters handling was wrong)
* source/rtl/teditor.prg
! fixed error in handling of text (EOL delimiters handling was wrong)
2001-06-09 23:15 GMT-3 Horacio Roldan <horacioroldan@usa.net>
*source/rdd/dbf1.c
! fixed message sending that corrupted dbf (with ftp) header

View File

@@ -244,9 +244,7 @@ FUNCTION MemoEdit(cString,;
DEFAULT cString TO ""
// Original MemoEdit() converts Tabs into spaces;
// TOFIX: I need to add an EOL char to fix the case where I call MemoEdit() with a string of one line without EOL.
// If I don't add an EOL I lose last char of string
oEd := TMemoEditor():New(StrTran(cString, Chr(K_TAB), Space(1)) + HB_OSNewLine(), nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize)
oEd := TMemoEditor():New(StrTran(cString, Chr(K_TAB), Space(1)), nTop, nLeft, nBottom, nRight, lEditMode, nLineLength, nTabSize)
oEd:MemoInit(cUserFunction)
oEd:RefreshWindow()

View File

@@ -176,9 +176,22 @@ STATIC function Text2Array(cString, nWordWrapCol)
cEOL := WhichEOL(cString)
nEOLLen := Len(cEOL)
// __StrTkPtr() needs that string to be tokenized be terminated with a token delimiter
if Rat(cEOL, cString) <> Len(cString) - nEOLLen + 1
cString += cEOL
endif
nRetLen := 0
ncSLen := Len(cString)
// If cString starts with an EOL delimiter I have to add an empty line since __StrTkPtr
// gives back _next_ token and would skip this first EOL delimiter
if Left(cString, nEOLLen) == cEOL
AAdd(aArray, TTextLine():New(cLine, .F.))
nTokPos += nEOLLen
nRetLen += nEOLLen
endif
while nRetLen < ncSLen
/* TOFIX: Note that __StrToken is not able to cope with delimiters longer than one char */
// Dos - OS/2 - Windows have CRLF as EOL
@@ -236,11 +249,14 @@ METHOD GetText() CLASS TEditor
LOCAL cEOL := HB_OSNewLine()
if ::lWordWrap
AEval(::aText, {|cItem| cString += cItem:cText + iif(cItem:lSoftCR, "", cEOL)})
AEval(::aText, {|cItem| cString += cItem:cText + iif(cItem:lSoftCR, "", cEOL)},, ::naTextLen - 1)
else
AEval(::aText, {|cItem| cString += cItem:cText + cEOL})
AEval(::aText, {|cItem| cString += cItem:cText + cEOL},, ::naTextLen - 1)
endif
// Last line does not need a cEOL delimiter
cString += ::aText[::naTextLen]:cText
return cString