summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2024-07-11 17:06:50 -0800
committerJim Raykowski <raykowj@gmail.com>2024-07-14 05:31:46 +0200
commit2c46d3c2ff6bbdcd387771f823aa5b3b812c80a8 (patch)
tree7ae52466f9d2c40231ac5d21f07a60bf9ad61fa8 /svx/source
parent3f7d0f79f1c43222bd160cffd9e443bb5fc91c99 (diff)
tdf#161811 Changes in TC manager dialog should be in order of
appearance in document Adds a drop down control to the Writer Manage Changes dialog/sidebar panel that can be used to select how the changes list is sorted. Change-Id: I9602322ec61ae6e15a08fbc26aa69de1b64294e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170390 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/ctredlin.cxx22
1 files changed, 20 insertions, 2 deletions
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 49091e01578a..1657bdd53c04 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -47,12 +47,14 @@ RedlinData::~RedlinData()
}
SvxRedlinTable::SvxRedlinTable(std::unique_ptr<weld::TreeView> xWriterControl,
- std::unique_ptr<weld::TreeView> xCalcControl)
+ std::unique_ptr<weld::TreeView> xCalcControl,
+ weld::ComboBox* pSortByControl)
: xSorter(new comphelper::string::NaturalStringSorter(::comphelper::getProcessComponentContext(),
Application::GetSettings().GetUILanguageTag().getLocale()))
, xWriterTreeView(std::move(xWriterControl))
, xCalcTreeView(std::move(xCalcControl))
, pTreeView(nullptr)
+ , m_pSortByComboBox(pSortByControl)
, nDatePos(WRITER_DATE)
, bAuthor(false)
, bDate(false)
@@ -121,6 +123,8 @@ IMPL_LINK(SvxRedlinTable, HeaderBarClick, int, nColumn, void)
{
//sort lists
pTreeView->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn);
+ if (m_pSortByComboBox)
+ m_pSortByComboBox->set_active(nColumn);
}
}
@@ -311,9 +315,13 @@ SvxTPView::SvxTPView(weld::Container* pParent)
, m_xAcceptAll(m_xBuilder->weld_button(u"acceptall"_ustr))
, m_xRejectAll(m_xBuilder->weld_button(u"rejectall"_ustr))
, m_xUndo(m_xBuilder->weld_button(u"undo"_ustr))
+ , m_xSortByComboBox(m_xBuilder->weld_combo_box(u"sortbycombobox"_ustr))
, m_xViewData(new SvxRedlinTable(m_xBuilder->weld_tree_view(u"writerchanges"_ustr),
- m_xBuilder->weld_tree_view(u"calcchanges"_ustr)))
+ m_xBuilder->weld_tree_view(u"calcchanges"_ustr),
+ m_xSortByComboBox.get()))
{
+ m_xSortByComboBox->connect_changed(LINK(this, SvxTPView, SortByComboBoxChangedHdl));
+
Link<weld::Button&,void> aLink=LINK( this, SvxTPView, PbClickHdl);
m_xAccept->connect_clicked(aLink);
@@ -351,6 +359,8 @@ void SvxRedlinTable::SetWriterView()
if (xCalcTreeView)
xCalcTreeView->hide();
xWriterTreeView->show();
+ if (m_pSortByComboBox)
+ m_pSortByComboBox->weld_parent()->show();
pTreeView = xWriterTreeView.get();
auto nDigitWidth = pTreeView->get_approximate_digit_width();
@@ -368,6 +378,8 @@ void SvxRedlinTable::SetCalcView()
nDatePos = CALC_DATE;
if (xWriterTreeView)
xWriterTreeView->hide();
+ if (m_pSortByComboBox)
+ m_pSortByComboBox->weld_parent()->hide();
xCalcTreeView->show();
pTreeView = xCalcTreeView.get();
@@ -431,6 +443,12 @@ void SvxTPView::EnableUndo(bool bFlag)
m_xUndo->set_sensitive(bFlag);
}
+IMPL_LINK_NOARG(SvxTPView, SortByComboBoxChangedHdl, weld::ComboBox&, void)
+{
+ if (SortByComboBoxChangedLk.IsSet())
+ SortByComboBoxChangedLk.Call(this);
+}
+
IMPL_LINK( SvxTPView, PbClickHdl, weld::Button&, rPushB, void)
{
if (&rPushB == m_xAccept.get())