Wine-Devel
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 24 participants
- 84529 discussions
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/d3d11/Makefile.in | 1 -
dlls/d3d11/device.c | 1 +
dlls/d3d11/view.c | 1 +
3 files changed, 2 insertions(+), 1 deletion(-)
3
2
Signed-off-by: Esme Povirk <esme(a)codeweavers.com>
---
dlls/appwiz.cpl/addons.c | 4 ++--
dlls/mscoree/mscoree_private.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/appwiz.cpl/addons.c b/dlls/appwiz.cpl/addons.c
index b2e726422da..e3004c972f1 100644
--- a/dlls/appwiz.cpl/addons.c
+++ b/dlls/appwiz.cpl/addons.c
@@ -57,10 +57,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(appwizcpl);
#define GECKO_SHA "???"
#endif
-#define MONO_VERSION "6.0.0"
+#define MONO_VERSION "6.1.1"
#if defined(__i386__) || defined(__x86_64__)
#define MONO_ARCH "x86"
-#define MONO_SHA "5c7af5976d101be359a77045c9cc8fc40feac028263d00e731578864e8b183d0"
+#define MONO_SHA "ac3b14beafde34b8482287e597000113dc06a915f32c9fd06c77eb819079e38b"
#else
#define MONO_ARCH ""
#define MONO_SHA "???"
diff --git a/dlls/mscoree/mscoree_private.h b/dlls/mscoree/mscoree_private.h
index 69c30e5e3e0..e396d855e71 100644
--- a/dlls/mscoree/mscoree_private.h
+++ b/dlls/mscoree/mscoree_private.h
@@ -45,7 +45,7 @@ extern HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version)
extern HRESULT assembly_get_vtable_fixups(ASSEMBLY *assembly, VTableFixup **fixups, DWORD *count) DECLSPEC_HIDDEN;
extern HRESULT assembly_get_native_entrypoint(ASSEMBLY *assembly, NativeEntryPointFunc *func) DECLSPEC_HIDDEN;
-#define WINE_MONO_VERSION "6.0.0"
+#define WINE_MONO_VERSION "6.1.1"
/* Mono embedding */
typedef struct _MonoDomain MonoDomain;
--
2.25.1
2
1
[PATCH] conhost: Fix wrapping when write_console finishes on line end.
by Gabriel Ivăncescu March 31, 2021
by Gabriel Ivăncescu March 31, 2021
March 31, 2021
Remember the fact we completed the entire line in cursor_x, but report it
as usual in other cases as the last character on the line. When writing a
new character, a newline is then written so it wraps properly.
This can happen in practice when writing one character at a time to the
console; right now it will keep overwriting the last character on the line.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
programs/conhost/conhost.c | 30 ++++++++--------
programs/conhost/conhost.h | 5 +++
programs/conhost/tests/tty.c | 67 ++++++++++++++++++++++++++++++++++++
programs/conhost/window.c | 8 ++---
4 files changed, 91 insertions(+), 19 deletions(-)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index fbee37d..e5ec84f 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -278,7 +278,7 @@ static void tty_sync( struct console *console )
if (console->active->cursor_visible)
{
- set_tty_cursor( console, console->active->cursor_x, console->active->cursor_y );
+ set_tty_cursor( console, get_bounded_cursor_x(console->active), console->active->cursor_y );
if (!console->tty_cursor_visible)
{
tty_write( console, "\x1b[?25h", 6 ); /* show cursor */
@@ -307,11 +307,12 @@ static void scroll_to_cursor( struct screen_buffer *screen_buffer )
{
int w = screen_buffer->win.right - screen_buffer->win.left + 1;
int h = screen_buffer->win.bottom - screen_buffer->win.top + 1;
+ unsigned int cursor_x = get_bounded_cursor_x(screen_buffer);
- if (screen_buffer->cursor_x < screen_buffer->win.left)
- screen_buffer->win.left = min( screen_buffer->cursor_x, screen_buffer->width - w );
- else if (screen_buffer->cursor_x > screen_buffer->win.right)
- screen_buffer->win.left = max( screen_buffer->cursor_x, w ) - w + 1;
+ if (cursor_x < screen_buffer->win.left)
+ screen_buffer->win.left = min( cursor_x, screen_buffer->width - w );
+ else if (cursor_x > screen_buffer->win.right)
+ screen_buffer->win.left = max( cursor_x, w ) - w + 1;
screen_buffer->win.right = screen_buffer->win.left + w - 1;
if (screen_buffer->cursor_y < screen_buffer->win.top)
@@ -1209,7 +1210,7 @@ static void update_read_output( struct console *console )
scroll_to_cursor( screen_buffer );
}
if (console->is_unix)
- set_tty_cursor_relative( screen_buffer->console, screen_buffer->cursor_x, screen_buffer->cursor_y );
+ set_tty_cursor_relative( screen_buffer->console, get_bounded_cursor_x(screen_buffer), screen_buffer->cursor_y );
tty_sync( screen_buffer->console );
update_window_config( screen_buffer->console );
}
@@ -1356,7 +1357,7 @@ static NTSTATUS read_console( struct console *console, unsigned int ioctl, size_
}
console->edit_line.history_index = console->history_index;
- console->edit_line.home_x = console->active->cursor_x;
+ console->edit_line.home_x = get_bounded_cursor_x(console->active);
console->edit_line.home_y = console->active->cursor_y;
console->edit_line.status = STATUS_PENDING;
if (edit_line_grow( console, 1 )) console->edit_line.buf[0] = 0;
@@ -1716,7 +1717,7 @@ static NTSTATUS get_output_info( struct screen_buffer *screen_buffer, size_t *ou
info->cursor_size = screen_buffer->cursor_size;
info->cursor_visible = screen_buffer->cursor_visible;
- info->cursor_x = screen_buffer->cursor_x;
+ info->cursor_x = get_bounded_cursor_x(screen_buffer);
info->cursor_y = screen_buffer->cursor_y;
info->width = screen_buffer->width;
info->height = screen_buffer->height;
@@ -1917,10 +1918,12 @@ static NTSTATUS write_console( struct screen_buffer *screen_buffer, const WCHAR
switch (buffer[i])
{
case '\b':
- if (screen_buffer->cursor_x) screen_buffer->cursor_x--;
+ if (screen_buffer->cursor_x && screen_buffer->cursor_x < screen_buffer->width)
+ screen_buffer->cursor_x--;
continue;
case '\t':
- j = min( screen_buffer->width - screen_buffer->cursor_x, 8 - (screen_buffer->cursor_x % 8) );
+ j = screen_buffer->cursor_x < screen_buffer->width ? screen_buffer->cursor_x : 0;
+ j = min( screen_buffer->width - j, 8 - (j % 8) );
while (j--) write_char( screen_buffer, ' ', &update_rect, NULL );
continue;
case '\n':
@@ -1946,11 +1949,8 @@ static NTSTATUS write_console( struct screen_buffer *screen_buffer, const WCHAR
write_char( screen_buffer, buffer[i], &update_rect, NULL );
}
- if (screen_buffer->cursor_x == screen_buffer->width)
- {
- if (screen_buffer->mode & ENABLE_WRAP_AT_EOL_OUTPUT) screen_buffer->cursor_x--;
- else screen_buffer->cursor_x = update_rect.left;
- }
+ if (screen_buffer->cursor_x == screen_buffer->width && !(screen_buffer->mode & ENABLE_WRAP_AT_EOL_OUTPUT))
+ screen_buffer->cursor_x = update_rect.left;
scroll_to_cursor( screen_buffer );
update_output( screen_buffer, &update_rect );
diff --git a/programs/conhost/conhost.h b/programs/conhost/conhost.h
index 6f39853..9e855c3 100644
--- a/programs/conhost/conhost.h
+++ b/programs/conhost/conhost.h
@@ -140,6 +140,11 @@ NTSTATUS write_console_input( struct console *console, const INPUT_RECORD *recor
void notify_screen_buffer_size( struct screen_buffer *screen_buffer );
NTSTATUS change_screen_buffer_size( struct screen_buffer *screen_buffer, int new_width, int new_height );
+static inline unsigned int get_bounded_cursor_x( struct screen_buffer *screen_buffer )
+{
+ return min(screen_buffer->cursor_x, screen_buffer->width - 1);
+}
+
static inline void empty_update_rect( struct screen_buffer *screen_buffer, RECT *rect )
{
SetRect( rect, screen_buffer->width, screen_buffer->height, 0, 0 );
diff --git a/programs/conhost/tests/tty.c b/programs/conhost/tests/tty.c
index 7cc37fa..db6c646 100644
--- a/programs/conhost/tests/tty.c
+++ b/programs/conhost/tests/tty.c
@@ -553,6 +553,8 @@ static void expect_char_key_(unsigned int line, WCHAR ch)
static void test_write_console(void)
{
+ BOOL expect_newline;
+
child_string_request(REQ_WRITE_CONSOLE, L"abc");
skip_hide_cursor();
expect_output_sequence("abc");
@@ -761,6 +763,71 @@ static void test_write_console(void)
expect_empty_output();
child_set_output_mode(ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT);
+
+ child_set_cursor(28, 11);
+ skip_hide_cursor();
+ expect_output_sequence("\x1b[12;29H"); /* set cursor */
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
+
+ child_string_request(REQ_WRITE_CONSOLE, L"a");
+ skip_hide_cursor();
+ expect_output_sequence("a");
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
+
+ child_string_request(REQ_WRITE_CONSOLE, L"b");
+ skip_hide_cursor();
+ expect_output_sequence("b");
+ expect_newline = TRUE;
+ if (!skip_sequence("\b"))
+ {
+ expect_newline = FALSE;
+ expect_output_sequence("\r\n");
+ }
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
+
+ child_string_request(REQ_WRITE_CONSOLE, L"c");
+ skip_hide_cursor();
+ if (expect_newline) expect_output_sequence("\r\n");
+ expect_output_sequence("c");
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
+
+ child_set_cursor(28, 11);
+ skip_hide_cursor();
+ expect_output_sequence("\x1b[12;29H"); /* set cursor */
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
+
+ child_string_request(REQ_WRITE_CONSOLE, L"x");
+ skip_hide_cursor();
+ expect_output_sequence("x");
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
+
+ child_string_request(REQ_WRITE_CONSOLE, L"y");
+ skip_hide_cursor();
+ expect_output_sequence("y");
+ expect_newline = TRUE;
+ if (!skip_sequence("\b"))
+ {
+ expect_newline = FALSE;
+ expect_output_sequence("\r\n");
+ }
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
+
+ child_string_request(REQ_WRITE_CONSOLE, L"\b");
+ expect_empty_output();
+
+ child_string_request(REQ_WRITE_CONSOLE, L"z");
+ skip_hide_cursor();
+ if (expect_newline) expect_output_sequence("\r\n");
+ expect_output_sequence("z");
+ skip_sequence("\x1b[?25h"); /* show cursor */
+ expect_empty_output();
}
static void test_tty_output(void)
diff --git a/programs/conhost/window.c b/programs/conhost/window.c
index a665cbb..456bcdd 100644
--- a/programs/conhost/window.c
+++ b/programs/conhost/window.c
@@ -430,8 +430,8 @@ static void update_window_cursor( struct console *console )
{
if (console->win != GetFocus() || !console->active->cursor_visible) return;
- SetCaretPos( (console->active->cursor_x - console->active->win.left) * console->active->font.width,
- (console->active->cursor_y - console->active->win.top) * console->active->font.height );
+ SetCaretPos( (get_bounded_cursor_x(console->active) - console->active->win.left) * console->active->font.width,
+ (console->active->cursor_y - console->active->win.top) * console->active->font.height );
ShowCaret( console->win );
}
@@ -607,10 +607,10 @@ static void update_window( struct console *console )
}
}
- if (update_all || console->active->cursor_x != console->window->cursor_pos.X ||
+ if (update_all || get_bounded_cursor_x(console->active) != console->window->cursor_pos.X ||
console->active->cursor_y != console->window->cursor_pos.Y)
{
- console->window->cursor_pos.X = console->active->cursor_x;
+ console->window->cursor_pos.X = get_bounded_cursor_x(console->active);
console->window->cursor_pos.Y = console->active->cursor_y;
update_window_cursor( console );
}
--
2.30.0
3
5
Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com>
---
Global options supposedly control exception handling configuration
of a COM core, which is now in combase.
dlls/combase/combase.c | 162 +++++++++++++++++++++++++++++++++++++-
dlls/combase/combase.spec | 2 +-
dlls/ole32/compobj.c | 96 ----------------------
dlls/ole32/oleproxy.c | 13 ---
4 files changed, 162 insertions(+), 111 deletions(-)
diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c
index 09d455317d1..cda0d52f579 100644
--- a/dlls/combase/combase.c
+++ b/dlls/combase/combase.c
@@ -429,6 +429,150 @@ static void com_cleanup_tlsdata(void)
NtCurrentTeb()->ReservedForOle = NULL;
}
+struct global_options
+{
+ IGlobalOptions IGlobalOptions_iface;
+ LONG refcount;
+};
+
+static inline struct global_options *impl_from_IGlobalOptions(IGlobalOptions *iface)
+{
+ return CONTAINING_RECORD(iface, struct global_options, IGlobalOptions_iface);
+}
+
+static HRESULT WINAPI global_options_QueryInterface(IGlobalOptions *iface, REFIID riid, void **ppv)
+{
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppv);
+
+ if (IsEqualGUID(&IID_IGlobalOptions, riid) || IsEqualGUID(&IID_IUnknown, riid))
+ {
+ *ppv = iface;
+ }
+ else
+ {
+ *ppv = NULL;
+ return E_NOINTERFACE;
+ }
+
+ IUnknown_AddRef((IUnknown *)*ppv);
+ return S_OK;
+}
+
+static ULONG WINAPI global_options_AddRef(IGlobalOptions *iface)
+{
+ struct global_options *options = impl_from_IGlobalOptions(iface);
+ LONG refcount = InterlockedIncrement(&options->refcount);
+
+ TRACE("%p, refcount %d.\n", iface, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI global_options_Release(IGlobalOptions *iface)
+{
+ struct global_options *options = impl_from_IGlobalOptions(iface);
+ LONG refcount = InterlockedDecrement(&options->refcount);
+
+ TRACE("%p, refcount %d.\n", iface, refcount);
+
+ if (!refcount)
+ heap_free(options);
+
+ return refcount;
+}
+
+static HRESULT WINAPI global_options_Set(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR value)
+{
+ FIXME("%p, %u, %lx.\n", iface, property, value);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI global_options_Query(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR *value)
+{
+ FIXME("%p, %u, %p.\n", iface, property, value);
+
+ return E_NOTIMPL;
+}
+
+static const IGlobalOptionsVtbl global_options_vtbl =
+{
+ global_options_QueryInterface,
+ global_options_AddRef,
+ global_options_Release,
+ global_options_Set,
+ global_options_Query
+};
+
+static HRESULT WINAPI class_factory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
+{
+ TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), ppv);
+
+ if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
+ {
+ *ppv = iface;
+ return S_OK;
+ }
+
+ *ppv = NULL;
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI class_factory_AddRef(IClassFactory *iface)
+{
+ return 2;
+}
+
+static ULONG WINAPI class_factory_Release(IClassFactory *iface)
+{
+ return 1;
+}
+
+static HRESULT WINAPI class_factory_LockServer(IClassFactory *iface, BOOL fLock)
+{
+ TRACE("%d\n", fLock);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI global_options_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
+{
+ struct global_options *object;
+ HRESULT hr;
+
+ TRACE("%p, %s, %p.\n", outer, debugstr_guid(riid), ppv);
+
+ if (outer)
+ return E_INVALIDARG;
+
+ if (!(object = heap_alloc(sizeof(*object))))
+ return E_OUTOFMEMORY;
+ object->IGlobalOptions_iface.lpVtbl = &global_options_vtbl;
+ object->refcount = 1;
+
+ hr = IGlobalOptions_QueryInterface(&object->IGlobalOptions_iface, riid, ppv);
+ IGlobalOptions_Release(&object->IGlobalOptions_iface);
+ return hr;
+}
+
+static const IClassFactoryVtbl global_options_factory_vtbl =
+{
+ class_factory_QueryInterface,
+ class_factory_AddRef,
+ class_factory_Release,
+ global_options_CreateInstance,
+ class_factory_LockServer
+};
+
+static IClassFactory global_options_factory = { &global_options_factory_vtbl };
+
+static HRESULT get_builtin_class_factory(REFCLSID rclsid, REFIID riid, void **obj)
+{
+ if (IsEqualCLSID(rclsid, &CLSID_GlobalOptions))
+ return IClassFactory_QueryInterface(&global_options_factory, riid, obj);
+ return E_UNEXPECTED;
+}
+
/***********************************************************************
* FreePropVariantArray (combase.@)
*/
@@ -1569,7 +1713,11 @@ static HRESULT com_get_class_object(REFCLSID rclsid, DWORD clscontext,
IsEqualCLSID(rclsid, &CLSID_StdGlobalInterfaceTable))
{
apartment_release(apt);
- return Ole32DllGetClassObject(rclsid, riid, obj);
+
+ if (IsEqualCLSID(rclsid, &CLSID_GlobalOptions))
+ return get_builtin_class_factory(rclsid, riid, obj);
+ else
+ return Ole32DllGetClassObject(rclsid, riid, obj);
}
}
@@ -3226,3 +3374,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
return TRUE;
}
+
+HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **obj)
+{
+ TRACE("%s, %s, %p.\n", debugstr_guid(rclsid), debugstr_guid(riid), obj);
+
+ *obj = NULL;
+
+ if (IsEqualCLSID(rclsid, &CLSID_GlobalOptions))
+ return IClassFactory_QueryInterface(&global_options_factory, riid, obj);
+
+ return CLASS_E_CLASSNOTAVAILABLE;
+}
diff --git a/dlls/combase/combase.spec b/dlls/combase/combase.spec
index 6e74cca1f24..0437714edcc 100644
--- a/dlls/combase/combase.spec
+++ b/dlls/combase/combase.spec
@@ -178,7 +178,7 @@
@ stub DcomChannelSetHResult
@ stdcall DllDebugObjectRPCHook(long ptr)
@ stdcall DllGetActivationFactory(ptr ptr)
-@ stdcall -private DllGetClassObject(ptr ptr ptr) ole32.DllGetClassObject
+@ stdcall -private DllGetClassObject(ptr ptr ptr)
@ stub EnableHookObject
@ stdcall FreePropVariantArray(long ptr)
@ stub FreePropVariantArrayWorker
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 51db61414dc..c40d8d03b2d 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -924,102 +924,6 @@ HRESULT Handler_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
return CLASS_E_CLASSNOTAVAILABLE;
}
-typedef struct {
- IGlobalOptions IGlobalOptions_iface;
- LONG ref;
-} GlobalOptions;
-
-static inline GlobalOptions *impl_from_IGlobalOptions(IGlobalOptions *iface)
-{
- return CONTAINING_RECORD(iface, GlobalOptions, IGlobalOptions_iface);
-}
-
-static HRESULT WINAPI GlobalOptions_QueryInterface(IGlobalOptions *iface, REFIID riid, void **ppv)
-{
- GlobalOptions *This = impl_from_IGlobalOptions(iface);
-
- TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
-
- if (IsEqualGUID(&IID_IGlobalOptions, riid) || IsEqualGUID(&IID_IUnknown, riid))
- {
- *ppv = iface;
- }
- else
- {
- *ppv = NULL;
- return E_NOINTERFACE;
- }
-
- IUnknown_AddRef((IUnknown*)*ppv);
- return S_OK;
-}
-
-static ULONG WINAPI GlobalOptions_AddRef(IGlobalOptions *iface)
-{
- GlobalOptions *This = impl_from_IGlobalOptions(iface);
- LONG ref = InterlockedIncrement(&This->ref);
-
- TRACE("(%p) ref=%d\n", This, ref);
-
- return ref;
-}
-
-static ULONG WINAPI GlobalOptions_Release(IGlobalOptions *iface)
-{
- GlobalOptions *This = impl_from_IGlobalOptions(iface);
- LONG ref = InterlockedDecrement(&This->ref);
-
- TRACE("(%p) ref=%d\n", This, ref);
-
- if (!ref)
- heap_free(This);
-
- return ref;
-}
-
-static HRESULT WINAPI GlobalOptions_Set(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR value)
-{
- GlobalOptions *This = impl_from_IGlobalOptions(iface);
- FIXME("(%p)->(%u %lx)\n", This, property, value);
- return S_OK;
-}
-
-static HRESULT WINAPI GlobalOptions_Query(IGlobalOptions *iface, GLOBALOPT_PROPERTIES property, ULONG_PTR *value)
-{
- GlobalOptions *This = impl_from_IGlobalOptions(iface);
- FIXME("(%p)->(%u %p)\n", This, property, value);
- return E_NOTIMPL;
-}
-
-static const IGlobalOptionsVtbl GlobalOptionsVtbl = {
- GlobalOptions_QueryInterface,
- GlobalOptions_AddRef,
- GlobalOptions_Release,
- GlobalOptions_Set,
- GlobalOptions_Query
-};
-
-HRESULT WINAPI GlobalOptions_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
-{
- GlobalOptions *global_options;
- HRESULT hres;
-
- TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
-
- if (outer)
- return E_INVALIDARG;
-
- global_options = heap_alloc(sizeof(*global_options));
- if (!global_options)
- return E_OUTOFMEMORY;
- global_options->IGlobalOptions_iface.lpVtbl = &GlobalOptionsVtbl;
- global_options->ref = 1;
-
- hres = IGlobalOptions_QueryInterface(&global_options->IGlobalOptions_iface, riid, ppv);
- IGlobalOptions_Release(&global_options->IGlobalOptions_iface);
- return hres;
-}
-
/***********************************************************************
* DllMain (OLE32.@)
*/
diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c
index 0429e0f5495..e40e2b073e5 100644
--- a/dlls/ole32/oleproxy.c
+++ b/dlls/ole32/oleproxy.c
@@ -148,17 +148,6 @@ static const IClassFactoryVtbl ComCatCFVtbl =
static IClassFactory ComCatCF = { &ComCatCFVtbl };
-static const IClassFactoryVtbl GlobalOptionsCFVtbl =
-{
- ClassFactory_QueryInterface,
- ClassFactory_AddRef,
- ClassFactory_Release,
- GlobalOptions_CreateInstance,
- ClassFactory_LockServer
-};
-
-IClassFactory GlobalOptionsCF = { &GlobalOptionsCFVtbl };
-
static const IClassFactoryVtbl GlobalInterfaceTableCFVtbl =
{
ClassFactory_QueryInterface,
@@ -230,8 +219,6 @@ HRESULT WINAPI Ole32DllGetClassObject(REFCLSID rclsid, REFIID riid, void **obj)
return IClassFactory_QueryInterface(&GlobalInterfaceTableCF, riid, obj);
else if (IsEqualCLSID(rclsid, &CLSID_ManualResetEvent))
return IClassFactory_QueryInterface(&ManualResetEventCF, riid, obj);
- else if (IsEqualCLSID(rclsid, &CLSID_GlobalOptions))
- return IClassFactory_QueryInterface(&GlobalOptionsCF, riid, obj);
else if (IsEqualCLSID(rclsid, &CLSID_InProcFreeMarshaler))
return FTMarshalCF_Create(riid, obj);
else
--
2.30.2
1
0
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
dlls/dnsapi/tests/query.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/dnsapi/tests/query.c b/dlls/dnsapi/tests/query.c
index 74669005a33..d68e9383204 100644
--- a/dlls/dnsapi/tests/query.c
+++ b/dlls/dnsapi/tests/query.c
@@ -40,7 +40,12 @@ static void test_DnsQuery(void)
rec = NULL;
status = DnsQuery_W(L"winehq.org", DNS_TYPE_A, DNS_QUERY_STANDARD, NULL, &rec, NULL);
- ok(status == ERROR_SUCCESS, "DnsQuery_W(%s) => %d\n", wine_dbgstr_w(name), status);
+ if (status == ERROR_TIMEOUT)
+ {
+ skip("query timed out\n");
+ return;
+ }
+ ok(status == ERROR_SUCCESS, "got %d\n", status);
DnsRecordListFree(rec, DnsFreeRecordList);
status = DnsQuery_W(L"", DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, &rec, NULL);
--
2.30.2
1
0
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/tests/editor.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 8ef88bd1b21..3a6a072f1f8 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -33,6 +33,8 @@
#include <ole2.h>
#include <richedit.h>
#include <richole.h>
+#include <imm.h>
+#include <textserv.h>
#include <commdlg.h>
#include <time.h>
#include <wine/test.h>
@@ -51,12 +53,38 @@ static CHAR string1[MAX_PATH], string2[MAX_PATH], string3[MAX_PATH];
static HMODULE hmoduleRichEdit;
static BOOL is_lang_japanese;
+#if defined(__i386__) && !defined(__MINGW32__) && (!defined(_MSC_VER) || !defined(__clang__))
+static void disable_beep( HWND hwnd )
+{
+ /* don't attempt to disable beep if we don't have thiscall compiler support */
+}
+#else
+#define ITextServices_OnTxPropertyBitsChange(This,a,b) (This)->lpVtbl->OnTxPropertyBitsChange(This,a,b)
+static void disable_beep( HWND hwnd )
+{
+ IRichEditOle *richole;
+ ITextServices *services;
+ IID *pIID_ITextServices = (IID *)GetProcAddress( hmoduleRichEdit, "IID_ITextServices" );
+
+ if (SendMessageW( hwnd, EM_GETOLEINTERFACE, 0, (LPARAM)&richole ))
+ {
+ if (SUCCEEDED( IRichEditOle_QueryInterface( richole, pIID_ITextServices, (void **)&services ) ))
+ {
+ ITextServices_OnTxPropertyBitsChange( services, TXTBIT_ALLOWBEEP, 0 );
+ ITextServices_Release( services );
+ }
+ IRichEditOle_Release( richole );
+ }
+}
+#endif
+
static HWND new_window(LPCSTR lpClassName, DWORD dwStyle, HWND parent) {
HWND hwnd;
hwnd = CreateWindowA(lpClassName, NULL, dwStyle|WS_POPUP|WS_HSCROLL|WS_VSCROLL
|WS_VISIBLE, 0, 0, 200, 60, parent, NULL,
hmoduleRichEdit, NULL);
ok(hwnd != NULL, "class: %s, error: %d\n", lpClassName, (int) GetLastError());
+ disable_beep( hwnd );
return hwnd;
}
@@ -66,6 +94,7 @@ static HWND new_windowW(LPCWSTR lpClassName, DWORD dwStyle, HWND parent) {
|WS_VISIBLE, 0, 0, 200, 60, parent, NULL,
hmoduleRichEdit, NULL);
ok(hwnd != NULL, "class: %s, error: %d\n", wine_dbgstr_w(lpClassName), (int) GetLastError());
+ disable_beep( hwnd );
return hwnd;
}
@@ -1862,6 +1891,7 @@ static void test_EM_SETOPTIONS(void)
hmoduleRichEdit, NULL);
ok(hwndRichEdit != NULL, "class: %s, error: %d\n",
RICHEDIT_CLASS20A, (int) GetLastError());
+ disable_beep( hwndRichEdit );
options = SendMessageA(hwndRichEdit, EM_GETOPTIONS, 0, 0);
/* WS_[VH]SCROLL cause the ECO_AUTO[VH]SCROLL options to be set */
ok(options == (ECO_AUTOVSCROLL|ECO_AUTOHSCROLL),
@@ -6337,6 +6367,7 @@ static void test_WM_CHAR(void)
hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP,
0, 0, 200, 60, 0, 0, 0, 0);
ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError());
+ disable_beep( hwnd );
p = char_list;
while (*p != '\0') {
@@ -6940,6 +6971,7 @@ static void test_undo_coalescing(void)
hwnd = CreateWindowExA(0, "RichEdit20W", NULL, WS_POPUP|ES_MULTILINE,
0, 0, 200, 60, 0, 0, 0, 0);
ok(hwnd != 0, "CreateWindowExA error %u\n", GetLastError());
+ disable_beep( hwnd );
result = SendMessageA(hwnd, EM_CANUNDO, 0, 0);
ok (result == FALSE, "Can undo after window creation.\n");
--
2.23.0
1
0
March 31, 2021
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/tests/richole.c | 9 +++++++++
dlls/riched20/tests/txtsrv.c | 9 +++++++++
2 files changed, 18 insertions(+)
diff --git a/dlls/riched20/tests/richole.c b/dlls/riched20/tests/richole.c
index 3cea9902620..e6329c5b1b6 100644
--- a/dlls/riched20/tests/richole.c
+++ b/dlls/riched20/tests/richole.c
@@ -149,6 +149,7 @@ static void test_Interfaces(void)
LRESULT res;
HWND w;
ULONG refcount;
+ IUnknown *unk, *unk2;
w = new_richedit(NULL);
if (!w) {
@@ -180,6 +181,14 @@ static void test_Interfaces(void)
hres = ITextDocument_GetSelection(txtDoc, &txtSel);
ok(hres == S_OK, "got 0x%08x\n", hres);
+ hres = ITextDocument_QueryInterface(txtDoc, &IID_IUnknown, (void **)&unk);
+ ok(hres == S_OK, "got 0x%08x\n", hres);
+ hres = ITextSelection_QueryInterface(txtSel, &IID_IUnknown, (void **)&unk2);
+ ok(hres == S_OK, "got 0x%08x\n", hres);
+ ok(unk != unk2, "unknowns are the same\n");
+ IUnknown_Release(unk2);
+ IUnknown_Release(unk);
+
EXPECT_REF(txtDoc, 4);
EXPECT_REF(txtSel, 2);
diff --git a/dlls/riched20/tests/txtsrv.c b/dlls/riched20/tests/txtsrv.c
index 6834e38b7f5..fe27be26edb 100644
--- a/dlls/riched20/tests/txtsrv.c
+++ b/dlls/riched20/tests/txtsrv.c
@@ -917,6 +917,7 @@ static void test_QueryInterface(void)
IRichEditOle *reole, *txtsrv_reole;
ITextDocument *txtdoc, *txtsrv_txtdoc;
ITextDocument2Old *txtdoc2old, *txtsrv_txtdoc2old;
+ IUnknown *unk, *unk2;
ULONG refcount;
if(!init_texthost(&txtserv, &host))
@@ -933,6 +934,14 @@ static void test_QueryInterface(void)
refcount = get_refcount((IUnknown *)txtsrv_reole);
ok(refcount == 2, "got wrong ref count: %d\n", refcount);
+ hres = ITextServices_QueryInterface( txtserv, &IID_IUnknown, (void **)&unk );
+ ok( hres == S_OK, "got 0x%08x\n", hres );
+ hres = IRichEditOle_QueryInterface( txtsrv_reole, &IID_IUnknown, (void **)&unk2 );
+ ok( hres == S_OK, "got 0x%08x\n", hres );
+ ok( unk == unk2, "unknowns differ\n" );
+ IUnknown_Release( unk2 );
+ IUnknown_Release( unk );
+
hres = IRichEditOle_QueryInterface(txtsrv_reole, &IID_ITextDocument, (void **)&txtdoc);
ok(hres == S_OK, "IRichEditOle_QueryInterface: 0x%08x\n", hres);
refcount = get_refcount((IUnknown *)txtserv);
--
2.23.0
1
0
[PATCH 2/4] riched20: Merge the richole object with the text services object.
by Huw Davies March 31, 2021
by Huw Davies March 31, 2021
March 31, 2021
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/editor.c | 31 +-
dlls/riched20/editor.h | 4 +-
dlls/riched20/editstr.h | 26 +-
dlls/riched20/richole.c | 897 ++++++++++++++++++----------------------
dlls/riched20/txtsrv.c | 29 +-
5 files changed, 444 insertions(+), 543 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index deb0a93c8dc..d4aadc325f9 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -1121,7 +1121,6 @@ static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HB
LPOLECLIENTSITE lpClientSite = NULL;
LPDATAOBJECT lpDataObject = NULL;
LPOLECACHE lpOleCache = NULL;
- LPRICHEDITOLE lpReOle = NULL;
STGMEDIUM stgm;
FORMATETC fm;
CLSID clsid;
@@ -1149,15 +1148,8 @@ static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HB
fm.lindex = -1;
fm.tymed = stgm.tymed;
- if (!editor->reOle)
- {
- if (!CreateIRichEditOle(NULL, editor, (LPVOID *)&editor->reOle))
- return hr;
- }
-
if (OleCreateDefaultHandler(&CLSID_NULL, NULL, &IID_IOleObject, (void**)&lpObject) == S_OK &&
- IUnknown_QueryInterface(editor->reOle, &IID_IRichEditOle, (void**)&lpReOle) == S_OK &&
- IRichEditOle_GetClientSite(lpReOle, &lpClientSite) == S_OK &&
+ IRichEditOle_GetClientSite(editor->richole, &lpClientSite) == S_OK &&
IOleObject_SetClientSite(lpObject, lpClientSite) == S_OK &&
IOleObject_GetUserClassID(lpObject, &clsid) == S_OK &&
IOleObject_QueryInterface(lpObject, &IID_IOleCache, (void**)&lpOleCache) == S_OK &&
@@ -1189,7 +1181,6 @@ static HRESULT insert_static_object(ME_TextEditor *editor, HENHMETAFILE hemf, HB
if (lpStorage) IStorage_Release(lpStorage);
if (lpDataObject) IDataObject_Release(lpDataObject);
if (lpOleCache) IOleCache_Release(lpOleCache);
- if (lpReOle) IRichEditOle_Release(lpReOle);
return hr;
}
@@ -2950,7 +2941,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed->have_texthost2 = FALSE;
}
- ed->reOle = NULL;
ed->bEmulateVersion10 = bEmulateVersion10;
ed->in_place_active = FALSE;
ed->total_rows = 0;
@@ -2993,6 +2983,7 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed->last_sel_start_para = ed->last_sel_end_para = ed->pCursors[0].para;
ed->bHideSelection = FALSE;
ed->pfnWordBreak = NULL;
+ ed->richole = NULL;
ed->lpOleCallback = NULL;
ed->mode = TM_MULTILEVELUNDO | TM_MULTICODEPAGE;
ed->mode |= (ed->props & TXTBIT_RICHTEXT) ? TM_RICHTEXT : TM_PLAINTEXT;
@@ -3094,11 +3085,7 @@ void ME_DestroyEditor(ME_TextEditor *editor)
}
if(editor->lpOleCallback)
IRichEditOleCallback_Release(editor->lpOleCallback);
- if (editor->reOle)
- {
- IUnknown_Release(editor->reOle);
- editor->reOle = NULL;
- }
+
OleUninitialize();
heap_free(editor->pBuffer);
@@ -4159,14 +4146,10 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam,
return 0;
}
case EM_GETOLEINTERFACE:
- {
- if (!editor->reOle)
- if (!CreateIRichEditOle(NULL, editor, (LPVOID *)&editor->reOle))
- return 0;
- if (IUnknown_QueryInterface(editor->reOle, &IID_IRichEditOle, (LPVOID *)lParam) == S_OK)
- return 1;
- return 0;
- }
+ IRichEditOle_AddRef( editor->richole );
+ *(IRichEditOle **)lParam = editor->richole;
+ return 1;
+
case EM_SETOLECALLBACK:
if(editor->lpOleCallback)
IRichEditOleCallback_Release(editor->lpOleCallback);
diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h
index d0274de409d..141e9034a6a 100644
--- a/dlls/riched20/editor.h
+++ b/dlls/riched20/editor.h
@@ -263,11 +263,13 @@ void ME_UpdateScrollBar(ME_TextEditor *editor) DECLSPEC_HIDDEN;
int ME_GetParaBorderWidth(const ME_Context *c, int flags) DECLSPEC_HIDDEN;
/* richole.c */
-LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj) DECLSPEC_HIDDEN;
void draw_ole( ME_Context *c, int x, int y, ME_Run* run, BOOL selected ) DECLSPEC_HIDDEN;
void ME_GetOLEObjectSize(const ME_Context *c, ME_Run *run, SIZE *pSize) DECLSPEC_HIDDEN;
void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags) DECLSPEC_HIDDEN;
void ME_DeleteReObject(struct re_object *re_object) DECLSPEC_HIDDEN;
+void richole_release_children( struct text_services *services ) DECLSPEC_HIDDEN;
+extern const IRichEditOleVtbl re_ole_vtbl DECLSPEC_HIDDEN;
+extern const ITextDocument2OldVtbl text_doc2old_vtbl DECLSPEC_HIDDEN;
/* editor.c */
ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10) DECLSPEC_HIDDEN;
diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h
index 86b3f0196c7..22cfd74722c 100644
--- a/dlls/riched20/editstr.h
+++ b/dlls/riched20/editstr.h
@@ -41,6 +41,7 @@
#include <richole.h>
#include "imm.h"
#include <textserv.h>
+#include <tom.h>
#include "usp10.h"
#include "wine/asm.h"
@@ -378,7 +379,6 @@ typedef struct tagME_InStream ME_InStream;
typedef struct tagME_TextEditor
{
ITextHost2 *texthost;
- IUnknown *reOle;
unsigned int bEmulateVersion10 : 1;
unsigned int in_place_active : 1;
unsigned int have_texthost2 : 1;
@@ -409,6 +409,7 @@ typedef struct tagME_TextEditor
BOOL bWordWrap;
int nTextLimit;
EDITWORDBREAKPROCW pfnWordBreak;
+ IRichEditOle *richole;
LPRICHEDITOLECALLBACK lpOleCallback;
/*TEXTMODE variable; contains only one of each of the following options:
*TM_RICHTEXT or TM_PLAINTEXT
@@ -456,4 +457,27 @@ typedef struct tagME_Context
ME_TextEditor *editor;
} ME_Context;
+struct text_selection
+{
+ ITextSelection ITextSelection_iface;
+ LONG ref;
+
+ struct text_services *services;
+};
+
+struct text_services
+{
+ IUnknown IUnknown_inner;
+ ITextServices ITextServices_iface;
+ IRichEditOle IRichEditOle_iface;
+ ITextDocument2Old ITextDocument2Old_iface;
+ IUnknown *outer_unk;
+ LONG ref;
+ ME_TextEditor *editor;
+ struct text_selection *text_selection;
+ struct list rangelist;
+ struct list clientsites;
+ char spare[256]; /* for bug #12179 */
+};
+
#endif
diff --git a/dlls/riched20/richole.c b/dlls/riched20/richole.c
index 2bb15bb4504..72840a4cafa 100644
--- a/dlls/riched20/richole.c
+++ b/dlls/riched20/richole.c
@@ -136,7 +136,6 @@ static HRESULT get_typeinfo(enum tid_t tid, ITypeInfo **typeinfo)
/* private IID used to get back IRichEditOleImpl pointer */
DEFINE_GUID(IID_Igetrichole, 0xe3ce5c7a, 0x8247, 0x4622, 0x81, 0xad, 0x11, 0x81, 0x02, 0xaa, 0x01, 0x30);
-typedef struct ITextSelectionImpl ITextSelectionImpl;
typedef struct IOleClientSiteImpl IOleClientSiteImpl;
typedef struct ITextRangeImpl ITextRangeImpl;
@@ -206,23 +205,9 @@ enum range_update_op {
RANGE_UPDATE_DELETE
};
-typedef struct IRichEditOleImpl {
- IUnknown IUnknown_inner;
- IRichEditOle IRichEditOle_iface;
- ITextDocument2Old ITextDocument2Old_iface;
- IUnknown *outer_unk;
- LONG ref;
-
- ME_TextEditor *editor;
- ITextSelectionImpl *txtSel;
-
- struct list rangelist;
- struct list clientsites;
-} IRichEditOleImpl;
-
struct reole_child {
struct list entry;
- IRichEditOleImpl *reole;
+ struct text_services *reole;
};
struct ITextRangeImpl {
@@ -232,13 +217,6 @@ struct ITextRangeImpl {
LONG start, end;
};
-struct ITextSelectionImpl {
- ITextSelection ITextSelection_iface;
- LONG ref;
-
- IRichEditOleImpl *reOle;
-};
-
typedef struct ITextFontImpl {
ITextFont ITextFont_iface;
LONG ref;
@@ -263,19 +241,14 @@ struct IOleClientSiteImpl {
LONG ref;
};
-static inline IRichEditOleImpl *impl_from_IRichEditOle(IRichEditOle *iface)
-{
- return CONTAINING_RECORD(iface, IRichEditOleImpl, IRichEditOle_iface);
-}
-
-static inline IRichEditOleImpl *impl_from_ITextDocument2Old(ITextDocument2Old *iface)
+static inline struct text_services *impl_from_IRichEditOle( IRichEditOle *iface )
{
- return CONTAINING_RECORD(iface, IRichEditOleImpl, ITextDocument2Old_iface);
+ return CONTAINING_RECORD( iface, struct text_services, IRichEditOle_iface );
}
-static inline IRichEditOleImpl *impl_from_IUnknown(IUnknown *iface)
+static inline struct text_services *impl_from_ITextDocument2Old( ITextDocument2Old *iface )
{
- return CONTAINING_RECORD(iface, IRichEditOleImpl, IUnknown_inner);
+ return CONTAINING_RECORD( iface, struct text_services, ITextDocument2Old_iface );
}
static inline IOleClientSiteImpl *impl_from_IOleInPlaceSite(IOleInPlaceSite *iface)
@@ -288,9 +261,9 @@ static inline ITextRangeImpl *impl_from_ITextRange(ITextRange *iface)
return CONTAINING_RECORD(iface, ITextRangeImpl, ITextRange_iface);
}
-static inline ITextSelectionImpl *impl_from_ITextSelection(ITextSelection *iface)
+static inline struct text_selection *impl_from_ITextSelection(ITextSelection *iface)
{
- return CONTAINING_RECORD(iface, ITextSelectionImpl, ITextSelection_iface);
+ return CONTAINING_RECORD(iface, struct text_selection, ITextSelection_iface);
}
static inline ITextFontImpl *impl_from_ITextFont(ITextFont *iface)
@@ -305,7 +278,7 @@ static inline ITextParaImpl *impl_from_ITextPara(ITextPara *iface)
static HRESULT create_textfont(ITextRange*, const ITextFontImpl*, ITextFont**);
static HRESULT create_textpara(ITextRange*, ITextPara**);
-static ITextSelectionImpl *CreateTextSelection(IRichEditOleImpl*);
+static struct text_selection *text_selection_create( struct text_services * );
static HRESULT textrange_get_storylength(ME_TextEditor *editor, LONG *length)
{
@@ -316,11 +289,11 @@ static HRESULT textrange_get_storylength(ME_TextEditor *editor, LONG *length)
return S_OK;
}
-static void textranges_update_ranges(IRichEditOleImpl *reole, LONG start, LONG end, enum range_update_op op)
+static void textranges_update_ranges(struct text_services *services, LONG start, LONG end, enum range_update_op op)
{
ITextRangeImpl *range;
- LIST_FOR_EACH_ENTRY(range, &reole->rangelist, ITextRangeImpl, child.entry) {
+ LIST_FOR_EACH_ENTRY(range, &services->rangelist, ITextRangeImpl, child.entry) {
switch (op)
{
case RANGE_UPDATE_DELETE:
@@ -434,7 +407,7 @@ static inline FLOAT points_to_twips(FLOAT value)
return value * 1440 / 72.0;
}
-static HRESULT get_textfont_prop_for_pos(const IRichEditOleImpl *reole, int pos, enum textfont_prop_id propid,
+static HRESULT get_textfont_prop_for_pos(const struct text_services *services, int pos, enum textfont_prop_id propid,
textfont_prop_val *value)
{
ME_Cursor from, to;
@@ -444,10 +417,10 @@ static HRESULT get_textfont_prop_for_pos(const IRichEditOleImpl *reole, int pos,
fmt.cbSize = sizeof(fmt);
fmt.dwMask = textfont_prop_masks[propid][0];
- cursor_from_char_ofs( reole->editor, pos, &from );
+ cursor_from_char_ofs( services->editor, pos, &from );
to = from;
- ME_MoveCursorChars(reole->editor, &to, 1, FALSE);
- ME_GetCharFormat(reole->editor, &from, &to, &fmt);
+ ME_MoveCursorChars( services->editor, &to, 1, FALSE );
+ ME_GetCharFormat( services->editor, &from, &to, &fmt );
switch (propid)
{
@@ -508,11 +481,11 @@ static HRESULT get_textfont_prop_for_pos(const IRichEditOleImpl *reole, int pos,
return S_OK;
}
-static inline const IRichEditOleImpl *get_range_reole(ITextRange *range)
+static inline const struct text_services *get_range_reole(ITextRange *range)
{
- IRichEditOleImpl *reole = NULL;
- ITextRange_QueryInterface(range, &IID_Igetrichole, (void**)&reole);
- return reole;
+ struct text_services *services = NULL;
+ ITextRange_QueryInterface(range, &IID_Igetrichole, (void**)&services);
+ return services;
}
static void textrange_set_font(ITextRange *range, ITextFont *font)
@@ -664,22 +637,22 @@ static void textrange_set_font(ITextRange *range, ITextFont *font)
if (fmt.dwMask)
{
- const IRichEditOleImpl *reole = get_range_reole(range);
+ const struct text_services *services = get_range_reole(range);
ME_Cursor from, to;
LONG start, end;
ITextRange_GetStart(range, &start);
ITextRange_GetEnd(range, &end);
- cursor_from_char_ofs( reole->editor, start, &from );
- cursor_from_char_ofs( reole->editor, end, &to );
- ME_SetCharFormat(reole->editor, &from, &to, &fmt);
+ cursor_from_char_ofs( services->editor, start, &from );
+ cursor_from_char_ofs( services->editor, end, &to );
+ ME_SetCharFormat( services->editor, &from, &to, &fmt );
}
}
static HRESULT get_textfont_prop(const ITextFontImpl *font, enum textfont_prop_id propid, textfont_prop_val *value)
{
- const IRichEditOleImpl *reole;
+ const struct text_services *services;
textfont_prop_val v;
LONG start, end, i;
HRESULT hr;
@@ -690,7 +663,7 @@ static HRESULT get_textfont_prop(const ITextFontImpl *font, enum textfont_prop_i
return S_OK;
}
- if (!(reole = get_range_reole(font->range)))
+ if (!(services = get_range_reole(font->range)))
return CO_E_RELEASED;
init_textfont_prop_value(propid, value);
@@ -699,14 +672,14 @@ static HRESULT get_textfont_prop(const ITextFontImpl *font, enum textfont_prop_i
ITextRange_GetEnd(font->range, &end);
/* iterate trough a range to see if property value is consistent */
- hr = get_textfont_prop_for_pos(reole, start, propid, &v);
+ hr = get_textfont_prop_for_pos( services, start, propid, &v );
if (FAILED(hr))
return hr;
for (i = start + 1; i < end; i++) {
textfont_prop_val cur;
- hr = get_textfont_prop_for_pos(reole, i, propid, &cur);
+ hr = get_textfont_prop_for_pos( services, i, propid, &cur );
if (FAILED(hr))
return hr;
@@ -747,7 +720,7 @@ static HRESULT get_textfont_propl(const ITextFontImpl *font, enum textfont_prop_
/* Value should already have a terminal value, for boolean properties it means tomToggle is not handled */
static HRESULT set_textfont_prop(ITextFontImpl *font, enum textfont_prop_id propid, const textfont_prop_val *value)
{
- const IRichEditOleImpl *reole;
+ const struct text_services *services;
ME_Cursor from, to;
CHARFORMAT2W fmt;
LONG start, end;
@@ -763,7 +736,7 @@ static HRESULT set_textfont_prop(ITextFontImpl *font, enum textfont_prop_id prop
return S_OK;
}
- if (!(reole = get_range_reole(font->range)))
+ if (!(services = get_range_reole(font->range)))
return CO_E_RELEASED;
memset(&fmt, 0, sizeof(fmt));
@@ -829,9 +802,9 @@ static HRESULT set_textfont_prop(ITextFontImpl *font, enum textfont_prop_id prop
ITextRange_GetStart(font->range, &start);
ITextRange_GetEnd(font->range, &end);
- cursor_from_char_ofs( reole->editor, start, &from );
- cursor_from_char_ofs( reole->editor, end, &to );
- ME_SetCharFormat(reole->editor, &from, &to, &fmt);
+ cursor_from_char_ofs( services->editor, start, &from );
+ cursor_from_char_ofs( services->editor, end, &to );
+ ME_SetCharFormat( services->editor, &from, &to, &fmt );
return S_OK;
}
@@ -880,16 +853,16 @@ static HRESULT set_textfont_propd(ITextFontImpl *font, enum textfont_prop_id pro
static HRESULT textfont_getname_from_range(ITextRange *range, BSTR *ret)
{
- const IRichEditOleImpl *reole;
+ const struct text_services *services;
textfont_prop_val v;
HRESULT hr;
LONG start;
- if (!(reole = get_range_reole(range)))
+ if (!(services = get_range_reole( range )))
return CO_E_RELEASED;
ITextRange_GetStart(range, &start);
- hr = get_textfont_prop_for_pos(reole, start, FONT_NAME, &v);
+ hr = get_textfont_prop_for_pos( services, start, FONT_NAME, &v );
*ret = v.str;
return hr;
}
@@ -934,118 +907,48 @@ static HRESULT textrange_expand(ITextRange *range, LONG unit, LONG *delta)
return S_OK;
}
-static HRESULT WINAPI IRichEditOleImpl_inner_fnQueryInterface(IUnknown *iface, REFIID riid, LPVOID *ppvObj)
-{
- IRichEditOleImpl *This = impl_from_IUnknown(iface);
-
- TRACE("%p %s\n", This, debugstr_guid(riid));
-
- *ppvObj = NULL;
- if (IsEqualGUID(riid, &IID_IUnknown))
- *ppvObj = &This->IUnknown_inner;
- else if (IsEqualGUID(riid, &IID_IRichEditOle))
- *ppvObj = &This->IRichEditOle_iface;
- else if (IsEqualGUID(riid, &IID_ITextDocument) || IsEqualGUID(riid, &IID_ITextDocument2Old))
- *ppvObj = &This->ITextDocument2Old_iface;
- if (*ppvObj)
- {
- IUnknown_AddRef((IUnknown *)*ppvObj);
- return S_OK;
- }
- FIXME("%p: unhandled interface %s\n", This, debugstr_guid(riid));
-
- return E_NOINTERFACE;
-}
-
-static ULONG WINAPI IRichEditOleImpl_inner_fnAddRef(IUnknown *iface)
-{
- IRichEditOleImpl *This = impl_from_IUnknown(iface);
- ULONG ref = InterlockedIncrement(&This->ref);
-
- TRACE("%p ref = %u\n", This, ref);
-
- return ref;
-}
-
-static ULONG WINAPI IRichEditOleImpl_inner_fnRelease(IUnknown *iface)
-{
- IRichEditOleImpl *This = impl_from_IUnknown(iface);
- ULONG ref = InterlockedDecrement(&This->ref);
-
- TRACE ("%p ref=%u\n", This, ref);
-
- if (!ref)
- {
- IOleClientSiteImpl *clientsite;
- ITextRangeImpl *txtRge;
-
- This->editor->reOle = NULL;
- if (This->txtSel) {
- This->txtSel->reOle = NULL;
- ITextSelection_Release(&This->txtSel->ITextSelection_iface);
- }
-
- LIST_FOR_EACH_ENTRY(txtRge, &This->rangelist, ITextRangeImpl, child.entry)
- txtRge->child.reole = NULL;
-
- LIST_FOR_EACH_ENTRY(clientsite, &This->clientsites, IOleClientSiteImpl, child.entry)
- clientsite->child.reole = NULL;
-
- heap_free(This);
- }
- return ref;
-}
-
-static const IUnknownVtbl reo_unk_vtbl =
-{
- IRichEditOleImpl_inner_fnQueryInterface,
- IRichEditOleImpl_inner_fnAddRef,
- IRichEditOleImpl_inner_fnRelease
-};
-
static HRESULT WINAPI
-IRichEditOle_fnQueryInterface(IRichEditOle *me, REFIID riid, LPVOID *ppvObj)
+IRichEditOle_fnQueryInterface(IRichEditOle *iface, REFIID riid, LPVOID *ppvObj)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- return IUnknown_QueryInterface(This->outer_unk, riid, ppvObj);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ return IUnknown_QueryInterface( services->outer_unk, riid, ppvObj );
}
static ULONG WINAPI
-IRichEditOle_fnAddRef(IRichEditOle *me)
+IRichEditOle_fnAddRef(IRichEditOle *iface)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- return IUnknown_AddRef(This->outer_unk);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ return IUnknown_AddRef( services->outer_unk );
}
static ULONG WINAPI
-IRichEditOle_fnRelease(IRichEditOle *me)
+IRichEditOle_fnRelease(IRichEditOle *iface)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- return IUnknown_Release(This->outer_unk);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ return IUnknown_Release( services->outer_unk );
}
static HRESULT WINAPI
-IRichEditOle_fnActivateAs(IRichEditOle *me, REFCLSID rclsid, REFCLSID rclsidAs)
+IRichEditOle_fnActivateAs(IRichEditOle *iface, REFCLSID rclsid, REFCLSID rclsidAs)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME( "stub %p\n", services );
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnContextSensitiveHelp(IRichEditOle *me, BOOL fEnterMode)
+IRichEditOle_fnContextSensitiveHelp(IRichEditOle *iface, BOOL fEnterMode)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME( "stub %p\n", services );
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnConvertObject(IRichEditOle *me, LONG iob,
- REFCLSID rclsidNew, LPCSTR lpstrUserTypeNew)
+IRichEditOle_fnConvertObject( IRichEditOle *iface, LONG iob, REFCLSID class, LPCSTR user_type )
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME( "stub %p\n", services );
return E_NOTIMPL;
}
@@ -1308,7 +1211,7 @@ static const IOleInPlaceSiteVtbl olestvt =
IOleInPlaceSite_fnOnPosRectChange
};
-static HRESULT CreateOleClientSite(IRichEditOleImpl *reOle, IOleClientSite **ret)
+static HRESULT CreateOleClientSite( struct text_services *services, IOleClientSite **ret )
{
IOleClientSiteImpl *clientSite = heap_alloc(sizeof *clientSite);
@@ -1318,67 +1221,67 @@ static HRESULT CreateOleClientSite(IRichEditOleImpl *reOle, IOleClientSite **ret
clientSite->IOleClientSite_iface.lpVtbl = &ocst;
clientSite->IOleInPlaceSite_iface.lpVtbl = &olestvt;
clientSite->ref = 1;
- clientSite->child.reole = reOle;
- list_add_head(&reOle->clientsites, &clientSite->child.entry);
+ clientSite->child.reole = services;
+ list_add_head( &services->clientsites, &clientSite->child.entry );
*ret = &clientSite->IOleClientSite_iface;
return S_OK;
}
static HRESULT WINAPI
-IRichEditOle_fnGetClientSite(IRichEditOle *me, IOleClientSite **clientsite)
+IRichEditOle_fnGetClientSite( IRichEditOle *iface, IOleClientSite **clientsite )
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
+ struct text_services *services = impl_from_IRichEditOle( iface );
- TRACE("(%p)->(%p)\n", This, clientsite);
+ TRACE("(%p)->(%p)\n", services, clientsite);
if (!clientsite)
return E_INVALIDARG;
- return CreateOleClientSite(This, clientsite);
+ return CreateOleClientSite( services, clientsite );
}
static HRESULT WINAPI
-IRichEditOle_fnGetClipboardData(IRichEditOle *me, CHARRANGE *lpchrg,
+IRichEditOle_fnGetClipboardData(IRichEditOle *iface, CHARRANGE *lpchrg,
DWORD reco, LPDATAOBJECT *lplpdataobj)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
+ struct text_services *services = impl_from_IRichEditOle( iface );
ME_Cursor start;
int nChars;
- TRACE("(%p,%p,%d)\n",This, lpchrg, reco);
+ TRACE("(%p,%p,%d)\n", services, lpchrg, reco);
if(!lplpdataobj)
return E_INVALIDARG;
if(!lpchrg)
{
- int nFrom, nTo, nStartCur = ME_GetSelectionOfs(This->editor, &nFrom, &nTo);
- start = This->editor->pCursors[nStartCur];
+ int nFrom, nTo, nStartCur = ME_GetSelectionOfs( services->editor, &nFrom, &nTo );
+ start = services->editor->pCursors[nStartCur];
nChars = nTo - nFrom;
}
else
{
- cursor_from_char_ofs( This->editor, lpchrg->cpMin, &start );
+ cursor_from_char_ofs( services->editor, lpchrg->cpMin, &start );
nChars = lpchrg->cpMax - lpchrg->cpMin;
}
- return ME_GetDataObject(This->editor, &start, nChars, lplpdataobj);
+ return ME_GetDataObject( services->editor, &start, nChars, lplpdataobj );
}
-static LONG WINAPI IRichEditOle_fnGetLinkCount(IRichEditOle *me)
+static LONG WINAPI IRichEditOle_fnGetLinkCount(IRichEditOle *iface)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob,
+IRichEditOle_fnGetObject(IRichEditOle *iface, LONG iob,
REOBJECT *lpreobject, DWORD dwFlags)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
+ struct text_services *services = impl_from_IRichEditOle( iface );
struct re_object *reobj = NULL;
LONG count = 0;
- TRACE("(%p)->(%x, %p, %x)\n", This, iob, lpreobject, dwFlags);
+ TRACE("(%p)->(%x, %p, %x)\n", services, iob, lpreobject, dwFlags);
if (!lpreobject || !lpreobject->cbStruct)
return E_INVALIDARG;
@@ -1388,7 +1291,7 @@ IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob,
ME_Cursor cursor;
TRACE("character offset: %d\n", lpreobject->cp);
- cursor_from_char_ofs( This->editor, lpreobject->cp, &cursor );
+ cursor_from_char_ofs( services->editor, lpreobject->cp, &cursor );
if (!cursor.run->reobj)
return E_INVALIDARG;
else
@@ -1398,7 +1301,7 @@ IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob,
{
ME_Cursor *from, *to;
- ME_GetSelection(This->editor, &from, &to);
+ ME_GetSelection(services->editor, &from, &to);
if (!from->run->reobj)
return E_INVALIDARG;
else
@@ -1406,9 +1309,9 @@ IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob,
}
else
{
- if (iob < 0 || iob >= IRichEditOle_GetObjectCount(me))
+ if (iob < 0 || iob >= IRichEditOle_GetObjectCount( iface ))
return E_INVALIDARG;
- LIST_FOR_EACH_ENTRY(reobj, &This->editor->reobj_list, struct re_object, entry)
+ LIST_FOR_EACH_ENTRY(reobj, &services->editor->reobj_list, struct re_object, entry)
{
if (count == iob)
break;
@@ -1420,89 +1323,90 @@ IRichEditOle_fnGetObject(IRichEditOle *me, LONG iob,
}
static LONG WINAPI
-IRichEditOle_fnGetObjectCount(IRichEditOle *me)
+IRichEditOle_fnGetObjectCount( IRichEditOle *iface )
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- TRACE("(%p)\n",This);
- return list_count(&This->editor->reobj_list);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ TRACE("(%p)\n", services);
+ return list_count( &services->editor->reobj_list );
}
static HRESULT WINAPI
-IRichEditOle_fnHandsOffStorage(IRichEditOle *me, LONG iob)
+IRichEditOle_fnHandsOffStorage(IRichEditOle *iface, LONG iob)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnImportDataObject(IRichEditOle *me, LPDATAOBJECT lpdataobj,
+IRichEditOle_fnImportDataObject(IRichEditOle *iface, LPDATAOBJECT lpdataobj,
CLIPFORMAT cf, HGLOBAL hMetaPict)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnInPlaceDeactivate(IRichEditOle *me)
+IRichEditOle_fnInPlaceDeactivate(IRichEditOle *iface)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnInsertObject(IRichEditOle *me, REOBJECT *reo)
+IRichEditOle_fnInsertObject(IRichEditOle *iface, REOBJECT *reo)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
+ struct text_services *services = impl_from_IRichEditOle( iface );
- TRACE("(%p,%p)\n", This, reo);
+ TRACE("(%p,%p)\n", services, reo);
if (!reo)
return E_INVALIDARG;
if (reo->cbStruct < sizeof(*reo)) return STG_E_INVALIDPARAMETER;
- ME_InsertOLEFromCursor(This->editor, reo, 0);
- ME_CommitUndo(This->editor);
- ME_UpdateRepaint(This->editor, FALSE);
+ ME_InsertOLEFromCursor(services->editor, reo, 0);
+ ME_CommitUndo(services->editor);
+ ME_UpdateRepaint(services->editor, FALSE);
return S_OK;
}
-static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *me, LONG iob,
+static HRESULT WINAPI IRichEditOle_fnSaveCompleted(IRichEditOle *iface, LONG iob,
LPSTORAGE lpstg)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnSetDvaspect(IRichEditOle *me, LONG iob, DWORD dvaspect)
+IRichEditOle_fnSetDvaspect(IRichEditOle *iface, LONG iob, DWORD dvaspect)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
-static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *me,
+static HRESULT WINAPI IRichEditOle_fnSetHostNames(IRichEditOle *iface,
LPCSTR lpstrContainerApp, LPCSTR lpstrContainerObj)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p %s %s\n",This, lpstrContainerApp, lpstrContainerObj);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p %s %s\n", services, lpstrContainerApp, lpstrContainerObj);
return E_NOTIMPL;
}
static HRESULT WINAPI
-IRichEditOle_fnSetLinkAvailable(IRichEditOle *me, LONG iob, BOOL fAvailable)
+IRichEditOle_fnSetLinkAvailable(IRichEditOle *iface, LONG iob, BOOL fAvailable)
{
- IRichEditOleImpl *This = impl_from_IRichEditOle(me);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_IRichEditOle( iface );
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
-static const IRichEditOleVtbl revt = {
+const IRichEditOleVtbl re_ole_vtbl =
+{
IRichEditOle_fnQueryInterface,
IRichEditOle_fnAddRef,
IRichEditOle_fnRelease,
@@ -1750,7 +1654,7 @@ static HRESULT WINAPI ITextRange_fnSetChar(ITextRange *me, LONG ch)
return E_NOTIMPL;
}
-static HRESULT CreateITextRange(IRichEditOleImpl *reOle, LONG start, LONG end, ITextRange** ppRange);
+static HRESULT CreateITextRange(struct text_services *services, LONG start, LONG end, ITextRange** ppRange);
static HRESULT WINAPI ITextRange_fnGetDuplicate(ITextRange *me, ITextRange **ppRange)
{
@@ -1807,7 +1711,7 @@ static HRESULT WINAPI ITextRange_fnGetStart(ITextRange *me, LONG *start)
return S_OK;
}
-static HRESULT textrange_setstart(const IRichEditOleImpl *reole, LONG value, LONG *start, LONG *end)
+static HRESULT textrange_setstart(const struct text_services *services, LONG value, LONG *start, LONG *end)
{
int len;
@@ -1822,7 +1726,7 @@ static HRESULT textrange_setstart(const IRichEditOleImpl *reole, LONG value, LON
return S_OK;
}
- len = ME_GetTextLength(reole->editor);
+ len = ME_GetTextLength(services->editor);
*start = *end = value > len ? len : value;
return S_OK;
}
@@ -1855,7 +1759,7 @@ static HRESULT WINAPI ITextRange_fnGetEnd(ITextRange *me, LONG *end)
return S_OK;
}
-static HRESULT textrange_setend(const IRichEditOleImpl *reole, LONG value, LONG *start, LONG *end)
+static HRESULT textrange_setend(const struct text_services *services, LONG value, LONG *start, LONG *end)
{
int len;
@@ -1867,7 +1771,7 @@ static HRESULT textrange_setend(const IRichEditOleImpl *reole, LONG value, LONG
return S_OK;
}
- len = ME_GetTextLength(reole->editor);
+ len = ME_GetTextLength( services->editor );
*end = value > len ? len + 1 : value;
return S_OK;
}
@@ -4126,27 +4030,27 @@ static HRESULT create_textpara(ITextRange *range, ITextPara **ret)
static HRESULT WINAPI ITextDocument2Old_fnQueryInterface(ITextDocument2Old* iface, REFIID riid,
void **ppvObject)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- return IRichEditOle_QueryInterface(&This->IRichEditOle_iface, riid, ppvObject);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ return IUnknown_QueryInterface( services->outer_unk, riid, ppvObject );
}
static ULONG WINAPI ITextDocument2Old_fnAddRef(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- return IRichEditOle_AddRef(&This->IRichEditOle_iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ return IUnknown_AddRef( services->outer_unk );
}
static ULONG WINAPI ITextDocument2Old_fnRelease(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- return IRichEditOle_Release(&This->IRichEditOle_iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ return IUnknown_Release( services->outer_unk );
}
static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfoCount(ITextDocument2Old *iface,
UINT *pctinfo)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- TRACE("(%p)->(%p)\n", This, pctinfo);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ TRACE("(%p)->(%p)\n", services, pctinfo);
*pctinfo = 1;
return S_OK;
}
@@ -4154,10 +4058,10 @@ static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfoCount(ITextDocument2Old *if
static HRESULT WINAPI ITextDocument2Old_fnGetTypeInfo(ITextDocument2Old *iface, UINT iTInfo, LCID lcid,
ITypeInfo **ppTInfo)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
HRESULT hr;
- TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
+ TRACE("(%p)->(%u,%d,%p)\n", services, iTInfo, lcid, ppTInfo);
hr = get_typeinfo(ITextDocument_tid, ppTInfo);
if (SUCCEEDED(hr))
@@ -4169,11 +4073,11 @@ static HRESULT WINAPI ITextDocument2Old_fnGetIDsOfNames(ITextDocument2Old *iface
LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
ITypeInfo *ti;
HRESULT hr;
- TRACE("(%p)->(%s, %p, %u, %d, %p)\n", This, debugstr_guid(riid),
+ TRACE("(%p)->(%s, %p, %u, %d, %p)\n", services, debugstr_guid(riid),
rgszNames, cNames, lcid, rgDispId);
hr = get_typeinfo(ITextDocument_tid, &ti);
@@ -4187,11 +4091,11 @@ static HRESULT WINAPI ITextDocument2Old_fnInvoke(ITextDocument2Old *iface, DISPI
DISPPARAMS *pDispParams, VARIANT *pVarResult,
EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
ITypeInfo *ti;
HRESULT hr;
- TRACE("(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n", This, dispIdMember,
+ TRACE("(%p)->(%d, %s, %d, %u, %p, %p, %p, %p)\n", services, dispIdMember,
debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult,
pExcepInfo, puArgErr);
@@ -4203,142 +4107,144 @@ static HRESULT WINAPI ITextDocument2Old_fnInvoke(ITextDocument2Old *iface, DISPI
static HRESULT WINAPI ITextDocument2Old_fnGetName(ITextDocument2Old *iface, BSTR *pName)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetSelection(ITextDocument2Old *iface, ITextSelection **selection)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
TRACE("(%p)->(%p)\n", iface, selection);
if (!selection)
return E_INVALIDARG;
- if (!This->txtSel) {
- This->txtSel = CreateTextSelection(This);
- if (!This->txtSel) {
- *selection = NULL;
- return E_OUTOFMEMORY;
- }
+ if (!services->text_selection)
+ {
+ services->text_selection = text_selection_create( services );
+ if (!services->text_selection)
+ {
+ *selection = NULL;
+ return E_OUTOFMEMORY;
+ }
}
- *selection = &This->txtSel->ITextSelection_iface;
+ *selection = &services->text_selection->ITextSelection_iface;
ITextSelection_AddRef(*selection);
return S_OK;
}
static HRESULT WINAPI ITextDocument2Old_fnGetStoryCount(ITextDocument2Old *iface, LONG *pCount)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetStoryRanges(ITextDocument2Old *iface,
ITextStoryRanges **ppStories)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetSaved(ITextDocument2Old *iface, LONG *pValue)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnSetSaved(ITextDocument2Old *iface, LONG Value)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetDefaultTabStop(ITextDocument2Old *iface, float *pValue)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnSetDefaultTabStop(ITextDocument2Old *iface, float Value)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnNew(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnOpen(ITextDocument2Old *iface, VARIANT *pVar,
LONG Flags, LONG CodePage)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnSave(ITextDocument2Old *iface, VARIANT *pVar,
LONG Flags, LONG CodePage)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnFreeze(ITextDocument2Old *iface, LONG *pCount)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnUnfreeze(ITextDocument2Old *iface, LONG *pCount)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnBeginEditCollection(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnEndEditCollection(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnUndo(ITextDocument2Old *iface, LONG Count, LONG *prop)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnRedo(ITextDocument2Old *iface, LONG Count, LONG *prop)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
-static HRESULT CreateITextRange(IRichEditOleImpl *reOle, LONG start, LONG end, ITextRange** ppRange)
+static HRESULT CreateITextRange(struct text_services *services, LONG start, LONG end, ITextRange** ppRange)
{
ITextRangeImpl *txtRge = heap_alloc(sizeof(ITextRangeImpl));
@@ -4346,10 +4252,10 @@ static HRESULT CreateITextRange(IRichEditOleImpl *reOle, LONG start, LONG end, I
return E_OUTOFMEMORY;
txtRge->ITextRange_iface.lpVtbl = &trvt;
txtRge->ref = 1;
- txtRge->child.reole = reOle;
+ txtRge->child.reole = services;
txtRge->start = start;
txtRge->end = end;
- list_add_head(&reOle->rangelist, &txtRge->child.entry);
+ list_add_head( &services->rangelist, &txtRge->child.entry );
*ppRange = &txtRge->ITextRange_iface;
return S_OK;
}
@@ -4357,84 +4263,84 @@ static HRESULT CreateITextRange(IRichEditOleImpl *reOle, LONG start, LONG end, I
static HRESULT WINAPI ITextDocument2Old_fnRange(ITextDocument2Old *iface, LONG cp1, LONG cp2,
ITextRange **ppRange)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- TRACE("%p %p %d %d\n", This, ppRange, cp1, cp2);
+ TRACE("%p %p %d %d\n", services, ppRange, cp1, cp2);
if (!ppRange)
return E_INVALIDARG;
- cp2range(This->editor, &cp1, &cp2);
- return CreateITextRange(This, cp1, cp2, ppRange);
+ cp2range(services->editor, &cp1, &cp2);
+ return CreateITextRange(services, cp1, cp2, ppRange);
}
static HRESULT WINAPI ITextDocument2Old_fnRangeFromPoint(ITextDocument2Old *iface, LONG x, LONG y,
ITextRange **ppRange)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
- FIXME("stub %p\n",This);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
+ FIXME("stub %p\n", services);
return E_NOTIMPL;
}
/* ITextDocument2Old methods */
static HRESULT WINAPI ITextDocument2Old_fnAttachMsgFilter(ITextDocument2Old *iface, IUnknown *filter)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%p): stub\n", This, filter);
+ FIXME("(%p)->(%p): stub\n", services, filter);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnSetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF cr)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d, 0x%x): stub\n", This, index, cr);
+ FIXME("(%p)->(%d, 0x%x): stub\n", services, index, cr);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetEffectColor(ITextDocument2Old *iface, LONG index, COLORREF *cr)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d, %p): stub\n", This, index, cr);
+ FIXME("(%p)->(%d, %p): stub\n", services, index, cr);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetCaretType(ITextDocument2Old *iface, LONG *type)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%p): stub\n", This, type);
+ FIXME("(%p)->(%p): stub\n", services, type);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnSetCaretType(ITextDocument2Old *iface, LONG type)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d): stub\n", This, type);
+ FIXME("(%p)->(%d): stub\n", services, type);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetImmContext(ITextDocument2Old *iface, LONG *context)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%p): stub\n", This, context);
+ FIXME("(%p)->(%p): stub\n", services, context);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnReleaseImmContext(ITextDocument2Old *iface, LONG context)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d): stub\n", This, context);
+ FIXME("(%p)->(%d): stub\n", services, context);
return E_NOTIMPL;
}
@@ -4443,9 +4349,9 @@ static HRESULT WINAPI ITextDocument2Old_fnGetPreferredFont(ITextDocument2Old *if
LONG options, LONG current_charrep, LONG current_fontsize,
BSTR *bstr, LONG *pitch_family, LONG *new_fontsize)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d, %d, %d, %d, %d, %p, %p, %p): stub\n", This, cp, charrep, options, current_charrep,
+ FIXME("(%p)->(%d, %d, %d, %d, %d, %p, %p, %p): stub\n", services, cp, charrep, options, current_charrep,
current_fontsize, bstr, pitch_family, new_fontsize);
return E_NOTIMPL;
@@ -4453,18 +4359,18 @@ static HRESULT WINAPI ITextDocument2Old_fnGetPreferredFont(ITextDocument2Old *if
static HRESULT WINAPI ITextDocument2Old_fnGetNotificationMode(ITextDocument2Old *iface, LONG *mode)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%p): stub\n", This, mode);
+ FIXME("(%p)->(%p): stub\n", services, mode);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnSetNotificationMode(ITextDocument2Old *iface, LONG mode)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(0x%x): stub\n", This, mode);
+ FIXME("(%p)->(0x%x): stub\n", services, mode);
return E_NOTIMPL;
}
@@ -4472,95 +4378,96 @@ static HRESULT WINAPI ITextDocument2Old_fnSetNotificationMode(ITextDocument2Old
static HRESULT WINAPI ITextDocument2Old_fnGetClientRect(ITextDocument2Old *iface, LONG type, LONG *left, LONG *top,
LONG *right, LONG *bottom)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d, %p, %p, %p, %p): stub\n", This, type, left, top, right, bottom);
+ FIXME("(%p)->(%d, %p, %p, %p, %p): stub\n", services, type, left, top, right, bottom);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetSelectionEx(ITextDocument2Old *iface, ITextSelection **selection)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%p): stub\n", This, selection);
+ FIXME("(%p)->(%p): stub\n", services, selection);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetWindow(ITextDocument2Old *iface, LONG *hwnd)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%p): stub\n", This, hwnd);
+ FIXME("(%p)->(%p): stub\n", services, hwnd);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnGetFEFlags(ITextDocument2Old *iface, LONG *flags)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%p): stub\n", This, flags);
+ FIXME("(%p)->(%p): stub\n", services, flags);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnUpdateWindow(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p): stub\n", This);
+ FIXME("(%p): stub\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnCheckTextLimit(ITextDocument2Old *iface, LONG cch, LONG *exceed)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d, %p): stub\n", This, cch, exceed);
+ FIXME("(%p)->(%d, %p): stub\n", services, cch, exceed);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnIMEInProgress(ITextDocument2Old *iface, LONG mode)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(0x%x): stub\n", This, mode);
+ FIXME("(%p)->(0x%x): stub\n", services, mode);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnSysBeep(ITextDocument2Old *iface)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p): stub\n", This);
+ FIXME("(%p): stub\n", services);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnUpdate(ITextDocument2Old *iface, LONG mode)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(0x%x): stub\n", This, mode);
+ FIXME("(%p)->(0x%x): stub\n", services, mode);
return E_NOTIMPL;
}
static HRESULT WINAPI ITextDocument2Old_fnNotify(ITextDocument2Old *iface, LONG notify)
{
- IRichEditOleImpl *This = impl_from_ITextDocument2Old(iface);
+ struct text_services *services = impl_from_ITextDocument2Old(iface);
- FIXME("(%p)->(%d): stub\n", This, notify);
+ FIXME("(%p)->(%d): stub\n", services, notify);
return E_NOTIMPL;
}
-static const ITextDocument2OldVtbl tdvt = {
+const ITextDocument2OldVtbl text_doc2old_vtbl =
+{
ITextDocument2Old_fnQueryInterface,
ITextDocument2Old_fnAddRef,
ITextDocument2Old_fnRelease,
@@ -4616,7 +4523,7 @@ static HRESULT WINAPI ITextSelection_fnQueryInterface(
REFIID riid,
void **ppvObj)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
*ppvObj = NULL;
if (IsEqualGUID(riid, &IID_IUnknown)
@@ -4630,7 +4537,7 @@ static HRESULT WINAPI ITextSelection_fnQueryInterface(
}
else if (IsEqualGUID(riid, &IID_Igetrichole))
{
- *ppvObj = This->reOle;
+ *ppvObj = This->services;
return S_OK;
}
@@ -4639,13 +4546,13 @@ static HRESULT WINAPI ITextSelection_fnQueryInterface(
static ULONG WINAPI ITextSelection_fnAddRef(ITextSelection *me)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
return InterlockedIncrement(&This->ref);
}
static ULONG WINAPI ITextSelection_fnRelease(ITextSelection *me)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ULONG ref = InterlockedDecrement(&This->ref);
if (ref == 0)
heap_free(This);
@@ -4654,7 +4561,7 @@ static ULONG WINAPI ITextSelection_fnRelease(ITextSelection *me)
static HRESULT WINAPI ITextSelection_fnGetTypeInfoCount(ITextSelection *me, UINT *pctinfo)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
TRACE("(%p)->(%p)\n", This, pctinfo);
*pctinfo = 1;
return S_OK;
@@ -4663,7 +4570,7 @@ static HRESULT WINAPI ITextSelection_fnGetTypeInfoCount(ITextSelection *me, UINT
static HRESULT WINAPI ITextSelection_fnGetTypeInfo(ITextSelection *me, UINT iTInfo, LCID lcid,
ITypeInfo **ppTInfo)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
HRESULT hr;
TRACE("(%p)->(%u,%d,%p)\n", This, iTInfo, lcid, ppTInfo);
@@ -4677,7 +4584,7 @@ static HRESULT WINAPI ITextSelection_fnGetTypeInfo(ITextSelection *me, UINT iTIn
static HRESULT WINAPI ITextSelection_fnGetIDsOfNames(ITextSelection *me, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITypeInfo *ti;
HRESULT hr;
@@ -4701,7 +4608,7 @@ static HRESULT WINAPI ITextSelection_fnInvoke(
EXCEPINFO *pExcepInfo,
UINT *puArgErr)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITypeInfo *ti;
HRESULT hr;
@@ -4717,20 +4624,20 @@ static HRESULT WINAPI ITextSelection_fnInvoke(
/*** ITextRange methods ***/
static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ME_Cursor *start = NULL, *end = NULL;
int nChars, endOfs;
BOOL bEOP;
TRACE("(%p)->(%p)\n", This, pbstr);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!pbstr)
return E_INVALIDARG;
- ME_GetSelection(This->reOle->editor, &start, &end);
+ ME_GetSelection(This->services->editor, &start, &end);
endOfs = ME_GetCursorOfs(end);
nChars = endOfs - ME_GetCursorOfs(start);
if (!nChars)
@@ -4743,8 +4650,8 @@ static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr)
if (!*pbstr)
return E_OUTOFMEMORY;
- bEOP = (!para_next( para_next( end->para ) ) && endOfs > ME_GetTextLength(This->reOle->editor));
- ME_GetTextW(This->reOle->editor, *pbstr, nChars, start, nChars, FALSE, bEOP);
+ bEOP = (!para_next( para_next( end->para ) ) && endOfs > ME_GetTextLength(This->services->editor));
+ ME_GetTextW(This->services->editor, *pbstr, nChars, start, nChars, FALSE, bEOP);
TRACE("%s\n", wine_dbgstr_w(*pbstr));
return S_OK;
@@ -4752,50 +4659,50 @@ static HRESULT WINAPI ITextSelection_fnGetText(ITextSelection *me, BSTR *pbstr)
static HRESULT WINAPI ITextSelection_fnSetText(ITextSelection *me, BSTR str)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ME_TextEditor *editor;
int len, to, from;
TRACE("(%p)->(%s)\n", This, debugstr_w(str));
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
- editor = This->reOle->editor;
+ editor = This->services->editor;
len = lstrlenW(str);
ME_GetSelectionOfs(editor, &from, &to);
ME_ReplaceSel(editor, FALSE, str, len);
if (len < to - from)
- textranges_update_ranges(This->reOle, from, len, RANGE_UPDATE_DELETE);
+ textranges_update_ranges(This->services, from, len, RANGE_UPDATE_DELETE);
return S_OK;
}
static HRESULT WINAPI ITextSelection_fnGetChar(ITextSelection *me, LONG *pch)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ME_Cursor *start = NULL, *end = NULL;
TRACE("(%p)->(%p)\n", This, pch);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!pch)
return E_INVALIDARG;
- ME_GetSelection(This->reOle->editor, &start, &end);
- return range_GetChar(This->reOle->editor, start, pch);
+ ME_GetSelection(This->services->editor, &start, &end);
+ return range_GetChar(This->services->editor, start, pch);
}
static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%x): stub\n", This, ch);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -4803,12 +4710,12 @@ static HRESULT WINAPI ITextSelection_fnSetChar(ITextSelection *me, LONG ch)
static HRESULT WINAPI ITextSelection_fnGetDuplicate(ITextSelection *me, ITextRange **range)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
LONG start, end;
TRACE("(%p)->(%p)\n", This, range);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!range)
@@ -4816,16 +4723,16 @@ static HRESULT WINAPI ITextSelection_fnGetDuplicate(ITextSelection *me, ITextRan
ITextSelection_GetStart(me, &start);
ITextSelection_GetEnd(me, &end);
- return CreateITextRange(This->reOle, start, end, range);
+ return CreateITextRange(This->services, start, end, range);
}
static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITextRange **range)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p): stub\n", This, range);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -4833,11 +4740,11 @@ static HRESULT WINAPI ITextSelection_fnGetFormattedText(ITextSelection *me, ITex
static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITextRange *range)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p): stub\n", This, range);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
FIXME("not implemented\n");
@@ -4846,83 +4753,83 @@ static HRESULT WINAPI ITextSelection_fnSetFormattedText(ITextSelection *me, ITex
static HRESULT WINAPI ITextSelection_fnGetStart(ITextSelection *me, LONG *pcpFirst)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
LONG lim;
TRACE("(%p)->(%p)\n", This, pcpFirst);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!pcpFirst)
return E_INVALIDARG;
- ME_GetSelectionOfs(This->reOle->editor, pcpFirst, &lim);
+ ME_GetSelectionOfs(This->services->editor, pcpFirst, &lim);
return S_OK;
}
static HRESULT WINAPI ITextSelection_fnSetStart(ITextSelection *me, LONG value)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
LONG start, end;
HRESULT hr;
TRACE("(%p)->(%d)\n", This, value);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
- ME_GetSelectionOfs(This->reOle->editor, &start, &end);
- hr = textrange_setstart(This->reOle, value, &start, &end);
+ ME_GetSelectionOfs(This->services->editor, &start, &end);
+ hr = textrange_setstart(This->services, value, &start, &end);
if (hr == S_OK)
- set_selection(This->reOle->editor, start, end);
+ set_selection(This->services->editor, start, end);
return hr;
}
static HRESULT WINAPI ITextSelection_fnGetEnd(ITextSelection *me, LONG *pcpLim)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
LONG first;
TRACE("(%p)->(%p)\n", This, pcpLim);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!pcpLim)
return E_INVALIDARG;
- ME_GetSelectionOfs(This->reOle->editor, &first, pcpLim);
+ ME_GetSelectionOfs(This->services->editor, &first, pcpLim);
return S_OK;
}
static HRESULT WINAPI ITextSelection_fnSetEnd(ITextSelection *me, LONG value)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
LONG start, end;
HRESULT hr;
TRACE("(%p)->(%d)\n", This, value);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
- ME_GetSelectionOfs(This->reOle->editor, &start, &end);
- hr = textrange_setend(This->reOle, value, &start, &end);
+ ME_GetSelectionOfs(This->services->editor, &start, &end);
+ hr = textrange_setend(This->services, value, &start, &end);
if (hr == S_OK)
- set_selection(This->reOle->editor, start, end);
+ set_selection(This->services->editor, start, end);
return hr;
}
static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **font)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%p)\n", This, font);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!font)
@@ -4936,7 +4843,7 @@ static HRESULT WINAPI ITextSelection_fnGetFont(ITextSelection *me, ITextFont **f
static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *font)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
TRACE("(%p)->(%p)\n", This, font);
@@ -4944,7 +4851,7 @@ static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *fo
if (!font)
return E_INVALIDARG;
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
@@ -4955,13 +4862,13 @@ static HRESULT WINAPI ITextSelection_fnSetFont(ITextSelection *me, ITextFont *fo
static HRESULT WINAPI ITextSelection_fnGetPara(ITextSelection *me, ITextPara **para)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%p)\n", This, para);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!para)
@@ -4975,11 +4882,11 @@ static HRESULT WINAPI ITextSelection_fnGetPara(ITextSelection *me, ITextPara **p
static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *para)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p): stub\n", This, para);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
FIXME("not implemented\n");
@@ -4988,23 +4895,23 @@ static HRESULT WINAPI ITextSelection_fnSetPara(ITextSelection *me, ITextPara *pa
static HRESULT WINAPI ITextSelection_fnGetStoryLength(ITextSelection *me, LONG *length)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
TRACE("(%p)->(%p)\n", This, length);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
- return textrange_get_storylength(This->reOle->editor, length);
+ return textrange_get_storylength(This->services->editor, length);
}
static HRESULT WINAPI ITextSelection_fnGetStoryType(ITextSelection *me, LONG *value)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
TRACE("(%p)->(%p)\n", This, value);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!value)
@@ -5016,31 +4923,31 @@ static HRESULT WINAPI ITextSelection_fnGetStoryType(ITextSelection *me, LONG *va
static HRESULT WINAPI ITextSelection_fnCollapse(ITextSelection *me, LONG bStart)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
LONG start, end;
HRESULT hres;
TRACE("(%p)->(%d)\n", This, bStart);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
- ME_GetSelectionOfs(This->reOle->editor, &start, &end);
+ ME_GetSelectionOfs(This->services->editor, &start, &end);
hres = range_Collapse(bStart, &start, &end);
if (SUCCEEDED(hres))
- set_selection(This->reOle->editor, start, end);
+ set_selection(This->services->editor, start, end);
return hres;
}
static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG unit, LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%d %p)\n", This, unit, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
@@ -5051,11 +4958,11 @@ static HRESULT WINAPI ITextSelection_fnExpand(ITextSelection *me, LONG unit, LON
static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG unit, LONG *index)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %p): stub\n", This, unit, index);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5064,11 +4971,11 @@ static HRESULT WINAPI ITextSelection_fnGetIndex(ITextSelection *me, LONG unit, L
static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG unit, LONG index,
LONG extend)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %d): stub\n", This, unit, index, extend);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5076,11 +4983,11 @@ static HRESULT WINAPI ITextSelection_fnSetIndex(ITextSelection *me, LONG unit, L
static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG anchor, LONG active)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d): stub\n", This, anchor, active);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5088,7 +4995,7 @@ static HRESULT WINAPI ITextSelection_fnSetRange(ITextSelection *me, LONG anchor,
static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *range, LONG *ret)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextSelection *selection = NULL;
LONG start, end;
@@ -5097,7 +5004,7 @@ static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *r
if (ret)
*ret = tomFalse;
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!range)
@@ -5115,11 +5022,11 @@ static HRESULT WINAPI ITextSelection_fnInRange(ITextSelection *me, ITextRange *r
static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *range, LONG *ret)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p %p): stub\n", This, range, ret);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5127,7 +5034,7 @@ static HRESULT WINAPI ITextSelection_fnInStory(ITextSelection *me, ITextRange *r
static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *range, LONG *ret)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextSelection *selection = NULL;
LONG start, end;
@@ -5136,7 +5043,7 @@ static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *r
if (ret)
*ret = tomFalse;
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
if (!range)
@@ -5154,11 +5061,11 @@ static HRESULT WINAPI ITextSelection_fnIsEqual(ITextSelection *me, ITextRange *r
static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
TRACE("(%p)\n", This);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
/* nothing to do */
@@ -5168,13 +5075,13 @@ static HRESULT WINAPI ITextSelection_fnSelect(ITextSelection *me)
static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG unit, LONG extend,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%d %d %p)\n", This, unit, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
@@ -5186,34 +5093,34 @@ static HRESULT WINAPI ITextSelection_fnStartOf(ITextSelection *me, LONG unit, LO
static HRESULT WINAPI ITextSelection_fnEndOf(ITextSelection *me, LONG unit, LONG extend,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%d %d %p)\n", This, unit, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
- hr = textrange_endof(range, This->reOle->editor, unit, extend, delta);
+ hr = textrange_endof(range, This->services->editor, unit, extend, delta);
ITextRange_Release(range);
return hr;
}
static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG unit, LONG count, LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
- hr = textrange_movestart(range, This->reOle->editor, unit, count, delta);
+ hr = textrange_movestart(range, This->services->editor, unit, count, delta);
ITextRange_Release(range);
return hr;
}
@@ -5221,17 +5128,17 @@ static HRESULT WINAPI ITextSelection_fnMove(ITextSelection *me, LONG unit, LONG
static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG unit, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
- hr = textrange_movestart(range, This->reOle->editor, unit, count, delta);
+ hr = textrange_movestart(range, This->services->editor, unit, count, delta);
ITextRange_Release(range);
return hr;
}
@@ -5239,17 +5146,17 @@ static HRESULT WINAPI ITextSelection_fnMoveStart(ITextSelection *me, LONG unit,
static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG unit, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%d %d %p)\n", This, unit, count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
- hr = textrange_moveend(range, This->reOle->editor, unit, count, delta);
+ hr = textrange_moveend(range, This->services->editor, unit, count, delta);
ITextRange_Release(range);
return hr;
}
@@ -5257,11 +5164,11 @@ static HRESULT WINAPI ITextSelection_fnMoveEnd(ITextSelection *me, LONG unit, LO
static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *charset, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5270,11 +5177,11 @@ static HRESULT WINAPI ITextSelection_fnMoveWhile(ITextSelection *me, VARIANT *ch
static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIANT *charset, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5283,11 +5190,11 @@ static HRESULT WINAPI ITextSelection_fnMoveStartWhile(ITextSelection *me, VARIAN
static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT *charset, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5296,11 +5203,11 @@ static HRESULT WINAPI ITextSelection_fnMoveEndWhile(ITextSelection *me, VARIANT
static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *charset, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5309,11 +5216,11 @@ static HRESULT WINAPI ITextSelection_fnMoveUntil(ITextSelection *me, VARIANT *ch
static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIANT *charset, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5322,11 +5229,11 @@ static HRESULT WINAPI ITextSelection_fnMoveStartUntil(ITextSelection *me, VARIAN
static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT *charset, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %p): stub\n", This, debugstr_variant(charset), count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5335,11 +5242,11 @@ static HRESULT WINAPI ITextSelection_fnMoveEndUntil(ITextSelection *me, VARIANT
static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR text, LONG count, LONG flags,
LONG *length)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
FIXME("not implemented\n");
@@ -5349,11 +5256,11 @@ static HRESULT WINAPI ITextSelection_fnFindText(ITextSelection *me, BSTR text, L
static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR text, LONG count,
LONG flags, LONG *length)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5362,11 +5269,11 @@ static HRESULT WINAPI ITextSelection_fnFindTextStart(ITextSelection *me, BSTR te
static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR text, LONG count,
LONG flags, LONG *length)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %d %x %p): stub\n", This, debugstr_w(text), count, flags, length);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5375,11 +5282,11 @@ static HRESULT WINAPI ITextSelection_fnFindTextEnd(ITextSelection *me, BSTR text
static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG unit, LONG count,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %p): stub\n", This, unit, count, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5387,45 +5294,45 @@ static HRESULT WINAPI ITextSelection_fnDelete(ITextSelection *me, LONG unit, LON
static HRESULT WINAPI ITextSelection_fnCut(ITextSelection *me, VARIANT *v)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%p): stub\n", This, v);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
- hr = textrange_copy_or_cut(range, This->reOle->editor, TRUE, v);
+ hr = textrange_copy_or_cut(range, This->services->editor, TRUE, v);
ITextRange_Release(range);
return hr;
}
static HRESULT WINAPI ITextSelection_fnCopy(ITextSelection *me, VARIANT *v)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
ITextRange *range = NULL;
HRESULT hr;
TRACE("(%p)->(%p)\n", This, v);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
ITextSelection_QueryInterface(me, &IID_ITextRange, (void**)&range);
- hr = textrange_copy_or_cut(range, This->reOle->editor, FALSE, v);
+ hr = textrange_copy_or_cut(range, This->services->editor, FALSE, v);
ITextRange_Release(range);
return hr;
}
static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *v, LONG format)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %x): stub\n", This, debugstr_variant(v), format);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5434,11 +5341,11 @@ static HRESULT WINAPI ITextSelection_fnPaste(ITextSelection *me, VARIANT *v, LON
static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *v, LONG format,
LONG *ret)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s %x %p): stub\n", This, debugstr_variant(v), format, ret);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5446,11 +5353,11 @@ static HRESULT WINAPI ITextSelection_fnCanPaste(ITextSelection *me, VARIANT *v,
static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *ret)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p): stub\n", This, ret);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5458,11 +5365,11 @@ static HRESULT WINAPI ITextSelection_fnCanEdit(ITextSelection *me, LONG *ret)
static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG type)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d): stub\n", This, type);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5470,11 +5377,11 @@ static HRESULT WINAPI ITextSelection_fnChangeCase(ITextSelection *me, LONG type)
static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG type, LONG *cx, LONG *cy)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %p %p): stub\n", This, type, cx, cy);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5483,11 +5390,11 @@ static HRESULT WINAPI ITextSelection_fnGetPoint(ITextSelection *me, LONG type, L
static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG y, LONG type,
LONG extend)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %d %d): stub\n", This, x, y, type, extend);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5495,11 +5402,11 @@ static HRESULT WINAPI ITextSelection_fnSetPoint(ITextSelection *me, LONG x, LONG
static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG value)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d): stub\n", This, value);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5507,11 +5414,11 @@ static HRESULT WINAPI ITextSelection_fnScrollIntoView(ITextSelection *me, LONG v
static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(ITextSelection *me, IUnknown **ppv)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p): stub\n", This, ppv);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5520,11 +5427,11 @@ static HRESULT WINAPI ITextSelection_fnGetEmbeddedObject(ITextSelection *me, IUn
/*** ITextSelection methods ***/
static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *flags)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p): stub\n", This, flags);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5532,11 +5439,11 @@ static HRESULT WINAPI ITextSelection_fnGetFlags(ITextSelection *me, LONG *flags)
static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG flags)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%x): stub\n", This, flags);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5544,11 +5451,11 @@ static HRESULT WINAPI ITextSelection_fnSetFlags(ITextSelection *me, LONG flags)
static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *type)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%p): stub\n", This, type);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5557,11 +5464,11 @@ static HRESULT WINAPI ITextSelection_fnGetType(ITextSelection *me, LONG *type)
static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG unit, LONG count,
LONG extend, LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5570,11 +5477,11 @@ static HRESULT WINAPI ITextSelection_fnMoveLeft(ITextSelection *me, LONG unit, L
static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG unit, LONG count,
LONG extend, LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5583,11 +5490,11 @@ static HRESULT WINAPI ITextSelection_fnMoveRight(ITextSelection *me, LONG unit,
static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG unit, LONG count,
LONG extend, LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5596,11 +5503,11 @@ static HRESULT WINAPI ITextSelection_fnMoveUp(ITextSelection *me, LONG unit, LON
static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG unit, LONG count,
LONG extend, LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %d %p): stub\n", This, unit, count, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5609,11 +5516,11 @@ static HRESULT WINAPI ITextSelection_fnMoveDown(ITextSelection *me, LONG unit, L
static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG unit, LONG extend,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5622,11 +5529,11 @@ static HRESULT WINAPI ITextSelection_fnHomeKey(ITextSelection *me, LONG unit, LO
static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG unit, LONG extend,
LONG *delta)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%d %d %p): stub\n", This, unit, extend, delta);
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5634,11 +5541,11 @@ static HRESULT WINAPI ITextSelection_fnEndKey(ITextSelection *me, LONG unit, LON
static HRESULT WINAPI ITextSelection_fnTypeText(ITextSelection *me, BSTR text)
{
- ITextSelectionImpl *This = impl_from_ITextSelection(me);
+ struct text_selection *This = impl_from_ITextSelection(me);
FIXME("(%p)->(%s): stub\n", This, debugstr_w(text));
- if (!This->reOle)
+ if (!This->services)
return CO_E_RELEASED;
return E_NOTIMPL;
@@ -5715,46 +5622,18 @@ static const ITextSelectionVtbl tsvt = {
ITextSelection_fnTypeText
};
-static ITextSelectionImpl *
-CreateTextSelection(IRichEditOleImpl *reOle)
+static struct text_selection *text_selection_create(struct text_services *services)
{
- ITextSelectionImpl *txtSel = heap_alloc(sizeof *txtSel);
+ struct text_selection *txtSel = heap_alloc(sizeof *txtSel);
if (!txtSel)
return NULL;
txtSel->ITextSelection_iface.lpVtbl = &tsvt;
txtSel->ref = 1;
- txtSel->reOle = reOle;
+ txtSel->services = services;
return txtSel;
}
-LRESULT CreateIRichEditOle(IUnknown *outer_unk, ME_TextEditor *editor, LPVOID *ppvObj)
-{
- IRichEditOleImpl *reo;
-
- reo = heap_alloc(sizeof(IRichEditOleImpl));
- if (!reo)
- return 0;
-
- reo->IUnknown_inner.lpVtbl = &reo_unk_vtbl;
- reo->IRichEditOle_iface.lpVtbl = &revt;
- reo->ITextDocument2Old_iface.lpVtbl = &tdvt;
- reo->ref = 1;
- reo->editor = editor;
- reo->txtSel = NULL;
-
- TRACE("Created %p\n",reo);
- list_init(&reo->rangelist);
- list_init(&reo->clientsites);
- if (outer_unk)
- reo->outer_unk = outer_unk;
- else
- reo->outer_unk = &reo->IUnknown_inner;
- *ppvObj = &reo->IUnknown_inner;
-
- return 1;
-}
-
static void convert_sizel(const ME_Context *c, const SIZEL* szl, SIZE* sz)
{
/* sizel is in .01 millimeters, sz in pixels */
@@ -5970,3 +5849,21 @@ void ME_CopyReObject(REOBJECT *dst, const REOBJECT *src, DWORD flags)
IOleClientSite_AddRef(dst->polesite);
}
}
+
+void richole_release_children( struct text_services *services )
+{
+ ITextRangeImpl *range;
+ IOleClientSiteImpl *site;
+
+ if (services->text_selection)
+ {
+ services->text_selection->services = NULL;
+ ITextSelection_Release( &services->text_selection->ITextSelection_iface );
+ }
+
+ LIST_FOR_EACH_ENTRY( range, &services->rangelist, ITextRangeImpl, child.entry )
+ range->child.reole = NULL;
+
+ LIST_FOR_EACH_ENTRY( site, &services->clientsites, IOleClientSiteImpl, child.entry )
+ site->child.reole = NULL;
+}
diff --git a/dlls/riched20/txtsrv.c b/dlls/riched20/txtsrv.c
index 80e4682880f..73b8d3ea7e9 100644
--- a/dlls/riched20/txtsrv.c
+++ b/dlls/riched20/txtsrv.c
@@ -32,16 +32,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(richedit);
-struct text_services
-{
- IUnknown IUnknown_inner;
- ITextServices ITextServices_iface;
- IUnknown *outer_unk;
- LONG ref;
- ME_TextEditor *editor;
- char spare[256]; /* for bug #12179 */
-};
-
static inline struct text_services *impl_from_IUnknown( IUnknown *iface )
{
return CONTAINING_RECORD( iface, struct text_services, IUnknown_inner );
@@ -55,13 +45,10 @@ static HRESULT WINAPI ITextServicesImpl_QueryInterface( IUnknown *iface, REFIID
if (IsEqualIID( iid, &IID_IUnknown )) *obj = &services->IUnknown_inner;
else if (IsEqualIID( iid, &IID_ITextServices )) *obj = &services->ITextServices_iface;
- else if (IsEqualIID( iid, &IID_IRichEditOle ) || IsEqualIID( iid, &IID_ITextDocument ) ||
- IsEqualIID( iid, &IID_ITextDocument2Old ))
- {
- if (!services->editor->reOle && !CreateIRichEditOle( services->outer_unk, services->editor, (void **)&services->editor->reOle ))
- return E_OUTOFMEMORY;
- return IUnknown_QueryInterface( services->editor->reOle, iid, obj );
- }
+ else if (IsEqualIID( iid, &IID_IRichEditOle )) *obj= &services->IRichEditOle_iface;
+ else if (IsEqualIID( iid, &IID_IDispatch ) ||
+ IsEqualIID( iid, &IID_ITextDocument ) ||
+ IsEqualIID( iid, &IID_ITextDocument2Old )) *obj = &services->ITextDocument2Old_iface;
else
{
*obj = NULL;
@@ -92,6 +79,7 @@ static ULONG WINAPI ITextServicesImpl_Release(IUnknown *iface)
if (!ref)
{
+ richole_release_children( services );
ME_DestroyEditor( services->editor );
CoTaskMemFree( services );
}
@@ -597,11 +585,18 @@ HRESULT create_text_services( IUnknown *outer, ITextHost *text_host, IUnknown **
services->ref = 1;
services->IUnknown_inner.lpVtbl = &textservices_inner_vtbl;
services->ITextServices_iface.lpVtbl = &textservices_vtbl;
+ services->IRichEditOle_iface.lpVtbl = &re_ole_vtbl;
+ services->ITextDocument2Old_iface.lpVtbl = &text_doc2old_vtbl;
services->editor = ME_MakeEditor( text_host, emulate_10 );
+ services->editor->richole = &services->IRichEditOle_iface;
if (outer) services->outer_unk = outer;
else services->outer_unk = &services->IUnknown_inner;
+ services->text_selection = NULL;
+ list_init( &services->rangelist );
+ list_init( &services->clientsites );
+
*unk = &services->IUnknown_inner;
return S_OK;
}
--
2.23.0
1
0
Signed-off-by: Huw Davies <huw(a)codeweavers.com>
---
dlls/riched20/editor.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index fe05d1e7444..deb0a93c8dc 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -279,6 +279,11 @@ ME_Paragraph *editor_end_para( ME_TextEditor *editor )
return &editor->pBuffer->pLast->member.para;
}
+static BOOL editor_beep( ME_TextEditor *editor, UINT type )
+{
+ return editor->props & TXTBIT_ALLOWBEEP && MessageBeep( type );
+}
+
static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStream *stream, ME_Style *style)
{
WCHAR *pText;
@@ -2281,7 +2286,7 @@ static BOOL paste_special(ME_TextEditor *editor, UINT cf, REPASTESPECIAL *ps, BO
/* Protect read-only edit control from modification */
if (editor->props & TXTBIT_READONLY)
{
- if (!check_only) MessageBeep(MB_ICONERROR);
+ if (!check_only) editor_beep( editor, MB_ICONERROR );
return FALSE;
}
@@ -2379,7 +2384,7 @@ static BOOL copy_or_cut( ME_TextEditor *editor, BOOL cut )
count -= offs;
hr = editor_copy_or_cut( editor, cut, sel_start, count, NULL );
- if (FAILED( hr )) MessageBeep( MB_ICONERROR );
+ if (FAILED( hr )) editor_beep( editor, MB_ICONERROR );
return SUCCEEDED( hr );
}
@@ -2422,7 +2427,7 @@ static BOOL handle_enter(ME_TextEditor *editor)
if (editor->props & TXTBIT_READONLY)
{
- MessageBeep(MB_ICONERROR);
+ editor_beep( editor, MB_ICONERROR );
return TRUE;
}
@@ -2683,7 +2688,7 @@ static LRESULT handle_wm_char( ME_TextEditor *editor, WCHAR wstr, LPARAM flags )
if (editor->props & TXTBIT_READONLY)
{
- MessageBeep(MB_ICONERROR);
+ editor_beep( editor, MB_ICONERROR );
return 0; /* FIXME really 0 ? */
}
@@ -2737,7 +2742,7 @@ static LRESULT handle_wm_char( ME_TextEditor *editor, WCHAR wstr, LPARAM flags )
if (para_in_table( para ) && cursor.run->nFlags & MERF_ENDPARA && from == to)
{
/* Text should not be inserted at the end of the table. */
- MessageBeep(-1);
+ editor_beep( editor, -1 );
return 0;
}
}
@@ -2951,7 +2956,8 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed->total_rows = 0;
ITextHost_TxGetPropertyBits( ed->texthost, TXTBIT_RICHTEXT | TXTBIT_MULTILINE | TXTBIT_READONLY |
TXTBIT_USEPASSWORD | TXTBIT_HIDESELECTION | TXTBIT_SAVESELECTION |
- TXTBIT_AUTOWORDSEL | TXTBIT_VERTICAL | TXTBIT_WORDWRAP | TXTBIT_DISABLEDRAG,
+ TXTBIT_AUTOWORDSEL | TXTBIT_VERTICAL | TXTBIT_WORDWRAP | TXTBIT_ALLOWBEEP |
+ TXTBIT_DISABLEDRAG,
&ed->props );
ITextHost_TxGetScrollBars( ed->texthost, &ed->scrollbars );
ed->pBuffer = ME_MakeText();
--
2.23.0
1
0
March 31, 2021
This moves running and waiting for the test executable out of main().
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
testbot/src/TestLauncher/TestLauncher.c | 162 +++++++++++++-----------
1 file changed, 85 insertions(+), 77 deletions(-)
diff --git a/testbot/src/TestLauncher/TestLauncher.c b/testbot/src/TestLauncher/TestLauncher.c
index b024714ac..022f25c98 100644
--- a/testbot/src/TestLauncher/TestLauncher.c
+++ b/testbot/src/TestLauncher/TestLauncher.c
@@ -208,6 +208,86 @@ BOOL CALLBACK DetectCriticalErrorDialog(HWND TopWnd, LPARAM lParam)
return TRUE;
}
+DWORD Start;
+
+DWORD RunTest(char *TestExeFileName, char* CommandLine, DWORD TimeOut, DWORD *Pid)
+{
+ STARTUPINFOA StartupInfo;
+ PROCESS_INFORMATION ProcessInformation;
+ DWORD ExitCode, WaitTimeOut;
+
+ StartupInfo.cb = sizeof(STARTUPINFOA);
+ GetStartupInfoA(&StartupInfo);
+ StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
+ StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
+ StartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+ StartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
+
+ /* Unlike WineTest we do not have the luxury of first running the test with
+ * a --list argument. This means we cannot use SetErrorMode() to check
+ * whether there are missing dependencies as it could modify the test
+ * results...
+ */
+ if (! CreateProcessA(NULL, CommandLine, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &StartupInfo, &ProcessInformation))
+ {
+ Error("CreateProcess failed (error %lu)\n", GetLastError());
+ ExitProcess(1);
+ }
+ CloseHandle(ProcessInformation.hThread);
+ *Pid = ProcessInformation.dwProcessId;
+
+ WaitTimeOut = 100;
+ ExitCode = WAIT_TIMEOUT;
+ while (ExitCode == WAIT_TIMEOUT)
+ {
+ DWORD Elapsed, Remaining;
+
+ ExitCode = WaitForSingleObject(ProcessInformation.hProcess, WaitTimeOut);
+ Elapsed = GetTickCount() - Start;
+ if (ExitCode != WAIT_TIMEOUT || Elapsed > TimeOut)
+ break;
+
+ /* ...instead detect the critical error dialog that pops up */
+ EnumWindows(DetectCriticalErrorDialog, (LPARAM)TestExeFileName);
+ if (Skips)
+ {
+ ExitCode = WAIT_OBJECT_0;
+ break;
+ }
+
+ Remaining = TimeOut == INFINITE ? TimeOut : TimeOut - Elapsed;
+ WaitTimeOut = (Elapsed > 3000) ? Remaining :
+ (2 * WaitTimeOut < Remaining) ? 2 * WaitTimeOut :
+ Remaining;
+ }
+
+ if (ExitCode != WAIT_OBJECT_0)
+ {
+ switch (ExitCode)
+ {
+ case WAIT_FAILED:
+ Error("Wait for child failed (error %lu)\n", GetLastError());
+ break;
+
+ case WAIT_TIMEOUT:
+ /* The 'exit code' on the done line identifies timeouts */
+ break;
+
+ default:
+ Error("Unexpected return value %lu from wait for child\n", ExitCode);
+ break;
+ }
+ if (!TerminateProcess(ProcessInformation.hProcess, 257))
+ Error("TerminateProcess failed (error %lu)\n", GetLastError());
+ }
+ else if (!Skips && !GetExitCodeProcess(ProcessInformation.hProcess, &ExitCode))
+ {
+ Error("Could not get the child exit code (error %lu)\n", GetLastError());
+ ExitCode = 259;
+ }
+ CloseHandle(ProcessInformation.hProcess);
+ return ExitCode;
+}
/*
* Command line parsing and test running.
@@ -216,7 +296,7 @@ BOOL CALLBACK DetectCriticalErrorDialog(HWND TopWnd, LPARAM lParam)
int main(int argc, char *argv[])
{
int Arg;
- DWORD Start, TimeOut, WaitTimeOut;
+ DWORD TimeOut;
BOOL UsageError;
char TestExeFullName[MAX_PATH];
char *TestExeFileName;
@@ -225,9 +305,7 @@ int main(int argc, char *argv[])
int TestArg;
char *CommandLine, *p;
int CommandLen;
- STARTUPINFOA StartupInfo;
- PROCESS_INFORMATION ProcessInformation;
- DWORD ExitCode;
+ DWORD Pid, ExitCode;
Name0 = p = argv[0];
while (*p != '\0')
@@ -340,82 +418,12 @@ int main(int argc, char *argv[])
printf("%s:%s start -\n", TestName, Subtest);
fflush(stdout);
- StartupInfo.cb = sizeof(STARTUPINFOA);
- GetStartupInfoA(&StartupInfo);
- StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
- StartupInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
- StartupInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
- StartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
-
- /* Unlike WineTest we do not have the luxury of first running the test with
- * a --list argument. This means we cannot use SetErrorMode() to check
- * whether there are missing dependencies as it could modify the test
- * results...
- */
- if (! CreateProcessA(NULL, CommandLine, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, &StartupInfo, &ProcessInformation))
- {
- Error("CreateProcess failed (error %lu)\n", GetLastError());
- return 1;
- }
- CloseHandle(ProcessInformation.hThread);
-
- WaitTimeOut = 100;
- ExitCode = WAIT_TIMEOUT;
- while (ExitCode == WAIT_TIMEOUT)
- {
- DWORD Elapsed, Remaining;
-
- ExitCode = WaitForSingleObject(ProcessInformation.hProcess, WaitTimeOut);
- Elapsed = GetTickCount() - Start;
- if (ExitCode != WAIT_TIMEOUT || Elapsed > TimeOut)
- break;
-
- /* ...instead detect the critical error dialog that pops up */
- EnumWindows(DetectCriticalErrorDialog, (LPARAM)TestExeFileName);
- if (Skips)
- {
- ExitCode = WAIT_OBJECT_0;
- break;
- }
-
- Remaining = TimeOut == INFINITE ? TimeOut : TimeOut - Elapsed;
- WaitTimeOut = (Elapsed > 3000) ? Remaining :
- (2 * WaitTimeOut < Remaining) ? 2 * WaitTimeOut :
- Remaining;
- }
-
- if (ExitCode != WAIT_OBJECT_0)
- {
- switch (ExitCode)
- {
- case WAIT_FAILED:
- Error("Wait for child failed (error %lu)\n", GetLastError());
- break;
-
- case WAIT_TIMEOUT:
- /* The 'exit code' on the done line identifies timeouts */
- break;
-
- default:
- Error("Unexpected return value %lu from wait for child\n", ExitCode);
- break;
- }
- if (!TerminateProcess(ProcessInformation.hProcess, 257))
- Error("TerminateProcess failed (error %lu)\n", GetLastError());
- }
- else if (!Skips && !GetExitCodeProcess(ProcessInformation.hProcess, &ExitCode))
- {
- Error("Could not get the child exit code (error %lu)\n", GetLastError());
- ExitCode = 259;
- }
- CloseHandle(ProcessInformation.hProcess);
-
+ ExitCode = RunTest(TestExeFileName, CommandLine, TimeOut, &Pid);
if (Skips)
- printf("%04lx:%s: 0 tests executed (0 marked as todo, 0 failures), %u skipped.\n", ProcessInformation.dwProcessId, Subtest, Skips);
+ printf("%04lx:%s: 0 tests executed (0 marked as todo, 0 failures), %u skipped.\n", Pid, Subtest, Skips);
printf("%s:%s:%04lx done (%ld) in %lds\n", TestName, Subtest,
- ProcessInformation.dwProcessId, ExitCode,
- (GetTickCount() - Start) / 1000);
+ Pid, ExitCode, (GetTickCount() - Start) / 1000);
return 0;
}
--
2.20.1
1
2