19#ifndef INCLUDED_SW_INC_UNDOBJ_HXX
20#define INCLUDED_SW_INC_UNDOBJ_HXX
49 class UndoRedoContext;
91 virtual void Undo()
override;
92 virtual void Redo()
override;
95 virtual void Repeat(SfxRepeatTarget &)
override;
96 virtual bool CanRepeat(SfxRepeatTarget &)
const override;
127 bool bDelRange =
true,
bool bCopyNext =
true );
180 bool bForceCreateFrames =
false);
217 void SaveSection(
const SwNodeRange& rRange,
bool bExpandNodes =
true);
218 void RestoreSection(
SwDoc* pDoc,
SwNodeIndex* pIdx, sal_uInt16 nSectType );
219 void RestoreSection(
SwDoc* pDoc,
const SwNode& rInsPos,
bool bForceCreateFrames =
false);
237 void SetValues(
const SwPaM& rPam );
238 void SetPaM(
SwPaM&,
bool bCorrToContent =
false )
const;
239 SwPaM & AddUndoRedoPaM(
247std::optional<std::vector<SwFrameFormat*>>
257 std::vector< std::shared_ptr<SwUndoInsLayFormat> >
m_FlyUndos;
275 void SetInsertRange(
const SwPaM&,
bool bScanFlys =
true,
280 std::vector<SwFrameFormat*> *
GetFlysAnchoredAt() {
return m_pFrameFormats ? &*m_pFrameFormats :
nullptr; }
308 void DelFly(
SwDoc* );
334 virtual OUString GetComment()
const override;
347 void RedoForRollback();
351 virtual SwRewriter GetRewriter()
const override;
Marks a node in the document model.
Base class of the Writer document model elements.
PaM is Point and Mark: a selection of the document model.
Represents the style of a paragraph.
SwNodeOffset m_nNodePagePos
SwFrameFormat * m_pFrameFormat
SwNodeOffset GetMvNodeCnt() const
const SwNodeIndex * GetMvSttIdx() const
Undo for Insert -> Text from file.
std::vector< std::shared_ptr< SwUndoInsLayFormat > > m_FlyUndos
SwNodeOffset m_nDeleteTextNodes
std::optional< SwNodeIndex > m_oUndoNodeIndex
start of Content in UndoNodes for Redo
SwTextFormatColl * m_pLastNodeColl
std::vector< SwFrameFormat * > * GetFlysAnchoredAt()
std::unique_ptr< SwRedlineData > m_pRedlineData
std::optional< std::vector< SwFrameFormat * > > m_pFrameFormats
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
const SwHistory * GetHistory() const
std::unique_ptr< SwRedlineSaveDatas > m_pRedlineSaveData
const SwNodeIndex * GetMvSttIdx() const
std::optional< SwNodeIndex > m_oMovedStart
SwNodeOffset GetMvNodeCnt() const
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)
void SetRedlineFlags(RedlineFlags eMode)
virtual void Repeat(SfxRepeatTarget &) override
virtual void Redo() override
RedlineFlags m_nOrigRedlineFlags
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
struct _xmlTextWriter * xmlTextWriterPtr
Dialog to specify the properties of date form field.
std::optional< std::vector< SwFrameFormat * > > GetFlysAnchoredAt(SwDoc &rDoc, SwNodeOffset const nSttNode)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Marks a position in the document model.
bool IsFlySelectedByCursor(SwDoc const &rDoc, SwPosition const &rStart, SwPosition const &rEnd)
check at-char and at-para flys in rDoc
struct _xmlTextWriter * xmlTextWriterPtr
bool IsSelectFrameAnchoredAtPara(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType=DelContentType::AllMask)
is a fly anchored at paragraph at rAnchorPos selected?
bool IsDestroyFrameAnchoredAtChar(SwPosition const &rAnchorPos, SwPosition const &rStart, SwPosition const &rEnd, DelContentType const nDelContentType=DelContentType::AllMask)
will DelContentIndex destroy a frame anchored at character at rAnchorPos?