summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2018-02-14 17:33:16 +0530
committerpranavk <pranavk@collabora.co.uk>2018-02-14 19:19:50 +0100
commit5024d7dbb364dec4fc90979251e5f29bc5ed3f5b (patch)
treee8de110007ecc97876f6f5236eb734cf7ce44985 /sd
parent45c472697821df1022cb8ac4d81a14fcb1f734ef (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 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx6
-rw-r--r--sd/source/ui/inc/unomodel.hxx3
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx36
3 files changed, 15 insertions, 30 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 4cdec1234c8e..e23ac2449841 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -49,6 +49,7 @@
#include <svx/svxids.hrc>
#include <DrawViewShell.hxx>
#include <pres.hxx>
+#include <vcl/vclevent.hxx>
#include <chrono>
@@ -1926,6 +1927,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);
@@ -1944,9 +1946,9 @@ void SdTiledRenderingTest::testIMESupport()
});
for (const auto& aInput: aInputs)
{
- pXImpressDocument->postExtTextInputEvent(LOK_EXT_TEXTINPUT, aInput);
+ pDocWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_EXTTEXTINPUT, aInput);
}
- pXImpressDocument->postExtTextInputEvent(LOK_EXT_TEXTINPUT_END, "");
+ pDocWindow->PostExtTextInputEvent(VCLEVENT_WINDOW_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 1e4bbcbab7a8..aff7c906ab39 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -242,6 +242,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;
@@ -249,8 +250,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 8d865516d032..4933b87742f9 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2367,6 +2367,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();
@@ -2517,32 +2527,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(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 SdXImpressDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int nButtons, int nModifier)
{
SolarMutexGuard aGuard;