summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-12-10 10:40:22 +0000
committerXisco Faulí <xiscofauli@libreoffice.org>2019-12-11 10:29:12 +0100
commit2f6fb28ded84878c5a19453f5076309505e30f0a (patch)
treebe217276d48a52edecfde1eb562c3f8e679b1535 /svx
parent79fdc6e0a3a44642ac8d49225f14241872097fb7 (diff)
Resolves: tdf#129250 move redline type into RedlinData so we can sort on it
Change-Id: Ia8e6744c1679655240a9a9cee9425030e994e16b Reviewed-on: https://gerrit.libreoffice.org/84808 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/ctredlin.cxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index e4e8eeb654df..f2d119b0005c 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -37,10 +37,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()
@@ -155,6 +157,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());