summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2020-05-04 17:41:11 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2020-05-06 13:52:33 +0200
commitd936d5658aba2ab921fe144f5240f42304e1c5ff (patch)
tree0f360476fb21f6253dfe0e0ac9c8c36eb182bdc3 /vcl
parent64d7f805616fd781d87b49156860d96f081a5a45 (diff)
tdf#64690 - Extend selection on find/replace
In the Basic code window, extend the selection on the last paragraph during the search/replace process in order to consider newly inserted text portions. Change-Id: I27ad998709ac25cffbef4a354c87d422f97e1b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93432 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit e7f3731b8d3e930f85e7df0c0e55bbb1aaea191b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93377 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/edit/textview.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx
index 2eaa1b2f598c..9d4d46a0839d 100644
--- a/vcl/source/edit/textview.cxx
+++ b/vcl/source/edit/textview.cxx
@@ -2204,6 +2204,11 @@ sal_uInt16 TextView::Replace( const i18nutil::SearchOptions& rSearchOptions, boo
nFound++;
TextPaM aNewStart = pTextEngine->ImpInsertText( aSel, rSearchOptions.replaceString );
+ // tdf#64690 - extend selection to include inserted text portions
+ if ( aSel.GetEnd().GetPara() == aSearchSel.GetEnd().GetPara() )
+ {
+ aSearchSel.GetEnd().GetIndex() += rSearchOptions.replaceString.getLength() - 1;
+ }
aSel = aSearchSel;
aSel.GetStart() = aNewStart;
bFound = pTextEngine->Search( aSel, rSearchOptions );