include/vcl/weld.hxx          |   53 +++++++++++++++++++++++++++++++++++++
 vcl/source/app/salvtables.cxx |   47 --------------------------------
 vcl/unx/gtk3/gtkinst.cxx      |   60 ------------------------------------------
 3 files changed, 53 insertions(+), 107 deletions(-)

New commits:
commit 8debe2a6798b45f654bd8046dfcc084a22803100
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Apr 14 22:25:26 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Apr 15 08:08:28 2025 +0200

    tdf#130857 Move weld::EntryTreeView::set_entry_editable impls to base
    
    The VCL and GTK implementations are equivalent, so move the
    implementation to the base class.
    
    Change-Id: Id0848a92b3bcb0728c9a03d45d3c950d2d656cff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184183
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index a5e8d2faed2b..254fcc352f7d 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2148,6 +2148,8 @@ public:
         m_xEntry->set_placeholder_text(rText);
     }
 
+    virtual void set_entry_editable(bool bEditable) override { 
m_xEntry->set_editable(bEditable); }
+
     void connect_row_activated(const Link<TreeView&, bool>& rLink)
     {
         m_xTreeView->connect_row_activated(rLink);
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 3fb31c879e14..6d93fe2bea45 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6966,12 +6966,6 @@ public:
         return rEntry.GetPointFont(*rEntry.GetOutDev());
     }
 
-    virtual void set_entry_editable(bool bEditable) override
-    {
-        Edit& rEntry = m_pEntry->getEntry();
-        rEntry.SetReadOnly(!bEditable);
-    }
-
     virtual void cut_entry_clipboard() override
     {
         Edit& rEntry = m_pEntry->getEntry();
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 8f90d81682be..947ea6ae7ceb 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -23406,11 +23406,6 @@ public:
         m_bAutoCompleteCaseSensitive = bCaseSensitive;
     }
 
