diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-20 21:39:15 +0530 |
---|---|---|
committer | pranavk <pranavk@collabora.co.uk> | 2018-02-23 08:43:31 +0100 |
commit | 190a44fe052f034368e254d263fca21fc000d6ce (patch) | |
tree | d4eebf9d476d5a1263bf1056cad2e9bfd5de373b /sd | |
parent | ce43b10ccac41d352bcbf3a40e36360c3d0483c2 (diff) |
lok: Factor out the code for finding vcl::Window of a document
This should also help with IME input on charts
Change-Id: Ie513790a5d0c87397c39301a328a44b59d394a45
Reviewed-on: https://gerrit.libreoffice.org/50091
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 2ff6f93c0680..3dc5e2839c74 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2344,6 +2344,12 @@ VclPtr<vcl::Window> SdXImpressDocument::getDocWindow() VclPtr<vcl::Window> pWindow; if (pViewShell) pWindow = pViewShell->GetActiveWindow(); + + LokChartHelper aChartHelper(pViewShell->GetViewShell()); + VclPtr<vcl::Window> pChartWindow = aChartHelper.GetWindow(); + if (pChartWindow) + pWindow = pChartWindow; + return pWindow; } @@ -2466,23 +2472,11 @@ void SdXImpressDocument::postKeyEvent(int nType, int nCharCode, int nKeyCode) { SolarMutexGuard aGuard; - DrawViewShell* pViewShell = GetViewShell(); - if (!pViewShell) - return; - - vcl::Window* pWindow = pViewShell->GetActiveWindow(); + VclPtr<vcl::Window> pWindow = getDocWindow(); if (!pWindow) return; - LokChartHelper aChartHelper(pViewShell->GetViewShell()); - vcl::Window* pChartWindow = aChartHelper.GetWindow(); - if (pChartWindow) - { - pWindow = pChartWindow; - } - KeyEvent aEvent(nCharCode, nKeyCode, 0); - switch (nType) { case LOK_KEYEVENT_KEYINPUT: |