LibreOffice Module sw (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SwUndo Class Referenceabstract

#include <undobj.hxx>

Inheritance diagram for SwUndo:
[legend]
Collaboration diagram for SwUndo:
[legend]

Public Member Functions

virtual void UndoImpl (::sw::UndoRedoContext &)=0
 
virtual void RedoImpl (::sw::UndoRedoContext &)=0
 
 SwUndo (SwUndoId const nId, const SwDoc *pDoc)
 
virtual ~SwUndo () override
 
SwUndoId GetId () const
 
virtual OUString GetComment () const override
 Returns textual comment for this undo object. More...
 
ViewShellId GetViewShellId () const override
 See SfxUndoAction::GetViewShellId(). More...
 
RedlineFlags GetRedlineFlags () const
 
void SetRedlineFlags (RedlineFlags eMode)
 
bool IsDelBox () const
 
void IgnoreRepeat ()
 
- Public Member Functions inherited from SfxUndoAction
 SfxUndoAction ()
 
virtual ~SfxUndoAction () COVERITY_NOEXCEPT_FALSE
 
virtual void Undo ()
 
virtual void UndoWithContext (SfxUndoContext &i_context)
 
virtual void Redo ()
 
virtual void RedoWithContext (SfxUndoContext &i_context)
 
virtual void Repeat (SfxRepeatTarget &)
 
virtual bool CanRepeat (SfxRepeatTarget &) const
 
virtual bool Merge (SfxUndoAction *pNextAction)
 
virtual OUString GetComment () const
 
virtual OUString GetRepeatComment (SfxRepeatTarget &) const
 
virtual ViewShellId GetViewShellId () const
 
const DateTimeGetDateTime () const
 
virtual void dumpAsXml (xmlTextWriterPtr pWriter) const
 

Static Public Member Functions

static bool FillSaveData (const SwPaM &rRange, SwRedlineSaveDatas &rSData, bool bDelRange=true, bool bCopyNext=true)
 
static bool FillSaveDataForFormat (const SwPaM &, SwRedlineSaveDatas &)
 
static void SetSaveData (SwDoc &rDoc, SwRedlineSaveDatas &rSData)
 
static bool HasHiddenRedlines (const SwRedlineSaveDatas &rSData)
 

Protected Member Functions

virtual SwRewriter GetRewriter () const
 Returns the rewriter for this object. More...
 
virtual void RepeatImpl (::sw::RepeatContext &)
 

Static Protected Member Functions

static void RemoveIdxFromSection (SwDoc &, SwNodeOffset nSttIdx, const SwNodeOffset *pEndIdx=nullptr)
 
static void RemoveIdxFromRange (SwPaM &rPam, bool bMoveNext)
 
static void RemoveIdxRel (SwNodeOffset, const SwPosition &)
 
static bool CanRedlineGroup (SwRedlineSaveDatas &rCurr, const SwRedlineSaveDatas &rCheck, bool bCurrIsEnd)
 

Protected Attributes

bool m_bCacheComment
 
std::optional< OUString > maComment
 

Private Member Functions

virtual void Undo () override
 
virtual void Redo () override
 
virtual void UndoWithContext (SfxUndoContext &) override
 
virtual void RedoWithContext (SfxUndoContext &) override
 
virtual void Repeat (SfxRepeatTarget &) override
 
virtual bool CanRepeat (SfxRepeatTarget &) const override
 

Static Private Member Functions

static ViewShellId CreateViewShellId (const SwDoc *pDoc)
 Try to obtain the view shell ID of the current view. More...
 

Private Attributes

SwUndoId const m_nId
 
RedlineFlags m_nOrigRedlineFlags
 
ViewShellId m_nViewShellId
 
bool m_isRepeatIgnored
 for multi-selection, only repeat 1st selection More...
 

Detailed Description

Definition at line 53 of file undobj.hxx.

Constructor & Destructor Documentation

◆ SwUndo()

SwUndo::SwUndo ( SwUndoId const  nId,
const SwDoc pDoc 
)

Definition at line 151 of file undobj.cxx.

References nId.

◆ ~SwUndo()

SwUndo::~SwUndo ( )
overridevirtual

Definition at line 178 of file undobj.cxx.

Member Function Documentation

◆ CanRedlineGroup()

bool SwUndo::CanRedlineGroup ( SwRedlineSaveDatas rCurr,
const SwRedlineSaveDatas rCheck,
bool  bCurrIsEnd 
)
staticprotected

◆ CanRepeat()

bool SwUndo::CanRepeat ( SfxRepeatTarget &  rContext) const
overrideprivatevirtual

Reimplemented from SfxUndoAction.

Definition at line 249 of file undobj.cxx.

References GetId(), REPEAT_END, and REPEAT_START.

◆ CreateViewShellId()

ViewShellId SwUndo::CreateViewShellId ( const SwDoc pDoc)
staticprivate

Try to obtain the view shell ID of the current view.

Definition at line 159 of file undobj.cxx.

References SwDoc::GetDocShell().

◆ FillSaveData()

bool SwUndo::FillSaveData ( const SwPaM rRange,
SwRedlineSaveDatas rSData,
bool  bDelRange = true,
bool  bCopyNext = true 
)
static

◆ FillSaveDataForFormat()

bool SwUndo::FillSaveDataForFormat ( const SwPaM rRange,
SwRedlineSaveDatas rSData 
)
static

◆ GetComment()

OUString SwUndo::GetComment ( ) const
overridevirtual

Returns textual comment for this undo object.

The textual comment is created from the resource string corresponding to this object's ID. The rewriter of this object is applied to the resource string to get the final comment.

Returns
textual comment for this undo object

Reimplemented from SfxUndoAction.

Reimplemented in SwUndoInsLayFormat, and SwSdrUndo.

Definition at line 694 of file undobj.cxx.

References SwRewriter::Apply(), GetId(), GetRewriter(), GetUndoComment(), m_bCacheComment, and maComment.

Referenced by SwUndoInsLayFormat::GetComment(), and lcl_dbg_out().

◆ GetId()

SwUndoId SwUndo::GetId ( ) const
inline

◆ GetRedlineFlags()

RedlineFlags SwUndo::GetRedlineFlags ( ) const
inline

◆ GetRewriter()

SwRewriter SwUndo::GetRewriter ( ) const
protectedvirtual

◆ GetViewShellId()

ViewShellId SwUndo::GetViewShellId ( ) const
overridevirtual

See SfxUndoAction::GetViewShellId().

Reimplemented from SfxUndoAction.

Definition at line 723 of file undobj.cxx.

References m_nViewShellId.

◆ HasHiddenRedlines()

bool SwUndo::HasHiddenRedlines ( const SwRedlineSaveDatas rSData)
static

Definition at line 1539 of file undobj.cxx.

References n, and SwRedlineSaveDatas::size().

Referenced by SwUndoRedline::SwUndoRedline().

◆ IgnoreRepeat()

void SwUndo::IgnoreRepeat ( )
inline

Definition at line 131 of file undobj.hxx.

References m_isRepeatIgnored.

Referenced by sw::UndoManager::AddUndoAction().

◆ IsDelBox()

bool SwUndo::IsDelBox ( ) const

◆ Redo()

void SwUndo::Redo ( )
overrideprivatevirtual

Reimplemented from SfxUndoAction.

Definition at line 214 of file undobj.cxx.

◆ RedoImpl()

virtual void SwUndo::RedoImpl ( ::sw::UndoRedoContext )
pure virtual

Implemented in SwUndoFieldFromDoc, SwUndoFieldFromAPI, SwUndoInserts, SwUndoInsLayFormat, SwUndoDelLayFormat, SwUndoParagraphSigning, SwUndoFormatCreate, SwUndoFormatDelete, SwUndoRenameFormat, SwUndoNumruleCreate, SwUndoNumruleDelete, SwUndoNumruleRename, SwUndoPageDesc, SwUndoPageDescCreate, SwUndoPageDescDelete, SwUndoTOXChange, SwUndoAttr, SwUndoResetAttr, SwUndoFormatAttr, SwUndoFormatResetAttr, SwUndoDontExpandFormat, SwUndoMoveLeftMargin, SwUndoDefaultAttr, SwUndoChangeFootNote, SwUndoFootNoteInfo, SwUndoEndNoteInfo, SwUndoInsBookmark, SwUndoDeleteBookmark, SwUndoRenameBookmark, SwUndoInsNoTextFieldmark, SwUndoDelNoTextFieldmark, SwUndoInsTextFieldmark, SwUndoDelTextFieldmark, SwUndoFormatColl, SwUndoSetFlyFormat, SwUndoOutlineLeftRight, SwUndoOutlineEdit, SwUndoDelete, SwSdrUndo, SwUndoDrawGroup, SwUndoDrawUnGroup, SwUndoDrawUnGroupConnectToLayout, SwUndoDrawDelete, SwUndoFlyStrAttr, SwUndoFlyDecorative, SwUndoInsert, SwUndoReplace, SwUndoReRead, SwUndoInsertLabel, SwUndoInsNum, SwUndoDelNum, SwUndoMoveNum, SwUndoNumUpDown, SwUndoNumOrNoNum, SwUndoNumRuleStart, SwUndoOverwrite, SwUndoTransliterate, SwUndoRedline, SwUndoCompDoc, SwUndoInsSection, SwUndoUpdateIndex, SwUndoSort, SwUndoSplitNode, SwUndoMove, SwUndoInsTable, SwUndoTextToTable, SwUndoTableToText, SwUndoAttrTable, SwUndoTableAutoFormat, SwUndoTableNdsChg, SwUndoTableMerge, SwUndoTableNumFormat, SwUndoTableCpyTable, SwUndoCpyTable, SwUndoSplitTable, SwUndoMergeTable, SwUndoTableHeadline, SwUndoTableStyleMake, SwUndoTableStyleDelete, SwUndoTableStyleUpdate, and SwUndoDelSection.

Referenced by RedoWithContext().

◆ RedoWithContext()

void SwUndo::RedoWithContext ( SfxUndoContext rContext)
overrideprivatevirtual

Reimplemented from SfxUndoAction.

Definition at line 228 of file undobj.cxx.

References RedoImpl().

◆ RemoveIdxFromRange()

void SwUndo::RemoveIdxFromRange ( SwPaM rPam,
bool  bMoveNext 
)
staticprotected

◆ RemoveIdxFromSection()

void SwUndo::RemoveIdxFromSection ( SwDoc rDoc,
SwNodeOffset  nSttIdx,
const SwNodeOffset pEndIdx = nullptr 
)
staticprotected

◆ RemoveIdxRel()

void SwUndo::RemoveIdxRel ( SwNodeOffset  nIdx,
const SwPosition rPos 
)
staticprotected

◆ Repeat()

void SwUndo::Repeat ( SfxRepeatTarget &  rContext)
overrideprivatevirtual

Reimplemented from SfxUndoAction.

Definition at line 237 of file undobj.cxx.

References m_isRepeatIgnored, and RepeatImpl().

◆ RepeatImpl()

void SwUndo::RepeatImpl ( ::sw::RepeatContext )
protectedvirtual

◆ SetRedlineFlags()

void SwUndo::SetRedlineFlags ( RedlineFlags  eMode)
inline

◆ SetSaveData()

void SwUndo::SetSaveData ( SwDoc rDoc,
SwRedlineSaveDatas rSData 
)
static

◆ Undo()

void SwUndo::Undo ( )
overrideprivatevirtual

Reimplemented from SfxUndoAction.

Definition at line 209 of file undobj.cxx.

◆ UndoImpl()

virtual void SwUndo::UndoImpl ( ::sw::UndoRedoContext )
pure virtual

Implemented in SwUndoFieldFromDoc, SwUndoFieldFromAPI, SwUndoInserts, SwUndoInsLayFormat, SwUndoDelLayFormat, SwUndoParagraphSigning, SwUndoFormatCreate, SwUndoFormatDelete, SwUndoRenameFormat, SwUndoNumruleCreate, SwUndoNumruleDelete, SwUndoNumruleRename, SwUndoPageDesc, SwUndoPageDescCreate, SwUndoPageDescDelete, SwUndoTOXChange, SwUndoAttr, SwUndoResetAttr, SwUndoFormatAttr, SwUndoFormatResetAttr, SwUndoDontExpandFormat, SwUndoMoveLeftMargin, SwUndoDefaultAttr, SwUndoChangeFootNote, SwUndoFootNoteInfo, SwUndoEndNoteInfo, SwUndoInsBookmark, SwUndoDeleteBookmark, SwUndoRenameBookmark, SwUndoInsNoTextFieldmark, SwUndoDelNoTextFieldmark, SwUndoInsTextFieldmark, SwUndoDelTextFieldmark, SwUndoFormatColl, SwUndoSetFlyFormat, SwUndoOutlineLeftRight, SwUndoOutlineEdit, SwUndoDelete, SwSdrUndo, SwUndoDrawGroup, SwUndoDrawUnGroup, SwUndoDrawUnGroupConnectToLayout, SwUndoDrawDelete, SwUndoFlyStrAttr, SwUndoFlyDecorative, SwUndoInsert, SwUndoReplace, SwUndoReRead, SwUndoInsertLabel, SwUndoInsNum, SwUndoDelNum, SwUndoMoveNum, SwUndoNumUpDown, SwUndoNumOrNoNum, SwUndoNumRuleStart, SwUndoOverwrite, SwUndoTransliterate, SwUndoRedline, SwUndoCompDoc, SwUndoInsSection, SwUndoUpdateIndex, SwUndoSort, SwUndoSplitNode, SwUndoMove, SwUndoInsTable, SwUndoTextToTable, SwUndoTableToText, SwUndoAttrTable, SwUndoTableAutoFormat, SwUndoTableNdsChg, SwUndoTableMerge, SwUndoTableNumFormat, SwUndoTableCpyTable, SwUndoCpyTable, SwUndoSplitTable, SwUndoMergeTable, SwUndoTableHeadline, SwUndoTableStyleMake, SwUndoTableStyleDelete, SwUndoTableStyleUpdate, and SwUndoDelSection.

Referenced by UndoWithContext().

◆ UndoWithContext()

void SwUndo::UndoWithContext ( SfxUndoContext rContext)
overrideprivatevirtual

Reimplemented from SfxUndoAction.

Definition at line 219 of file undobj.cxx.

References UndoImpl().

Member Data Documentation

◆ m_bCacheComment

bool SwUndo::m_bCacheComment
protected

◆ m_isRepeatIgnored

bool SwUndo::m_isRepeatIgnored
private

for multi-selection, only repeat 1st selection

Definition at line 59 of file undobj.hxx.

Referenced by IgnoreRepeat(), and Repeat().

◆ m_nId

SwUndoId const SwUndo::m_nId
private

Definition at line 56 of file undobj.hxx.

Referenced by GetId().

◆ m_nOrigRedlineFlags

RedlineFlags SwUndo::m_nOrigRedlineFlags
private

Definition at line 57 of file undobj.hxx.

Referenced by GetRedlineFlags(), and SetRedlineFlags().

◆ m_nViewShellId

ViewShellId SwUndo::m_nViewShellId
private

Definition at line 58 of file undobj.hxx.

Referenced by GetViewShellId().

◆ maComment

std::optional<OUString> SwUndo::maComment
mutableprotected

Definition at line 63 of file undobj.hxx.

Referenced by GetComment(), and SwUndoInsLayFormat::GetComment().


The documentation for this class was generated from the following files: