[Libreoffice-commits] core.git: include/vcl vcl/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 4 22:04:49 UTC 2020


 include/vcl/weld.hxx          |    4 ++--
 vcl/source/app/salvtables.cxx |    6 ++----
 vcl/unx/gtk3/gtk3gtkinst.cxx  |    6 ++----
 3 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 43c7f1944b47ca06234f1b37a24fe0f9ec659111
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Jun 4 10:43:43 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Jun 5 00:03:45 2020 +0200

    make [g|s]et_sort_indicator column argument required
    
    which all users already do, and drop unused auto-pick of default
    text column if not set
    
    Change-Id: Ibf8d8fb8295ebd10d89b2096b85dd08314aff3f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95503
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index d8d6b1a0492d..fedf414432c3 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1104,8 +1104,8 @@ public:
     virtual void set_sort_order(bool bAscending) = 0;
 
     // TRUE ascending, FALSE, descending, INDET, neither (off)
-    virtual void set_sort_indicator(TriState eState, int nColumn = -1) = 0;
-    virtual TriState get_sort_indicator(int nColumn = -1) const = 0;
+    virtual void set_sort_indicator(TriState eState, int nColumn) = 0;
+    virtual TriState get_sort_indicator(int nColumn) const = 0;
 
     virtual int get_sort_column() const = 0;
     virtual void set_sort_column(int nColumn) = 0;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2b0e1c9c28cb..e00adc86f6a5 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4465,8 +4465,7 @@ public:
 
     virtual void set_sort_indicator(TriState eState, int col) override
     {
-        if (col == -1)
-            col = 0;
+        assert(col >= 0 && "cannot sort on expander column");
 
         LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
         if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
@@ -4488,8 +4487,7 @@ public:
 
     virtual TriState get_sort_indicator(int col) const override
     {
-        if (col == -1)
-            col = 0;
+        assert(col >= 0 && "cannot sort on expander column");
 
         LclHeaderTabListBox* pHeaderBox = dynamic_cast<LclHeaderTabListBox*>(m_xTreeView.get());
         if (HeaderBar* pHeaderBar = pHeaderBox ? pHeaderBox->GetHeaderBar() : nullptr)
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index b821ebe7302d..fe4d84a7397d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -10145,8 +10145,7 @@ public:
 
     virtual void set_sort_indicator(TriState eState, int col) override
     {
-        if (col == -1)
-            col = get_view_col(m_nTextCol);
+        assert(col >= 0 && "cannot sort on expander column");
 
         GtkTreeViewColumn* pColumn = GTK_TREE_VIEW_COLUMN(g_list_nth_data(m_pColumns, col));
         assert(pColumn && "wrong count");
@@ -10162,8 +10161,7 @@ public:
 
     virtual TriState get_sort_indicator(int col) const override
     {
-        if (col == -1)
-            col = get_view_col(m_nTextCol);
+        assert(col >= 0 && "cannot sort on expander column");
 
         GtkTreeViewColumn* pColumn = GTK_TREE_VIEW_COLUMN(g_list_nth_data(m_pColumns, col));
         if (!gtk_tree_view_column_get_sort_indicator(pColumn))


More information about the Libreoffice-commits mailing list