20#include <libxml/xmlwriter.h>
28#include <UndoManager.hxx>
51 : m_nSttNode( 0 ), m_nEndNode( 0 ), m_nSttContent( 0 ), m_nEndContent( 0 )
104 SetPaM( rPaM, bCorrToContent );
153 , m_nViewShellId(CreateViewShellId(pDoc))
154 , m_isRepeatIgnored(false)
155 , m_bCacheComment(true)
165 if (
const SwView* pView = pDocShell->GetView())
166 nRet = pView->GetViewShellId();
184class UndoRedoRedlineGuard
188 : m_rRedlineAccess(rContext.GetDoc().getIDocumentRedlineAccess())
189 , m_eMode(m_rRedlineAccess.GetRedlineFlags())
194 m_rRedlineAccess.SetRedlineFlags( eTmpMode );
198 ~UndoRedoRedlineGuard()
200 m_rRedlineAccess.SetRedlineFlags(m_eMode);
224 const UndoRedoRedlineGuard aUndoRedoRedlineGuard(*pContext, *
this);
233 const UndoRedoRedlineGuard aUndoRedoRedlineGuard(*pContext, *
this);
245 assert(pRepeatContext);
273 pId = STR_DELETE_UNDO;
276 pId = STR_INSERT_UNDO;
282 pId = STR_SPLITNODE_UNDO;
285 pId = STR_INSATTR_UNDO;
288 pId = STR_SETFMTCOLL_UNDO;
291 pId = STR_RESET_ATTR_UNDO;
294 pId = STR_INSFMT_ATTR_UNDO;
297 pId = STR_INSERT_DOC_UNDO;
303 pId = STR_INSTABLE_UNDO;
306 pId = STR_TABLETOTEXT_UNDO;
309 pId = STR_TEXTTOTABLE_UNDO;
318 pId = STR_TABLEHEADLINE;
321 pId = STR_INSERTSECTION;
324 pId = STR_OUTLINE_LR;
327 pId = STR_OUTLINE_UD;
330 pId = STR_OUTLINE_EDIT;
342 pId = STR_INSERTDRAW;
345 pId = STR_NUMORNONUM;
348 pId = STR_INC_LEFTMARGIN;
351 pId = STR_DEC_LEFTMARGIN;
354 pId = STR_INSERTLABEL;
357 pId = STR_SETNUMRULESTART;
363 SAL_INFO(
"sw.core",
"Should NEVER be used/translated");
366 pId = STR_ACCEPT_REDLINE;
369 pId = STR_REJECT_REDLINE;
372 pId = STR_SPLIT_TABLE;
375 pId = STR_DONTEXPAND;
378 pId = STR_AUTOCORRECT;
381 pId = STR_MERGE_TABLE;
384 pId = STR_TRANSLITERATE;
387 pId = STR_PASTE_CLIPBOARD_UNDO;
390 pId = STR_TYPING_UNDO;
396 pId = STR_INSERT_GLOSSARY;
399 pId = STR_DELBOOKMARK;
402 pId = STR_INSBOOKMARK;
411 pId = STR_AUTOFORMAT;
417 pId = STR_DELETESECTION;
420 pId = STR_CHANGESECTION;
423 pId = STR_CHANGEDEFATTR;
435 pId = STR_DRAWUNGROUP;
438 pId = STR_DRAWDELETE;
447 pId = STR_TABLE_ATTR;
450 pId = STR_UNDO_TABLE_AUTOFMT;
453 pId = STR_UNDO_TABLE_INSCOL;
456 pId = STR_UNDO_TABLE_INSROW;
459 pId = STR_UNDO_TABLE_DELBOX;
462 pId = STR_UNDO_TABLE_SPLIT;
465 pId = STR_UNDO_TABLE_MERGE;
468 pId = STR_TABLE_NUMFORMAT;
471 pId = STR_INSERT_TOX;
474 pId = STR_CLEAR_TOX_RANGE;
477 pId = STR_TABLE_TBLCPYTBL;
480 pId = STR_TABLE_CPYTBL;
483 pId = STR_INS_FROM_SHADOWCRSR;
486 pId = STR_UNDO_CHAIN;
489 pId = STR_UNDO_UNCHAIN;
492 pId = STR_UNDO_FTNINFO;
495 pId = STR_UNDO_COMPAREDOC;
498 pId = STR_UNDO_SETFLYFRMFMT;
501 pId = STR_UNDO_SETRUBYATTR;
507 pId = STR_UNDO_PAGEDESC_CREATE;
510 pId = STR_UNDO_PAGEDESC;
513 pId = STR_UNDO_PAGEDESC_DELETE;
516 pId = STR_UNDO_HEADER_FOOTER;
519 pId = STR_UNDO_FIELD;
522 pId = STR_UNDO_TXTFMTCOL_CREATE;
525 pId = STR_UNDO_TXTFMTCOL_DELETE;
528 pId = STR_UNDO_TXTFMTCOL_RENAME;
531 pId = STR_UNDO_CHARFMT_CREATE;
534 pId = STR_UNDO_CHARFMT_DELETE;
537 pId = STR_UNDO_CHARFMT_RENAME;
540 pId = STR_UNDO_FRMFMT_CREATE;
543 pId = STR_UNDO_FRMFMT_DELETE;
546 pId = STR_UNDO_FRMFMT_RENAME;
549 pId = STR_UNDO_NUMRULE_CREATE;
552 pId = STR_UNDO_NUMRULE_DELETE;
555 pId = STR_UNDO_NUMRULE_RENAME;
558 pId = STR_UNDO_BOOKMARK_RENAME;
561 pId = STR_UNDO_INDEX_ENTRY_INSERT;
564 pId = STR_UNDO_INDEX_ENTRY_DELETE;
567 pId = STR_UNDO_COL_DELETE;
570 pId = STR_UNDO_ROW_DELETE;
573 pId = STR_UNDO_PAGEDESC_RENAME;
579 pId = STR_UNDO_FLYFRMFMT_TITLE;
582 pId = STR_UNDO_FLYFRMFMT_DESCRIPTION;
585 pId = STR_UNDO_TBLSTYLE_CREATE;
588 pId = STR_UNDO_TBLSTYLE_DELETE;
591 pId = STR_UNDO_TBLSTYLE_UPDATE;
594 pId = STR_REPLACE_UNDO;
597 pId = STR_INSERT_PAGE_BREAK_UNDO;
600 pId = STR_INSERT_COLUMN_BREAK_UNDO;
603 pId = STR_INSERT_ENV_UNDO;
606 pId = STR_DRAG_AND_COPY;
609 pId = STR_DRAG_AND_MOVE;
612 pId = STR_INSERT_CHART;
615 pId = STR_INSERT_FOOTNOTE;
618 pId = STR_INSERT_URLBTN;
621 pId = STR_INSERT_URLTXT;
624 pId = STR_DELETE_INVISIBLECNTNT;
627 pId = STR_REPLACE_STYLE;
630 pId = STR_DELETE_PAGE_BREAK;
633 pId = STR_TEXT_CORRECTION;
636 pId = STR_UNDO_TABLE_DELETE;
641 pId = STR_PARAGRAPH_SIGN_UNDO;
644 pId = STR_UNDO_INSERT_FORM_FIELD;
647 pId = STR_UNDO_INSERT_PAGE_NUMBER;
650 pId = STR_UNDO_UPDATE_FORM_FIELD;
653 pId = STR_UNDO_UPDATE_FORM_FIELDS;
656 pId = STR_UNDO_DELETE_FORM_FIELDS;
659 pId = STR_UPDATE_BOOKMARK;
662 pId = STR_UPDATE_BOOKMARKS;
665 pId = STR_DELETE_BOOKMARKS;
668 pId = STR_UPDATE_FIELD;
671 pId = STR_UPDATE_FIELDS;
674 pId = STR_DELETE_FIELDS;
677 pId = STR_UPDATE_SECTIONS;
680 pId = STR_UNDO_CHANGE_THEME_COLORS;
683 pId = STR_DELETE_SECTIONS;
686 pId = STR_UNDO_FLYFRMFMT_DECORATIVE;
717 aResult = aRewriter.
Apply(aResult);
744 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwUndoSaveContent"));
745 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
752 (void)xmlTextWriterEndElement(pWriter);
780 if( pCpyNd || pEndNdIdx )
801 const SwNodeOffset* pEndNdIdx,
bool const bForceCreateFrames)
810 SwPaM aPaM( rInsPos );
820 if (!pEndNdIdx && pTextNd)
830 bool bDeleteLastNode =
false;
832 bDeleteLastNode =
true;
838 bDeleteLastNode =
true;
840 if( bDeleteLastNode )
848 rNds.
Delete( rDelNode, nDelOffset );
906 const SwPosition *pStt = rMark < rPoint ? &rMark : &rPoint,
907 *pEnd = &rMark == pStt ? &rPoint : &rMark;
921 if( !rFootnoteArr.
empty() )
923 const SwNode* pFootnoteNd;
929 while(
nPos < rFootnoteArr.
size() && ( pFootnoteNd =
931 <= pEnd->GetNodeIndex() )
933 const sal_Int32 nFootnoteSttIdx = pSrch->
GetStart();
935 ? (&pEnd->GetNode() == pFootnoteNd )
936 : (( &pStt->
GetNode() == pFootnoteNd &&
938 ( &pEnd->GetNode() == pFootnoteNd &&
939 nFootnoteSttIdx >= pEnd->GetContentIndex() )) )
954 assert(pFootnoteHint);
960 while(
nPos-- && ( pFootnoteNd = &( pSrch = rFootnoteArr[
nPos ] )->
963 const sal_Int32 nFootnoteSttIdx = pSrch->
GetStart();
965 ( &pStt->
GetNode() == pFootnoteNd &&
967 ( &pEnd->GetNode() == pFootnoteNd &&
968 nFootnoteSttIdx >= pEnd->GetContentIndex() )))
979 assert(pFootnoteHint);
992 if( !rSpzArr.
empty() )
996 size_t n = rSpzArr.
size();
999 while(
n && !rSpzArr.
empty() )
1001 pFormat = rSpzArr[--
n];
1005 case RndStdIds::FLY_AS_CHAR:
1009 pAPos->
GetNode() < pEnd->GetNode() )
1010 : ( *pStt <= *pAPos && *pAPos < *pEnd )) )
1024 case RndStdIds::FLY_AT_PARA:
1036 m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
1042 & nDelContentType) &&
1063 case RndStdIds::FLY_AT_CHAR:
1071 *pAPos, *pStt, *pEnd, nDelContentType))
1073 m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
1080 if( *pStt <= *pAPos && *pAPos < *pEnd )
1096 case RndStdIds::FLY_AT_FLY:
1104 m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
1127 bool bSavePos =
false;
1128 bool bSaveOtherPos =
false;
1134 if ( pStt->
GetNode() <= pBkmk->GetMarkPos().GetNode()
1135 && pBkmk->GetMarkPos().GetNode() < pEnd->GetNode() )
1139 if ( pBkmk->IsExpanded()
1140 && pStt->
GetNode() <= pBkmk->GetOtherMarkPos().GetNode()
1141 && pBkmk->GetOtherMarkPos().GetNode() < pEnd->GetNode() )
1143 bSaveOtherPos =
true;
1157 bool bMaybe =
false;
1158 if ( *pStt <= pBkmk->GetMarkPos() && pBkmk->GetMarkPos() <= *pEnd )
1160 if ( pBkmk->GetMarkPos() == *pEnd
1161 || ( *pStt == pBkmk->GetMarkPos() && pBkmk->IsExpanded() ) )
1166 if( pBkmk->IsExpanded() &&
1167 *pStt <= pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() <= *pEnd )
1169 assert(!bSaveOtherPos);
1171 || (*pStt < pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() < *pEnd)
1181 && pEnd->GetContentIndex() == pEnd->GetNode().GetTextNode()->Len()))
1185 bSaveOtherPos =
true;
1189 if ( !bSavePos && !bSaveOtherPos
1193 const bool bDifferentTextNodesAtMarkAndPoint =
1197 if ( bDifferentTextNodesAtMarkAndPoint )
1201 if( pStt->
GetNode() == pBkmk->GetMarkPos().GetNode()
1202 && pEnd->GetContentIndex() != pEnd->GetNode().
GetTextNode()->
Len() )
1205 bSaveOtherPos =
false;
1209 else if( pEnd->GetNode() == pBkmk->GetMarkPos().GetNode() &&
1213 bSaveOtherPos =
false;
1220 const SwPosition& rAnnotationEndPos = pBkmk->GetMarkEnd();
1221 if ( *pStt < rAnnotationEndPos && rAnnotationEndPos <= *pEnd )
1224 bSaveOtherPos = pBkmk->IsExpanded();
1229 if ( bSavePos || bSaveOtherPos )
1235 m_pHistory->Add( *pBkmk, bSavePos, bSaveOtherPos );
1239 || !pBkmk->IsExpanded() ) )
1275 const SwNodeRange& rRange,
bool const bExpandNodes)
1311 if(
nullptr != pCNd )
1322 sal_uInt16 nSectType )
1341 SwDoc *
const pDoc,
const SwNode& rInsPos,
bool bForceCreateFrames)
1414#if OSL_DEBUG_LEVEL > 0
1456 const SwPaM& rRange,
1463 auto [pStt, pEnd] = rRange.
StartEnd();
1467 for ( ;
n < rTable.
size(); ++
n )
1482 if( !rSData.
empty() && bDelRange )
1486 return !rSData.
empty();
1490 const SwPaM& rRange,
1499 for ( ;
n < rTable.
size(); ++
n )
1502 if ( RedlineType::Format == pRedl->
GetType() )
1515 return !rSData.
empty();
1525 for(
size_t n = rSData.
size();
n; )
1526 rSData[ --
n ].RedlineToDoc( aPam );
1528#if OSL_DEBUG_LEVEL > 0
1531 assert(rSData.
empty() || rSData[0].m_bRedlineMoved ||
1541 for(
size_t n = rSData.
size();
n; )
1542 if( rSData[ --
n ].GetMvSttIdx() )
1550 if( rCurr.
size() != rCheck.
size() )
1553 for(
size_t n = 0;
n < rCurr.
size(); ++
n )
1567 for(
size_t n = 0;
n < rCurr.
size(); ++
n )
1579OUString
ShortenString(
const OUString & rStr, sal_Int32 nLength, std::u16string_view aFillStr)
1581 assert(
nLength - aFillStr.size() >= 2);
1583 if (rStr.getLength() <=
nLength)
1591 const sal_Int32 nBackLen =
nLength - nFrontLen;
1593 return OUString::Concat(rStr.subView(0, nFrontLen))
1595 + rStr.subView(rStr.getLength() - nBackLen);
1604 return node == rAnchorPos.
GetNode()
1616 assert(node <= rAnchorPos.
GetNode());
1651 assert(rStart <= rEnd);
1663 return (rStart < rAnchorPos) && (rAnchorPos < rEnd);
1673 return ((rStart < rAnchorPos)
1674 || (rStart == rAnchorPos
1680 && ((rAnchorPos < rEnd)
1681 || (rAnchorPos == rEnd
1692 assert(rStart <= rEnd);
1738 case RndStdIds::FLY_AT_CHAR:
1739 case RndStdIds::FLY_AT_PARA:
1743 if (pAnchorPos !=
nullptr
1744 && ((rAnchor.
GetAnchorId() == RndStdIds::FLY_AT_CHAR)
Provides access to the marks of a document.
virtual sal_Int32 getAllMarksCount() const =0
returns the number of marks.
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark, bool isMoveNodes)=0
Deletes a mark.
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
@ CROSSREF_NUMITEM_BOOKMARK
@ CROSSREF_HEADING_BOOKMARK
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
Marks a character position inside a document model content node (SwContentNode)
virtual sal_Int32 Len() const
void CorrAbs(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
IDocumentMarkAccess * getIDocumentMarkAccess()
const sw::FrameFormats< sw::SpzFrameFormat * > * GetSpzFrameFormats() const
SwDocShell * GetDocShell()
::sw::UndoManager & GetUndoManager()
bool IsInWriterfilterImport() const
bool Rollback(SwDoc *pDoc, sal_uInt16 nStart=0)
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool IsContentNode() const
const SwStartNode * StartOfSectionNode() const
SwNodeOffset EndOfSectionIndex() const
SwNoTextNode * GetNoTextNode()
const SwEndNode * EndOfSectionNode() const
void MoveRange(SwPaM &, SwPosition &, SwNodes &rNodes)
move a range
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool MoveNodes(const SwNodeRange &, SwNodes &rNodes, SwNode &rPos, bool bNewFrames=true)
move the node pointer
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
static SwStartNode * MakeEmptySection(SwNode &rWhere, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
static SwContentNode * GoPrevious(SwNodeIndex *)
SwContentNode * GoNext(SwNodeIndex *) const
SwNode & GetEndOfPostIts() const
A still empty section.
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.
std::pair< const SwPosition *, const SwPosition * > StartEnd() const
Because sometimes the cost of the operator<= can add up.
SwContentNode * GetPointContentNode() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * End() const
SwContentNode * GetMarkContentNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
const OUString & GetComment(sal_uInt16 nPos=0) const
const SwNodeIndex * GetContentIdx() const
void SetContentIdx(const SwNodeIndex &)
RedlineType GetType(sal_uInt16 nPos=0) const
friend class SwRangeRedline
bool CanCombine(const SwRedlineData &rCmp) const
const SwNodeIndex * GetMvSttIdx() const
sal_uInt16 m_nRedlineCount
void RedlineToDoc(SwPaM const &rPam)
SwRedlineSaveData(SwComparePosition eCmpPos, const SwPosition &rSttPos, const SwPosition &rEndPos, SwRangeRedline &rRedl, bool bCopyNext)
void push_back(std::unique_ptr< SwRedlineSaveData > pNew)
vector_type::size_type size_type
OUString Apply(const OUString &rStr) const
Starts a section of nodes in the document model.
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
sal_Int32 GetStart() const
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
void EraseText(const SwContentIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
SwTextAttr * GetTextAttrForCharAt(const sal_Int32 nIndex, const sal_uInt16 nWhich=RES_TXTATR_END) const
get the text attribute at position nIndex which owns the dummy character CH_TXTATR_* at that position...
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
void SetPaM(SwPaM &, bool bCorrToContent=false) const
void SetValues(const SwPaM &rPam)
static void MoveFromUndoNds(SwDoc &rDoc, SwNodeOffset nNodeIdx, SwPosition &rInsPos, const SwNodeOffset *pEndNdIdx=nullptr, bool bForceCreateFrames=false)
virtual ~SwUndoSaveContent() COVERITY_NOEXCEPT_FALSE
void DelContentIndex(const SwPosition &pMark, const SwPosition &pPoint, DelContentType nDelContentType=DelContentType::AllMask)
static void MoveToUndoNds(SwPaM &rPam, SwNodeIndex *pNodeIdx, SwNodeOffset *pEndNdIdx=nullptr)
std::unique_ptr< SwHistory > m_pHistory
static bool MovePtBackward(SwPaM &rPam)
static void MovePtForward(SwPaM &rPam, bool bMvBkwrd)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
void SaveSection(const SwNodeIndex &rSttIdx)
const SwHistory * GetHistory() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
void RestoreSection(SwDoc *pDoc, SwNodeIndex *pIdx, sal_uInt16 nSectType)
std::optional< SwNodeIndex > m_oMovedStart
virtual SwRewriter GetRewriter() const
Returns the rewriter for this object.
std::optional< OUString > maComment
virtual void UndoImpl(::sw::UndoRedoContext &)=0
SwUndo(SwUndoId const nId, const SwDoc *pDoc)
virtual void Repeat(SfxRepeatTarget &) override
virtual void Redo() override
RedlineFlags GetRedlineFlags() const
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
virtual bool CanRepeat(SfxRepeatTarget &) const override
static bool FillSaveData(const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
virtual OUString GetComment() const override
Returns textual comment for this undo object.
static void RemoveIdxRel(SwNodeOffset, const SwPosition &)
static void RemoveIdxFromRange(SwPaM &rPam, bool bMoveNext)
virtual void UndoWithContext(SfxUndoContext &) override
static bool HasHiddenRedlines(const SwRedlineSaveDatas &rSData)
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
static bool CanRedlineGroup(SwRedlineSaveDatas &rCurr, const SwRedlineSaveDatas &rCheck, bool bCurrIsEnd)
virtual void RepeatImpl(::sw::RepeatContext &)
static ViewShellId CreateViewShellId(const SwDoc *pDoc)
Try to obtain the view shell ID of the current view.
static bool FillSaveDataForFormat(const SwPaM &, SwRedlineSaveDatas &)
virtual void RedoImpl(::sw::UndoRedoContext &)=0
static void RemoveIdxFromSection(SwDoc &, SwNodeOffset nSttIdx, const SwNodeOffset *pEndIdx=nullptr)
virtual void Undo() override
bool m_isRepeatIgnored
for multi-selection, only repeat 1st selection
ViewShellId m_nViewShellId
virtual void RedoWithContext(SfxUndoContext &) override
virtual ~SwUndo() override
virtual SwCursor & CreateNewShellCursor()=0
SwNodes const & GetUndoNodes() const
IShellCursorSupplier & GetCursorSupplier()
struct _xmlTextWriter * xmlTextWriterPtr
#define suppress_fun_call_w_exception(expr)
void PaMCorrRel(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)
Sets all PaMs in OldNode to relative Pos.
#define SAL_INFO(area, stream)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
@ OverlapBehind
Pos1 overlaps Pos2 at the end.
@ CollideEnd
Pos1 end touches at Pos2 start.
@ Behind
Pos1 behind Pos2.
@ OverlapBefore
Pos1 overlaps Pos2 at the beginning.
@ Outside
Pos2 completely contained in Pos1.
@ Before
Pos1 before Pos2.
@ Inside
Pos1 completely contained in Pos2.
@ CollideStart
Pos1 start touches at Pos2 end.
@ Equal
Pos1 is as large as Pos2.
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
const SwContentNode * GetContentNode() const
SwNodeOffset GetNodeIndex() const
const SwNodes & GetNodes() const
sal_Int32 GetContentIndex() const
SwDoc & GetDoc() const
Returns the document this position is in.
OUString SwResId(TranslateId aId)
constexpr sal_Int32 COMPLETE_STRING
@ UI_DELETE_INVISIBLECNTNT
OUString ShortenString(const OUString &rStr, sal_Int32 nLength, std::u16string_view aFillStr)
Shortens a string to a maximum length.
bool IsSelectFrameAnchoredAtPara(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
is a fly anchored at paragraph at rAnchorPos selected?
static bool IsAtEndOfSection2(SwPosition const &rPos)
passed start / end position could be on section start / end node
static bool IsAtStartOfSection(SwPosition const &rAnchorPos)
static bool IsNotBackspaceHeuristic(SwPosition const &rStart, SwPosition const &rEnd)
bool IsFlySelectedByCursor(SwDoc const &rDoc, SwPosition const &rStart, SwPosition const &rEnd)
check at-char and at-para flys in rDoc
static bool IsAtStartOfSection2(SwPosition const &rPos)
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?
OUString GetUndoComment(SwUndoId eId)
static bool IsAtEndOfSection(SwPosition const &rAnchorPos)