LibreOffice Module sw (master) 1
|
Stores the undo/redo information, implementing the IDocumentUndoRedo interface. More...
#include <UndoManager.hxx>
Public Member Functions | |
UndoManager (std::shared_ptr< SwNodes > pUndoNodes, IDocumentDrawModelAccess &rDrawModelAccess, IDocumentRedlineAccess &rRedlineAccess, IDocumentState &rState) | |
virtual void | DoUndo (bool const bDoUndo) override |
IDocumentUndoRedo. More... | |
virtual bool | DoesUndo () const override |
virtual void | DoGroupUndo (bool const bDoUndo) override |
virtual bool | DoesGroupUndo () const override |
virtual void | DoDrawUndo (bool const bDoUndo) override |
virtual bool | DoesDrawUndo () const override |
void | DoRepair (bool bRepair) override |
bool | DoesRepair () const override |
virtual void | SetUndoNoModifiedPosition () override |
virtual void | LockUndoNoModifiedPosition () override |
virtual void | UnLockUndoNoModifiedPosition () override |
virtual void | SetUndoNoResetModified () override |
virtual bool | IsUndoNoResetModified () const override |
virtual SwUndoId | StartUndo (SwUndoId const eUndoId, SwRewriter const *const pRewriter) override |
virtual SwUndoId | EndUndo (SwUndoId const eUndoId, SwRewriter const *const pRewriter) override |
virtual void | DelAllUndoObj () override |
virtual bool | GetLastUndoInfo (OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const override |
virtual SwUndoComments_t | GetUndoComments () const override |
virtual bool | GetFirstRedoInfo (OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const override |
virtual SwUndoComments_t | GetRedoComments () const override |
virtual bool | Repeat (::sw::RepeatContext &rContext, sal_uInt16 const nRepeatCnt) override |
N.B. More... | |
virtual SwUndoId | GetRepeatInfo (OUString *const o_pStr) const override |
virtual void | AppendUndo (std::unique_ptr< SwUndo > pUndo) override |
virtual void | ClearRedo () override |
virtual bool | IsUndoNodes (SwNodes const &rNodes) const override |
virtual size_t | GetUndoActionCount (const bool bCurrentLevel=true) const override |
size_t | GetRedoActionCount (const bool bCurrentLevel=true) const override |
void | SetView (SwView *pView) override |
bool | UndoWithOffset (size_t nUndoOffset) override |
virtual void | AddUndoAction (std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false) override |
virtual bool | Undo () override |
virtual bool | Redo () override |
void | dumpAsXml (xmlTextWriterPtr pWriter) const |
SwUndo * | RemoveLastUndo () |
SwUndo * | GetLastUndo () |
SwNodes const & | GetUndoNodes () const |
SwNodes & | GetUndoNodes () |
void | SetDocShell (SwDocShell *pDocShell) |
bool | IsViewUndoActionIndependent (const SwView *pView, sal_uInt16 &rOffset) const |
Checks if the topmost undo action owned by pView is independent from the topmost action undo action. More... | |
Public Member Functions inherited from SdrUndoManager | |
SdrUndoManager () | |
virtual | ~SdrUndoManager () override |
virtual bool | Undo () override |
virtual bool | Redo () override |
virtual void | Clear () override |
void | SetEndTextEditHdl (const Link< SdrUndoManager *, void > &rLink) |
bool | isEndTextEditTriggeredFromUndo () const |
void | SetDocShell (SfxObjectShell *pDocShell) |
size_t | GetRedoActionCountBeforeTextEdit () const |
Private Types | |
enum class | UndoOrRedoType { Undo , Redo } |
Private Member Functions | |
virtual void | EmptyActionsChanged () override |
bool | impl_DoUndoRedo (UndoOrRedoType undoOrRedo, size_t nUndoOffset) |
Private Attributes | |
IDocumentDrawModelAccess & | m_rDrawModelAccess |
IDocumentRedlineAccess & | m_rRedlineAccess |
IDocumentState & | m_rState |
std::shared_ptr< SwNodes > | m_xUndoNodes |
Undo nodes array: content not currently in document, but required for undo/redo. More... | |
bool | m_bGroupUndo: 1 |
bool | m_bDrawUndo: 1 |
bool | m_bRepair |
If true, then repair mode is enabled. More... | |
bool | m_bLockUndoNoModifiedPosition: 1 |
bool | m_isAddWithIgnoreRepeat |
set the IgnoreRepeat flag on every added action More... | |
UndoStackMark | m_UndoSaveMark |
position in Undo-Array at which Doc was saved (and is not modified) More... | |
SwDocShell * | m_pDocShell |
SwView * | m_pView |
Additional Inherited Members | |
Protected Member Functions inherited from SdrUndoManager | |
bool | isTextEditActive () const |
virtual void | EmptyActionsChanged () override |
Stores the undo/redo information, implementing the IDocumentUndoRedo interface.
It contains a stack of SwUndo actions, each of which represents one user-visible undo / redo step.
Definition at line 41 of file UndoManager.hxx.
|
strongprivate |
Enumerator | |
---|---|
Undo | |
Redo |
Definition at line 132 of file UndoManager.hxx.
sw::UndoManager::UndoManager | ( | std::shared_ptr< SwNodes > | pUndoNodes, |
IDocumentDrawModelAccess & | rDrawModelAccess, | ||
IDocumentRedlineAccess & | rRedlineAccess, | ||
IDocumentState & | rState | ||
) |
Definition at line 56 of file docundo.cxx.
References m_xUndoNodes, and MARK_INVALID.
|
overridevirtual |
Definition at line 603 of file docundo.cxx.
References Count, SfxViewFrame::GetBindings(), SfxViewFrame::GetFirst(), SfxViewFrame::GetNext(), SwUndo::GetRedlineFlags(), IDocumentRedlineAccess::GetRedlineFlags(), GetUndoNodes(), SwUndo::IgnoreRepeat(), SfxBindings::Invalidate(), m_isAddWithIgnoreRepeat, m_pDocShell, m_rRedlineAccess, NONE, SwUndo::SetRedlineFlags(), and UNDO_ACTION_LIMIT.
Referenced by AppendUndo().
|
overridevirtual |
Definition at line 250 of file docundo.cxx.
References AddUndoAction().
|
overridevirtual |
Definition at line 255 of file docundo.cxx.
|
overridevirtual |
Definition at line 260 of file docundo.cxx.
References m_UndoSaveMark, and MARK_INVALID.
|
overridevirtual |
Definition at line 188 of file docundo.cxx.
References m_bDrawUndo.
|
overridevirtual |
Definition at line 193 of file docundo.cxx.
References m_bDrawUndo.
|
overridevirtual |
Definition at line 183 of file docundo.cxx.
References m_bGroupUndo.
|
override |
Definition at line 203 of file docundo.cxx.
References m_bRepair.
|
overridevirtual |
Definition at line 166 of file docundo.cxx.
References SdrUndoManager::isTextEditActive().
Referenced by Repeat().
|
overridevirtual |
Definition at line 178 of file docundo.cxx.
References m_bGroupUndo.
|
override |
Definition at line 198 of file docundo.cxx.
References m_bRepair.
|
overridevirtual |
IDocumentUndoRedo.
Definition at line 152 of file docundo.cxx.
References SdrModel::EnableUndo(), IDocumentDrawModelAccess::GetDrawModel(), SdrUndoManager::isTextEditActive(), and m_rDrawModelAccess.
void sw::UndoManager::dumpAsXml | ( | xmlTextWriterPtr | pWriter | ) | const |
Definition at line 751 of file docundo.cxx.
References m_xUndoNodes.
|
overrideprivatevirtual |
Reimplemented from SdrUndoManager.
Definition at line 763 of file docundo.cxx.
References m_pDocShell.
|
overridevirtual |
Definition at line 302 of file docundo.cxx.
References SwRewriter::Apply(), EMPTY, END, SfxUndoAction::GetComment(), GetUndoComment(), nCount, and START.
|
overridevirtual |
Definition at line 505 of file docundo.cxx.
References CONFLICT, EMPTY, SfxUndoAction::GetComment(), SwDocShell::GetView(), SfxUndoAction::GetViewShellId(), SfxViewShell::GetViewShellId(), comphelper::LibreOfficeKit::isActive(), m_bRepair, and m_pDocShell.
SwUndo * sw::UndoManager::GetLastUndo | ( | ) |
Definition at line 240 of file docundo.cxx.
Referenced by sw::DocumentContentOperationsManager::DeleteAndJoinWithRedlineImpl(), sw::DocumentContentOperationsManager::DeleteRangeImplImpl(), sw::DocumentContentOperationsManager::InsertString(), sw::DocumentContentOperationsManager::Overwrite(), and SwDoc::UpdateRsid().
|
overridevirtual |
Definition at line 443 of file docundo.cxx.
References CONFLICT, EMPTY, SfxUndoAction::GetComment(), SwDocShell::GetView(), SfxUndoAction::GetViewShellId(), SfxViewShell::GetViewShellId(), comphelper::LibreOfficeKit::isActive(), IsViewUndoActionIndependent(), m_bRepair, m_pDocShell, and o3tl::temporary().
Referenced by GetRepeatInfo().
|
override |
Definition at line 128 of file docundo.cxx.
References SfxUndoAction::GetViewShellId(), SfxViewShell::GetViewShellId(), comphelper::LibreOfficeKit::isActive(), m_bRepair, and m_pView.
Referenced by IsViewUndoActionIndependent().
|
overridevirtual |
Definition at line 551 of file docundo.cxx.
References n.
|
overridevirtual |
Definition at line 568 of file docundo.cxx.
References EMPTY, and GetLastUndoInfo().
|
overridevirtual |
Definition at line 104 of file docundo.cxx.
References SfxUndoAction::GetViewShellId(), SfxViewShell::GetViewShellId(), comphelper::LibreOfficeKit::isActive(), m_bRepair, and m_pView.
Referenced by IsViewUndoActionIndependent().
|
overridevirtual |
Definition at line 488 of file docundo.cxx.
References n.
SwNodes & sw::UndoManager::GetUndoNodes | ( | ) |
Definition at line 84 of file docundo.cxx.
References m_xUndoNodes.
SwNodes const & sw::UndoManager::GetUndoNodes | ( | ) | const |
Definition at line 79 of file docundo.cxx.
References m_xUndoNodes.
Referenced by AddUndoAction(), impl_DoUndoRedo(), SwUndoSaveContent::MoveFromUndoNds(), SwUndoSaveContent::MoveToUndoNds(), SwUndoDelete::SwUndoDelete(), and SwUndoDelete::UndoImpl().
|
private |
Definition at line 664 of file docundo.cxx.
References SwCursorShell::ClearMark(), SfxViewShell::Current(), SwEditShell::CursorsLocked(), SwDoc::GetEditShell(), GetUndoNodes(), SwView::GetWrtShellPtr(), SwEditShell::HandleUndoRedoContext(), comphelper::LibreOfficeKit::isActive(), SwCursorShell::KillPams(), m_rState, m_UndoSaveMark, IDocumentState::ResetModified(), SwCursorShell::SetMark(), IDocumentState::SetModified(), sw::UndoRedoContext::SetUndoOffset(), and Undo.
Referenced by Redo(), and UndoWithOffset().
|
overridevirtual |
Definition at line 89 of file docundo.cxx.
References m_xUndoNodes.
|
overridevirtual |
Definition at line 208 of file docundo.cxx.
References m_UndoSaveMark, and MARK_INVALID.
bool sw::UndoManager::IsViewUndoActionIndependent | ( | const SwView * | pView, |
sal_uInt16 & | rOffset | ||
) | const |
Checks if the topmost undo action owned by pView is independent from the topmost action undo action.
Sets rOffset to the offset of that independent undo action on success.
Definition at line 364 of file docundo.cxx.
References GetRedoActionCount(), GetUndoActionCount(), SfxUndoAction::GetViewShellId(), SfxViewShell::GetViewShellId(), i, and TYPING.
Referenced by SwBaseShell::ExecUndo(), and GetLastUndoInfo().
|
overridevirtual |
Definition at line 230 of file docundo.cxx.
References m_bLockUndoNoModifiedPosition.
|
overridevirtual |
Reimplemented from SdrUndoManager.
Definition at line 739 of file docundo.cxx.
References impl_DoUndoRedo(), SdrUndoManager::isTextEditActive(), SdrUndoManager::Redo(), and Redo.
SwUndo * sw::UndoManager::RemoveLastUndo | ( | ) |
Definition at line 583 of file docundo.cxx.
Referenced by SwDoc::MergeTable().
|
overridevirtual |
N.B.
: this does not call SdrUndoManager::Repeat because it is not possible to wrap a list action around it: calling EnterListAction here will cause SdrUndoManager::Repeat to repeat the list action!
Definition at line 776 of file docundo.cxx.
References SfxUndoAction::CanRepeat(), DoesUndo(), SfxUndoAction::GetComment(), SfxUndoAction::GetRepeatComment(), sw::RepeatContext::GetRepeatPaM(), sw::Ring< value_type >::GetRingContainer(), SwDocShell::GetView(), sw::RepeatContext::m_bDeleteRepeated, m_isAddWithIgnoreRepeat, sw::RepeatContext::m_pCurrentPaM, m_pDocShell, nId, and SfxUndoAction::Repeat().
void sw::UndoManager::SetDocShell | ( | SwDocShell * | pDocShell | ) |
Definition at line 94 of file docundo.cxx.
References m_pDocShell.
Referenced by SwDoc::SetDocShell().
|
overridevirtual |
Definition at line 222 of file docundo.cxx.
References m_bLockUndoNoModifiedPosition, and m_UndoSaveMark.
|
overridevirtual |
Definition at line 213 of file docundo.cxx.
References m_UndoSaveMark, and MARK_INVALID.
|
override |
Definition at line 99 of file docundo.cxx.
References m_pView.
|
overridevirtual |
Definition at line 270 of file docundo.cxx.
References SwRewriter::Apply(), EMPTY, END, GetUndoComment(), SwDocShell::GetView(), m_pDocShell, and START.
|
overridevirtual |
Reimplemented from SdrUndoManager.
Definition at line 725 of file docundo.cxx.
References UndoWithOffset().
|
override |
Definition at line 727 of file docundo.cxx.
References impl_DoUndoRedo(), SdrUndoManager::isTextEditActive(), SdrUndoManager::Undo(), and Undo.
Referenced by Undo().
|
overridevirtual |
Definition at line 235 of file docundo.cxx.
References m_bLockUndoNoModifiedPosition.
|
private |
Definition at line 121 of file UndoManager.hxx.
Referenced by DoDrawUndo(), and DoesDrawUndo().
|
private |
Definition at line 120 of file UndoManager.hxx.
Referenced by DoesGroupUndo(), and DoGroupUndo().
|
private |
Definition at line 124 of file UndoManager.hxx.
Referenced by LockUndoNoModifiedPosition(), SetUndoNoModifiedPosition(), and UnLockUndoNoModifiedPosition().
|
private |
If true, then repair mode is enabled.
Definition at line 123 of file UndoManager.hxx.
Referenced by DoesRepair(), DoRepair(), GetFirstRedoInfo(), GetLastUndoInfo(), GetRedoActionCount(), and GetUndoActionCount().
|
private |
set the IgnoreRepeat flag on every added action
Definition at line 126 of file UndoManager.hxx.
Referenced by AddUndoAction(), and Repeat().
|
private |
Definition at line 129 of file UndoManager.hxx.
Referenced by AddUndoAction(), EmptyActionsChanged(), GetFirstRedoInfo(), GetLastUndoInfo(), Repeat(), SetDocShell(), and StartUndo().
|
private |
Definition at line 130 of file UndoManager.hxx.
Referenced by GetRedoActionCount(), GetUndoActionCount(), and SetView().
|
private |
Definition at line 113 of file UndoManager.hxx.
Referenced by DoUndo().
|
private |
Definition at line 114 of file UndoManager.hxx.
Referenced by AddUndoAction().
|
private |
Definition at line 115 of file UndoManager.hxx.
Referenced by impl_DoUndoRedo().
|
private |
position in Undo-Array at which Doc was saved (and is not modified)
Definition at line 128 of file UndoManager.hxx.
Referenced by DelAllUndoObj(), impl_DoUndoRedo(), IsUndoNoResetModified(), SetUndoNoModifiedPosition(), and SetUndoNoResetModified().
|
private |
Undo nodes array: content not currently in document, but required for undo/redo.
Definition at line 118 of file UndoManager.hxx.
Referenced by dumpAsXml(), GetUndoNodes(), IsUndoNodes(), and UndoManager().