diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2021-06-18 11:23:41 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-06-23 15:05:20 +0200 |
commit | ce275a824aab6601c9de0b61f4b8568b9478ce19 (patch) | |
tree | 0d3a3cc763b28fa71dfaf86f96dfc805e2647e5f /editeng | |
parent | 8bc61249b5db50bbf8895bdca142e402b5fab496 (diff) |
tdf#142716 Update selection after any text is inserted.
When we don't update the selection after insertion of new text
SvxUnoTextBase::createEnumeration knows old selection and losts last part
of the text.
Change-Id: I20f6530f34097ff213ff00cff617139887fd287a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117409
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
(cherry picked from commit e837f50313a703b6b26abb78f224472c1e4734ea)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117555
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/uno/unotext.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 6761f8b8b622..81699a1365d3 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -1732,13 +1732,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const uno::Reference< text::XTextRan if( !xRange.is() ) return; - if (GetEditSource()) - { - ESelection aSelection; - ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() ); - SetSelection( aSelection ); - } - SvxUnoTextRangeBase* pRange = comphelper::getUnoTunnelImplementation<SvxUnoTextRange>( xRange ); if(!pRange) return; @@ -1754,6 +1747,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const uno::Reference< text::XTextRan pRange->setString( aString ); pRange->CollapseToEnd(); + + if (GetEditSource()) + { + ESelection aSelection; + ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() ); + SetSelection( aSelection ); + } } void SAL_CALL SvxUnoTextBase::insertControlCharacter( const uno::Reference< text::XTextRange >& xRange, sal_Int16 nControlCharacter, sal_Bool bAbsorb ) |