summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-26 00:27:23 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-26 06:35:00 +0100
commite52cf954a1dcd0f26096fcdb89f068e76c3fa9f2 (patch)
tree7b734face8663901fec3c87788c508ae7df82d9c /sw/source/core
parente76b1faa3326e5cffed4472fcd410b5abf273067 (diff)
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.kaganski@collabora.com>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/text/txtfrm.cxx52
1 files changed, 26 insertions, 26 deletions
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();