diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-12-24 15:25:52 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-12-24 21:42:08 +0100 |
commit | 8b333c76945960fc62a01829666ba234f59a6d94 (patch) | |
tree | 4393e992348ac00faf04256d5f51f9e3aea2e4e6 /vcl/win | |
parent | fd4acfaca9fc012313f03f46e927add6feb6a553 (diff) |
Use rtl functions instead of own surrogate checking/combining
Change-Id: I3eb05d8f5b0761bc3b672d4c855eb469f8cc1a29
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127375
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/window/salframe.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 6593b2fbebb6..95b9a36693ad 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -38,6 +38,7 @@ #include <osl/file.hxx> #include <osl/process.h> +#include <rtl/character.hxx> #include <rtl/string.h> #include <rtl/ustring.h> #include <sal/log.hxx> @@ -122,8 +123,6 @@ const unsigned int WM_USER_SYSTEM_WINDOW_ACTIVATED = RegisterWindowMessageW(L"SY bool WinSalFrame::mbInReparent = false; // Macros for support of WM_UNICHAR & Keyman 6.0 -//#define Uni_UTF32ToSurrogate1(ch) (((unsigned long) (ch) - 0x10000) / 0x400 + 0xD800) -#define Uni_UTF32ToSurrogate2(ch) ((static_cast<tools::ULong>(ch) - 0x10000) % 0x400 + 0xDC00) #define Uni_SupplementaryPlanesStart 0x10000 static void UpdateFrameGeometry( HWND hWnd, WinSalFrame* pFrame ); @@ -3472,7 +3471,7 @@ static bool ImplHandleKeyMsg( HWND hWnd, UINT nMsg, nLastVKChar = 0; pFrame->CallCallback( SalEvent::KeyInput, &aKeyEvt ); pFrame->CallCallback( SalEvent::KeyUp, &aKeyEvt ); - wParam = static_cast<sal_Unicode>(Uni_UTF32ToSurrogate2( wParam )); + wParam = rtl::getLowSurrogate( wParam ); } aKeyEvt.mnCharCode = static_cast<sal_Unicode>(wParam); |