diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-06-04 10:43:43 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-05 00:03:45 +0200 |
commit | 43c7f1944b47ca06234f1b37a24fe0f9ec659111 (patch) | |
tree | 2a59dde0e4829cd3b3518fee864b82efa281cf68 /vcl | |
parent | 214077401a736d49e9c9c6e8f1dd348725455fd7 (diff) |
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@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 6 |
2 files changed, 4 insertions, 8 deletions
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)) |