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 /sw | |
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 'sw')
-rw-r--r-- | sw/inc/unotxdoc.hxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/tiledrendering/tiledrendering.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 30 |
3 files changed, 16 insertions, 24 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index a0cbcb0d63de..9cd47293c63c 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -415,12 +415,12 @@ public: virtual OUString getPartName(int nPart) override; /// @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; /// @see vcl::ITiledRenderable::setTextSelection(). diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index 05c352926d73..bb539a326149 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -38,6 +38,7 @@ #include <sfx2/dispatch.hxx> #include <redline.hxx> #include <IDocumentRedlineAccess.hxx> +#include <vcl/vclevent.hxx> #include <flddat.hxx> static const char* DATA_DIRECTORY = "/sw/qa/extras/tiledrendering/data/"; @@ -2042,6 +2043,7 @@ void SwTiledRenderingTest::testIMESupport() { comphelper::LibreOfficeKit::setActive(); SwXTextDocument* pXTextDocument = createDoc("dummy.fodt"); + VclPtr<vcl::Window> pDocWindow = pXTextDocument->getDocWindow(); SwView* pView = dynamic_cast<SwView*>(SfxViewShell::Current()); SwWrtShell* pWrtShell = pView->GetWrtShellPtr(); @@ -2055,9 +2057,9 @@ void SwTiledRenderingTest::testIMESupport() }); for (const auto& aInput: aInputs) { - pXTextDocument->postExtTextInputEvent(LOK_EXT_TEXTINPUT, aInput); + pDocWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_EXTTEXTINPUT, aInput); } - pXTextDocument->postExtTextInputEvent(LOK_EXT_TEXTINPUT_END, ""); + pDocWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_ENDEXTTEXTINPUT, ""); // the cursor should be at position 2nd SwShellCursor* pShellCursor = pWrtShell->getShellCursor(false); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 77393d59bdaa..43101853987a 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3402,6 +3402,16 @@ OUString SwXTextDocument::getPartHash(int nPart) return OUString::number(sPart.hashCode()); } +VclPtr<vcl::Window> SwXTextDocument::getDocWindow() +{ + SolarMutexGuard aGuard; + VclPtr<vcl::Window> pWindow; + SwView* pView = pDocShell->GetView(); + if (pView) + pWindow = &(pView->GetEditWin()); + return pWindow; +} + void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) { SolarMutexGuard aGuard; @@ -3501,26 +3511,6 @@ 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(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 SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier) { SolarMutexGuard aGuard; |