diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-14 17:33:16 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2018-02-14 19:19:50 +0100 |
commit | 5024d7dbb364dec4fc90979251e5f29bc5ed3f5b (patch) | |
tree | e8de110007ecc97876f6f5236eb734cf7ce44985 /desktop | |
parent | 45c472697821df1022cb8ac4d81a14fcb1f734ef (diff) |
lok IME: support dialogs as well
Change-Id: Ic78da45dadaa5a4e1ca78e20d04974108581121e
(cherry picked from commit 44fa8ae7d9bb3a28d860b2cc5871d6a6ccfc8411)
Reviewed-on: https://gerrit.libreoffice.org/49728
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index eafdf21f88ce..8c51972b861d 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -569,6 +569,7 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nCharCode, int nKeyCode); static void doc_postExtTextInputEvent(LibreOfficeKitDocument* pThis, + unsigned nWindowId, int nType, const char* pText); static void doc_postWindowKeyEvent(LibreOfficeKitDocument* pThis, @@ -2285,18 +2286,43 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar pDoc->postKeyEvent(nType, nCharCode, nKeyCode); } -static void doc_postExtTextInputEvent(LibreOfficeKitDocument* pThis, int nType, const char* pText) +static void doc_postExtTextInputEvent(LibreOfficeKitDocument* pThis, unsigned nWindowId, int nType, const char* pText) { SolarMutexGuard aGuard; + VclPtr<vcl::Window> pWindow; + if (nWindowId == 0) + { + ITiledRenderable* pDoc = getTiledRenderable(pThis); + if (!pDoc) + { + gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + return; + } + pWindow = pDoc->getDocWindow(); + } + else + { + pWindow = vcl::Window::FindLOKWindow(nWindowId); + } - ITiledRenderable* pDoc = getTiledRenderable(pThis); - if (!pDoc) + if (!pWindow) { - gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering"; + gImpl->maLastExceptionMsg = "No window found for window id: " + OUString::number(nWindowId); return; } - pDoc->postExtTextInputEvent(nType, OUString::fromUtf8(OString(pText, strlen(pText)))); + switch (nType) + { + case LOK_EXT_TEXTINPUT: + pWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_EXTTEXTINPUT, + OUString::fromUtf8(OString(pText, strlen(pText)))); + break; + case LOK_EXT_TEXTINPUT_END: + pWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_ENDEXTTEXTINPUT, ""); + break; + default: + assert(false && "Unhandled External Text input event!"); + } } static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode) |