From 79df0b655949f2369b61bd535c7b39a85f1ef3b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Czerpak?= Date: Wed, 10 May 2017 16:39:38 +0200 Subject: [PATCH] 2017-05-10 16:39 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbwin/olecore.c - removed support for VT_DECIMAL and VT_PTR arrays from __oleVariantNew() - I found in MSDN that such types are unsupported in SAFEARRAYs ! fixed indexes in array conversion in __oleVariantNew() ! fixed conversion to VT_BSTR arrays in __oleVariantNew() --- ChangeLog.txt | 8 ++++++++ contrib/hbwin/olecore.c | 23 ++--------------------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4ec3b426ec..eb4b78ae50 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,14 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2017-05-10 16:39 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * contrib/hbwin/olecore.c + - removed support for VT_DECIMAL and VT_PTR arrays from + __oleVariantNew() - I found in MSDN that such types are + unsupported in SAFEARRAYs + ! fixed indexes in array conversion in __oleVariantNew() + ! fixed conversion to VT_BSTR arrays in __oleVariantNew() + 2017-05-10 12:27 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/hbwin/olecore.c + automatically add WIN_VT_ARRAY bit in 1-st parameter of diff --git a/contrib/hbwin/olecore.c b/contrib/hbwin/olecore.c index 4e45702ebc..3014112c26 100644 --- a/contrib/hbwin/olecore.c +++ b/contrib/hbwin/olecore.c @@ -602,13 +602,6 @@ static SAFEARRAY * hb_oleSafeArrayFromItem( PHB_ITEM pItem, VARTYPE vt ) ptr = &V_CY( &v ); } break; - case VT_DECIMAL: - if( pStr == NULL ) - { - VarDecFromR8( hb_arrayGetND( pItem, uiPos ), &HB_WIN_U1( &v, decVal ) /*&V_DECIMAL( &v )*/ ); - ptr = &HB_WIN_U1( &v, decVal ); /*&V_DECIMAL( &v )*/ - } - break; case VT_DATE: if( pStr == NULL ) { @@ -616,28 +609,16 @@ static SAFEARRAY * hb_oleSafeArrayFromItem( PHB_ITEM pItem, VARTYPE vt ) ptr = &V_R8( &v ); } break; -#ifdef HB_OLE_PASS_POINTERS - case VT_PTR: - if( pStr == NULL ) - { - V_BYREF( &v ) = hb_arrayGetPtr( pItem, uiPos ); - ptr = &V_BYREF( &v ); - } - break; -#endif case VT_BSTR: if( pStr == NULL ) - { - V_BSTR( &v ) = hb_oleItemToString( hb_arrayGetItemPtr( pItem, uiPos ) ); - ptr = &V_BSTR( &v ); - } + ptr = hb_oleItemToString( hb_arrayGetItemPtr( pItem, uiPos ) ); break; } if( ptr != NULL ) { long lIndex[ 1 ]; - lIndex[ 0 ] = ( long ) uiPos; + lIndex[ 0 ] = ( long ) uiPos - 1; SafeArrayPutElement( pSafeArray, lIndex, ptr ); } else