diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2020-05-04 17:41:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-04 20:48:44 +0200 |
commit | e7f3731b8d3e930f85e7df0c0e55bbb1aaea191b (patch) | |
tree | e735fd9ada947fe03e53dc975797180d5c7d92e9 /vcl | |
parent | 02323e893a2bd426ee8a07d25ac7d4a1e66d3be1 (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>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/textview.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index b5dc9703e5ae..3582e6742529 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -2207,6 +2207,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 ); |