summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@libreoffice.org>2013-10-07 21:09:26 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-10-14 11:00:31 +0000
commitbb90748abbe4196bf0bca324b979fcc44bd643a2 (patch)
treec66b34e37aeaf545bca5b9720d05618e0f88d2c9
parent991a4daa1e59c46847b289b6bd9f273145fd5646 (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> (cherry picked from commit f431f2fbaad8098870b1f9bdb71b6db514d2cbda) Reviewed-on: https://gerrit.libreoffice.org/6214
-rw-r--r--sw/source/core/doc/docedt.cxx12
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 )
{