cui/source/inc/optpath.hxx | 1 + cui/source/options/optpath.cxx | 10 ++++++++++ cui/uiconfig/ui/optpathspage.ui | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-)
New commits: commit 3925f38cbd384dca41154f15435bcec97d22f884 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Dec 13 20:08:09 2020 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Mon Dec 14 09:39:04 2020 +0100 tdf#138874 restore sort on first column of paths treeview Change-Id: I7cd831de30523a61631be5cc2f1f3b8a001d9e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107626 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/cui/source/inc/optpath.hxx b/cui/source/inc/optpath.hxx index 4447c98425b9..ac8747088e90 100644 --- a/cui/source/inc/optpath.hxx +++ b/cui/source/inc/optpath.hxx @@ -48,6 +48,7 @@ private: DECL_LINK(StandardHdl_Impl, weld::Button&, void); DECL_LINK(PathSelect_Impl, weld::TreeView&, void); + DECL_LINK(HeaderBarClick, int, void); DECL_LINK(DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, void); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 45b2c14d5c0d..eef4935480e4 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -195,12 +195,20 @@ SvxPathTabPage::SvxPathTabPage(weld::Container* pPage, weld::DialogController* p m_xPathBox->get_height_rows(20)); m_xPathBox->connect_row_activated( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) ); + m_xPathBox->connect_column_clicked(LINK(this, SvxPathTabPage, HeaderBarClick)); m_xPathBox->connect_changed( LINK( this, SvxPathTabPage, PathSelect_Impl ) ); m_xPathBox->set_selection_mode(SelectionMode::Multiple); xDialogListener->SetDialogClosedLink( LINK( this, SvxPathTabPage, DialogClosedHdl ) ); } +IMPL_LINK(SvxPathTabPage, HeaderBarClick, int, nColumn, void) +{ + bool bSortAtoZ = !m_xPathBox->get_sort_order(); + m_xPathBox->set_sort_order(bSortAtoZ); + m_xPathBox->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn); +} + SvxPathTabPage::~SvxPathTabPage() { for (int i = 0, nEntryCount = m_xPathBox->n_children(); i < nEntryCount; ++i) @@ -228,6 +236,7 @@ bool SvxPathTabPage::FillItemSet( SfxItemSet* ) void SvxPathTabPage::Reset( const SfxItemSet* ) { m_xPathBox->clear(); + m_xPathBox->make_unsorted(); std::unique_ptr<weld::TreeIter> xIter = m_xPathBox->make_iterator(); for( sal_uInt16 i = 0; i <= sal_uInt16(SvtPathOptions::PATH_CLASSIFICATION); ++i ) @@ -319,6 +328,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* ) } m_xPathBox->columns_autosize(); + m_xPathBox->make_sorted(); PathSelect_Impl(*m_xPathBox); } diff --git a/cui/uiconfig/ui/optpathspage.ui b/cui/uiconfig/ui/optpathspage.ui index 7b436abaed43..b469c0bd98fc 100644 --- a/cui/uiconfig/ui/optpathspage.ui +++ b/cui/uiconfig/ui/optpathspage.ui @@ -80,6 +80,8 @@ <property name="resizable">True</property> <property name="spacing">6</property> <property name="title" translatable="yes" context="optpathspage|type">Type</property> + <property name="clickable">True</property> + <property name="sort-indicator">True</property> <child> <object class="GtkCellRendererPixbuf" id="cellrenderertext1"/> <attributes> @@ -100,7 +102,6 @@ <property name="resizable">True</property> <property name="spacing">6</property> <property name="title" translatable="yes" context="optpathspage|user_paths">User Paths</property> - <property name="clickable">True</property> <child> <object class="GtkCellRendererText" id="cellrenderer9"/> <attributes> @@ -115,7 +116,6 @@ <property name="resizable">True</property> <property name="spacing">6</property> <property name="title" translatable="yes" context="optpathspage|internal_paths">Internal Paths</property> - <property name="clickable">True</property> <child> <object class="GtkCellRendererText" id="cellrenderer1"/> <attributes> _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
