sw/source/core/undo/unspnd.cxx |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 693cf862c7da540817d3bdff9120429f1528ef64
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Aug 31 10:25:02 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Aug 31 14:26:23 2022 +0200

    use more SwPosition::Assign
    
    part of hiding the internals of SwPosition
    
    Change-Id: I7ab1a9f34fb1c953d0b4ea7d5b610b37fab2b2fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139081
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 75b6927282d8..8dc653303251 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -79,8 +79,8 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & 
rContext)
     if( m_bTableFlag )
     {
         // than a TextNode was added directly before the current table
-        SwNodeIndex& rIdx = rPam.GetPoint()->nNode;
-        rIdx = m_nNode;
+        SwPosition& rPos = *rPam.GetPoint();
+        rPos.Assign(m_nNode);
         SwTextNode* pTNd;
         SwNode* pCurrNd = pDoc->GetNodes()[ m_nNode + 1 ];
         SwTableNode* pTableNd = pCurrNd->FindTableNode();
@@ -101,7 +101,6 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & 
rContext)
 
             // than delete it again
             SwNodeIndex aDelNd( *pTableNd, -1 );
-            rPam.GetPoint()->nContent.Assign( 
static_cast<SwContentNode*>(pCurrNd), 0 );
             RemoveIdxRel( aDelNd.GetIndex(), *rPam.GetPoint() );
             pDoc->GetNodes().Delete( aDelNd );
         }
@@ -126,9 +125,9 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & 
rContext)
             pTNd->JoinNext();
             if (m_pHistory)
             {
-                rPam.GetPoint()->nContent = 0;
+                rPam.GetPoint()->SetContent(0);
                 rPam.SetMark();
-                rPam.GetPoint()->nContent = pTNd->GetText().getLength();
+                rPam.GetPoint()->SetContent(pTNd->GetText().getLength());
 
                 pDoc->RstTextAttrs( rPam, true );
                 m_pHistory->TmpRollback( pDoc, 0, false );
@@ -146,13 +145,13 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & 
rContext)
 void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext)
 {
     SwCursor & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() );
-    rPam.GetPoint()->nNode = m_nNode;
+    rPam.GetPoint()->Assign(m_nNode);
     SwTextNode * pTNd = rPam.GetPointNode().GetTextNode();
     OSL_ENSURE(pTNd, "SwUndoSplitNode::RedoImpl(): SwTextNode expected");
     if (!pTNd)
         return;
 
-    rPam.GetPoint()->nContent.Assign( pTNd, m_nContent );
+    rPam.GetPoint()->SetContent( m_nContent );
 
     SwDoc& rDoc = rPam.GetDoc();
     rDoc.getIDocumentContentOperations().SplitNode( *rPam.GetPoint(), 
m_bCheckTableStart );

Reply via email to