2007-05-07 11:04 UTC+0300 Chen Kedem <niki@actcom.co.il>

This commit is contained in:
Chen Kedem
2007-05-07 08:04:19 +00:00
parent dab98431de
commit 1c66044477
2 changed files with 17 additions and 5 deletions

View File

@@ -8,6 +8,12 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-05-07 11:04 UTC+0300 Chen Kedem <niki@actcom.co.il>
* source/rtl/mlctopos.c
! Fix bug#1635288 - Make the function MLCTOPOS() more Clipper
compatible. Also, the WordWrap value was taken from the wrong
parameter.
2007-05-07 02:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rdd/dbcmd.c
* initialize lpaParent in DBRELINFO structure to pArea - please

View File

@@ -61,9 +61,9 @@ HB_FUNC( MLCTOPOS )
ULONG ulTabLength = ISNUM( 5 ) ? hb_parni( 5 ) : 4;
ULONG ulLastSpace = 0;
ULONG ulCurLength = 0;
BOOL bWordWrap = ISLOG( 5 ) ? hb_parl( 5 ) : TRUE;
BOOL bWordWrap = ISLOG( 6 ) ? hb_parl( 6 ) : TRUE;
ULONG ulLen = hb_parclen( 1 );
ULONG ulLines = 0;
ULONG ulLines = 1;
ULONG ulPos;
ULONG ulBegOfLine = 0;
ULONG ulLastLen = 0;
@@ -124,15 +124,21 @@ HB_FUNC( MLCTOPOS )
if( ulCurLength > 0 )
{
ulLines++;
ulBegOfLine = ulPos - ulCurLength;
ulLastLen = ulCurLength ;
}
if( ulLine == ulLines )
{
ulLastLen--; /* Column is zero based */
hb_retnl( ulBegOfLine + ( ( ulCol < ulLastLen ) ? ulCol : ulLastLen ) );
if( ulLastLen )
ulLastLen--; /* Column is zero based */
ulPos = ulBegOfLine + 1 + ( ( ulCol < ulLastLen ) ? ulCol : ulLastLen );
/* When wordwrap is active, skip the first space if not on the first line */
if( bWordWrap && !ulCol && ulLine > 1 )
if( pszString[ ulPos - 1 ] == ' ' || pszString[ ulPos - 1 ] == HB_CHAR_HT )
ulPos++;
hb_retnl( ulPos );
}
else
hb_retnl( ulLen );