summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-09-05 15:00:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-06 08:56:53 +0200
commit46159a67dd45a604a0197a26d177d6e9dce62d96 (patch)
tree2040860f54be41c17a0d3e75cce2c914886a25e1
parent3a8c74efa2da18f16af4f395e46ee13bfdfa76cc (diff)
use more SwPosition::Assign
part of hiding the internals of SwPosition Change-Id: I878f32139a82eab4a9f77673ebaadb1f1f1007f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/undo/undobj1.cxx15
1 files changed, 4 insertions, 11 deletions
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 3b7e0289b74d..8ece221511f8 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -115,12 +115,10 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrame)
}
else
{
- SwPosition aNewPos(pDoc->GetNodes().GetEndOfContent());
- aNewPos.nNode = m_nNodePagePos;
+ SwPosition aNewPos(*pDoc->GetNodes()[m_nNodePagePos]);
if ((RndStdIds::FLY_AS_CHAR == m_nRndId) || (RndStdIds::FLY_AT_CHAR == m_nRndId))
{
- aNewPos.nContent.Assign( aNewPos.GetNode().GetContentNode(),
- m_nContentPos );
+ aNewPos.SetContent( m_nContentPos );
}
aAnchor.SetAnchor( &aNewPos );
}
@@ -254,8 +252,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc )
{
// Pointer to 0, do not delete
const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat();
- SwContentIndex aIdx( pPos->nContent );
- pTextNd->EraseText( aIdx, 1 );
+ pTextNd->EraseText( *pPos, 1 );
}
}
else if (RndStdIds::FLY_AT_CHAR == m_nRndId)
@@ -339,10 +336,6 @@ void SwUndoInsLayFormat::RepeatImpl(::sw::RepeatContext & rContext)
(RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId()))
{
SwPosition aPos( *rContext.GetRepeatPaM().GetPoint() );
- if (RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId())
- {
- aPos.nContent.Assign( nullptr, 0 );
- }
aAnchor.SetAnchor( &aPos );
}
else if( RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId() )
@@ -540,7 +533,7 @@ void SwUndoSetFlyFormat::GetAnchor( SwFormatAnchor& rAnchor,
}
else
{
- aPos.nContent.Assign(pNd->GetTextNode(), nContent);
+ aPos.SetContent(nContent);
}
}
if ( pNd )