diff --git a/0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch b/0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch new file mode 100644 index 0000000..42aa816 --- /dev/null +++ b/0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch @@ -0,0 +1,87 @@ +From 36e158ce7a0effb130936ba4598a193102faa6a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Mon, 19 Jan 2015 12:09:17 +0000 +Subject: [PATCH 1/2] if we change the keys we have to resort based on the new + keys + +Change-Id: Ied95c2d1490554d9ba5402c936a9720c8a325771 +--- + sw/source/core/doc/docredln.cxx | 26 ++++++++++++++++++++++---- + 1 file changed, 22 insertions(+), 4 deletions(-) + +diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx +index 960a15d..b2f1eea 100644 +--- a/sw/source/core/doc/docredln.cxx ++++ b/sw/source/core/doc/docredln.cxx +@@ -1336,6 +1336,8 @@ void SwRangeRedline::MoveFromSection() + SwDoc* pDoc = GetDoc(); + const SwRedlineTbl& rTbl = pDoc->getIDocumentRedlineAccess().GetRedlineTbl(); + std::vector aBeforeArr, aBehindArr; ++ typedef std::map IndexAndRange; ++ IndexAndRange aIndexAndRangeMap; + sal_uInt16 nMyPos = rTbl.GetPos( this ); + OSL_ENSURE( this, "this is not in the array?" ); + bool bBreak = false; +@@ -1346,12 +1348,16 @@ void SwRangeRedline::MoveFromSection() + bBreak = true; + if( rTbl[ n ]->GetBound(true) == *GetPoint() ) + { +- aBehindArr.push_back( &rTbl[ n ]->GetBound(true) ); ++ SwRangeRedline* pRedl = rTbl[n]; ++ aBehindArr.push_back(&pRedl->GetBound(true)); ++ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); + bBreak = false; + } + if( rTbl[ n ]->GetBound(false) == *GetPoint() ) + { +- aBehindArr.push_back( &rTbl[ n ]->GetBound(false) ); ++ SwRangeRedline* pRedl = rTbl[n]; ++ aBehindArr.push_back(&pRedl->GetBound(false)); ++ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); + bBreak = false; + } + } +@@ -1361,12 +1367,16 @@ void SwRangeRedline::MoveFromSection() + bBreak = true; + if( rTbl[ n ]->GetBound(true) == *GetPoint() ) + { +- aBeforeArr.push_back( &rTbl[ n ]->GetBound(true) ); ++ SwRangeRedline* pRedl = rTbl[n]; ++ aBeforeArr.push_back(&pRedl->GetBound(true)); ++ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); + bBreak = false; + } + if( rTbl[ n ]->GetBound(false) == *GetPoint() ) + { +- aBeforeArr.push_back( &rTbl[ n ]->GetBound(false) ); ++ SwRangeRedline* pRedl = rTbl[n]; ++ aBeforeArr.push_back(&pRedl->GetBound(false)); ++ aIndexAndRangeMap.insert(std::make_pair(n, pRedl)); + bBreak = false; + } + } +@@ -1420,6 +1430,7 @@ void SwRangeRedline::MoveFromSection() + if( pColl && pCNd ) + pCNd->ChgFmtColl( pColl ); + } ++ + // #i95771# + // Under certain conditions the previous has already + // removed the change tracking section of this instance from +@@ -1440,6 +1451,13 @@ void SwRangeRedline::MoveFromSection() + *aBeforeArr[ n ] = *Start(); + for( n = 0; n < aBehindArr.size(); ++n ) + *aBehindArr[ n ] = *End(); ++ SwRedlineTbl& rResortTbl = const_cast(rTbl); ++ for (auto& a : aIndexAndRangeMap) ++ { ++ // re-insert ++ rResortTbl.Remove(a.first); ++ rResortTbl.Insert(a.second); ++ } + } + else + InvalidateRange(); +-- +1.9.3 + diff --git a/libreoffice.spec b/libreoffice.spec index b721980..7eb02b7 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -327,6 +327,7 @@ Patch19: 0001-allow-comparing-documents-which-only-differ-by-frame.patch Patch20: 0001-classic-draw-rectangles-fit-to-contour-utterly-broke.patch Patch21: 0001-Use-the-same-advanced-Ellipse-and-Rectangle-shapes-i.patch Patch22: 0001-rhbz-1180114-writerfilter-don-t-crash-on-w-customXml.patch +Patch23: 0001-if-we-change-the-keys-we-have-to-resort-based-on-the.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice