summaryrefslogtreecommitdiff
path: root/sc/source/ui/app/inputwin.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-04-14 12:09:38 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2022-05-01 20:18:52 +0200
commit7df8334b0078b4e8f8fbf5c55d9fdc54398b57b7 (patch)
treeb481558d291aec0ccb67eec7e991b5116e4e1f77 /sc/source/ui/app/inputwin.cxx
parent3dd8b19b814e959d00235df8bc08f9892f45dd87 (diff)
jsdialog: handle formulabar as textinput
mostly boilerplate code jsdialog changes: - added force parameter to sendAction - added support for key press/release and command events - moved ActionDataMap to jsdialog namespace for sharing formulabar changes: - added calls to send jsdialog messages with formula - added cursor moving support - on command event Change-Id: I714715133901941ba0758655e2d5907a3bae79f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133010 Reviewed-by: Mert Tumer <mert.tumer@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133652 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc/source/ui/app/inputwin.cxx')
-rw-r--r--sc/source/ui/app/inputwin.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 47c8c0fdb770..e50c682a1703 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1115,6 +1115,8 @@ ScTextWndGroup::ScTextWndGroup(ScInputBarGroup& rParent, ScTabViewShell* pViewSh
, mrParent(rParent)
{
mxScrollWin->connect_vadjustment_changed(LINK(this, ScTextWndGroup, Impl_ScrollHdl));
+ if (comphelper::LibreOfficeKit::isActive())
+ ScInputHandler::LOKSendFormulabarUpdate(SfxViewShell::Current(), "", ESelection());
}
Point ScTextWndGroup::GetCursorScreenPixelPos(bool bBelow)
@@ -1734,6 +1736,26 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt )
SC_MOD()->InputChanged( m_xEditView.get() );
}
+ if ( comphelper::LibreOfficeKit::isActive() && nCommand == CommandEventId::CursorPos )
+ {
+ // LOK uses this to setup caret position because drawingarea is replaced
+ // with text input field, it sends logical caret position (start, end) not pixels
+
+ StartEditEngine();
+ TextGrabFocus();
+
+ if (!m_xEditView)
+ return true;
+
+ Point aSelectionStartEnd = rCEvt.GetMousePosPixel();
+ m_xEditView->SetSelection(ESelection(0, aSelectionStartEnd.X(),
+ 0, aSelectionStartEnd.Y()));
+
+ SC_MOD()->InputSelection( m_xEditView.get() );
+
+ bConsumed = true;
+ }
+
bInputMode = false;
return bConsumed;
@@ -1889,6 +1911,12 @@ static sal_Int32 findFirstNonMatchingChar(const OUString& rStr1, const OUString&
void ScTextWnd::SetTextString( const OUString& rNewString )
{
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ ESelection aSel = m_xEditView ? m_xEditView->GetSelection() : ESelection();
+ ScInputHandler::LOKSendFormulabarUpdate(SfxViewShell::Current(), rNewString, aSel);
+ }
+
// Ideally it would be best to create on demand the EditEngine/EditView here, but... for
// the initialisation scenario where a cell is first clicked on we end up with the text in the
// inputbar window scrolled to the bottom if we do that here ( because the tableview and topview