diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2018-02-20 21:39:15 +0530 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-25 21:24:13 +0200 |
commit | 2de36b5cedf790fd5198b8f7c4dfdb3bf67d4f0e (patch) | |
tree | 06fb59a21c626b8ef23702fe312834a6b9e72f3a /sd | |
parent | 3cc59cfae1cf8701ec7a5e7d85fc7a3645f55d96 (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>
(cherry picked from commit 190a44fe052f034368e254d263fca21fc000d6ce)
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 af019e5ffdff..339fe46449d9 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: |