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 /sc | |
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 'sc')
-rw-r--r-- | sc/inc/docuno.hxx | 6 | ||||
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 34 |
3 files changed, 17 insertions, 29 deletions
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 4c4e74583023..0b91ec3ddcfc 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -379,15 +379,15 @@ public: /// @see vcl::ITiledRenderable::getPartHash(). virtual OUString getPartHash( int nPart ) override; + /// @see vcl::ITiledRenderable::getDocWindow(). + virtual VclPtr<vcl::Window> getDocWindow() override; + /// @see vcl::ITiledRenderable::initializeForTiledRendering(). 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; diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 801f7ad55288..74d2d3dc5f0a 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -32,6 +32,7 @@ #include <comphelper/propertyvalue.hxx> #include <sfx2/lokhelper.hxx> #include <svx/svdpage.hxx> +#include <vcl/vclevent.hxx> #include <chrono> #include <tabvwsh.hxx> @@ -1566,6 +1567,7 @@ void ScTiledRenderingTest::testIMESupport() comphelper::LibreOfficeKit::setActive(); ScModelObj* pModelObj = createDoc("empty.ods"); + VclPtr<vcl::Window> pDocWindow = pModelObj->getDocWindow(); ScDocument* pDoc = pModelObj->GetDocument(); ScTabViewShell* pView = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()); @@ -1581,9 +1583,9 @@ void ScTiledRenderingTest::testIMESupport() }); for (const auto& aInput: aInputs) { - pModelObj->postExtTextInputEvent(LOK_EXT_TEXTINPUT, aInput); + pDocWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_EXTTEXTINPUT, aInput); } - pModelObj->postExtTextInputEvent(LOK_EXT_TEXTINPUT_END, ""); + pDocWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_ENDEXTTEXTINPUT, ""); // commit the string to the cell pModelObj->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, awt::Key::RETURN); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index fc7c6407915c..63a7b757bf9a 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -546,6 +546,16 @@ OUString ScModelObj::getPartHash( int nPart ) return (pViewData->GetDocument()->GetHashCode(nPart, nHashCode) ? OUString::number(nHashCode) : OUString()); } +VclPtr<vcl::Window> ScModelObj::getDocWindow() +{ + SolarMutexGuard aGuard; + ScViewData* pViewData = ScDocShell::GetViewData(); + VclPtr<vcl::Window> pWindow; + if (pViewData) + pWindow = pViewData->GetActiveWin(); + return pWindow; +} + Size ScModelObj::getDocumentSize() { Size aSize(10, 10); // minimum size @@ -616,30 +626,6 @@ void ScModelObj::postKeyEvent(int nType, int nCharCode, int nKeyCode) } } -void ScModelObj::postExtTextInputEvent(int nType, const OUString& rText) -{ - SolarMutexGuard aGuard; - - ScViewData* pViewData = ScDocShell::GetViewData(); - vcl::Window* pWindow = pViewData->GetActiveWin(); - - if (!pWindow) - return; - - CommandExtTextInputData aTextInputData(rText, nullptr, 0, 0, false); - switch (nType) - { - case LOK_EXT_TEXTINPUT: - pWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_EXTTEXTINPUT, rText); - break; - case LOK_EXT_TEXTINPUT_END: - pWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_ENDEXTTEXTINPUT, ""); - break; - default: - assert(false && "Unhandled External Text input event!"); - } -} - void ScModelObj::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) { SolarMutexGuard aGuard; |