include/vcl/customweld.hxx        |    1 +
 include/vcl/salvtables.hxx        |    2 ++
 include/vcl/weld.hxx              |    2 ++
 sc/source/ui/pagedlg/tphfedit.cxx |    2 ++
 vcl/source/app/salvtables.cxx     |   10 +++++++++-
 vcl/unx/gtk3/gtk3gtkinst.cxx      |    2 ++
 6 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 1ae63cb4755610f535ad7a1146b77415adb64939
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Feb 23 14:42:03 2022 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Fri Mar 4 13:21:30 2022 +0100

    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>

diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index fbfd025af5a5..1b23a09473c5 100644
--- a/include/vcl/customweld.hxx
+++ b/include/vcl/customweld.hxx
@@ -52,6 +52,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/salvtables.hxx b/include/vcl/salvtables.hxx
index 16b3db623c73..38a8299ae14c 100644
--- a/include/vcl/salvtables.hxx
+++ b/include/vcl/salvtables.hxx
@@ -289,6 +289,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/include/vcl/weld.hxx b/include/vcl/weld.hxx
index ef208a1bc662..9ded43bcf6cc 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -162,6 +162,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 15cc5242152a..fed870582dcc 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -112,6 +112,8 @@ void ScEditWindow::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
         pAcc->InitAcc(nullptr, m_xEditView.get(), nullptr,
                       sName, pDrawingArea->get_tooltip_text());
     }
+
+    SetCursor(m_xEditView->GetCursor());
 }
 
 ScEditWindow::~ScEditWindow()
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 80e22bef5670..4208c1465d23 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -529,6 +529,15 @@ 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();
@@ -5406,7 +5415,6 @@ void 
SalInstanceDrawingArea::HandleMouseEventListener(VclSimpleEvent& rEvent)
     SalInstanceWidget::HandleMouseEventListener(rEvent);
 }
 
-
 bool SalInstanceDrawingArea::HandleKeyEventListener(VclWindowEvent& /*rEvent*/)
 {
     return false;
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 84163b05ac64..f9e1c9f17fd5 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2700,6 +2700,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