vcl/qt5/QtInstanceToolbar.cxx |   30 ++++++++++++++++++++++++------
 vcl/unx/gtk3/gtkinst.cxx      |   16 ++++++++--------
 2 files changed, 32 insertions(+), 14 deletions(-)

New commits:
commit ad6c5d3211b09bd947c1521132d62503287f8de9
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 6 01:47:05 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Feb 6 10:15:45 2026 +0100

    gtk weld: Drop unnecessary GTK_WIDGET casting
    
    GtkInstanceToolbar::m_aMap is a
    std::map<OUString, GtkWidget*>, so these are
    already GtkWidget*, hence no need to cast to that.
    
    (Before
    
        commit 0195b41a0c9e81f042e5b998a3b8f8c22a6b3c5d
        Date:   Tue Jul 6 14:31:08 2021 +0100
    
            gtk[3|4]: remove some unnecessary ifdefs
    
    , the gtk3 map was using GtkToolItem* instead of GtkWidget*,
    but that's no longer the case.)
    
    Change-Id: I1978a88dbbb2b7f9188f5e14f4eeba1d621b85c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198809
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 292592157e11..ecb4e3f714a3 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -11906,30 +11906,30 @@ public:
     virtual void set_item_sensitive(const OUString& rIdent, bool bSensitive) 
override
     {
         disable_item_notify_events();
-        gtk_widget_set_sensitive(GTK_WIDGET(m_aMap[rIdent]), bSensitive);
+        gtk_widget_set_sensitive(m_aMap[rIdent], bSensitive);
         enable_item_notify_events();
     }
 
     virtual bool get_item_sensitive(const OUString& rIdent) const override
     {
-        return 
gtk_widget_get_sensitive(GTK_WIDGET(m_aMap.find(rIdent)->second));
+        return gtk_widget_get_sensitive(m_aMap.find(rIdent)->second);
     }
 
     virtual void set_item_visible(const OUString& rIdent, bool bVisible) 
override
     {
         disable_item_notify_events();
-        gtk_widget_set_visible(GTK_WIDGET(m_aMap[rIdent]), bVisible);
+        gtk_widget_set_visible(m_aMap[rIdent], bVisible);
         enable_item_notify_events();
     }
 
     virtual void set_item_help_id(const OUString& rIdent, const OUString& 
rHelpId) override
     {
-        ::set_help_id(GTK_WIDGET(m_aMap[rIdent]), rHelpId);
+        ::set_help_id(m_aMap[rIdent], rHelpId);
     }
 
     virtual bool get_item_visible(const OUString& rIdent) const override
     {
-        return gtk_widget_get_visible(GTK_WIDGET(m_aMap.find(rIdent)->second));
+        return gtk_widget_get_visible(m_aMap.find(rIdent)->second);
     }
 
     virtual void set_item_active(const OUString& rIdent, bool bActive) override
@@ -12226,7 +12226,7 @@ public:
 
     virtual void set_item_tooltip_text(const OUString& rIdent, const OUString& 
rTip) override
     {
-        GtkWidget* pItem = GTK_WIDGET(m_aMap[rIdent]);
+        GtkWidget* pItem = m_aMap[rIdent];
         gtk_widget_set_tooltip_text(pItem, OUStringToOString(rTip, 
RTL_TEXTENCODING_UTF8).getStr());
     }
 
@@ -12245,7 +12245,7 @@ public:
 
     virtual void set_item_accessible_name(const OUString& rIdent, const 
OUString& rName) override
     {
-        GtkWidget* pItem = GTK_WIDGET(m_aMap[rIdent]);
+        GtkWidget* pItem = m_aMap[rIdent];
 #if !GTK_CHECK_VERSION(4, 0, 0)
         AtkObject* pAccessible = gtk_widget_get_accessible(pItem);
         assert(pAccessible);
@@ -12258,7 +12258,7 @@ public:
 
     virtual OUString get_item_tooltip_text(const OUString& rIdent) const 
override
     {
-        GtkWidget* pItem = GTK_WIDGET(m_aMap.find(rIdent)->second);
+        GtkWidget* pItem = m_aMap.find(rIdent)->second;
         const gchar* pStr = gtk_widget_get_tooltip_text(pItem);
         return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8);
     }
commit e8287452f5e47b226448dec071f3bad8838135b5
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 6 01:36:31 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Feb 6 10:15:38 2026 +0100

    tdf#130857 qt weld: Implement QtInstanceToolbar::get_item_visible
    
    Change-Id: Ica4489c2229a12d27029ea047da531d313516db6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198808
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceToolbar.cxx b/vcl/qt5/QtInstanceToolbar.cxx
index 08af7f6ca2b8..2eb40e6fb08d 100644
--- a/vcl/qt5/QtInstanceToolbar.cxx
+++ b/vcl/qt5/QtInstanceToolbar.cxx
@@ -116,10 +116,18 @@ void QtInstanceToolbar::set_item_help_id(const OUString&, 
const OUString&)
     assert(false && "Not implemented yet");
 }
 
-bool QtInstanceToolbar::get_item_visible(const OUString&) const
+bool QtInstanceToolbar::get_item_visible(const OUString& rIdent) const
 {
-    assert(false && "Not implemented yet");
-    return false;
+    SolarMutexGuard g;
+
+    bool bVisible = false;
+    GetQtInstance().RunInMainThread([&] {
+        QToolButton* pToolButton = 
m_pToolBar->findChild<QToolButton*>(toQString(rIdent));
+        assert(pToolButton && "No tool button with the given ID found");
+        bVisible = pToolButton->isVisible();
+    });
+
+    return bVisible;
 }
 
 void QtInstanceToolbar::set_item_label(const OUString&, const OUString&)
commit 4bcf3bd50b95bee9418e0d72a33c7dd6bdc92753
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Feb 6 01:21:06 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Fri Feb 6 10:15:31 2026 +0100

    tdf#130857 qt weld: Implement QtInstanceToolbar::get_item_ident
    
    Change-Id: I3882f7c06998ebc2104293fb2679bf12539ddc15
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198807
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceToolbar.cxx b/vcl/qt5/QtInstanceToolbar.cxx
index df6d054621e1..08af7f6ca2b8 100644
--- a/vcl/qt5/QtInstanceToolbar.cxx
+++ b/vcl/qt5/QtInstanceToolbar.cxx
@@ -218,10 +218,20 @@ int QtInstanceToolbar::get_n_items() const
     return nItemCount;
 }
 
-OUString QtInstanceToolbar::get_item_ident(int) const
+OUString QtInstanceToolbar::get_item_ident(int nIndex) const
 {
-    assert(false && "Not implemented yet");
-    return OUString();
+    SolarMutexGuard g;
+
+    OUString sIdent;
+    GetQtInstance().RunInMainThread([&] {
+        QAction* pAction = m_pToolBar->actions().at(nIndex);
+        assert(pAction);
+        QWidget* pWidget = m_pToolBar->widgetForAction(pAction);
+        assert(pWidget);
+        sIdent = toOUString(pWidget->objectName());
+    });
+
+    return sIdent;
 }
 
 void QtInstanceToolbar::set_item_ident(int, const OUString&)

Reply via email to