29#include <osl/diagnose.h>
55 if( pUndo && !*pUndo )
90 }
while( pEndSelPos );
94 std::optional<SwPaM> pNewPam;
105 pNewPam->Start()->Assign(*pTableNode);
111 pNewPam->Start()->Assign(*pSectionNode);
144 DeleteSel(rPaM, isArtificialSelection, &bUndo);
168 std::vector< std::shared_ptr<SwPosition> > aInsertList;
173 std::shared_ptr<SwPosition> pInsertPos;
174 sal_uInt16 nMove = 0;
179 if( &rDestShell ==
this )
183 pPos = rPaM.GetPoint();
197 pInsertPos = std::make_shared<SwPosition>( *aCursor.
GetPoint() );
198 aInsertList.push_back( pInsertPos );
202 pInsertPos = std::make_shared<SwPosition>( *pPos );
208 *rPaM.Start() <= *pTmp && *pTmp < *rPaM.End() )
216 bool bFirstMove =
true;
218 sal_Int32 nSttCntIdx = 0;
220 auto pNextInsert = aInsertList.begin();
227 if( &rDestShell ==
this )
231 pPos = rPaM.GetPoint();
239 if( pNextInsert != aInsertList.end() )
241 pPos = pNextInsert->get();
249 if( !rPaM.HasMark() || *rPaM.GetPoint() == *rPaM.GetMark() )
275 pCursor->
GetPoint()->
Assign( aSttNdIdx.GetIndex()+1, nSttCntIdx );
284#if OSL_DEBUG_LEVEL > 0
289 OSL_ENSURE( rCmp.GetPoint()->GetContentNode()
290 == rCmp.GetPointContentNode(),
"Point in wrong Node" );
291 OSL_ENSURE( rCmp.GetMark()->GetContentNode()
292 == rCmp.GetMarkContentNode(),
"Mark in wrong Node" );
325 if( rPaM.HasMark() && *rPaM.GetMark() != *rPaM.GetPoint() )
@ CheckPosInFly
check if target position is in fly anchored at source range
@ ArtificialSelection
keyboard delete, artificial selection, avoid deleting flys
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
StartsWith StartsWith_()
If document body starts with a table or starts/ends with hidden paragraph.
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
bool CursorInsideInputField() const
bool ExtendedSelectedAll()
If ExtendedSelectAll() was called and selection didn't change since then.
bool HasReadonlySel(bool isReplace=false) const
void SaveTableBoxContent(const SwPosition *pPos=nullptr)
bool UpDown(bool bUp, sal_uInt16 nCnt, Point const *pPt, tools::Long nUpDownX, SwRootFrame &rLayout)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
void MakeUniqueNumRules(const SwPaM &rPaM)
void StartAllAction()
For all views of this document.
bool RemoveParagraphMetadataFieldAtCursor()
Removes the paragraph metadata field at the current cursor, if any.
SAL_DLLPRIVATE void DeleteSel(SwPaM &rPam, bool isArtificialSelection, bool *pUndo=nullptr)
bool Delete(bool isArtificialSelection=false)
Delete content of all ranges.
bool DelFullPara()
Remove a complete paragraph.
bool Replace(const OUString &rNewStr, bool bRegExpRplc)
Replace a selected range in a TextNode by given string.
bool Copy(SwEditShell &rDestShell)
Copy content of all ranges at current position of cursor to given Shell.
Marks a node in the document model.
Base class of the Writer document model elements.
SwNodeOffset GetIndex() const
bool IsInProtectSect() const
Is node in a protected area?
bool IsContentNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwStartNode * StartOfSectionNode() const
const SwEndNode * EndOfSectionNode() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
SwNode & GetPointNode() const
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
bool IsMultiSelection() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
SwNode & GetMarkNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void AddRule(SwUndoArg eWhat, const OUString &rWith)
A section node represents the start of a section on the UI, i.e.
Represents the current text cursor of one opened edit window.
IDocumentContentOperations & getIDocumentContentOperations()
Provides access to the content operations interface.
SwRootFrame * GetLayout() const
ring_container GetRingContainer()
bool ReplaceImpl(SwPaM &rCursor, OUString const &rReplacement, bool const bRegExp, SwDoc &rDoc, SwRootFrame const *const pLayout)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
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.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
OUString SwResId(TranslateId aId)
bool IsFlySelectedByCursor(SwDoc const &rDoc, SwPosition const &rStart, SwPosition const &rEnd)
check at-char and at-para flys in rDoc