summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-06-18 11:23:41 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-06-23 15:05:56 +0200
commitd212119828a71e4dc72b6e09532e3628a4597d35 (patch)
tree70818f2e359d3e313ec7b957a1dba5d43081c3d7 /editeng
parentb25d7bbd98e5d60a4dee2f3a866958ca72c5126a (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/+/117556 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.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 4796732b2c74..246bdc370be6 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1736,13 +1736,6 @@ void SAL_CALL SvxUnoTextBase::insertString( const uno::Reference< text::XTextRan
if( !xRange.is() )
return;
- ESelection aSelection;
- if (GetEditSource())
- {
- ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
- SetSelection( aSelection );
- }
-
SvxUnoTextRangeBase* pRange = comphelper::getUnoTunnelImplementation<SvxUnoTextRange>( xRange );
if(pRange)
{
@@ -1757,6 +1750,13 @@ void SAL_CALL SvxUnoTextBase::insertString( const uno::Reference< text::XTextRan
pRange->setString( aString );
pRange->CollapseToEnd();
+
+ ESelection aSelection;
+ if (GetEditSource())
+ {
+ ::GetSelection( aSelection, GetEditSource()->GetTextForwarder() );
+ SetSelection( aSelection );
+ }
}
}