Use IsTextNode instead of comparison of GetNodeType result

Looks more consistent to me.

Change-Id: Id61cb07ece99766b31713006ad3cc4d46c362791
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/12304
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 1c7834da4d12de8458d57eee25e2fe97b5c6ace5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211047
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Mike Kaganski
2026-09-16 20:20:59 +02:00
committed by Xisco Fauli
parent 1eca0c353a
commit ab5bdc9cdd
4 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -1279,8 +1279,7 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
bool bRet = false;
// Only compare textnodes
if( SwNodeType::Text == m_pNode->GetNodeType() &&
SwNodeType::Text == rLine.GetNode().GetNodeType() )
if (m_pNode->IsTextNode() && rLine.GetNode().IsTextNode())
{
SwTextNode& rDstNd = *const_cast<SwTextNode*>(m_pNode->GetTextNode());
const SwTextNode& rSrcNd = *rLine.GetNode().GetTextNode();
@@ -3144,7 +3144,7 @@ void SwEnhancedPDFExportHelper::ExportAuthorityEntryLinks()
&& pIteratedTOX->GetType() == TOX_AUTHORITIES)
{
if (const SwNode& rCurrentNode = mrSh.GetCursor()->GetPoint()->GetNode();
rCurrentNode.GetNodeType() == SwNodeType::Text)
rCurrentNode.IsTextNode())
{
if (mrSh.GetCursor()->GetPoint()->GetNode().FindSectionNode()->GetSection().GetType()
== SectionType::ToxContent) // this checks it's not a heading
+2 -2
View File
@@ -2707,7 +2707,7 @@ void WW8TabDesc::ParkPaM()
{
m_pIo->m_pPaM->GetPoint()->Assign(nSttNd);
}
while (m_pIo->m_pPaM->GetPointNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd);
while (!m_pIo->m_pPaM->GetPointNode().IsTextNode() && ++nSttNd < nEndNd);
m_pIo->m_pPaM->GetPoint()->SetContent(0);
m_pIo->m_rDoc.SetTextFormatColl(*m_pIo->m_pPaM, const_cast<SwTextFormatColl*>(m_pIo->m_pDfltTextFormatColl));
@@ -2946,7 +2946,7 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
{
m_pIo->m_pPaM->GetPoint()->Assign(nSttNd);
}
while (m_pIo->m_pPaM->GetPointNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd);
while (!m_pIo->m_pPaM->GetPointNode().IsTextNode() && ++nSttNd < nEndNd);
m_pIo->m_pPaM->GetPoint()->SetContent(0);
// Precautionally set now, otherwise the style is not set for cells
// that are inserted for margin balancing.
+1 -1
View File
@@ -490,7 +490,7 @@ void SwWrtShell::ClickToField(const SwField& rField, bool bExecHyperlinks)
vFieldText = pField->GetAuthority(GetLayout(), &pIteratedTOX->GetTOXForm());
if (const SwNode& rCurrentNode = GetCursor()->GetPoint()->GetNode();
rCurrentNode.GetNodeType() == SwNodeType::Text
rCurrentNode.IsTextNode()
&& (GetCursor()->GetPoint()->GetNode().FindSectionNode()->GetSection().GetType()
== SectionType::ToxContent) // this checks it's not a heading
&& static_cast<const SwTextNode*>(&rCurrentNode)->GetText() == vFieldText)