summaryrefslogtreecommitdiff
path: root/bean
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-09-26 11:28:57 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-09-30 11:23:41 +0200
commit362a21d3a129b90149f6ef645c127f5e86e0ba61 (patch)
tree8583cb29b33de56e4489cb8950d2714a1fb2957e /bean
parent81ce629c9e8a4fc26ded9d49157e3f3263991e03 (diff)
Use explicit function names for fooA/fooW WinAPI; prefer fooW
We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'bean')
-rw-r--r--bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c b/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
index dc3ee5b4bb35..b1b476356fd5 100644
--- a/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
+++ b/bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c
@@ -38,7 +38,7 @@
#define SYSTEM_WIN32 1
-#define OLD_PROC_KEY "oldwindowproc"
+#define OLD_PROC_KEY L"oldwindowproc"
static LRESULT APIENTRY OpenOfficeWndProc( HWND , UINT , WPARAM , LPARAM );
@@ -131,10 +131,10 @@ JNIEXPORT jlong JNICALL Java_com_sun_star_comp_beans_LocalOfficeWindow_getNative
and calls on such construct produce
a stack overflow.
*/
- if (GetProp( hWnd, OLD_PROC_KEY )==NULL)
+ if (GetPropW( hWnd, OLD_PROC_KEY )==NULL)
{
- hFuncPtr = SetWindowLongPtr( hWnd, GWLP_WNDPROC, (LONG_PTR)OpenOfficeWndProc );
- SetProp( hWnd, OLD_PROC_KEY, (HANDLE)hFuncPtr );
+ hFuncPtr = SetWindowLongPtrW( hWnd, GWLP_WNDPROC, (LONG_PTR)OpenOfficeWndProc );
+ SetPropW( hWnd, OLD_PROC_KEY, (HANDLE)hFuncPtr );
}
return (jlong)hWnd;
@@ -182,7 +182,7 @@ static LRESULT APIENTRY OpenOfficeWndProc(
#pragma warning(push)
#pragma warning(disable: 4152) /* function/data pointer conversion: */
#endif
- return CallWindowProc(GetProp(hWnd, OLD_PROC_KEY),
+ return CallWindowProcW(GetPropW(hWnd, OLD_PROC_KEY),
hWnd, uMsg, wParam, lParam);
#if defined _MSC_VER
#pragma warning(pop)