38 while( ( pStartNode !=
nullptr ) &&
54 if ((rStart <= rPos) && (rPos <= rEnd))
62 bool lcl_PaMCorrAbs(
SwPaM & rPam,
68 bRet |= lcl_PosCorrAbs(rPam.
GetBound(), rStart, rEnd, rNewPos);
69 bRet |= lcl_PosCorrAbs(rPam.
GetBound(
false), rStart, rEnd, rNewPos);
73 void lcl_PaMCorrRel1(
SwPaM * pPam,
74 SwNode const *
const pOldNode,
76 const sal_Int32 nCntIdx)
78 for(
int nb = 0; nb < 2; ++nb)
109 lcl_PaMCorrAbs( *_pStackCursor, aStart, aEnd, aNewPos );
112 _pStackCursor = _pStackCursor->
GetNext();
119 lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
123 lcl_PaMCorrAbs(
const_cast<SwPaM &
>(*pCursorShell->
GetTableCrs()), aStart, aEnd, aNewPos );
130 auto pUnoCursor(pWeakUnoCursor.lock());
134 bool bChange =
false;
138 bool const bLeaveSection =
139 pUnoCursor->IsRemainInSection() &&
140 ( lcl_FindUnoCursorSection( aNewPos.
GetNode() ) !=
141 lcl_FindUnoCursorSection(
142 pUnoCursor->GetPoint()->GetNode() ) );
146 bChange |= lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
151 if( pUnoTableCursor )
156 lcl_PaMCorrAbs( rPaM, aStart, aEnd, aNewPos );
162 if (bChange && bLeaveSection)
166 pUnoCursor->m_aNotifier.Broadcast(aHint);
173 const sal_Int32 nOffset,
177 SwPaM const aPam(rOldNode, 0,
178 rOldNode, pContentNode ? pContentNode->
Len() : 0);
190 bool const bChanged =
191 lcl_PaMCorrAbs(*pRedline, *aPam.
Start(), *aPam.
End(), aNewPos);
238 SwPaM const aPam(rStartNode, 0,
239 rEndNode, pContentNode ? pContentNode->
Len() : 0);
246 const sal_Int32 nOffset )
248 const SwNode* pOldNode = &rOldNode;
265 lcl_PaMCorrRel1( _pStackCursor, pOldNode, aNewPos, nCntIdx );
268 _pStackCursor = _pStackCursor->
GetNext();
276 lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx);
280 lcl_PaMCorrRel1( pCursorShell->
GetTableCrs(), pOldNode, aNewPos, nCntIdx );
287 auto pUnoCursor(pWeakUnoCursor.lock());
292 lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx );
297 if( pUnoTableCursor )
301 lcl_PaMCorrRel1( &rPaM, pOldNode, aNewPos, nCntIdx );
309 const sal_Int32 nOffset,
320 lcl_PaMCorrRel1(
p, &rOldNode, aNewPos, aNewPos.
GetContentIndex() + nOffset );
339 if(
auto pEditShell =
dynamic_cast<const SwEditShell *
>(&rCurrentSh) )
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void correctMarksRelative(const SwNode &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...
virtual void correctMarksAbsolute(const SwNode &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
virtual sal_Int32 Len() const
const SwPaM * GetTableCrs() const
SwShellCursor * GetCursor_()
SwPaM * GetStackCursor() const
void CorrRel(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
::sw::IShellCursorSupplier * GetIShellCursorSupplier()
std::vector< std::weak_ptr< SwUnoCursor > > mvUnoCursorTable
void CorrAbs(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
void cleanupUnoCursorTable() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwEditShell const * GetEditShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
Marks a node in the document model.
Base class of the Writer document model elements.
SwStartNode * GetStartNode()
bool IsSectionNode() const
const SwStartNode * StartOfSectionNode() const
SwContentNode * GetContentNode()
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
const SwPosition * End() const
SwPosition & GetBound(bool bOne=true)
const SwPosition * GetPoint() const
const SwPosition * Start() const
const SwNodeIndex * GetContentIdx() const
void DeleteAndDestroy(size_type nPos)
vector_type::size_type size_type
Represents the current text cursor of one opened edit window.
Starts a section of nodes in the document model.
The Undo actions need to create new Shell cursors.
ring_container GetRingContainer()
void DelBookmarks(SwNode &rStt, const SwNode &rEnd, std::vector< SaveBookmark > *pSaveBkmk, std::optional< sal_Int32 > oStartContentIdx, std::optional< sal_Int32 > oEndContentIdx)
void PaMCorrRel(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)
Sets all PaMs in OldNode to relative Pos.
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while.
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
sal_Int32 GetContentIndex() const
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.