2015-02-11 18:48 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* src/rtl/mlcfunc.c
    * modified unpadded MemoLine() mode to return last blank
      character in the line

  * src/rtl/teditor.prg
    ! fixed typo in MemoLine() parameters
    + added lSoftCR parameter to GetText() - when it's true returned
      text contains SoftCRs

  * src/rtl/memoedit.prg
    ! return text with SoftCRs - Cl*pper compatible

  ; Above modifications fix initial and result text formatting
    in MemoEdit() (#33)
This commit is contained in:
Przemysław Czerpak
2015-02-11 18:48:48 +01:00
parent bc40e114db
commit 403decab13
4 changed files with 30 additions and 8 deletions

View File

@@ -10,6 +10,22 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2015-02-11 18:48 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/mlcfunc.c
* modified unpadded MemoLine() mode to return last blank
character in the line
* src/rtl/teditor.prg
! fixed typo in MemoLine() parameters
+ added lSoftCR parameter to GetText() - when it's true returned
text contains SoftCRs
* src/rtl/memoedit.prg
! return text with SoftCRs - Cl*pper compatible
; Above modifications fix initial and result text formatting
in MemoEdit() (#33)
2015-02-11 13:10 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* package/harbour-wce.spec.in
* package/harbour-win.spec.in
@@ -17,7 +33,7 @@
* changed deprecated BuildPrereq tag to BuildRequires
! remove optionally created libtiff
; above modifications close issue #38
; above modifications close issue #38
2015-02-11 12:31 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/codepage/l_fr.h
@@ -40,7 +56,7 @@
+ added new French codepage "FR850" with all French characters and
accented equal collation rules.
; above modifications close issue #88
; above modifications close issue #88
2015-02-11 09:49 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rdd/dbf1.c

View File

@@ -349,7 +349,7 @@ FUNCTION MemoEdit( ;
nOldCursor := SetCursor( iif( Set( _SET_INSERT ), SC_INSERT, SC_NORMAL ) )
oEd:Edit()
IF oEd:Changed() .AND. oEd:Saved()
cString := oEd:GetText()
cString := oEd:GetText( .T. )
ENDIF
SetCursor( nOldCursor )
ENDIF

View File

@@ -385,11 +385,15 @@ HB_FUNC( MEMOLINE )
}
}
}
if( nCol < MLC.nLineLength && fPad )
if( nCol < MLC.nLineLength )
{
nCol = MLC.nLineLength - nCol;
if( nCol > nSize - nLen )
nCol = nSize - nLen;
if( ! fPad && nCol > 0 )
nCol = nIndex < MLC.nLen &&
( MLC.pszString[ nIndex ] == ' ' ||
MLC.pszString[ nIndex ] == HB_CHAR_HT ) ? 1 : 0;
memset( szLine + nLen, ' ', nCol );
nLen += nCol;
}

View File

@@ -77,7 +77,7 @@ CREATE CLASS HBEditor
METHOD GotoLine( nRow ) // Put line nRow at cursor position
METHOD LineCount() // Returns number of lines in text.
METHOD GetText() // Returns aText as a string (for MemoEdit())
METHOD GetText( lSoftCR ) // Returns aText as a string (for MemoEdit())
METHOD display() // Redraw a window
METHOD RefreshLine() // Redraw a line
@@ -281,13 +281,15 @@ METHOD LineLen( nRow ) CLASS HBEditor
RETURN iif( nRow >= 1 .AND. nRow <= Len( ::aText ), Len( ::aText[ nRow ]:cText ), 0 )
// Converts an array of text lines to a String
METHOD GetText() CLASS HBEditor
METHOD GetText( lSoftCR ) CLASS HBEditor
LOCAL cString := ""
LOCAL cEOL := hb_eol()
LOCAL cSoftCR
IF ::lWordWrap
AEval( ::aText, {| cItem | cString += cItem:cText + iif( cItem:lSoftCR, "", cEOL ) },, ::naTextLen - 1 )
cSoftCR := iif( hb_defaultValue( lSoftCR, .F. ), Chr( 141 ) + Chr( 10 ), "" )
AEval( ::aText, {| cItem | cString += cItem:cText + iif( cItem:lSoftCR, cSoftCR, cEOL ) },, ::naTextLen - 1 )
ELSE
AEval( ::aText, {| cItem | cString += cItem:cText + cEOL },, ::naTextLen - 1 )
ENDIF
@@ -1072,7 +1074,7 @@ STATIC FUNCTION Text2Array( cString, nWordWrapCol, nTabWidth )
IF nWordWrapCol != NIL .AND. Len( cLine ) > nWordWrapCol
nLines := MLCount( cLine, nWordWrapCol + 1, nTabWidth )
FOR nLine := 1 TO nLines
AAdd( aArray, HBTextLine():New( MemoLine( cLine, nWordWrapCol + 1, nLine, nTabWidth,,, .T. ), ;
AAdd( aArray, HBTextLine():New( MemoLine( cLine, nWordWrapCol + 1, nLine, nTabWidth,,, .F. ), ;
nLine < nLines ) )
NEXT
ELSE