diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-30 15:34:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-30 17:07:22 +0000 |
commit | a5a20187c3a5e5956492f932c49501f9547e4915 (patch) | |
tree | 1eb69b1233af1e8d2e7e0f74b3ef7442632a3b46 /sw/inc | |
parent | 75fa61754122cf44a6bd6ac4a0efb44918b1305b (diff) |
During DocumentRedlineManager::SetRedlineMode the array becomes unsorted
so GetPos cannot be used safely, so pass down the known index
of the redline and propogate it everywhere the redline goes
This reverts
commit 36e158ce7a0effb130936ba4598a193102faa6a1
Author: Caolán McNamara <caolanm@redhat.com>
Date: Mon Jan 19 12:09:17 2015 +0000
if we change the keys we have to resort based on the new keys
which tried to keep the table sorted, but thats no use because
DocumentRedlineManager::SetRedlineMode loops over by index
so sorting the table during the process busts that.
Taking a copy of the entries and looping over that shows another
gadzillion problems.
So try this approach instead.
I imagine it should be possible to calculate the correct
current index of pRedl in DocumentRedlineManager::AppendRedline
but for now assume that we are sorted correctly at that
point and can use GetPos
Change-Id: If092dce185e3b36fd256db390132358cba155847
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/docary.hxx | 1 | ||||
-rw-r--r-- | sw/inc/redline.hxx | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx index fba92fb4bd8b..8b36d6a9b090 100644 --- a/sw/inc/docary.hxx +++ b/sw/inc/docary.hxx @@ -232,6 +232,7 @@ public: using _SwRedlineTbl::size_type; using _SwRedlineTbl::operator[]; using _SwRedlineTbl::empty; + using _SwRedlineTbl::Resort; }; /// Table that holds 'extra' redlines, such as 'table row insert\delete', 'paragraph moves' etc... diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 17bc9b7896dd..6ff33580bc41 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -189,8 +189,8 @@ class SW_DLLPUBLIC SwRangeRedline : public SwPaM void MoveToSection(); void CopyToSection(); - void DelCopyOfSection(); - void MoveFromSection(); + void DelCopyOfSection(size_t nMyPos); + void MoveFromSection(size_t nMyPos); public: SwRangeRedline( RedlineType_t eType, const SwPaM& rPam ); @@ -260,10 +260,10 @@ public: // hide the Del-Redlines via Copy and Delete. // Otherwise at Move the attribution would be handled incorrectly. // All other callers must always give 0. - void CallDisplayFunc( sal_uInt16 nLoop = 0 ); - void Show( sal_uInt16 nLoop = 0 ); - void Hide( sal_uInt16 nLoop = 0 ); - void ShowOriginal( sal_uInt16 nLoop = 0 ); + void CallDisplayFunc(sal_uInt16 nLoop, size_t nMyPos); + void Show(sal_uInt16 nLoop , size_t nMyPos); + void Hide(sal_uInt16 nLoop , size_t nMyPos); + void ShowOriginal(sal_uInt16 nLoop, size_t nMyPos); /// Calculates the intersection with text node number nNdIdx. void CalcStartEnd(sal_uLong nNdIdx, sal_Int32& rStart, sal_Int32& rEnd) const; |