use more SwPosition::Assign
part of hiding the internals of SwPosition Change-Id: Ib9012888a7d75e75a9301ac612349ed28d02a8a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139359 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
262df14af3
commit
1dd58b8bc1
5 changed files with 15 additions and 15 deletions
|
@ -303,7 +303,7 @@ public:
|
|||
SwSectionFormat& rSectionFormat,
|
||||
SwSectionData const&,
|
||||
SwTOXBase const*const pTOXBase,
|
||||
SwNodeIndex const*const pEnd,
|
||||
SwNode const * pEndNd,
|
||||
bool const bInsAtStart = true,
|
||||
bool const bCreateFrames = true);
|
||||
|
||||
|
|
|
@ -461,12 +461,12 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
|
|||
if (aEndIdx >= aStartIdx)
|
||||
{
|
||||
pSectNd = GetNodes().InsertTextSection(aStartIdx.GetNode(),
|
||||
*pFormat, aSectData, nullptr, &aEndIdx, false);
|
||||
*pFormat, aSectData, nullptr, &aEndIdx.GetNode(), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
pSectNd = GetNodes().InsertTextSection(aEndIdx.GetNode(),
|
||||
*pFormat, aSectData, nullptr, &aStartIdx, false);
|
||||
*pFormat, aSectData, nullptr, &aStartIdx.GetNode(), false);
|
||||
}
|
||||
// <- #i26762#
|
||||
|
||||
|
|
|
@ -397,7 +397,7 @@ SwTOXBaseSection* SwDoc::InsertTableOf( const SwPaM& aPam,
|
|||
--aIdx;
|
||||
SwSectionFormat* pSectFormat = MakeSectionFormat();
|
||||
GetNodes().InsertTextSection(
|
||||
*pHeadNd, *pSectFormat, headerData, nullptr, &aIdx, true, false);
|
||||
*pHeadNd, *pSectFormat, headerData, nullptr, &aIdx.GetNode(), true, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -431,7 +431,7 @@ void SwDoc::InsertTableOf( SwNodeOffset nSttNd, SwNodeOffset nEndNd,
|
|||
pFormat->SetFormatAttr(*pSet);
|
||||
|
||||
SwSectionNode *const pNewSectionNode =
|
||||
GetNodes().InsertTextSection(aStt.GetNode(), *pFormat, aSectionData, &rTOX, &aEnd);
|
||||
GetNodes().InsertTextSection(aStt.GetNode(), *pFormat, aSectionData, &rTOX, &aEnd.GetNode());
|
||||
if (!pNewSectionNode)
|
||||
{
|
||||
DelSectionFormat( pFormat );
|
||||
|
@ -1052,7 +1052,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
|
|||
--aIdx;
|
||||
SwSectionFormat* pSectFormat = rDoc.MakeSectionFormat();
|
||||
rDoc.GetNodes().InsertTextSection(
|
||||
*pHeadNd, *pSectFormat, headerData, nullptr, &aIdx, true, false);
|
||||
*pHeadNd, *pSectFormat, headerData, nullptr, &aIdx.GetNode(), true, false);
|
||||
|
||||
if (pUndo)
|
||||
{
|
||||
|
|
|
@ -222,7 +222,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
|
|||
|
||||
--aEnd; // End is inclusive in the InsertSection
|
||||
pNewSectNode = GetNodes().InsertTextSection(
|
||||
aStt.GetNode(), *pFormat, rNewData, pTOXBase, & aEnd);
|
||||
aStt.GetNode(), *pFormat, rNewData, pTOXBase, & aEnd.GetNode());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -291,7 +291,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
|
|||
}
|
||||
}
|
||||
pNewSectNode = GetNodes().InsertTextSection(
|
||||
pSttPos->GetNode(), *pFormat, rNewData, pTOXBase, &pEndPos->nNode);
|
||||
pSttPos->GetNode(), *pFormat, rNewData, pTOXBase, &pEndPos->GetNode());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -783,14 +783,14 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd,
|
|||
SwSectionFormat& rSectionFormat,
|
||||
SwSectionData const& rSectionData,
|
||||
SwTOXBase const*const pTOXBase,
|
||||
SwNodeIndex const*const pEnd,
|
||||
SwNode const*const pEndNd,
|
||||
bool const bInsAtStart, bool const bCreateFrames)
|
||||
{
|
||||
SwNodeIndex aInsPos( rNd );
|
||||
if( !pEnd ) // No Area, thus create a new Section before/after it
|
||||
if( !pEndNd ) // No Area, thus create a new Section before/after it
|
||||
{
|
||||
// #i26762#
|
||||
OSL_ENSURE(!pEnd || rNd.GetIndex() <= pEnd->GetIndex(),
|
||||
OSL_ENSURE(!pEndNd || rNd.GetIndex() <= pEndNd->GetIndex(),
|
||||
"Section start and end in wrong order!");
|
||||
|
||||
if( bInsAtStart )
|
||||
|
@ -845,11 +845,11 @@ SwSectionNode* SwNodes::InsertTextSection(SwNode& rNd,
|
|||
}
|
||||
}
|
||||
|
||||
if( pEnd )
|
||||
if( pEndNd )
|
||||
{
|
||||
// Special case for the Reader/Writer
|
||||
if( pEnd->GetNode() != GetEndOfContent() )
|
||||
aInsPos = pEnd->GetIndex()+1;
|
||||
if( *pEndNd != GetEndOfContent() )
|
||||
aInsPos = pEndNd->GetIndex()+1;
|
||||
// #i58710: We created a RTF document with a section break inside a table cell
|
||||
// We are not able to handle a section start inside a table and the section end outside.
|
||||
const SwNode* pLastNode = pSectNd->StartOfSectionNode()->EndOfSectionNode();
|
||||
|
|
|
@ -380,7 +380,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext)
|
|||
/// OD 04.10.2002 #102894#
|
||||
/// remember inserted section node for further calculations
|
||||
SwSectionNode* pInsertedSectNd = rDoc.GetNodes().InsertTextSection(
|
||||
aStt.GetNode(), *pFormat, *m_pSectionData, nullptr, & aEnd);
|
||||
aStt.GetNode(), *pFormat, *m_pSectionData, nullptr, & aEnd.GetNode() );
|
||||
|
||||
if( SfxItemState::SET == pFormat->GetItemState( RES_FTN_AT_TXTEND ) ||
|
||||
SfxItemState::SET == pFormat->GetItemState( RES_END_AT_TXTEND ))
|
||||
|
|
Loading…
Reference in a new issue