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/gtkinst.cxx          |    2 ++
 6 files changed, 18 insertions(+)

New commits:
commit 97d99ee76579af7566740e9fe6052ebae2e87dd7
Author:     Henry Castro <[email protected]>
AuthorDate: Wed Feb 23 14:42:03 2022 -0400
Commit:     Henry Castro <[email protected]>
CommitDate: Wed Dec 7 11:16:06 2022 +0000

    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 <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136829
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140983

diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index e37555b36777..196608ee53a9 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 HasChildFocus() const { return m_pDrawingArea->has_child_focus(); }
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index d1d798299279..2d54da18d641 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -220,6 +220,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 c71c67b0842b..bf256e8a0016 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -107,6 +107,8 @@ void ScEditWindow::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
     tmpAcc->InitAcc(nullptr, m_xEditView.get(),
                   sName, pDrawingArea->get_tooltip_text());
+
+    SetCursor(m_xEditView->GetCursor());
 }
 
 ScEditWindow::~ScEditWindow()
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index f93407dae8a9..d1aa50d183e0 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -308,6 +308,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 b122bcefbf07..3fe6f3a08acf 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -418,6 +418,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/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 6b97261e7e89..0d1e9ed18a47 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -3900,6 +3900,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

Reply via email to