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

New commits:
commit ecc1568567d9e879ae861eaeb6c12a9a6c06a8d3
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 11:33:00 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>
    (cherry picked from commit 2a00d621a13049af7a62783c29a458e68c6429e4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138430
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 305dddcd4caa..6ad02a0a4ee4 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