sw/source/core/doc/extinput.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit aed6183b12f496e1dcb7429a88da9e521ba622a3
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu Aug 18 13:56:22 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Aug 19 10:00:49 2022 +0200

    tdf#150331: update index only when text is inserted
    
    other branches of the
    if( m_bIsOverwriteCursor && !m_sOverwriteText.isEmpty() )
    condition do the same
    
    Regression introduced by 218acb48df79101392c2cc3a030ddb5dcee878c7
    "tdf#146728 lok: IME: preset formatting in the new paragraph"
    
    CppunitTest_sw_tiledrendering passes with this patch in place.
    I plan to add a test in a follow-up commit
    
    Change-Id: I0f63b2c802b1280d16afeb18ad0f1735891e6a33
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138485
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 8fd2a751bcc8..15fe67f21760 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -115,9 +115,10 @@ SwExtTextInput::~SwExtTextInput()
         sal_Int32 nLenghtOfOldString = nEndCnt - nSttCnt;
 
         if( m_bInsText )
+        {
+            rIdx = nSttCnt;
             rDoc.getIDocumentContentOperations().InsertString( *this, sText, 
SwInsertFlags::EMPTYEXPAND );
-
-        rIdx = nEndCnt;
+        }
 
         pTNd->EraseText( rIdx, nLenghtOfOldString );
     }

Reply via email to