38 while( ( pStartNode !=
nullptr ) &&
51 if ((rStart <= rPos) && (rPos <= rEnd))
59 bool lcl_PaMCorrAbs(
SwPaM & rPam,
65 bRet |= lcl_PosCorrAbs(rPam.
GetBound(), rStart, rEnd, rNewPos);
66 bRet |= lcl_PosCorrAbs(rPam.
GetBound(
false), rStart, rEnd, rNewPos);
70 void lcl_PaMCorrRel1(
SwPaM * pPam,
71 SwNode const *
const pOldNode,
73 const sal_Int32 nCntIdx)
75 for(
int nb = 0; nb < 2; ++nb)
92 SwDoc& rDoc = aStart.nNode.GetNode().GetDoc();
106 lcl_PaMCorrAbs( *_pStackCursor, aStart, aEnd, aNewPos );
109 _pStackCursor = _pStackCursor->
GetNext();
114 for(
SwPaM& rPaM : const_cast<SwShellCursor*>(pCursorShell->
GetCursor_())->GetRingContainer())
116 lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
120 lcl_PaMCorrAbs( const_cast<SwPaM &>(*pCursorShell->
GetTableCrs()), aStart, aEnd, aNewPos );
127 auto pUnoCursor(pWeakUnoCursor.lock());
131 bool bChange =
false;
135 bool const bLeaveSection =
136 pUnoCursor->IsRemainInSection() &&
137 ( lcl_FindUnoCursorSection( aNewPos.nNode.GetNode() ) !=
138 lcl_FindUnoCursorSection(
139 pUnoCursor->GetPoint()->nNode.GetNode() ) );
143 bChange |= lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
148 if( pUnoTableCursor )
153 lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
159 if (bChange && bLeaveSection)
163 pUnoCursor->m_aNotifier.Broadcast(aHint);
170 const sal_Int32 nOffset,
174 SwPaM const aPam(rOldNode, 0,
175 rOldNode, pContentNode ? pContentNode->Len() : 0);
177 aNewPos.nContent += nOffset;
187 bool const bChanged =
188 lcl_PaMCorrAbs(*pRedline, *aPam.
Start(), *aPam.End(), aNewPos);
218 DelBookmarks( aStart.nNode, aEnd.nNode,
nullptr, &aStart.nContent, &aEnd.nContent );
235 SwPaM const aPam(rStartNode, 0,
236 rEndNode, pContentNode ? pContentNode->Len() : 0);
243 const sal_Int32 nOffset )
263 lcl_PaMCorrRel1( _pStackCursor, pOldNode, aNewPos, nCntIdx );
266 _pStackCursor = _pStackCursor->
GetNext();
274 lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx);
278 lcl_PaMCorrRel1( pCursorShell->
GetTableCrs(), pOldNode, aNewPos, nCntIdx );
285 auto pUnoCursor(pWeakUnoCursor.lock());
290 lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx );
295 if( pUnoTableCursor )
299 lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx );
307 const sal_Int32 nOffset,
337 if(
auto pEditShell = dynamic_cast<const SwEditShell *>(&rCurrentSh) )
Starts a section of nodes in the document model.
Marks a position in the document model.
void DelBookmarks(const SwNodeIndex &rStt, const SwNodeIndex &rEnd, std::vector< SaveBookmark > *pSaveBkmk, const SwIndex *pSttIdx, const SwIndex *pEndIdx)
const SwPosition * GetMark() const
virtual void correctMarksRelative(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)=0
Corrects marks (relative) This method uses the previous position of the mark in the paragraph as offs...
SwPosition & GetBound(bool bOne=true)
IDocumentMarkAccess * getIDocumentMarkAccess()
SwPaM * GetStackCursor() const
void cleanupUnoCursorTable() const
SwShellCursor * GetCursor_()
PaM is Point and Mark: a selection of the document model.
const SwPaM * GetTableCrs() const
const SwStartNode * StartOfSectionNode() const
void DeleteAndDestroy(size_type nPos)
const SwPosition * GetPoint() const
SwIndex & Assign(SwIndexReg *, sal_Int32)
SwEditShell const * GetEditShell() const
std::vector< std::weak_ptr< SwUnoCursor > > mvUnoCursorTable
SwContentNode * GetContentNode()
vector_type::size_type size_type
void PaMCorrRel(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)
Sets all PaMs in OldNode to relative Pos.
Marks a node in the document model.
ring_container GetRingContainer()
SwStartNodeType GetStartNodeType() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
const SwPosition * Start() const
The Undo actions need to create new Shell cursors.
void CorrRel(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void CorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
sal_Int32 GetIndex() const
const SwPosition * End() const
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while...
virtual void correctMarksAbsolute(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)=0
Corrects marks (absolute) This method ignores the previous position of the mark in the paragraph...
virtual const SwRedlineTable & GetRedlineTable() const =0
const SwIndexReg * GetIdxReg() const
::sw::IShellCursorSupplier * GetIShellCursorSupplier()
SwNodeIndex * GetContentIdx() const
Base class of the Writer document model elements.