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 /sd | |
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 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 36 |
3 files changed, 15 insertions, 30 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 6990b25ae3ce..dbb77a32b3e8 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -49,6 +49,7 @@ #include <DrawViewShell.hxx> #include <pres.hxx> #include <vcl/scheduler.hxx> +#include <vcl/vclevent.hxx> #include <chrono> @@ -1948,6 +1949,7 @@ void SdTiledRenderingTest::testIMESupport() comphelper::LibreOfficeKit::setActive(); SdXImpressDocument* pXImpressDocument = createDoc("dummy.odp"); + VclPtr<vcl::Window> pDocWindow = pXImpressDocument->getDocWindow(); sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); SdrObject* pObject = pViewShell->GetActualPage()->GetObj(0); SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObject); @@ -1966,9 +1968,9 @@ void SdTiledRenderingTest::testIMESupport() }); for (const auto& aInput: aInputs) { - pXImpressDocument->postExtTextInputEvent(LOK_EXT_TEXTINPUT, aInput); + pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, aInput); } - pXImpressDocument->postExtTextInputEvent(LOK_EXT_TEXTINPUT_END, ""); + pDocWindow->PostExtTextInputEvent(VclEventId::EndExtTextInput, ""); // the cursor should be at position 3rd EditView& rEditView = pView->GetTextEditOutlinerView()->GetEditView(); diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 096afe120ccf..67770cc27313 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -239,6 +239,7 @@ public: virtual int getParts() override; virtual OUString getPartName( int nPart ) override; virtual OUString getPartHash( int nPart ) override; + virtual VclPtr<vcl::Window> getDocWindow() override; virtual void setPartMode( int nPartMode ) override; @@ -246,8 +247,6 @@ 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 973702c926be..50702bed3a3e 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2337,6 +2337,16 @@ OUString SdXImpressDocument::getPartHash( int nPart ) return OUString::number(pPage->GetHashCode()); } +VclPtr<vcl::Window> SdXImpressDocument::getDocWindow() +{ + SolarMutexGuard aGuard; + DrawViewShell* pViewShell = GetViewShell(); + VclPtr<vcl::Window> pWindow; + if (pViewShell) + pWindow = pViewShell->GetActiveWindow(); + return pWindow; +} + void SdXImpressDocument::setPartMode( int nPartMode ) { DrawViewShell* pViewSh = GetViewShell(); @@ -2487,32 +2497,6 @@ 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; |