29 #include <osl/diagnose.h>
31 #include <strings.hrc>
55 if( pUndo && !*pUndo )
64 SwNode& rNd = aDelPam.GetNode();
66 if( pEndSelPos->nNode.GetIndex() <= rEndNd.
GetIndex() )
68 *aDelPam.GetPoint() = *pEndSelPos;
74 aDelPam.GetPoint()->nNode = rEndNd;
90 }
while( pEndSelPos );
94 std::unique_ptr<SwPaM> pNewPam;
98 assert(dynamic_cast<SwShellCursor*>(&rPam));
105 pNewPam->Start()->nNode = *pTableNode;
111 pNewPam->Start()->nNode = *pSectionNode;
113 pNewPam->Start()->nContent.Assign(
nullptr, 0);
114 pPam = pNewPam.get();
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() )
285 #if OSL_DEBUG_LEVEL > 0
290 OSL_ENSURE( rCmp.GetPoint()->nContent.GetIdxReg()
291 == rCmp.GetContentNode(),
"Point in wrong Node" );
292 OSL_ENSURE( rCmp.GetMark()->nContent.GetIdxReg()
293 == rCmp.GetContentNode(
false),
"Mark in wrong Node" );
326 if( rPaM.HasMark() && *rPaM.GetMark() != *rPaM.GetPoint() )
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwEndNode * EndOfSectionNode() const
sal_uLong GetIndex() const
SwNode & GetNode(bool bPoint=true) const
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Marks a position in the document model.
bool IsMultiSelection() const
bool DelFullPara()
Remove a complete paragraph.
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
void SaveTableBoxContent(const SwPosition *pPos=nullptr)
SAL_DLLPRIVATE void DeleteSel(SwPaM &rPam, bool *pUndo=nullptr)
const SwPosition * GetMark() const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
IDocumentContentOperations const & getIDocumentContentOperations() const
bool RemoveParagraphMetadataFieldAtCursor()
Removes the paragraph metadata field at the current cursor, if any.
SwContentNode * GetContentNode(bool bPoint=true) const
IDocumentContentOperations & getIDocumentContentOperations()
Provides access to the content operations interface.
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
check if target position is in fly anchored at source range
sal_uLong GetIndex() const
bool IsContentNode() const
PaM is Point and Mark: a selection of the document model.
bool ExtendedSelectedAll()
If ExtendedSelectAll() was called and selection didn't change since then.
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
void MakeUniqueNumRules(const SwPaM &rPaM)
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
SwIndex & Assign(SwIndexReg *, sal_Int32)
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Marks a node in the document model.
bool UpDown(bool bUp, sal_uInt16 nCnt, Point const *pPt, tools::Long nUpDownX, SwRootFrame &rLayout)
ring_container GetRingContainer()
OUString SwResId(const char *pId)
bool ReplaceImpl(SwPaM &rCursor, OUString const &rReplacement, bool const bRegExp, SwDoc &rDoc, SwRootFrame const *const pLayout)
bool HasReadonlySel() const
const SwPosition * Start() const
bool IsInProtectSect() const
Is node in a protected area?
bool Delete()
Delete content of all ranges.
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
virtual bool DelFullPara(SwPaM &)=0
Delete full paragraphs.
sal_Int32 GetIndex() const
bool StartsWithTable()
If document body starts with a table.
const SwPosition * End() const
SwMoveFnCollection const & fnMoveBackward
SwTableNode * FindTableNode()
Search table node, in which it is.
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart)=0
Split a node at rPos (implemented only for TextNode).
bool Copy(SwEditShell &rDestShell)
Copy content of all ranges at current position of cursor to given Shell.
bool IsFlySelectedByCursor(SwDoc const &rDoc, SwPosition const &rStart, SwPosition const &rEnd)
check at-char and at-para flys in rDoc
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
void StartAllAction()
For all views of this document.
SwRootFrame * GetLayout() const
bool Replace(const OUString &rNewStr, bool bRegExpRplc)
Replace a selected range in a TextNode by given string.
Base class of the Writer document model elements.
bool CursorInsideInputField() const