diff options
author | Arnaud Versini <arnaud.versini@libreoffice.org> | 2013-10-07 21:09:26 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-11 13:06:11 +0000 |
commit | f431f2fbaad8098870b1f9bdb71b6db514d2cbda (patch) | |
tree | c1c7ccb19c42fdea36093befe415e6f89b71b133 | |
parent | 4c8e5c2a5cf67661ebf33be5c5c2700a4c389f7c (diff) |
fdo#70143: fix SwDoc::ReplaceRangeImpl()
Fix fdo#70143 by reporting swaping of positions
(regression from 6b08fe833186a04f9aef698a540d3a7493ac4519,
which changed SwUndoReplace::Impl::SetEnd to use the wrongly set end
position in rPam)
Change-Id: I14c6f58bc5c1418c69eb565d42f1829856eed58c
(cherry picked from commit 9685d20f2a0526a4c454cea1bd947eccbaeefa84)
Fixes regex replace of "$" with nothing (to delete line
breaks).
Change-Id: If7ec1e5f524f7bb308a2949ace16cb8aa6989106
(cherry picked from commit f011a5c5071ed4a60f0ee7117608b72cecbb958d)
Reviewed-on: https://gerrit.libreoffice.org/6176
Reviewed-by: Arnaud Versini <arnaud.versini@libreoffice.org>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 6d34685e883c..52b0b407fa2a 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -2469,17 +2469,23 @@ SetRedlineMode( eOld ); } } - *rPam.GetMark() = *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 ) { |