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:37 +0100 |
commit | 712540224d7c5c8cdb4a5214e2d7963a314c1928 (patch) | |
tree | 101386fc33b278d6ab307c665256a22b8beb439f /desktop/source/lib | |
parent | 4e1161c6cbdaf2bf0a92d3a5195ee559f2b77bed (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>
Diffstat (limited to 'desktop/source/lib')
-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 bc788d243b9e..8d0611c21d07 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -543,6 +543,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, @@ -2298,18 +2299,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) |