summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-19 12:09:17 +0000
committerDavid Tardon <dtardon@redhat.com>2015-01-19 16:33:24 +0000
commit201e1813cef4059944c2d3e31b3e7dd5e88dbf6a (patch)
tree0fea9cb9a672aebdfd4191c3538a3dc3c05e86fb /sw
parent7d6ddf18e6266825eb2aef47b41a461a5ac0baa6 (diff)
if we change the keys we have to resort based on the new keys
Change-Id: Ied95c2d1490554d9ba5402c936a9720c8a325771 (cherry picked from commit 36e158ce7a0effb130936ba4598a193102faa6a1) Reviewed-on: https://gerrit.libreoffice.org/14009 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docredln.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 62b1f7d6ad2b..e42cbe3e9b38 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<SwPosition*> aBeforeArr, aBehindArr;
+ typedef std::map<sal_uInt16, SwRangeRedline*> 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 <SwDoc::Move(..)> has already
// removed the change tracking section of this <SwRangeRedline> 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<SwRedlineTbl&>(rTbl);
+ for (auto& a : aIndexAndRangeMap)
+ {
+ // re-insert
+ rResortTbl.Remove(a.first);
+ rResortTbl.Insert(a.second);
+ }
}
else
InvalidateRange();