add get_modifier_state to toolbar for what modifiers are held

Change-Id: I77e7f6238d82249ffede1edee2dc88f1a76b3717
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90860
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 861b7d9..b7bf769 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2073,6 +2073,9 @@ public:
    virtual vcl::ImageType get_icon_size() const = 0;
    virtual void set_icon_size(vcl::ImageType eType) = 0;

    // return what modifiers are held
    virtual sal_uInt16 get_modifier_state() const = 0;

    void connect_clicked(const Link<const OString&, void>& rLink) { m_aClickHdl = rLink; }
    void connect_menu_toggled(const Link<const OString&, void>& rLink) { m_aToggleMenuHdl = rLink; }
};
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index c0f203d..4262185 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1007,6 +1007,11 @@ public:
        }
    }

    virtual sal_uInt16 get_modifier_state() const override
    {
        return m_xToolBox->GetModifier();
    }

    virtual ~SalInstanceToolbar() override
    {
        m_xToolBox->SetDropdownClickHdl(Link<ToolBox*, void>());
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index d8c0213..6f11a6a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -7794,6 +7794,13 @@ public:
        return gtk_toolbar_set_icon_size(m_pToolbar, VclToGtk(eType));
    }

    virtual sal_uInt16 get_modifier_state() const override
    {
        GdkKeymap* pKeymap = gdk_keymap_get_default();
        guint nState = gdk_keymap_get_modifier_state(pKeymap);
        return GtkSalFrame::GetKeyModCode(nState);
    }

    virtual ~GtkInstanceToolbar() override
    {
        for (auto& a : m_aMap)