diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-14 17:33:16 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-25 19:59:22 +0200 |
commit | 6fd8f91fad9a5bbd906b1d9a94ff3376e18f0ef2 (patch) | |
tree | cb84349782706623e2917ef8285a1f5270a995f1 /desktop/source/lib/init.cxx | |
parent | d19d5a89158cc05c3b6972a36dffe64a2656339f (diff) |
lok IME: support dialogs as well
Change-Id: Ic78da45dadaa5a4e1ca78e20d04974108581121e
Reviewed-on: https://gerrit.libreoffice.org/49714
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
(cherry picked from commit 712540224d7c5c8cdb4a5214e2d7963a314c1928)
Diffstat (limited to 'desktop/source/lib/init.cxx')
-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 c33f7aac4d17..dd538d127f96 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -550,6 +550,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, @@ -2305,18 +2306,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(VclEventId::ExtTextInput, + OUString::fromUtf8(OString(pText, strlen(pText)))); + break; + case LOK_EXT_TEXTINPUT_END: + pWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, ""); + break; + default: + assert(false && "Unhandled External Text input event!"); + } } static void doc_postWindowKeyEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindowId, int nType, int nCharCode, int nKeyCode) |