From 155977236e766cfa03ed1e512b41abefb65a9d0b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 11 Feb 2009 15:34:30 +0000 Subject: [PATCH] 2009-02-11 16:30 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/gtwvg/wvgutils.c ! Applied fixes done to WIN_APPENDMENU() to the exact same function named WVT_APPENDMENU(). % Converted WVT_APPENDMENU() to a simple stub redirecting the call to WIN_APPENDMENU(). --- harbour/ChangeLog | 7 ++++ harbour/contrib/gtwvg/wvgutils.c | 72 ++------------------------------ 2 files changed, 10 insertions(+), 69 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 447b356f9a..9dc44903f8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,13 @@ 2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-02-11 16:30 UTC+0100 Viktor Szakats (harbour.01 syenar hu) + * contrib/gtwvg/wvgutils.c + ! Applied fixes done to WIN_APPENDMENU() to the exact + same function named WVT_APPENDMENU(). + % Converted WVT_APPENDMENU() to a simple stub redirecting + the call to WIN_APPENDMENU(). + 2009-02-11 15:33 UTC+0100 Viktor Szakats (harbour.01 syenar hu) * contrib/gtwvg/wvgwin.c ! Fixed to use hb_snprintf() instead of unsafe sprintf(). diff --git a/harbour/contrib/gtwvg/wvgutils.c b/harbour/contrib/gtwvg/wvgutils.c index 87f73dc7e9..adf8cefa8e 100644 --- a/harbour/contrib/gtwvg/wvgutils.c +++ b/harbour/contrib/gtwvg/wvgutils.c @@ -733,77 +733,11 @@ HB_FUNC( WVT_CREATEPOPUPMENU ) //-------------------------------------------------------------------// +HB_FUNC_EXTERN( WIN_APPENDMENU ); + HB_FUNC( WVT_APPENDMENU ) { - #if 0 - char ucBuf[ 256 ]; - int i,iLen; - LPTSTR lpszCaption; - - if ( ISCHAR( 4 ) ) - { - iLen = hb_parclen( 4 ); - if ( iLen > 0 && iLen < 256 ) // Translate '~' to '&' - { - lpszCaption = HB_TCHAR_CONVTO( hb_parc( 4 ) ); - for ( i = 0; i < iLen; i++ ) - { - ucBuf[ i ] = ( *lpszCaption == '~' ) ? '&' : ( char ) *lpszCaption; - lpszCaption++; - } - ucBuf[ iLen ]= '\0'; - - lpszCaption = HB_TCHAR_CONVTO( ucBuf ); - hb_retl( AppendMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), ( HB_PTRDIFF ) hb_parnint( 3 ), ( LPCTSTR ) lpszCaption ) ) ; - HB_TCHAR_FREE( lpszCaption ); - } - else - { - lpszCaption = HB_TCHAR_CONVTO( hb_parc( 4 ) ); - hb_retl( AppendMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), ( HB_PTRDIFF ) hb_parnint( 3 ), ( LPCTSTR ) lpszCaption ) ) ; - HB_TCHAR_FREE( lpszCaption ); - } - } - else - { - lpszCaption = ( LPTSTR ) ( HB_PTRDIFF ) hb_parnint( 4 ) ; // It is a SEPARATOR or Submenu - hb_retl( AppendMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), ( HB_PTRDIFF ) hb_parnint( 3 ), ( LPCTSTR ) lpszCaption ) ) ; - } - #endif - - LPTSTR buffer; - int i,iLen ; - - if ( ISCHAR( 4 ) ) - { - iLen = hb_parclen( 4 ); - if ( iLen > 0 && iLen < 256 ) // Translate '~' to '&' - { - LPTSTR pDest; - - buffer = HB_TCHAR_CONVTO( hb_parc( 4 ) ); - pDest = buffer; - for ( i = 0; i < iLen; i++ ) - { - pDest[ i ] = ( *buffer == '~' ) ? '&' : ( char ) *buffer; - buffer++; - } - buffer = pDest; - hb_retl( AppendMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), ( HB_PTRDIFF ) hb_parnint( 3 ), buffer ) ) ; - HB_TCHAR_FREE( buffer ); - } - else - { - buffer = HB_TCHAR_CONVTO( hb_parc( 4 ) ); - hb_retl( AppendMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), ( HB_PTRDIFF ) hb_parnint( 3 ), buffer ) ) ; - HB_TCHAR_FREE( buffer ); - } - } - else - { // It is a SEPARATOR or Submenu - LPCTSTR lpszCaption = ( LPCTSTR ) ( HB_PTRDIFF ) hb_parnint( 4 ) ; - hb_retl( AppendMenu( ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ), ( UINT ) hb_parni( 2 ), ( HB_PTRDIFF ) hb_parnint( 3 ), ( LPCTSTR ) lpszCaption ) ) ; - } + HB_FUNC_EXEC( WIN_APPENDMENU ); } //-------------------------------------------------------------------//