include/vcl/customweld.hxx | 1 + include/vcl/weld.hxx | 2 ++ sc/source/ui/pagedlg/tphfedit.cxx | 2 ++ vcl/inc/salvtables.hxx | 2 ++ vcl/source/app/salvtables.cxx | 9 +++++++++ vcl/unx/gtk3/gtk3gtkinst.cxx | 2 ++ 6 files changed, 18 insertions(+)
New commits: commit 49b8b4c2caefa9428d86ee0c6bb78a151e10d292 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Wed Feb 23 14:42:03 2022 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Tue Jul 5 17:46:16 2022 +0200 lok: vcl: introduce set_cursor_data method The ScEditWindow requires to assign a cursor, so the child widget can send cursor invalidation to client side. Change-Id: I429d484a311f217f2419e38d50f8d9a422640221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130446 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136832 Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index 64f980732dfb..e5166bae0fd9 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -63,6 +63,7 @@ public: } virtual void Show() { m_pDrawingArea->show(); } virtual void Hide() { m_pDrawingArea->hide(); } + void SetCursor(void * pData) { m_pDrawingArea->set_cursor_data(pData); } void GrabFocus() { m_pDrawingArea->grab_focus(); } bool HasFocus() const { return m_pDrawingArea->has_focus(); } bool IsVisible() const { return m_pDrawingArea->get_visible(); } diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 70d91ee6ca96..c2922048e0a8 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -206,6 +206,8 @@ public: virtual void set_tooltip_text(const OUString& rTip) = 0; virtual OUString get_tooltip_text() const = 0; + virtual void set_cursor_data(void * pData) = 0; + virtual void connect_focus_in(const Link<Widget&, void>& rLink) { assert(!m_aFocusInHdl.IsSet() || !rLink.IsSet()); diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index acf8333d246d..964b022eb943 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -111,6 +111,8 @@ void ScEditWindow::SetDrawingArea(weld::DrawingArea* pDrawingArea) pAcc->InitAcc(nullptr, m_xEditView.get(), nullptr, nullptr, sName, pDrawingArea->get_tooltip_text()); + + SetCursor(m_xEditView->GetCursor()); } ScEditWindow::~ScEditWindow() diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index aeb1e7bc4e0f..cb57115a73b9 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -300,6 +300,8 @@ public: virtual OUString get_tooltip_text() const override; + virtual void set_cursor_data(void * pData) override; + virtual void connect_focus_in(const Link<Widget&, void>& rLink) override; virtual void connect_mnemonic_activate(const Link<Widget&, bool>& rLink) override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 97330df96b58..f3797237e1fa 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -391,6 +391,15 @@ void SalInstanceWidget::set_tooltip_text(const OUString& rTip) OUString SalInstanceWidget::get_tooltip_text() const { return m_xWidget->GetQuickHelpText(); } +void SalInstanceWidget::set_cursor_data(void * pData) +{ + vcl::Cursor * pCursor = static_cast<vcl::Cursor *>(pData); + if (!pCursor) + return; + + m_xWidget->SetCursor(pCursor); +} + void SalInstanceWidget::connect_focus_in(const Link<Widget&, void>& rLink) { ensure_event_listener(); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 9fd92aa39b9c..292cd3bb764b 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -2874,6 +2874,8 @@ public: return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8); } + virtual void set_cursor_data(void * /*pData*/) override {}; + virtual std::unique_ptr<weld::Container> weld_parent() const override; virtual OString get_buildable_name() const override