diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d3123a9982..01aed4e49b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,12 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-23 19:10 UTC+0300 Pavel Tsarenko (tpe2 at mail.ru) + * contrib/hbct/screen1.c + * added codepage translation in ScreenMix and SayScreen functions + * contrib/hbmisc/numtxtru.prg + * small enhacement + 2012-11-23 17:46 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbnf/aredit.prg * contrib/hbnf/popadder.prg diff --git a/harbour/contrib/hbct/screen1.c b/harbour/contrib/hbct/screen1.c index c6da13523a..2a77cc5441 100644 --- a/harbour/contrib/hbct/screen1.c +++ b/harbour/contrib/hbct/screen1.c @@ -109,22 +109,30 @@ HB_FUNC( SCREENMIX ) if( iRow >= 0 && iCol >= 0 && iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() ) { + int iColor; + HB_BYTE bAttr; + HB_USHORT usChar; + HB_WCHAR wc; + PHB_CODEPAGE cdp = hb_gtHostCP(); + HB_SIZE nIndex = 0; + hb_gtBeginWrite(); i = iCol; - do + for( ;; ) { - if( hb_gtPutChar( iRow, i++, ( HB_UCHAR ) szAttr[ ul ], 0, ( HB_UCHAR ) *szText++ ) != HB_SUCCESS ) + if( hb_gtGetChar( iRow, i, &iColor, &bAttr, &usChar ) != HB_SUCCESS ) { if( ++iRow > hb_gtMaxRow() ) break; - --szText; - ++nLen; i = iCol; } - else if( ++ul == nAttr ) + else if( HB_CDPCHAR_GET( cdp, szText, nLen, &nIndex, &wc ) ) + hb_gtPutChar( iRow, i++, ( HB_UCHAR ) szAttr[ ul ], 0, wc ); + else + break; + if( ++ul == nAttr ) ul = 0; } - while( --nLen ); hb_gtEndWrite(); } } @@ -150,24 +158,28 @@ HB_FUNC( SAYSCREEN ) if( iRow >= 0 && iCol >= 0 && iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() ) { + PHB_CODEPAGE cdp = hb_gtHostCP(); + HB_SIZE nIndex = 0; + hb_gtBeginWrite(); i = iCol; - do + for( ;; ) { int iColor; HB_BYTE bAttr; HB_USHORT usChar; + HB_WCHAR wc; if( hb_gtGetChar( iRow, i, &iColor, &bAttr, &usChar ) != HB_SUCCESS ) { if( ++iRow > hb_gtMaxRow() ) break; - ++nLen; i = iCol; } + else if( HB_CDPCHAR_GET( cdp, szText, nLen, &nIndex, &wc ) ) + hb_gtPutChar( iRow, i++, iColor, bAttr, wc ); else - hb_gtPutChar( iRow, i++, iColor, bAttr, ( HB_UCHAR ) *szText++ ); + break; } - while( --nLen ); hb_gtEndWrite(); } } diff --git a/harbour/contrib/hbmisc/numtxtru.prg b/harbour/contrib/hbmisc/numtxtru.prg index 3806a1e08c..abb38dd1bb 100644 --- a/harbour/contrib/hbmisc/numtxtru.prg +++ b/harbour/contrib/hbmisc/numtxtru.prg @@ -466,8 +466,8 @@ FUNCTION MnyToTxtRU( nValue, cLang, nMode1, nMode2 ) nCent := Round( ( nValue - Int( nValue ) ) * 100, 0 ) nValue := Int( nValue ) - cRetVal := MnyToStrRaw( nValue, cLang, aMsg[ NTSR_CURR ], nMode1 ) + " " + ; - MnyToStrRaw( nCent, cLang, aMsg[ NTSR_CENT ], nMode2 ) + cRetVal := MnyToStrRaw( nValue, aMsg, aMsg[ NTSR_CURR ], nMode1 ) + " " + ; + MnyToStrRaw( nCent, aMsg, aMsg[ NTSR_CENT ], nMode2 ) RETURN hb_UTF8ToStr( cRetVal ) @@ -492,9 +492,8 @@ FUNCTION DateToTxtRU( dDate, cLang, lWord ) RETURN hb_UTF8ToStr( cRetVal ) -STATIC FUNCTION MnyToStrRaw( nValue, cLang, aCur, nMode ) +STATIC FUNCTION MnyToStrRaw( nValue, aMsg, aCur, nMode ) - LOCAL aMsg := GetLangMsg( cLang ) LOCAL cRetVal LOCAL cTemp, nTemp LOCAL lShort := nMode == 2 .OR. nMode == 4