diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-07 21:23:42 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2018-02-08 09:44:51 +0100 |
commit | b746577d27437f9298fa111512d083eaccd4fbed (patch) | |
tree | 9d10d171d4f1e39cd643eb3e09af30d9a5c96e26 /sd/source/ui | |
parent | 0d0c13bfbdff85a18433aee6e94558689f0cb722 (diff) |
sd, sc lok: IME support + unit tests
Change-Id: I710ba4347977641102b89fd274a159d34bc29e72
Reviewed-on: https://gerrit.libreoffice.org/49385
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 27 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 03924470f724..096afe120ccf 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -246,6 +246,8 @@ public: virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override; /// @see vcl::ITiledRenderable::postKeyEvent(). virtual void postKeyEvent(int nType, int nCharCode, int nKeyCode) override; + /// @see vcl::ITiledRenderable::postExtTextInputEvent(). + virtual void postExtTextInputEvent(int nType, const OUString& rText) override; /// @see vcl::ITiledRenderable::postMouseEvent(). virtual void postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) override; /// @see vcl::ITiledRenderable::setTextSelection(). diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 9eff10023c07..973702c926be 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -45,6 +45,7 @@ #include "unopool.hxx" #include <sfx2/dispatch.hxx> #include <sfx2/bindings.hxx> +#include <vcl/commandevent.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> @@ -2486,6 +2487,32 @@ void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) } } +void SdXImpressDocument::postExtTextInputEvent(int nType, const OUString& rText) +{ + SolarMutexGuard aGuard; + + DrawViewShell* pViewShell = GetViewShell(); + if (!pViewShell) + return; + + vcl::Window* pWindow = pViewShell->GetActiveWindow(); + if (!pWindow) + return; + + 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 SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) { SolarMutexGuard aGuard; |