diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-01 09:46:42 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-10-02 17:27:02 +0200 |
commit | d23ca66f4dcdae9470972aed6861e84167a8571e (patch) | |
tree | 14cb8ab4989acb9a71fce27ab2d4f4cb4a864cf7 | |
parent | 3bc383f5f6059ace3b834a637a49bc884fc00324 (diff) |
use more SwPosition::SetContent
part of the processof hiding the internals of SwPosition
Change-Id: I5789329e9d0a6cbdc03d51b2163fc88ebd9c6293
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140829
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/source/core/undo/undel.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 965f2159a354..06774f56b997 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -868,13 +868,12 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) pInsNd = rDoc.GetNodes().MakeTextNode( aIdx.GetNode(), rDoc.GetDfltTextFormatColl() ); --aIdx; - aPos.nNode = aIdx; - aPos.nContent.Assign( pInsNd->GetContentNode(), m_nSttContent ); + aPos.Assign( *pInsNd->GetContentNode(), m_nSttContent ); } else { if( pInsNd->IsContentNode() ) - aPos.nContent.Assign( static_cast<SwContentNode*>(pInsNd), m_nSttContent ); + aPos.SetContent( m_nSttContent ); if( !m_bTableDelLastNd ) pInsNd = nullptr; // do not delete Node! } @@ -1002,7 +1001,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) if( m_aSttStr ) { - aPos.nNode = m_nSttNode - m_nNdDiff + ( m_bJoinNext ? SwNodeOffset(0) : m_nReplaceDummy ); + aPos.Assign( m_nSttNode - m_nNdDiff + ( m_bJoinNext ? SwNodeOffset(0) : m_nReplaceDummy ) ); SwTextNode * pTextNd = aPos.GetNode().GetTextNode(); // If more than a single Node got deleted, also all "Node" // attributes were saved @@ -1016,7 +1015,7 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) // SectionNode mode and selection from top to bottom: // -> in StartNode is still the rest of the Join => delete - aPos.nContent.Assign( pTextNd, m_nSttContent ); + aPos.SetContent( m_nSttContent ); pTextNd->SetInSwUndo(true); OUString const ins( pTextNd->InsertText(*m_aSttStr, aPos, SwInsertFlags::NOHINTEXPAND) ); |