sw/source/core/text/txtfrm.cxx |   52 ++++++++++++++++++++---------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

New commits:
commit e52cf954a1dcd0f26096fcdb89f068e76c3fa9f2
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Nov 26 00:27:23 2022 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Nov 26 06:35:00 2022 +0100

    Use reference instead of pointer
    
    Change-Id: I2d15ee96373d21b6501fa956601378d7f698a099
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143311
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index f0400c3cb91d..29e98cfca5b9 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1800,48 +1800,48 @@ static void lcl_SetWrong( SwTextFrame& rFrame, 
SwTextNode const& rNode,
 {
     if ( !rFrame.IsFollow() )
     {
-        SwTextNode* pTextNode = const_cast<SwTextNode*>(&rNode);
-        sw::GrammarContact* pGrammarContact = 
sw::getGrammarContactFor(*pTextNode);
+        SwTextNode& rTextNode = const_cast<SwTextNode&>(rNode);
+        sw::GrammarContact* pGrammarContact = 
sw::getGrammarContactFor(rTextNode);
         SwGrammarMarkUp* pWrongGrammar = pGrammarContact ?
-            pGrammarContact->getGrammarCheck( *pTextNode, false ) :
-            pTextNode->GetGrammarCheck();
-        bool bGrammarProxy = pWrongGrammar != pTextNode->GetGrammarCheck();
+            pGrammarContact->getGrammarCheck( rTextNode, false ) :
+            rTextNode.GetGrammarCheck();
+        bool bGrammarProxy = pWrongGrammar != rTextNode.GetGrammarCheck();
         if( bMove )
         {
-            if( pTextNode->GetWrong() )
-                pTextNode->GetWrong()->Move( nPos, nCnt );
+            if( rTextNode.GetWrong() )
+                rTextNode.GetWrong()->Move( nPos, nCnt );
             if( pWrongGrammar )
                 pWrongGrammar->MoveGrammar( nPos, nCnt );
-            if( bGrammarProxy && pTextNode->GetGrammarCheck() )
-                pTextNode->GetGrammarCheck()->MoveGrammar( nPos, nCnt );
-            if( pTextNode->GetSmartTags() )
-                pTextNode->GetSmartTags()->Move( nPos, nCnt );
+            if( bGrammarProxy && rTextNode.GetGrammarCheck() )
+                rTextNode.GetGrammarCheck()->MoveGrammar( nPos, nCnt );
+            if( rTextNode.GetSmartTags() )
+                rTextNode.GetSmartTags()->Move( nPos, nCnt );
         }
         else
         {
-            if( pTextNode->GetWrong() )
-                pTextNode->GetWrong()->Invalidate( nPos, nCnt );
+            if( rTextNode.GetWrong() )
+                rTextNode.GetWrong()->Invalidate( nPos, nCnt );
             if( pWrongGrammar )
                 pWrongGrammar->Invalidate( nPos, nCnt );
-            if( pTextNode->GetSmartTags() )
-                pTextNode->GetSmartTags()->Invalidate( nPos, nCnt );
+            if( rTextNode.GetSmartTags() )
+                rTextNode.GetSmartTags()->Invalidate( nPos, nCnt );
         }
         const sal_Int32 nEnd = nPos + (nCnt > 0 ? nCnt : 1 );
-        if ( !pTextNode->GetWrong() && !pTextNode->IsWrongDirty() )
+        if ( !rTextNode.GetWrong() && !rTextNode.IsWrongDirty() )
         {
-            pTextNode->SetWrong( std::make_unique<SwWrongList>( 
WRONGLIST_SPELL ) );
-            pTextNode->GetWrong()->SetInvalid( nPos, nEnd );
+            rTextNode.SetWrong( std::make_unique<SwWrongList>( WRONGLIST_SPELL 
) );
+            rTextNode.GetWrong()->SetInvalid( nPos, nEnd );
         }
-        if ( !pTextNode->GetSmartTags() && !pTextNode->IsSmartTagDirty() )
+        if ( !rTextNode.GetSmartTags() && !rTextNode.IsSmartTagDirty() )
         {
-            pTextNode->SetSmartTags( std::make_unique<SwWrongList>( 
WRONGLIST_SMARTTAG ) );
-            pTextNode->GetSmartTags()->SetInvalid( nPos, nEnd );
+            rTextNode.SetSmartTags( std::make_unique<SwWrongList>( 
WRONGLIST_SMARTTAG ) );
+            rTextNode.GetSmartTags()->SetInvalid( nPos, nEnd );
         }
-        pTextNode->SetWrongDirty(sw::WrongState::TODO);
-        pTextNode->SetGrammarCheckDirty( true );
-        pTextNode->SetWordCountDirty( true );
-        pTextNode->SetAutoCompleteWordDirty( true );
-        pTextNode->SetSmartTagDirty( true );
+        rTextNode.SetWrongDirty(sw::WrongState::TODO);
+        rTextNode.SetGrammarCheckDirty( true );
+        rTextNode.SetWordCountDirty( true );
+        rTextNode.SetAutoCompleteWordDirty( true );
+        rTextNode.SetSmartTagDirty( true );
     }
 
     SwRootFrame *pRootFrame = rFrame.getRootFrame();

Reply via email to