diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-10-09 14:22:00 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-10-09 19:46:00 +0200 |
commit | f011a5c5071ed4a60f0ee7117608b72cecbb958d (patch) | |
tree | f7b6ce9817a939b5049977d163891dcd222188a1 | |
parent | 2386a92c1e6e8ec263edb4dc4fdcfeaa4673ce1f (diff) |
fdo#70143: fix SwDoc::ReplaceRangeImpl() a bit more
Fixes regex replace of "$" with nothing (to delete line
breaks).
Change-Id: If7ec1e5f524f7bb308a2949ace16cb8aa6989106
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index c269b1d8667d..4df3707c29e6 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -2440,18 +2440,23 @@ SetRedlineMode( eOld ); } } - if (aDelPam.GetMark() != pStt) - *rPam.GetPoint() = *aDelPam.GetMark(); - + *rPam.GetPoint() = *aDelPam.GetMark(); ++aPtNd; rPam.GetMark()->nNode = aPtNd; rPam.GetMark()->nContent.Assign( aPtNd.GetNode().GetCntntNode(), nPtCnt ); - if (bJoinTxt && !bJoinPrev) + if (bJoinTxt) { + assert(rPam.GetPoint() == rPam.End()); + // move so that SetEnd remembers position after sw_JoinText rPam.Move(fnMoveBackward); } + else if (aDelPam.GetPoint() == pStt) // backward selection? + { + assert(*rPam.GetMark() <= *rPam.GetPoint()); + rPam.Exchange(); // swap so that rPam is backwards + } if( pUndoRpl ) { |