mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-22 14:44:09 +00:00
msado15: Implement _Recordset get_EditMode.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
a34669b238
commit
d106b3c450
|
@ -48,6 +48,7 @@ struct recordset
|
||||||
CursorLocationEnum cursor_location;
|
CursorLocationEnum cursor_location;
|
||||||
CursorTypeEnum cursor_type;
|
CursorTypeEnum cursor_type;
|
||||||
IRowset *row_set;
|
IRowset *row_set;
|
||||||
|
EditModeEnum editmode;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fields
|
struct fields
|
||||||
|
@ -1575,8 +1576,14 @@ static HRESULT WINAPI recordset_put_AbsolutePage( _Recordset *iface, PositionEnu
|
||||||
|
|
||||||
static HRESULT WINAPI recordset_get_EditMode( _Recordset *iface, EditModeEnum *mode )
|
static HRESULT WINAPI recordset_get_EditMode( _Recordset *iface, EditModeEnum *mode )
|
||||||
{
|
{
|
||||||
FIXME( "%p, %p\n", iface, mode );
|
struct recordset *recordset = impl_from_Recordset( iface );
|
||||||
return E_NOTIMPL;
|
TRACE( "%p, %p\n", iface, mode );
|
||||||
|
|
||||||
|
if (recordset->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
|
||||||
|
if (recordset->index < 0) return MAKE_ADO_HRESULT( adErrNoCurrentRecord );
|
||||||
|
|
||||||
|
*mode = recordset->editmode;
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI recordset_get_Filter( _Recordset *iface, VARIANT *criteria )
|
static HRESULT WINAPI recordset_get_Filter( _Recordset *iface, VARIANT *criteria )
|
||||||
|
@ -2123,6 +2130,7 @@ HRESULT Recordset_create( void **obj )
|
||||||
recordset->cursor_location = adUseServer;
|
recordset->cursor_location = adUseServer;
|
||||||
recordset->cursor_type = adOpenForwardOnly;
|
recordset->cursor_type = adOpenForwardOnly;
|
||||||
recordset->row_set = NULL;
|
recordset->row_set = NULL;
|
||||||
|
recordset->editmode = adEditNone;
|
||||||
|
|
||||||
*obj = &recordset->Recordset_iface;
|
*obj = &recordset->Recordset_iface;
|
||||||
TRACE( "returning iface %p\n", *obj );
|
TRACE( "returning iface %p\n", *obj );
|
||||||
|
|
|
@ -60,6 +60,7 @@ static void test_Recordset(void)
|
||||||
BSTR name;
|
BSTR name;
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
VARIANT bookmark;
|
VARIANT bookmark;
|
||||||
|
EditModeEnum editmode;
|
||||||
|
|
||||||
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
|
hr = CoCreateInstance( &CLSID_Recordset, NULL, CLSCTX_INPROC_SERVER, &IID__Recordset, (void **)&recordset );
|
||||||
ok( hr == S_OK, "got %08lx\n", hr );
|
ok( hr == S_OK, "got %08lx\n", hr );
|
||||||
|
@ -110,6 +111,10 @@ static void test_Recordset(void)
|
||||||
ok( hr == S_OK, "got %08lx\n", hr );
|
ok( hr == S_OK, "got %08lx\n", hr );
|
||||||
ok( cursor == adOpenForwardOnly, "got %d\n", cursor );
|
ok( cursor == adOpenForwardOnly, "got %d\n", cursor );
|
||||||
|
|
||||||
|
editmode = -1;
|
||||||
|
hr = _Recordset_get_EditMode( recordset, &editmode );
|
||||||
|
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08lx\n", hr );
|
||||||
|
|
||||||
VariantInit( &bookmark );
|
VariantInit( &bookmark );
|
||||||
hr = _Recordset_get_Bookmark( recordset, &bookmark );
|
hr = _Recordset_get_Bookmark( recordset, &bookmark );
|
||||||
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08lx\n", hr );
|
ok( hr == MAKE_ADO_HRESULT( adErrObjectClosed ), "got %08lx\n", hr );
|
||||||
|
@ -197,6 +202,10 @@ static void test_Recordset(void)
|
||||||
ok( is_eof( recordset ), "not eof\n" );
|
ok( is_eof( recordset ), "not eof\n" );
|
||||||
ok( is_bof( recordset ), "not bof\n" );
|
ok( is_bof( recordset ), "not bof\n" );
|
||||||
|
|
||||||
|
editmode = -1;
|
||||||
|
hr = _Recordset_get_EditMode( recordset, &editmode );
|
||||||
|
ok( hr == MAKE_ADO_HRESULT( adErrNoCurrentRecord ), "got %08lx\n", hr );
|
||||||
|
|
||||||
hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified );
|
hr = _Recordset_Open( recordset, missing, missing, adOpenStatic, adLockBatchOptimistic, adCmdUnspecified );
|
||||||
ok( hr == MAKE_ADO_HRESULT( adErrObjectOpen ), "got %08lx\n", hr );
|
ok( hr == MAKE_ADO_HRESULT( adErrObjectOpen ), "got %08lx\n", hr );
|
||||||
|
|
||||||
|
@ -223,6 +232,11 @@ static void test_Recordset(void)
|
||||||
ok( !is_eof( recordset ), "eof\n" );
|
ok( !is_eof( recordset ), "eof\n" );
|
||||||
ok( !is_bof( recordset ), "bof\n" );
|
ok( !is_bof( recordset ), "bof\n" );
|
||||||
|
|
||||||
|
editmode = -1;
|
||||||
|
hr = _Recordset_get_EditMode( recordset, &editmode );
|
||||||
|
ok( hr == S_OK, "got %08lx\n", hr );
|
||||||
|
todo_wine ok( editmode == adEditAdd, "got %d\n", editmode );
|
||||||
|
|
||||||
rec_count = -1;
|
rec_count = -1;
|
||||||
hr = _Recordset_get_RecordCount( recordset, &rec_count );
|
hr = _Recordset_get_RecordCount( recordset, &rec_count );
|
||||||
ok( hr == S_OK, "got %08lx\n", hr );
|
ok( hr == S_OK, "got %08lx\n", hr );
|
||||||
|
|
Loading…
Reference in a new issue