Commit dae6979e authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

msscript.ocx: Implement IScriptError::get_Column.

parent 00b4d368
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment