diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-10 11:47:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-08-14 12:02:57 +0200 |
commit | ab0d9af99b2dc69fa8e7463fb33ca28cbccf484d (patch) | |
tree | add60bc9fa4c6b6016ab487e15d472355841b8a9 /sw/source/filter/ww8 | |
parent | 25a299a8859e82fe0fdafc2bb70680aed54d3887 (diff) |
rename SwPaM::GetNode to GetPointNode/GetContentNode
Using a parameter to select point/mark makes the code much harder to
read
Change-Id: I4ac8b904ac423e2b99253b7e4b6adc72c8afe1a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138083
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 8 |
10 files changed, 40 insertions, 40 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 8298af5de01b..1543df719fec 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -390,10 +390,10 @@ static void checkAndWriteFloatingTables(DocxAttributeOutput& rDocxAttributeOutpu const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); const SwPosition* pPosition = rAnchor.GetContentAnchor(); - if (!pPosition || ! rExport.m_pCurPam->GetNode().GetTextNode()) + if (!pPosition || ! rExport.m_pCurPam->GetPointNode().GetTextNode()) continue; - if (pPosition->nNode != rExport.m_pCurPam->GetNode().GetTextNode()->GetIndex()) + if (pPosition->nNode != rExport.m_pCurPam->GetPointNode().GetTextNode()->GetIndex()) continue; const SwNodeIndex* pStartNode = pFrameFormat->GetContent().GetContentIdx(); @@ -502,7 +502,7 @@ sal_Int32 DocxAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t p bool bEndParaSdt = false; if (m_aParagraphSdt.m_bStartedSdt) { - SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode(); + SwTextNode* pTextNode = m_rExport.m_pCurPam->GetPointNode().GetTextNode(); if (pTextNode && pTextNode->GetpSwAttrSet()) { const SfxItemSet* pSet = pTextNode->GetpSwAttrSet(); @@ -1501,7 +1501,7 @@ void DocxAttributeOutput::EndParagraphProperties(const SfxItemSet& rParagraphMar m_pSerializer->endElementNS( XML_w, XML_pPr ); // RDF metadata for this text node. - SwTextNode* pTextNode = m_rExport.m_pCurPam->GetNode().GetTextNode(); + SwTextNode* pTextNode = m_rExport.m_pCurPam->GetPointNode().GetTextNode(); std::map<OUString, OUString> aStatements; if (pTextNode) aStatements = SwRDFHelper::getTextNodeStatements("urn:bails", *pTextNode); @@ -7152,7 +7152,7 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, bool bBreakAfter, const WW // Detect when the current node is the last node in the // document: the last section is written explicitly in // DocxExport::WriteMainText(), don't duplicate that here. - SwNodeIndex aCurrentNode(m_rExport.m_pCurPam->GetNode()); + SwNodeIndex aCurrentNode(m_rExport.m_pCurPam->GetPointNode()); SwNodeIndex aLastNode(m_rExport.m_rDoc.GetNodes().GetEndOfContent(), -1); bool bEmit = aCurrentNode != aLastNode; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 7a0dee9c743b..e2ee0fb284ef 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -496,7 +496,7 @@ void RtfExport::WriteMainText() Strm().WriteChar('}'); // background } - SwTableNode* pTableNode = m_pCurPam->GetNode().FindTableNode(); + SwTableNode* pTableNode = m_pCurPam->GetPointNode().FindTableNode(); if (m_pWriter && m_pWriter->m_bWriteOnlyFirstTable && pTableNode != nullptr) { m_pCurPam->GetPoint()->nNode = *pTableNode; diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index d166b5d885c9..f0187d3a6230 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -995,7 +995,7 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport ) sal_uLong nRstLnNum = pSet ? pSet->Get( RES_LINENUMBER ).GetStartValue() : 0; - const SwTableNode* pTableNd = rExport.m_pCurPam->GetNode().FindTableNode(); + const SwTableNode* pTableNd = rExport.m_pCurPam->GetPointNode().FindTableNode(); const SwSectionNode* pSectNd = nullptr; if ( pTableNd ) { @@ -1570,12 +1570,12 @@ bool UsePrevSectionNextStyle(sal_uInt8 nBreakCode, const SwPageDesc* pPd, SwPaM aPaM(*pSectionStart); aPaM.Move(fnMoveBackward); - if (!aPaM.GetNode().IsTextNode()) + if (!aPaM.GetPointNode().IsTextNode()) { return false; } - SwTextNode* pTextNode = aPaM.GetNode().GetTextNode(); + SwTextNode* pTextNode = aPaM.GetPointNode().GetTextNode(); const SwAttrSet* pParaProps = &pTextNode->GetSwAttrSet(); sal_uInt32 nCharHeight = pParaProps->GetSize().GetHeight(); if (nCharHeight > 20) @@ -1584,12 +1584,12 @@ bool UsePrevSectionNextStyle(sal_uInt8 nBreakCode, const SwPageDesc* pPd, } aPaM.Move(fnMoveBackward); - if (!aPaM.GetNode().IsTextNode()) + if (!aPaM.GetPointNode().IsTextNode()) { return false; } - pTextNode = aPaM.GetNode().GetTextNode(); + pTextNode = aPaM.GetPointNode().GetTextNode(); pParaProps = &pTextNode->GetSwAttrSet(); return pParaProps->HasItem(RES_PAGEDESC); } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index f6d5160cd92e..77a66658f8d4 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2787,7 +2787,7 @@ void MSWordExportBase::WriteText() TrackContentToExport aContentTracking(m_pCurPam.get(), m_nCurStart, m_nCurEnd); while (aContentTracking.contentRemainsToExport(m_pTableInfo.get())) { - SwNode& rNd = m_pCurPam->GetNode(); + SwNode& rNd = m_pCurPam->GetPointNode(); // no section breaks exported for Endnotes if ( rNd.IsTextNode() && m_nTextTyp != TXT_EDN && m_nTextTyp != TXT_FTN ) @@ -2962,7 +2962,7 @@ bool MSWordExportBase::IsInTable() const if (m_pCurPam != nullptr) { - SwNode& rNode = m_pCurPam->GetNode(); + SwNode& rNode = m_pCurPam->GetPointNode(); if (m_pTableInfo) { @@ -3815,7 +3815,7 @@ ErrCode SwWW8Writer::WriteStorageImpl() // Respect table at the beginning of the document { - SwTableNode* pTNd = m_pCurrentPam->GetNode().FindTableNode(); + SwTableNode* pTNd = m_pCurrentPam->GetPointNode().FindTableNode(); if( pTNd && m_bWriteAll ) // start with the table node !! m_pCurrentPam->GetPoint()->nNode = *pTNd; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index d83af1e5a6c9..58d0a5bd4995 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3293,7 +3293,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField ) const SwTextNode *pTextNd = GetExport().GetHdFtPageRoot(); if (!pTextNd) { - pTextNd = GetExport().m_pCurPam->GetNode().GetTextNode(); + pTextNd = GetExport().m_pCurPam->GetPointNode().GetTextNode(); } if (pTextNd) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 346c3d6cb699..065be5d855c4 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2416,7 +2416,7 @@ void wwSectionManager::SetHdFt(wwSection const &rSection, int nSect, void SwWW8ImplReader::AppendTextNode(SwPosition& rPos) { - SwTextNode* pText = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pText = m_pPaM->GetPointNode().GetTextNode(); const SwNumRule* pRule = nullptr; @@ -3552,7 +3552,7 @@ bool SwWW8ImplReader::HandlePageBreakChar() if (!m_nInTable) { bool IsTemp=true; - SwTextNode* pTemp = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pTemp = m_pPaM->GetPointNode().GetTextNode(); if (pTemp && pTemp->GetText().isEmpty() && (m_bFirstPara || m_bFirstParaOfPage)) { @@ -3573,7 +3573,7 @@ bool SwWW8ImplReader::HandlePageBreakChar() bParaEndAdded = true; if (0 >= m_pPaM->GetPoint()->GetContentIndex()) { - if (SwTextNode* pTextNode = m_pPaM->GetNode().GetTextNode()) + if (SwTextNode* pTextNode = m_pPaM->GetPointNode().GetTextNode()) { pTextNode->SetAttr( *GetDfltAttr(RES_PARATR_NUMRULE)); @@ -3862,20 +3862,20 @@ tools::Long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, tools::Long nTextEnd tools::Long nSkipChars = 0; WW8PLCFManResult aRes; - OSL_ENSURE(m_pPaM->GetNode().GetTextNode(), "Missing txtnode"); + OSL_ENSURE(m_pPaM->GetPointNode().GetTextNode(), "Missing txtnode"); bool bStartAttr = m_xPlcxMan->Get(&aRes); // Get Attribute position again aRes.nCurrentCp = rTextPos; // Current Cp position bool bNewSection = (aRes.nFlags & MAN_MASK_NEW_SEP) && !m_bIgnoreText; if ( bNewSection ) // New Section { - OSL_ENSURE(m_pPaM->GetNode().GetTextNode(), "Missing txtnode"); + OSL_ENSURE(m_pPaM->GetPointNode().GetTextNode(), "Missing txtnode"); // Create PageDesc and fill it m_aSectionManager.CreateSep(rTextPos); // -> 0xc was a Sectionbreak, but not a Pagebreak; // Create PageDesc and fill it m_bPgSecBreak = false; - OSL_ENSURE(m_pPaM->GetNode().GetTextNode(), "Missing txtnode"); + OSL_ENSURE(m_pPaM->GetPointNode().GetTextNode(), "Missing txtnode"); } // New paragraph over Plcx.Fkp.papx @@ -4068,7 +4068,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) while (l < nTextEnd) { ReadAttrs( l, nNext, nTextEnd, bStartLine );// Takes SectionBreaks into account, too - OSL_ENSURE(m_pPaM->GetNode().GetTextNode(), "Missing txtnode"); + OSL_ENSURE(m_pPaM->GetPointNode().GetTextNode(), "Missing txtnode"); if (m_pPostProcessAttrsInfo != nullptr) PostProcessAttrs(); @@ -4103,7 +4103,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) if (SwTextNode* pPreviousNode = (bStartLine && m_xPreviousNode) ? m_xPreviousNode->GetTextNode() : nullptr) { - SwTextNode* pEndNd = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pEndNd = m_pPaM->GetPointNode().GetTextNode(); SAL_WARN_IF(!pEndNd, "sw.ww8", "didn't find textnode for dropcap"); if (pEndNd) { @@ -4140,7 +4140,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) else if (m_bDropCap) { // If we have found a dropcap store the textnode - m_xPreviousNode.reset(new TextNodeListener(m_pPaM->GetNode().GetTextNode())); + m_xPreviousNode.reset(new TextNodeListener(m_pPaM->GetPointNode().GetTextNode())); SprmResult aDCS; if (m_bVer67) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 9bdd867ad9eb..89338e5d0a67 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -188,7 +188,7 @@ sal_uInt16 SwWW8ImplReader::End_Footnote() //Get the footnote character and remove it from the txtnode. We'll //replace it with the footnote - SwTextNode* pText = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pText = m_pPaM->GetPointNode().GetTextNode(); sal_Int32 nPos = m_pPaM->GetPoint()->GetContentIndex(); OUString sChar; @@ -1039,7 +1039,7 @@ void SwWW8ImplReader::NextAnlLine(const sal_uInt8* pSprm13) else m_nSwNumLevel = 0xff; // no number - SwTextNode* pNd = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pNd = m_pPaM->GetPointNode().GetTextNode(); if (!pNd) return; @@ -2648,13 +2648,13 @@ void WW8TabDesc::MergeCells() { SwPaM aPam( *m_pTabBox->GetSttNd(), 0 ); aPam.GetPoint()->nNode++; - SwTextNode* pNd = aPam.GetNode().GetTextNode(); + SwTextNode* pNd = aPam.GetPointNode().GetTextNode(); while( pNd ) { pNd->SetCountedInList( false ); aPam.GetPoint()->nNode++; - pNd = aPam.GetNode().GetTextNode(); + pNd = aPam.GetPointNode().GetTextNode(); } } @@ -2740,7 +2740,7 @@ void WW8TabDesc::ParkPaM() { m_pIo->m_pPaM->GetPoint()->nNode = nSttNd; } - while (m_pIo->m_pPaM->GetNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd); + 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_rDoc.SetTextFormatColl(*m_pIo->m_pPaM, const_cast<SwTextFormatColl*>(m_pIo->m_pDfltTextFormatColl)); @@ -2983,7 +2983,7 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam) { m_pIo->m_pPaM->GetPoint()->nNode = nSttNd; } - while (m_pIo->m_pPaM->GetNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd); + while (m_pIo->m_pPaM->GetPointNode().GetNodeType() != SwNodeType::Text && ++nSttNd < nEndNd); m_pIo->m_pPaM->GetPoint()->nContent.Assign(m_pIo->m_pPaM->GetContentNode(), 0); // Precautionally set now, otherwise the style is not set for cells // that are inserted for margin balancing. @@ -2993,7 +2993,7 @@ void WW8TabDesc::SetPamInCell(short nWwCol, bool bPam) } // Better to turn Snap to Grid off for all paragraphs in tables - SwTextNode *pNd = m_pIo->m_pPaM->GetNode().GetTextNode(); + SwTextNode *pNd = m_pIo->m_pPaM->GetPointNode().GetTextNode(); if(!pNd) return; diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index ee821eb75d11..d4081a4d055f 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -1665,7 +1665,7 @@ bool SwWW8ImplReader::SetTextFormatCollAndListLevel(const SwPaM& rRg, if( rStyleInfo.m_pFormat && rStyleInfo.m_bColl ) { bRes = m_rDoc.SetTextFormatColl(rRg, static_cast<SwTextFormatColl*>(rStyleInfo.m_pFormat)); - SwTextNode* pTextNode = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pTextNode = m_pPaM->GetPointNode().GetTextNode(); OSL_ENSURE( pTextNode, "No Text-Node at PaM-Position" ); if ( !pTextNode ) { @@ -1809,7 +1809,7 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO, if (!m_xLstManager) // are all list declarations read? return; - SwTextNode* pTextNd = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pTextNd = m_pPaM->GetPointNode().GetTextNode(); OSL_ENSURE(pTextNd, "No Text-Node at PaM-Position"); if (!pTextNd) return; @@ -2010,7 +2010,7 @@ void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData, // So instead use USHRT_MAX-1 for indicating an explicit "cancel numbering". RegisterNumFormat(USHRT_MAX-1, MAXLEVEL); } - else if (SwTextNode* pTextNode = m_pPaM->GetNode().GetTextNode()) + else if (SwTextNode* pTextNode = m_pPaM->GetPointNode().GetTextNode()) { // here a paragraph is being directly formatted diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 508cae886c1f..4447d124f267 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2584,7 +2584,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, OUString& rSt //we have inserted a section before this point, so adjust pos //for future page/section segment insertion - m_aSectionManager.PrependedInlineNode(aTmpPos, m_pPaM->GetNode()); + m_aSectionManager.PrependedInlineNode(aTmpPos, m_pPaM->GetPointNode()); return eF_ResT::TEXT; } @@ -3500,7 +3500,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) // inserting a toc inserts a section before this point, so adjust pos // for future page/section segment insertion - m_aSectionManager.PrependedInlineNode( *m_oPosAfterTOC->GetPoint(), aRegion.GetNode() ); + m_aSectionManager.PrependedInlineNode( *m_oPosAfterTOC->GetPoint(), aRegion.GetPointNode() ); } // Set end in stack diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index dabeae478f5c..26e4d1d9419c 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2497,7 +2497,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p { // ofz#34749 we shouldn't anchor anything into an 'extra' paragraph scheduled for // removal at end of import, but check if that scenario is happening - m_aExtraneousParas.remove_if_present(m_pPaM->GetNode().GetTextNode()); + m_aExtraneousParas.remove_if_present(m_pPaM->GetPointNode().GetTextNode()); m_xSFlyPara->SetFlyFormat(m_rDoc.MakeFlySection(WW8SwFlyPara::eAnchor, m_pPaM->GetPoint(), &aFlySet)); OSL_ENSURE(m_xSFlyPara->GetFlyFormat()->GetAnchor().GetAnchorId() == @@ -4229,7 +4229,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe // for list levels of mode LABEL_ALIGNMENT.(see ww8par3.cxx // W8ImplReader::RegisterNumFormatOnTextNode). // Need to apply the list format to the paragraph here. - SwTextNode* pTextNode = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pTextNode = m_pPaM->GetPointNode().GetTextNode(); if( pTextNode && pTextNode->AreListLevelIndentsApplicable() ) { SwNumRule * pNumRule = pTextNode->GetNumRule(); @@ -4319,7 +4319,7 @@ void SwWW8ImplReader::Read_LR( sal_uInt16 nId, const sal_uInt8* pData, short nLe if (!m_pCurrentColl) { - if (const SwTextNode* pNode = m_pPaM->GetNode().GetTextNode()) + if (const SwTextNode* pNode = m_pPaM->GetPointNode().GetTextNode()) { if ( const SwNumFormat *pNumFormat = GetNumFormatFromTextNode(*pNode) ) { @@ -4543,7 +4543,7 @@ void SwWW8ImplReader::Read_LineBreakClear(sal_uInt16 /*nId*/, const sal_uInt8* p { if (nLen == -1 && m_oLineBreakClear.has_value()) { - SwTextNode* pText = m_pPaM->GetNode().GetTextNode(); + SwTextNode* pText = m_pPaM->GetPointNode().GetTextNode(); sal_Int32 nPos = m_pPaM->GetPoint()->GetContentIndex(); if (!pText || !nPos) { |