diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-10 10:40:22 +0000 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2019-12-11 10:28:40 +0100 |
commit | c6c75d7ba2633316e53366450343d56956c58391 (patch) | |
tree | e6b270952ebb5033a2b4b2aa2ebb178dfd5e9cbb /svx | |
parent | 6d87a3ab7947ab862c56f1c73c8ca1b08411adcf (diff) |
Resolves: tdf#129250 move redline type into RedlinData so we can sort on it
Change-Id: Ia8e6744c1679655240a9a9cee9425030e994e16b
Reviewed-on: https://gerrit.libreoffice.org/84806
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/ctredlin.cxx | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index a045af36efcc..f5defbb30ba8 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -35,10 +35,12 @@ #define WRITER_DATE 2 #define CALC_DATE 3 -RedlinData::RedlinData() : aDateTime(DateTime::EMPTY) +RedlinData::RedlinData() + : aDateTime(DateTime::EMPTY) + , pData(nullptr) + , eType(RedlineType::Any) + , bDisabled(false) { - bDisabled=false; - pData=nullptr; } RedlinData::~RedlinData() @@ -128,6 +130,21 @@ int SvxRedlinTable::ColCompare(const weld::TreeIter& rLeft, const weld::TreeIter int nSortCol = pTreeView->get_sort_column(); + if (pTreeView == xWriterTreeView.get() && nSortCol == 0) + { + RedlinData *pLeftData = reinterpret_cast<RedlinData*>(pTreeView->get_id(rLeft).toInt64()); + RedlinData *pRightData = reinterpret_cast<RedlinData*>(pTreeView->get_id(rRight).toInt64()); + + if (pLeftData && pRightData) + { + if (pLeftData->eType < pRightData->eType) + nCompare = -1; + else if (pLeftData->eType > pRightData->eType) + nCompare = 1; + return nCompare; + } + } + if (nSortCol == nDatePos) { RedlinData *pLeftData = reinterpret_cast<RedlinData*>(pTreeView->get_id(rLeft).toInt64()); |