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

New commits:
commit 221d76260096b9e6b4c4479b1b89c95af8b05774
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Oct 9 13:46:45 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Oct 9 21:04:40 2022 +0200

    simplify assignment
    
    pSttPos and pSpellArgs->pStartPos point at the same thing
    (and similarly for pEndPos), so no need to assign to them twice.
    
    Change-Id: I45a99187d07b24afa0667154e121e32557a389d3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141142
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index d2bb92dd4058..55c43a041f93 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -652,11 +652,8 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
                                     aRet <<= aResult;
                                     //put the cursor to the current error
                                     const linguistic2::SingleProofreadingError 
&rError = aResult.aErrors[0];
-                                    nCurrNd = pNd->GetIndex();
-                                    pSttPos->Assign(nCurrNd);
-                                    pEndPos->Assign(nCurrNd);
-                                    
pSpellArgs->pStartPos->Assign(*pNd->GetTextNode(), 
aConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos );
-                                    
pSpellArgs->pEndPos->Assign(*pNd->GetTextNode(), 
aConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength 
).mnPos );
+                                    pSttPos->Assign(*pNd->GetTextNode(), 
aConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos );
+                                    pEndPos->Assign(*pNd->GetTextNode(), 
aConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength 
).mnPos );
                                     nCurrNd = nEndNd;
                                 }
                             }

Reply via email to