summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2020-03-05 11:42:29 +0100
committerJan Holesovsky <kendy@collabora.com>2020-03-18 21:47:48 +0100
commit3a7486b16ee89031ef9ae36a07474a8fa13b7de3 (patch)
tree2389267d6e0808024a6817396449ed861d7cc922 /editeng
parent60ababfc35eabe0fa0b6205681775085cf20da25 (diff)
lok: avoid to grab the focus from the formula bar
Change-Id: I13a2766e3c5dfd67cc89b5303e4a06f058b43891
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx5
-rw-r--r--editeng/source/editeng/impedit.cxx9
2 files changed, 12 insertions, 2 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 24d0947d7de5..66c8ed6f5b4a 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -486,6 +486,11 @@ void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bActivat
if (pParent && pParent->GetLOKWindowId() != 0)
return;
+ // We need to avoid to grab the focus from the formula bar
+ vcl::Window* pWindow = Application::GetFocusWindow();
+ if (!pWindow || pWindow != pImpEditView->pOutWin)
+ return;
+
static const OString aPayload = OString::boolean(true);
pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, aPayload.getStr());
pImpEditView->mpViewShell->NotifyOtherViews(LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", aPayload);
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index c9ad00241a55..e5bf2f3d3cf3 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1196,8 +1196,13 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
}
}
- SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect, bIsWrong, sHyperlink);
- mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
+ // We need to avoid to grab the focus from the formula bar
+ vcl::Window* pWindow = Application::GetFocusWindow();
+ if (pWindow && pWindow == pOutWin)
+ {
+ SfxLokHelper::notifyVisCursorInvalidation(mpViewShell, sRect, bIsWrong, sHyperlink);
+ mpViewShell->NotifyOtherViews(LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
+ }
}
}