-    virtual void set_entry_editable(bool bEditable) override
-    {
-        m_xEntry->set_editable(bEditable);
-    }
-
     virtual void cut_entry_clipboard() override
     {
         m_xEntry->cut_clipboard();
commit 09b8cfcdcd0a9c72f2c00654df2c07670c88b05f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Apr 14 22:21:07 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Apr 15 08:08:21 2025 +0200

    tdf#130857 Move weld::EntryTreeView::set_entry_placeholder_text impls to 
base
    
    The VCL and GTK implementations are equivalent, so move the
    implementation to the base class.
    
    Change-Id: I12f768f025e373d6fc442b18335544da0559f825
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184182
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 1aee0aaf4fe7..a5e8d2faed2b 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2142,6 +2142,12 @@ public:
     {
         return m_xEntry->get_selection_bounds(rStartPos, rEndPos);
     }
+
+    virtual void set_entry_placeholder_text(const OUString& rText) override
+    {
+        m_xEntry->set_placeholder_text(rText);
+    }
+
     void connect_row_activated(const Link<TreeView&, bool>& rLink)
     {
         m_xTreeView->connect_row_activated(rLink);
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 372e4a4c1422..3fb31c879e14 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6966,12 +6966,6 @@ public:
         return rEntry.GetPointFont(*rEntry.GetOutDev());
     }
 
-    virtual void set_entry_placeholder_text(const OUString& rText) override
-    {
-        Edit& rEntry = m_pEntry->getEntry();
-        rEntry.SetPlaceholderText(rText);
-    }
-
     virtual void set_entry_editable(bool bEditable) override
     {
         Edit& rEntry = m_pEntry->getEntry();
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 9475ff58c303..8f90d81682be 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -23406,11 +23406,6 @@ public:
         m_bAutoCompleteCaseSensitive = bCaseSensitive;
     }
 
-    virtual void set_entry_placeholder_text(const OUString& rText) override
-    {
-        m_xEntry->set_placeholder_text(rText);
-    }
-
     virtual void set_entry_editable(bool bEditable) override
     {
         m_xEntry->set_editable(bEditable);
commit fbf81a6b7959fde6c47da3e818f3e285e1ac80d0
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Apr 14 22:03:20 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Apr 15 08:08:15 2025 +0200

    tdf#130857 Move weld::EntryTreeView dummy method impls to base class
    
    Instead of having the same dummy implementations for weld::EntryTreeView
    implementations for methods from the weld::ComboBox that only trigger
    asserts in all subclasses, move those to the weld::EntryTreeView base
    class.
    
    As I understand it, these are most likely not actually used, but only
    there because of weld::EntryTreeView being a weld::ComboBox subclass
    (but GtkInstanceEntryTreeView and SalInstanceEntryTreeView not
    subclassing GtkInstanceComboBox and SalInstanceComboBox, so they
    cannot use the existing implementations from those).
    
    Change-Id: Ibf88663fc83142300aa14b39a1e0805bd6f688cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184181
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index a7a5c4ad2d6d..1aee0aaf4fe7 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2150,6 +2150,51 @@ public:
     virtual bool get_popup_shown() const override { return false; }
 
     void set_height_request_by_rows(int nRows);
+
+    // Methods from weld::ComboBox subclass API that are not actually 
implemented/used
+    virtual void insert_separator(int /*pos*/, const OUString& /*rId*/) 
override final
+    {
+        assert(false && "not implemented");
+    }
+
+    virtual void set_font(const vcl::Font&) override final { assert(false && 
"not implemented"); }
+
+    virtual void set_custom_renderer(bool /*bOn*/) override final
+    {
+        assert(false && "not implemented");
+    }
+
+    virtual int get_max_mru_count() const override final
+    {
+        assert(false && "not implemented");
+        return 0;
+    }
+
+    virtual void set_max_mru_count(int) override final { assert(false && "not 
implemented"); }
+
+    virtual OUString get_mru_entries() const override final
+    {
+        assert(false && "not implemented");
+        return OUString();
+    }
+
+    virtual void set_mru_entries(const OUString&) override final
+    {
+        assert(false && "not implemented");
+    }
+
+    virtual void set_max_drop_down_rows(int) override final { assert(false && 
"not implemented"); }
+
+    virtual void set_item_menu(const OUString&, weld::Menu*) override final
+    {
+        assert(false && "not implemented");
+    }
+
+    int get_menu_button_width() const override final
+    {
+        assert(false && "not implemented");
+        return 0;
+    }
 };
 
 class VCL_DLLPUBLIC MetricSpinButton final
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index c018a367a73f..372e4a4c1422 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6944,8 +6944,6 @@ public:
         rEntry.AddEventListener(LINK(this, SalInstanceEntryTreeView, 
KeyPressListener));
     }
 
-    virtual void insert_separator(int /*pos*/, const OUString& /*rId*/) 
override { assert(false); }
-
     virtual void make_sorted() override
     {
         vcl::Window* pTreeView = m_pTreeView->getWidget();
@@ -6960,8 +6958,6 @@ public:
         rEntry.SetAutocompleteHdl(Link<Edit&, void>());
     }
 
-    virtual void set_font(const vcl::Font&) override { assert(false && "not 
implemented"); }
-
     virtual void set_entry_font(const vcl::Font& rFont) override { 
m_pEntry->set_font(rFont); }
 
     virtual vcl::Font get_entry_font() override
@@ -7014,37 +7010,6 @@ public:
 
     virtual bool changed_by_direct_pick() const override { return 
m_bTreeChange; }
 
-    virtual void set_custom_renderer(bool /*bOn*/) override { assert(false && 
"not implemented"); }
-
-    virtual int get_max_mru_count() const override
-    {
-        assert(false && "not implemented");
-        return 0;
-    }
-
-    virtual void set_max_mru_count(int) override { assert(false && "not 
implemented"); }
-
-    virtual OUString get_mru_entries() const override
-    {
-        assert(false && "not implemented");
-        return OUString();
-    }
-
-    virtual void set_mru_entries(const OUString&) override { assert(false && 
"not implemented"); }
-
-    virtual void set_max_drop_down_rows(int) override { assert(false && "not 
implemented"); }
-
-    virtual void set_item_menu(const OUString&, weld::Menu*) override
-    {
-        assert(false && "not implemented");
-    }
-
-    int get_menu_button_width() const override
-    {
-        assert(false && "not implemented");
-        return 0;
-    }
-
     VclPtr<VirtualDevice> create_render_virtual_device() const override
     {
         return VclPtr<VirtualDevice>::Create();
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index d5b0da792707..9475ff58c303 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -23392,11 +23392,6 @@ public:
         m_nEntryInsertTextSignalId = g_signal_connect(pWidget, "insert-text", 
G_CALLBACK(signalEntryInsertText), this);
     }
 
-    virtual void insert_separator(int /*pos*/, const OUString& /*rId*/) 
override
-    {
-        assert(false);
-    }
-
     virtual void make_sorted() override
     {
         GtkWidget* pTreeView = m_pTreeView->getWidget();
@@ -23436,11 +23431,6 @@ public:
         m_xEntry->paste_clipboard();
     }
 
-    virtual void set_font(const vcl::Font&) override
-    {
-        assert(false && "not implemented");
-    }
-
     virtual void set_entry_font(const vcl::Font& rFont) override
     {
         m_xEntry->set_font(rFont);
@@ -23490,51 +23480,11 @@ public:
         return m_bTreeChange;
     }
 
-    virtual void set_custom_renderer(bool /*bOn*/) override
-    {
-        assert(false && "not implemented");
-    }
-
-    virtual int get_max_mru_count() const override
-    {
-        assert(false && "not implemented");
-        return 0;
-    }
-
-    virtual void set_max_mru_count(int) override
-    {
-        assert(false && "not implemented");
-    }
-
-    virtual OUString get_mru_entries() const override
-    {
-        assert(false && "not implemented");
-        return OUString();
-    }
-
-    virtual void set_mru_entries(const OUString&) override
-    {
-        assert(false && "not implemented");
-    }
-
-    virtual void set_item_menu(const OUString&, weld::Menu*) override
-    {
-        assert(false && "not implemented");
-    }
-
     VclPtr<VirtualDevice> create_render_virtual_device() const override
     {
         return create_virtual_device();
     }
 
-    int get_menu_button_width() const override
-    {
-        assert(false && "not implemented");
-        return 0;
-    }
-
-    virtual void set_max_drop_down_rows(int) override { assert(false && "not 
implemented"); }
-
     virtual ~GtkInstanceEntryTreeView() override
     {
         if (m_nAutoCompleteIdleId)

Reply via email to