diff options
author | Michael Stahl <mst@openoffice.org> | 2011-03-11 11:47:32 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2011-03-11 11:47:32 +0100 |
commit | 8e8d4ca2bdb5b28e7371efebab6fde4285b6ae09 (patch) | |
tree | 90fb22a1975c3849251b7d631db29c5c5ea924b1 /sw | |
parent | dc8fc17fedf7e66795870bbb2ba46395071d1461 (diff) |
sw34bf04: #o11831122#: prevent redline corruption:
SwDoc::DelFullPara: call other CorrAbs variant in case of single paragraph.
SwDoc::CorrAbs: delete empty redlines, which cause assertions.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/doccorr.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 11 |
2 files changed, 23 insertions, 4 deletions
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index 3477619fba33..1390a049fd4a 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -212,10 +212,22 @@ void SwDoc::CorrAbs(const SwNodeIndex& rOldNode, getIDocumentMarkAccess()->correctMarksAbsolute(rOldNode, rNewPos, nOffset); { // fix redlines SwRedlineTbl& rTbl = *pRedlineTbl; - for( sal_uInt16 n = 0; n < rTbl.Count(); ++n ) + for (sal_uInt16 n = 0; n < rTbl.Count(); ) { // is on position ?? - lcl_PaMCorrAbs(*rTbl[ n ], *aPam.Start(), *aPam.End(), aNewPos); + SwRedline *const pRedline( rTbl[ n ] ); + bool const bChanged = + lcl_PaMCorrAbs(*pRedline, *aPam.Start(), *aPam.End(), aNewPos); + // clean up empty redlines: docredln.cxx asserts these as invalid + if (bChanged && (*pRedline->GetPoint() == *pRedline->GetMark()) + && (pRedline->GetContentIdx() == NULL)) + { + rTbl.DeleteAndDestroy(n); + } + else + { + ++n; + } } } diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 488a6a7a44c7..489bbce0d7da 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -2646,8 +2646,15 @@ bool SwDoc::DelFullPara( SwPaM& rPam ) return sal_False; } } - // text::Bookmarks usw. verschieben - CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True ); + // move bookmarks, redlines etc. + if (aRg.aStart == aRg.aEnd) // only first CorrAbs variant handles this + { + CorrAbs( aRg.aStart, *rPam.GetPoint(), 0, sal_True ); + } + else + { + CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True ); + } // was ist mit Fly's ?? { |