summaryrefslogtreecommitdiff
path: root/sc
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:37 +0100
commit712540224d7c5c8cdb4a5214e2d7963a314c1928 (patch)
tree101386fc33b278d6ab307c665256a22b8beb439f /sc
parent4e1161c6cbdaf2bf0a92d3a5195ee559f2b77bed (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 'sc')
-rw-r--r--sc/inc/docuno.hxx6
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx34
3 files changed, 17 insertions, 29 deletions
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 6cf2cc35c360..5e1ce12bd37a 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -319,15 +319,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 d306b32afd46..e70d4f17b3f7 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -33,6 +33,7 @@
#include <sfx2/lokhelper.hxx>
#include <svx/svdpage.hxx>
#include <vcl/scheduler.hxx>
+#include <vcl/vclevent.hxx>
#include <chrono>
#include <cstddef>
@@ -1575,6 +1576,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());
@@ -1590,9 +1592,9 @@ void ScTiledRenderingTest::testIMESupport()
});
for (const auto& aInput: aInputs)
{
- pModelObj->postExtTextInputEvent(LOK_EXT_TEXTINPUT, aInput);
+ pDocWindow->PostExtTextInputEvent(VclEventId::ExtTextInput, aInput);
}
- pModelObj->postExtTextInputEvent(LOK_EXT_TEXTINPUT_END, "");
+ pDocWindow->PostExtTextInputEvent(VclEventId::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 d12a063a926a..b64645dfe667 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -549,6 +549,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
@@ -619,30 +629,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(VclEventId::ExtTextInput, rText);
- break;
- case LOK_EXT_TEXTINPUT_END:
- pWindow->PostExtTextInputEvent(VclEventId::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;