Gabriel Ivăncescu : msscript.ocx: Implement IScriptError::get_Column.
Alexandre Julliard
julliard at winehq.org
Tue Aug 25 16:16:56 CDT 2020
Module: wine
Branch: master
Commit: dae6979ee8f7fb7876e9c3f7ba3c972f957855f5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=dae6979ee8f7fb7876e9c3f7ba3c972f957855f5
Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date: Mon Aug 24 17:56:20 2020 +0300
msscript.ocx: Implement IScriptError::get_Column.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msscript.ocx/msscript.c | 9 +++++++--
dlls/msscript.ocx/tests/msscript.c | 20 +++++++++++++++-----
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c
index 3bf900913e..112403a78c 100644
--- a/dlls/msscript.ocx/msscript.c
+++ b/dlls/msscript.ocx/msscript.c
@@ -131,6 +131,7 @@ typedef struct {
BSTR help_file;
DWORD help_context;
ULONG line;
+ LONG column;
BOOLEAN info_filled;
BOOLEAN text_filled;
@@ -2168,6 +2169,7 @@ static void fill_error_pos(ScriptError *error)
return;
error->line = line;
+ error->column = column;
}
static HRESULT WINAPI ScriptError_QueryInterface(IScriptError *iface, REFIID riid, void **ppv)
@@ -2358,9 +2360,11 @@ static HRESULT WINAPI ScriptError_get_Column(IScriptError *iface, LONG *plColumn
{
ScriptError *This = impl_from_IScriptError(iface);
- FIXME("(%p)->(%p)\n", This, plColumn);
+ TRACE("(%p)->(%p)\n", This, plColumn);
- return E_NOTIMPL;
+ fill_error_pos(This);
+ *plColumn = This->column;
+ return S_OK;
}
static HRESULT WINAPI ScriptError_Clear(IScriptError *iface)
@@ -2386,6 +2390,7 @@ static HRESULT WINAPI ScriptError_Clear(IScriptError *iface)
This->help_file = NULL;
This->help_context = 0;
This->line = 0;
+ This->column = 0;
This->info_filled = FALSE;
This->text_filled = FALSE;
diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c
index 5e1ae16196..5b958633da 100644
--- a/dlls/msscript.ocx/tests/msscript.c
+++ b/dlls/msscript.ocx/tests/msscript.c
@@ -3354,6 +3354,9 @@ static void test_IScriptControl_get_Error(void)
hr = IScriptError_get_Line(error, &x);
ok(hr == S_OK, "IScriptError_get_Line failed: 0x%08x.\n", hr);
ok(x == 0, "Error Line is not 0, got %d.\n", x);
+ hr = IScriptError_get_Column(error, &x);
+ ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
+ ok(x == 0, "Error Column is not 0, got %d.\n", x);
str = SysAllocString(L"jscript");
hr = IScriptControl_put_Language(sc, str);
@@ -3387,6 +3390,9 @@ static void test_IScriptControl_get_Error(void)
hr = IScriptError_get_Line(error, &x);
ok(hr == S_OK, "IScriptError_get_Line failed: 0x%08x.\n", hr);
ok(x == 3, "Error Line is not 3, got %d.\n", x);
+ hr = IScriptError_get_Column(error, &x);
+ ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
+ ok(x == 5, "Error Column is not 5, got %d.\n", x);
hr = IScriptError_Clear(error);
ok(hr == S_OK, "IScriptError_Clear failed: 0x%08x.\n", hr);
@@ -3412,6 +3418,9 @@ static void test_IScriptControl_get_Error(void)
hr = IScriptError_get_Line(error, &x);
ok(hr == S_OK, "IScriptError_get_Line failed: 0x%08x.\n", hr);
ok(x == 0, "Error Line is not 0, got %d.\n", x);
+ hr = IScriptError_get_Column(error, &x);
+ ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
+ ok(x == 0, "Error Column is not 0, got %d.\n", x);
hr = IScriptControl_get_Error(sc, &error2);
ok(hr == S_OK, "IScriptControl_get_Error failed: 0x%08x.\n", hr);
@@ -3488,7 +3497,8 @@ static void test_IScriptControl_get_Error(void)
ok(x == 0, "Error Line is not 0, got %d.\n", x);
CHECK_CALLED(GetSourcePosition);
hr = IScriptError_get_Column(error, &x);
- todo_wine ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
+ ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
+ ok(x == 0, "Error Column is not 0, got %d.\n", x);
/* Check with deferred fill-in */
ActiveScriptError_stage = 1;
@@ -3525,8 +3535,8 @@ static void test_IScriptControl_get_Error(void)
ok(x == 42, "Error Line is not 42, got %d.\n", x);
CHECK_CALLED(GetSourcePosition);
hr = IScriptError_get_Column(error, &x);
- todo_wine ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
- todo_wine ok(x == 10, "Error Column is not 10, got %d.\n", x);
+ ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
+ ok(x == 10, "Error Column is not 10, got %d.\n", x);
/* Check without deferred fill-in, but using scode */
ActiveScriptError_stage = 2;
@@ -3560,8 +3570,8 @@ static void test_IScriptControl_get_Error(void)
ok(x == 42, "Error Line is not 42, got %d.\n", x);
CHECK_CALLED(GetSourcePosition);
hr = IScriptError_get_Column(error, &x);
- todo_wine ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
- todo_wine ok(x == 10, "Error Column is not 10, got %d.\n", x);
+ ok(hr == S_OK, "IScriptError_get_Column failed: 0x%08x.\n", hr);
+ ok(x == 10, "Error Column is not 10, got %d.\n", x);
IActiveScriptSite_Release(site);
More information about the wine-cvs
mailing list