diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-10 10:40:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-10 12:47:48 +0100 |
commit | e6271a8a4eafcbb357bbd3cf21126f64b45125e9 (patch) | |
tree | d52df138180f821b613637f5da8d9d64b41a979c /svx/source | |
parent | 88ca6e9904e87ae3473a5d8936adb4a2ced8572f (diff) |
Resolves: tdf#129250 move redline type into RedlinData so we can sort on it
Change-Id: Ia8e6744c1679655240a9a9cee9425030e994e16b
Reviewed-on: https://gerrit.libreoffice.org/84805
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-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()); |