diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-07 17:19:58 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2018-02-08 08:40:25 +0100 |
commit | 7f9f58f3a304733f7089719a5a65eef8c68c2b8d (patch) | |
tree | 3ee9c3b4548304306a7dbd9ed0ab33249d88cc64 /sw/source/uibase | |
parent | 274825b4180c81540cd0d1b22c5243f1b39fe4db (diff) |
sw lok: IME support + unit test
Change-Id: I557493db23dfa3529606050c86161628dbd722e7
Reviewed-on: https://gerrit.libreoffice.org/49354
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index aa6e3395270b..19f7c24b2a37 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -25,7 +25,9 @@ #include <AnnotationWin.hxx> #include <o3tl/any.hxx> #include <osl/mutex.hxx> +#include <vcl/commandevent.hxx> #include <vcl/image.hxx> +#include <vcl/vclevent.hxx> #include <vcl/virdev.hxx> #include <vcl/sysdata.hxx> #include <vcl/svapp.hxx> @@ -3493,6 +3495,26 @@ void SwXTextDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) } } +void SwXTextDocument::postExtTextInputEvent(int nType, const OUString& rText) +{ + SolarMutexGuard aGuard; + + vcl::Window* pWindow = &(pDocShell->GetView()->GetEditWin()); + + CommandExtTextInputData aTextInputData(rText, nullptr, 0, 0, false); + switch (nType) + { + case LOK_EXT_TEXTINPUT: + pWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, rText); + break; + case LOK_EXT_TEXTINPUT_END: + pWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, ""); + break; + default: + assert(false && "Unhandled External Text input event!"); + } +} + void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) { SolarMutexGuard aGuard; |