20 #include <libxml/xmlwriter.h>
28 #include <UndoManager.hxx>
41 #include <strings.hrc>
49 : m_nSttNode( 0 ), m_nEndNode( 0 ), m_nSttContent( 0 ), m_nEndContent( 0 )
87 else if( bCorrToContent )
102 else if( bCorrToContent )
112 SetPaM( rPaM, bCorrToContent );
121 : aIdx.GetNode().EndOfSectionIndex() );
163 , m_nViewShellId(CreateViewShellId(pDoc))
164 , m_isRepeatIgnored(false)
165 , m_bCacheComment(true)
175 if (
const SwView* pView = pDocShell->GetView())
176 nRet = pView->GetViewShellId();
194 class UndoRedoRedlineGuard
198 : m_rRedlineAccess(rContext.GetDoc().getIDocumentRedlineAccess())
199 , m_eMode(m_rRedlineAccess.GetRedlineFlags())
204 m_rRedlineAccess.SetRedlineFlags( eTmpMode );
208 ~UndoRedoRedlineGuard()
210 m_rRedlineAccess.SetRedlineFlags(m_eMode);
232 dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
234 const UndoRedoRedlineGuard aUndoRedoRedlineGuard(*pContext, *
this);
241 dynamic_cast< ::sw::UndoRedoContext * >(& rContext));
243 const UndoRedoRedlineGuard aUndoRedoRedlineGuard(*pContext, *
this);
254 dynamic_cast< ::sw::RepeatContext * >(& rContext));
261 assert(dynamic_cast< ::sw::RepeatContext * >(& rContext));
273 const char *pId =
nullptr;
283 pId = STR_DELETE_UNDO;
286 pId = STR_INSERT_UNDO;
292 pId = STR_SPLITNODE_UNDO;
295 pId = STR_INSATTR_UNDO;
298 pId = STR_SETFMTCOLL_UNDO;
301 pId = STR_RESET_ATTR_UNDO;
304 pId = STR_INSFMT_ATTR_UNDO;
307 pId = STR_INSERT_DOC_UNDO;
313 pId = STR_INSTABLE_UNDO;
316 pId = STR_TABLETOTEXT_UNDO;
319 pId = STR_TEXTTOTABLE_UNDO;
328 pId = STR_TABLEHEADLINE;
331 pId = STR_INSERTSECTION;
334 pId = STR_OUTLINE_LR;
337 pId = STR_OUTLINE_UD;
349 pId = STR_INSERTDRAW;
352 pId = STR_NUMORNONUM;
355 pId = STR_INC_LEFTMARGIN;
358 pId = STR_DEC_LEFTMARGIN;
361 pId = STR_INSERTLABEL;
364 pId = STR_SETNUMRULESTART;
370 SAL_INFO(
"sw.core",
"Should NEVER be used/translated");
373 pId = STR_ACCEPT_REDLINE;
376 pId = STR_REJECT_REDLINE;
379 pId = STR_SPLIT_TABLE;
382 pId = STR_DONTEXPAND;
385 pId = STR_AUTOCORRECT;
388 pId = STR_MERGE_TABLE;
391 pId = STR_TRANSLITERATE;
394 pId = STR_PASTE_CLIPBOARD_UNDO;
397 pId = STR_TYPING_UNDO;
403 pId = STR_INSERT_GLOSSARY;
406 pId = STR_DELBOOKMARK;
409 pId = STR_INSBOOKMARK;
418 pId = STR_AUTOFORMAT;
424 pId = STR_DELETESECTION;
427 pId = STR_CHANGESECTION;
430 pId = STR_CHANGEDEFATTR;
442 pId = STR_DRAWUNGROUP;
445 pId = STR_DRAWDELETE;
454 pId = STR_TABLE_ATTR;
457 pId = STR_UNDO_TABLE_AUTOFMT;
460 pId = STR_UNDO_TABLE_INSCOL;
463 pId = STR_UNDO_TABLE_INSROW;
466 pId = STR_UNDO_TABLE_DELBOX;
469 pId = STR_UNDO_TABLE_SPLIT;
472 pId = STR_UNDO_TABLE_MERGE;
475 pId = STR_TABLE_NUMFORMAT;
478 pId = STR_INSERT_TOX;
481 pId = STR_CLEAR_TOX_RANGE;
484 pId = STR_TABLE_TBLCPYTBL;
487 pId = STR_TABLE_CPYTBL;
490 pId = STR_INS_FROM_SHADOWCRSR;
493 pId = STR_UNDO_CHAIN;
496 pId = STR_UNDO_UNCHAIN;
499 pId = STR_UNDO_FTNINFO;
502 pId = STR_UNDO_COMPAREDOC;
505 pId = STR_UNDO_SETFLYFRMFMT;
508 pId = STR_UNDO_SETRUBYATTR;
514 pId = STR_UNDO_PAGEDESC_CREATE;
517 pId = STR_UNDO_PAGEDESC;
520 pId = STR_UNDO_PAGEDESC_DELETE;
523 pId = STR_UNDO_HEADER_FOOTER;
526 pId = STR_UNDO_FIELD;
529 pId = STR_UNDO_TXTFMTCOL_CREATE;
532 pId = STR_UNDO_TXTFMTCOL_DELETE;
535 pId = STR_UNDO_TXTFMTCOL_RENAME;
538 pId = STR_UNDO_CHARFMT_CREATE;
541 pId = STR_UNDO_CHARFMT_DELETE;
544 pId = STR_UNDO_CHARFMT_RENAME;
547 pId = STR_UNDO_FRMFMT_CREATE;
550 pId = STR_UNDO_FRMFMT_DELETE;
553 pId = STR_UNDO_FRMFMT_RENAME;
556 pId = STR_UNDO_NUMRULE_CREATE;
559 pId = STR_UNDO_NUMRULE_DELETE;
562 pId = STR_UNDO_NUMRULE_RENAME;
565 pId = STR_UNDO_BOOKMARK_RENAME;
568 pId = STR_UNDO_INDEX_ENTRY_INSERT;
571 pId = STR_UNDO_INDEX_ENTRY_DELETE;
574 pId = STR_UNDO_COL_DELETE;
577 pId = STR_UNDO_ROW_DELETE;
580 pId = STR_UNDO_PAGEDESC_RENAME;
586 pId = STR_UNDO_FLYFRMFMT_TITLE;
589 pId = STR_UNDO_FLYFRMFMT_DESCRIPTION;
592 pId = STR_UNDO_TBLSTYLE_CREATE;
595 pId = STR_UNDO_TBLSTYLE_DELETE;
598 pId = STR_UNDO_TBLSTYLE_UPDATE;
601 pId = STR_REPLACE_UNDO;
604 pId = STR_INSERT_PAGE_BREAK_UNDO;
607 pId = STR_INSERT_COLUMN_BREAK_UNDO;
610 pId = STR_INSERT_ENV_UNDO;
613 pId = STR_DRAG_AND_COPY;
616 pId = STR_DRAG_AND_MOVE;
619 pId = STR_INSERT_CHART;
622 pId = STR_INSERT_FOOTNOTE;
625 pId = STR_INSERT_URLBTN;
628 pId = STR_INSERT_URLTXT;
631 pId = STR_DELETE_INVISIBLECNTNT;
634 pId = STR_REPLACE_STYLE;
637 pId = STR_DELETE_PAGE_BREAK;
640 pId = STR_TEXT_CORRECTION;
643 pId = STR_UNDO_TABLE_DELETE;
648 pId = STR_PARAGRAPH_SIGN_UNDO;
651 pId = STR_UNDO_INSERT_FORM_FIELD;
682 aResult = aRewriter.
Apply(aResult);
709 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SwUndoSaveContent"));
710 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
717 xmlTextWriterEndElement(pWriter);
745 if( pCpyNd || pEndNdIdx )
757 *pEndNdIdx = aPos.nNode.GetIndex();
760 aPos.nNode = nTmpMvNode;
762 *pNodeIdx = aPos.nNode;
767 const sal_uLong* pEndNdIdx,
bool const bForceCreateFrames)
776 SwPaM aPaM( rInsPos );
778 aPaM.GetPoint()->nNode.Assign( rNds, *pEndNdIdx );
786 if (!pEndNdIdx && pTextNd)
789 aPaM.GetPoint()->nNode = nNodeIdx;
790 aPaM.GetPoint()->nContent.Assign(aPaM.GetContentNode(), 0);
797 if( !aPaM.GetPoint()->nContent.GetIndex() ||
798 ( aPaM.GetPoint()->nNode++ &&
801 aPaM.GetPoint()->nContent.Assign(
nullptr, 0 );
803 rNds.
Delete( aPaM.GetPoint()->nNode,
805 aPaM.GetPoint()->nNode.GetIndex() );
866 const SwPosition *pStt = rMark < rPoint ? &rMark : &rPoint,
867 *pEnd = &rMark == pStt ? &rPoint : &rMark;
881 if( !rFootnoteArr.
empty() )
883 const SwNode* pFootnoteNd;
889 while( nPos < rFootnoteArr.
size() && ( pFootnoteNd =
890 &( pSrch = rFootnoteArr[ nPos ] )->GetTextNode())->GetIndex()
891 <= pEnd->nNode.GetIndex() )
893 const sal_Int32 nFootnoteSttIdx = pSrch->
GetStart();
895 ? (&pEnd->nNode.GetNode() == pFootnoteNd )
898 ( &pEnd->nNode.GetNode() == pFootnoteNd &&
899 nFootnoteSttIdx >= pEnd->nContent.
GetIndex() )) )
915 SwIndex aIdx( pTextNd, nFootnoteSttIdx );
920 while( nPos-- && ( pFootnoteNd = &( pSrch = rFootnoteArr[ nPos ] )->
923 const sal_Int32 nFootnoteSttIdx = pSrch->
GetStart();
927 ( &pEnd->nNode.GetNode() == pFootnoteNd &&
928 nFootnoteSttIdx >= pEnd->nContent.
GetIndex() )))
940 SwIndex aIdx( pTextNd, nFootnoteSttIdx );
952 if( !rSpzArr.
empty() )
956 size_t n = rSpzArr.
size();
959 while( n && !rSpzArr.
empty() )
961 pFormat = rSpzArr[--n];
965 case RndStdIds::FLY_AS_CHAR:
969 pAPos->
nNode < pEnd->nNode )
970 : ( *pStt <= *pAPos && *pAPos < *pEnd )) )
981 n = n >= rSpzArr.
size() ? rSpzArr.
size() : n+1;
984 case RndStdIds::FLY_AT_PARA:
996 m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
998 n = n >= rSpzArr.
size() ? rSpzArr.
size() : n+1;
1002 & nDelContentType) &&
1019 case RndStdIds::FLY_AT_CHAR:
1027 *pAPos, *pStt, *pEnd, nDelContentType))
1029 m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
1030 n = n >= rSpzArr.
size() ? rSpzArr.
size() : n+1;
1036 if( *pStt <= *pAPos && *pAPos < *pEnd )
1052 case RndStdIds::FLY_AT_FLY:
1060 m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
1063 n = n >= rSpzArr.
size() ? rSpzArr.
size() : n+1;
1083 bool bSavePos =
false;
1084 bool bSaveOtherPos =
false;
1090 if ( pStt->
nNode <= pBkmk->GetMarkPos().nNode
1091 && pBkmk->GetMarkPos().nNode < pEnd->nNode )
1095 if ( pBkmk->IsExpanded()
1096 && pStt->
nNode <= pBkmk->GetOtherMarkPos().nNode
1097 && pBkmk->GetOtherMarkPos().nNode < pEnd->nNode )
1099 bSaveOtherPos =
true;
1113 bool bMaybe =
false;
1114 if ( *pStt <= pBkmk->GetMarkPos() && pBkmk->GetMarkPos() <= *pEnd )
1116 if ( pBkmk->GetMarkPos() == *pEnd
1117 || ( *pStt == pBkmk->GetMarkPos() && pBkmk->IsExpanded() ) )
1122 if( pBkmk->IsExpanded() &&
1123 *pStt <= pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() <= *pEnd )
1127 || (*pStt < pBkmk->GetOtherMarkPos() && pBkmk->GetOtherMarkPos() < *pEnd)
1136 bSaveOtherPos =
true;
1140 if ( !bSavePos && !bSaveOtherPos
1141 && dynamic_cast< const ::sw::mark::CrossRefBookmark* >(pBkmk) )
1144 const bool bDifferentTextNodesAtMarkAndPoint =
1148 if ( bDifferentTextNodesAtMarkAndPoint )
1152 if( pStt->
nNode == pBkmk->GetMarkPos().nNode
1153 && pEnd->nContent.
GetIndex() != pEnd->nNode.GetNode().GetTextNode()->Len() )
1156 bSaveOtherPos =
false;
1160 else if( pEnd->nNode == pBkmk->GetMarkPos().nNode &&
1164 bSaveOtherPos =
false;
1171 const SwPosition& rAnnotationEndPos = pBkmk->GetMarkEnd();
1172 if ( *pStt < rAnnotationEndPos && rAnnotationEndPos <= *pEnd )
1175 bSaveOtherPos = pBkmk->IsExpanded();
1180 if ( bSavePos || bSaveOtherPos )
1186 m_pHistory->Add( *pBkmk, bSavePos, bSaveOtherPos );
1190 || !pBkmk->IsExpanded() ) )
1201 : m_nMoveLen( 0 ), m_nStartPos( ULONG_MAX )
1225 const SwNodeRange& rRange,
bool const bExpandNodes)
1261 if(
nullptr != pCNd )
1272 sal_uInt16 nSectType )
1282 static_cast<SwStartNodeType>(nSectType) );
1364 #if OSL_DEBUG_LEVEL > 0
1405 const SwPaM& rRange,
1417 for ( ; n < rTable.
size(); ++n )
1432 if( !rSData.
empty() && bDelRange )
1436 return !rSData.
empty();
1440 const SwPaM& rRange,
1449 for ( ; n < rTable.
size(); ++n )
1452 if ( RedlineType::Format == pRedl->
GetType() )
1465 return !rSData.
empty();
1475 for(
size_t n = rSData.
size();
n; )
1476 rSData[ --
n ].RedlineToDoc( aPam );
1478 #if OSL_DEBUG_LEVEL > 0
1490 for(
size_t n = rSData.
size();
n; )
1491 if( rSData[ --
n ].GetMvSttIdx() )
1499 if( rCurr.
size() != rCheck.
size() )
1502 for(
size_t n = 0;
n < rCurr.
size(); ++
n )
1516 for(
size_t n = 0;
n < rCurr.
size(); ++
n )
1528 OUString
ShortenString(
const OUString & rStr, sal_Int32 nLength,
const OUString & rFillStr)
1530 assert(nLength - rFillStr.getLength() >= 2);
1532 if (rStr.getLength() <= nLength)
1535 nLength -= rFillStr.getLength();
1539 const sal_Int32 nFrontLen = nLength - nLength / 2;
1540 const sal_Int32 nBackLen = nLength - nFrontLen;
1542 return rStr.subView(0, nFrontLen)
1544 + rStr.subView(rStr.getLength() - nBackLen);
1553 return node == rAnchorPos.
nNode
1565 assert(node <= rAnchorPos.
nNode);
1566 return node == rAnchorPos.
nNode && rAnchorPos.
nContent == 0;
1607 return (rStart < rAnchorPos) && (rAnchorPos < rEnd);
1617 return ((rStart < rAnchorPos)
1618 || (rStart == rAnchorPos
1624 && ((rAnchorPos < rEnd)
1625 || (rAnchorPos == rEnd
1680 switch (rAnchor.GetAnchorId())
1682 case RndStdIds::FLY_AT_CHAR:
1683 case RndStdIds::FLY_AT_PARA:
1685 SwPosition const*
const pAnchorPos(rAnchor.GetContentAnchor());
1687 if (pAnchorPos !=
nullptr
1688 && ((rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR)
static bool IsAtEndOfSection(SwPosition const &rAnchorPos)
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
SwPaM & AddUndoRedoPaM(::sw::UndoRedoContext &, bool const bCorrToContent=false) const
virtual sal_Int32 Len() const
sal_uLong GetIndex() const
SwNode & GetNode(bool bPoint=true) const
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
Marks a position in the document model.
std::unique_ptr< SwHistory > m_pHistory
SwNodes const & GetUndoNodes() const
void SetContentIdx(const SwNodeIndex *)
SwComparePosition ComparePosition(const T &rStt1, const T &rEnd1, const T &rStt2, const T &rEnd2)
static bool IsAtStartOfSection(SwPosition const &rAnchorPos)
SwDocShell * GetDocShell()
virtual SwPaM & CreateNewShellCursor()=0
virtual AppendResult AppendRedline(SwRangeRedline *pNewRedl, bool bCallDelete)=0
Append a new redline.
bool Rollback(SwDoc *pDoc, sal_uInt16 nStart=0)
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
static bool FillSaveDataForFormat(const SwPaM &, SwRedlineSaveDatas &)
virtual void Repeat(SfxRepeatTarget &) override
virtual sal_Int32 Len() const override
Pos1 is as large as Pos2.
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
const SwPosition * GetMark() const
Pos1 completely contained in Pos2.
static ViewShellId CreateViewShellId(const SwDoc *pDoc)
Try to obtain the view shell ID of the current view.
Provides access to the marks of a document.
virtual ~SwUndoSaveContent() COVERITY_NOEXCEPT_FALSE
SwRedlineSaveData(SwComparePosition eCmpPos, const SwPosition &rSttPos, const SwPosition &rEndPos, SwRangeRedline &rRedl, bool bCopyNext)
static SwContentNode * GoPrevious(SwNodeIndex *)
static bool IsAtStartOfSection2(SwPosition const &rPos)
bool IsSelectFrameAnchoredAtPara(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
is a fly anchored at paragraph at rAnchorPos selected?
const SwHistory * GetHistory() const
IDocumentMarkAccess * getIDocumentMarkAccess()
IDocumentUndoRedo & GetIDocumentUndoRedo()
SwNode & GetEndOfPostIts() const
A still empty section.
static void RemoveIdxFromSection(SwDoc &, sal_uLong nSttIdx, const sal_uLong *pEndIdx=nullptr)
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?
virtual void RepeatImpl(::sw::RepeatContext &)
bool CanCombine(const SwRedlineData &rCmp) const
const SwFrameFormats * GetSpzFrameFormats() const
IShellCursorSupplier & GetCursorSupplier()
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
void push_back(std::unique_ptr< SwRedlineSaveData, o3tl::default_delete< SwRedlineSaveData >> pNew)
SwContentNode * GetContentNode(bool bPoint=true) const
void SetValues(const SwPaM &rPam)
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...
Pos1 end touches at Pos2 start.
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
sal_uInt16 m_nRedlineCount
SwNodeIndex * GetMvSttIdx() const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
sal_uLong GetIndex() const
sal_Int32 GetStart() const
virtual SwRewriter GetRewriter() const
Returns the rewriter for this object.
Pos2 completely contained in Pos1.
static bool CanRedlineGroup(SwRedlineSaveDatas &rCurr, const SwRedlineSaveDatas &rCheck, bool bCurrIsEnd)
static void MoveToUndoNds(SwPaM &rPam, SwNodeIndex *pNodeIdx, sal_uLong *pEndNdIdx=nullptr)
static void RemoveIdxFromRange(SwPaM &rPam, bool bMoveNext)
virtual bool CanRepeat(SfxRepeatTarget &) const override
RedlineFlags GetRedlineFlags() const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
virtual std::unique_ptr< ILazyDeleter > deleteMark(const IDocumentMarkAccess::const_iterator_t &ppMark)=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.
bool IsContentNode() const
static void MovePtForward(SwPaM &rPam, bool bMvBkwrd)
PaM is Point and Mark: a selection of the document model.
struct _xmlTextWriter * xmlTextWriterPtr
virtual void UndoImpl(::sw::UndoRedoContext &)=0
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
static bool IsNotBackspaceHeuristic(SwPosition const &rStart, SwPosition const &rEnd)
::sw::UndoManager & GetUndoManager()
static bool HasHiddenRedlines(const SwRedlineSaveDatas &rSData)
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
Pos1 start touches at Pos2 end.
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
void DelContentIndex(const SwPosition &pMark, const SwPosition &pPoint, DelContentType nDelContentType=DelContentType::AllMask)
SwIndex & Assign(SwIndexReg *, sal_Int32)
OUString Apply(const OUString &rStr) const
OUString ShortenString(const OUString &rStr, sal_Int32 nLength, const OUString &rFillStr)
Shortens a string to a maximum length.
static void SetSaveData(SwDoc &rDoc, SwRedlineSaveDatas &rSData)
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
SwContentNode * GetContentNode()
vector_type::size_type size_type
void MakeStartIndex(SwIndex *pIdx)
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
SwNoTextNode * GetNoTextNode()
ViewShellId m_nViewShellId
virtual void UndoWithContext(SfxUndoContext &) override
Marks a character position inside a document model node.
void PaMCorrRel(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset)
Sets all PaMs in OldNode to relative Pos.
std::optional< OUString > maComment
Marks a node in the document model.
SwNodes & GetNodes()
Node is in which nodes-array/doc?
static bool MovePtBackward(SwPaM &rPam)
OUString SwResId(const char *pId)
virtual OUString GetComment() const override
Returns textual comment for this undo object.
std::unique_ptr< SwNodeIndex > m_pMovedStart
const SwPosition * Start() const
void RedlineToDoc(SwPaM const &rPam)
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
const OUString & GetComment(sal_uInt16 nPos=0) const
void EraseText(const SwIndex &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...
SwTextNode is a paragraph in the document model.
void RestoreSection(SwDoc *pDoc, SwNodeIndex *pIdx, sal_uInt16 nSectType)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void SetPaM(SwPaM &, bool bCorrToContent=false) const
static void MoveFromUndoNds(SwDoc &rDoc, sal_uLong nNodeIdx, SwPosition &rInsPos, const sal_uLong *pEndNdIdx=nullptr, bool bForceCreateFrames=false)
virtual sal_Int32 getAllMarksCount() const =0
returns the number of marks.
void CorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
Pos1 overlaps Pos2 at the end.
const SwNodes & GetNodes() const
virtual ~SwUndo() override
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
#define SAL_INFO(area, stream)
sal_Int32 GetIndex() const
SwUndo(SwUndoId const nId, const SwDoc *pDoc)
const SwPosition * End() const
SwDoc & GetDoc() const
Returns the document this position is in.
bool m_isRepeatIgnored
for multi-selection, only repeat 1st selection
RedlineType GetType(sal_uInt16 nPos=0) const
virtual void Redo() override
virtual void RedoWithContext(SfxUndoContext &) override
static void RemoveIdxRel(sal_uLong, const SwPosition &)
SwMoveFnCollection const & fnMoveBackward
friend class SwRangeRedline
virtual void RedoImpl(::sw::UndoRedoContext &)=0
OUString GetUndoComment(SwUndoId eId)
virtual void Undo() override
SwFootnoteIdxs & GetFootnoteIdxs()
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
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.
static bool FillSaveData(const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
virtual const SwRedlineTable & GetRedlineTable() const =0
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
const SwIndexReg * GetIdxReg() const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
void SaveSection(const SwNodeIndex &rSttIdx)
SwNodeIndex * GetContentIdx() const
const sal_Int32 COMPLETE_STRING
Pos1 overlaps Pos2 at the beginning.
bool IsInWriterfilterImport() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
static bool IsAtEndOfSection2(SwPosition const &rPos)
passed start / end position could be on section start / end node
bool MoveNodes(const SwNodeRange &, SwNodes &rNodes, const SwNodeIndex &, bool bNewFrames=true)
move the node pointer
static SwStartNode * MakeEmptySection(const SwNodeIndex &rIdx, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
Base class of the Writer document model elements.
void MoveRange(SwPaM &, SwPosition &, SwNodes &rNodes)
move a range