summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-08-10 13:43:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-14 12:03:26 +0200
commitedc5240a96f003b9aec8f8d2ce92db39ad603fd7 (patch)
treeda0faa62c787e15d7368a5dbf48e723c96652e2c /sw/source/filter
parentab0d9af99b2dc69fa8e7463fb33ca28cbccf484d (diff)
rename SwPaM::GetContentNode to GetPointContentNode/GetMarkContentNode
Using a parameter to select point/mark makes the code much harder to read Change-Id: Ic24098a6045ff2262d4c808228ded7bf8206fe8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138085 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/basflt/shellio.cxx2
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/swhtml.cxx6
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx12
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx8
-rw-r--r--sw/source/filter/xml/swxml.cxx10
-rw-r--r--sw/source/filter/xml/xmlimp.cxx2
8 files changed, 22 insertions, 22 deletions
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 3d3e40a6807e..9c37a082cf58 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -183,7 +183,7 @@ ErrCode SwReader::Read( const Reader& rOptions )
const sal_Int32 nSttContent = pPam->GetPoint()->GetContentIndex();
// make sure the End position is correct for all Readers
- SwContentNode* pCNd = pPam->GetContentNode();
+ SwContentNode* pCNd = pPam->GetPointContentNode();
sal_Int32 nEndContent = pCNd ? pCNd->Len() - nSttContent : 0;
SwNodeIndex aEndPos( pPam->GetPoint()->GetNode(), 1 );
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index fbc89f00475d..5a7174325166 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1417,7 +1417,7 @@ void SwHTMLParser::StripTrailingPara()
{
bool bSetSmallFont = false;
- SwContentNode* pCNd = m_pPam->GetContentNode();
+ SwContentNode* pCNd = m_pPam->GetPointContentNode();
SwNodeOffset nNodeIdx = m_pPam->GetPoint()->GetNodeIndex();
if( !m_pPam->GetPoint()->GetContentIndex() )
{
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index dd3f4f78839b..a1eb92a17eae 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -813,7 +813,7 @@ void SwHTMLParser::Continue( HtmlTokenId nToken )
{
if (!m_pPam->GetPoint()->GetContentIndex() && CanRemoveNode(nNodeIdx))
{
- SwContentNode* pCNd = m_pPam->GetContentNode();
+ SwContentNode* pCNd = m_pPam->GetPointContentNode();
if( pCNd && pCNd->StartOfSectionIndex()+2 <
pCNd->EndOfSectionIndex() && !bHasFlysOrMarks )
{
@@ -3032,7 +3032,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable,
{
pFrameFormat->DelFrames();
*aAttrPam.GetPoint() = *pFlyPos;
- aAttrPam.GetPoint()->nContent.Assign( aAttrPam.GetContentNode(),
+ aAttrPam.GetPoint()->nContent.Assign( aAttrPam.GetPointContentNode(),
m_aMoveFlyCnts[n] );
SwFormatAnchor aAnchor( rAnchor );
aAnchor.SetType( RndStdIds::FLY_AT_CHAR );
@@ -4612,7 +4612,7 @@ bool SwHTMLParser::HasCurrentParaFlys( bool bNoSurroundOnly,
const SwFormatColl *SwHTMLParser::GetCurrFormatColl() const
{
- const SwContentNode* pCNd = m_pPam->GetContentNode();
+ const SwContentNode* pCNd = m_pPam->GetPointContentNode();
return pCNd ? &pCNd->GetAnyFormatColl() : nullptr;
}
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index f0187d3a6230..ff5af1a68785 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -990,7 +990,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
const SwSectionFormat *pFormat = nullptr;
rExport.m_pCurrentPageDesc = &rExport.m_rDoc.GetPageDesc( 0 );
- const SwNode* pNd = rExport.m_pCurPam->GetContentNode();
+ const SwNode* pNd = rExport.m_pCurPam->GetPointContentNode();
const SfxItemSet* pSet = pNd ? &static_cast<const SwContentNode*>(pNd)->GetSwAttrSet() : nullptr;
sal_uLong nRstLnNum = pSet ? pSet->Get( RES_LINENUMBER ).GetStartValue() : 0;
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 065be5d855c4..74605572486a 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2503,9 +2503,9 @@ bool SwWW8ImplReader::SetSpacing(SwPaM &rMyPam, int nSpace, bool bIsUpper )
aUL.SetLower( static_cast< sal_uInt16 >(nSpace) );
const sal_Int32 nEnd = pSpacingPos->GetContentIndex();
- rMyPam.GetPoint()->nContent.Assign(rMyPam.GetContentNode(), 0);
+ rMyPam.GetPoint()->nContent.Assign(rMyPam.GetPointContentNode(), 0);
m_xCtrlStck->NewAttr(*pSpacingPos, aUL);
- rMyPam.GetPoint()->nContent.Assign(rMyPam.GetContentNode(), nEnd);
+ rMyPam.GetPoint()->nContent.Assign(rMyPam.GetPointContentNode(), nEnd);
m_xCtrlStck->SetAttr(*pSpacingPos, RES_UL_SPACE);
bRet = true;
}
@@ -3317,7 +3317,7 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString
sal_Int32 nLen = rAddString.getLength();
OUString sParagraphText;
- const SwContentNode *pCntNd = m_pPaM->GetContentNode();
+ const SwContentNode *pCntNd = m_pPaM->GetPointContentNode();
const SwTextNode* pNd = pCntNd ? pCntNd->GetTextNode() : nullptr;
if (pNd)
sParagraphText = pNd->GetText();
@@ -3462,7 +3462,7 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString)
if (addString.isEmpty())
return;
- const SwContentNode *pCntNd = m_pPaM->GetContentNode();
+ const SwContentNode *pCntNd = m_pPaM->GetPointContentNode();
const SwTextNode* pNd = pCntNd ? pCntNd->GetTextNode() : nullptr;
OSL_ENSURE(pNd, "What the hell, where's my text node");
@@ -3628,7 +3628,7 @@ bool SwWW8ImplReader::ReadChar(tools::Long nPosCp, tools::Long nCpOfs)
else if (!m_nInTable)
{
// Always insert a txtnode for a column break, e.g. ##
- SwContentNode *pCntNd=m_pPaM->GetContentNode();
+ SwContentNode *pCntNd=m_pPaM->GetPointContentNode();
if (pCntNd!=nullptr && pCntNd->Len()>0) // if par is empty not break is needed
AppendTextNode(*m_pPaM->GetPoint());
m_rDoc.getIDocumentContentOperations().InsertPoolItem(*m_pPaM, SvxFormatBreakItem(SvxBreak::ColumnBefore, RES_BREAK));
@@ -4620,7 +4620,7 @@ void wwSectionManager::InsertSegments()
aSectPaM.GetPoint()->Assign(*pTextNd);
aSectPaM.GetPoint()->nContent.Assign(
- aSectPaM.GetContentNode(), 0);
+ aSectPaM.GetPointContentNode(), 0);
}
aSectPaM.SetMark();
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 89338e5d0a67..2cff6ea67ef2 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2742,7 +2742,7 @@ void WW8TabDesc::ParkPaM()
}
while (m_pIo->m_pPaM->GetPointNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd);
- m_pIo->m_pPaM->GetPoint()->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0);
+ m_pIo->m_pPaM->GetPoint()->nContent.Assign(m_pIo->m_pPaM->GetPointContentNode(), 0);
m_pIo->m_rDoc.SetTextFormatColl(*m_pIo->m_pPaM, const_cast<SwTextFormatColl*>(m_pIo->m_pDfltTextFormatColl));
}
}
@@ -2984,7 +2984,7 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
m_pIo->m_pPaM->GetPoint()->nNode = nSttNd;
}
while (m_pIo->m_pPaM->GetPointNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd);
- m_pIo->m_pPaM->GetPoint()->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0);
+ m_pIo->m_pPaM->GetPoint()->nContent.Assign(m_pIo->m_pPaM->GetPointContentNode(), 0);
// Precautionally set now, otherwise the style is not set for cells
// that are inserted for margin balancing.
m_pIo->m_rDoc.SetTextFormatColl(*m_pIo->m_pPaM, const_cast<SwTextFormatColl*>(m_pIo->m_pDfltTextFormatColl));
@@ -3009,9 +3009,9 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
SwPosition* pGridPos = m_pIo->m_pPaM->GetPoint();
const sal_Int32 nEnd = pGridPos->GetContentIndex();
- pGridPos->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0);
+ pGridPos->nContent.Assign(m_pIo->m_pPaM->GetPointContentNode(), 0);
m_pIo->m_xCtrlStck->NewAttr(*pGridPos, aGridItem);
- pGridPos->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), nEnd);
+ pGridPos->nContent.Assign(m_pIo->m_pPaM->GetPointContentNode(), nEnd);
m_pIo->m_xCtrlStck->SetAttr(*pGridPos, RES_PARATR_SNAPTOGRID);
}
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index aaf206016603..b124189ccd72 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -90,18 +90,18 @@ using namespace ::com::sun::star::lang;
static void lcl_EnsureValidPam( SwPaM& rPam )
{
- if( rPam.GetContentNode() != nullptr )
+ if( rPam.GetPointContentNode() != nullptr )
{
// set proper point content
- if( rPam.GetContentNode() != rPam.GetPoint()->GetContentNode() )
+ if( rPam.GetPointContentNode() != rPam.GetPoint()->GetContentNode() )
{
- rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 );
+ rPam.GetPoint()->nContent.Assign( rPam.GetPointContentNode(), 0 );
}
// else: point was already valid
// if mark is invalid, we delete it
- if( ( rPam.GetContentNode( false ) == nullptr ) ||
- ( rPam.GetContentNode( false ) != rPam.GetMark()->GetContentNode() ) )
+ if( ( rPam.GetMarkContentNode() == nullptr ) ||
+ ( rPam.GetMarkContentNode() != rPam.GetMark()->GetContentNode() ) )
{
rPam.DeleteMark();
}
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 8816422d39ef..a0b201cda9cc 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -727,7 +727,7 @@ void SwXMLImport::endDocument()
( pPrev->IsEndNode() &&
pPrev->StartOfSectionNode()->IsSectionNode() ) )
{
- SwContentNode* pCNd = pPaM->GetContentNode();
+ SwContentNode* pCNd = pPaM->GetPointContentNode();
if( pCNd && pCNd->StartOfSectionIndex()+2 <
pCNd->EndOfSectionIndex() )
{