sw/source/core/undo/undel.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit d23ca66f4dcdae9470972aed6861e84167a8571e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Sat Oct 1 09:46:42 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Oct 2 17:27:02 2022 +0200

    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.gran...@collabora.co.uk>

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) );

Reply via email to