22#include <osl/mutex.hxx>
27#include <libxml/xmlwriter.h>
28#include <boost/property_tree/json_parser.hpp>
38SfxRepeatTarget::~SfxRepeatTarget()
91 assert(!
"pure virtual function called: SfxUndoAction::Undo()");
104 assert(!
"pure virtual function called: SfxUndoAction::Redo()");
117 assert(!
"pure virtual function called: SfxUndoAction::Repeat()");
128 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SfxUndoAction"));
129 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
130 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"symbol"), BAD_CAST(
typeid(*this).name()));
131 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"comment"), BAD_CAST(
GetComment().toUtf8().getStr()));
132 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"viewShellId"), BAD_CAST(OString::number(
static_cast<sal_Int32
>(
GetViewShellId())).getStr()));
134 (void)xmlTextWriterEndElement(pWriter);
214 struct NotifyUndoListener
236 assert( is() &&
"NotifyUndoListener: this will crash!" );
306 m_notifiers.emplace_back( i_notificationMethod, i_actionComment );
331 ::std::for_each( aListenersCopy.begin(), aListenersCopy.end(), notifier );
353 UndoManagerGuard aGuard( *
m_xData );
361 if (
m_xData->mbUndoEnabled == i_enable )
363 m_xData->mbUndoEnabled = i_enable;
369 UndoManagerGuard aGuard( *
m_xData );
381 UndoManagerGuard aGuard( *
m_xData );
388 tools::Long nNumToDelete =
m_xData->pActUndoArray->maUndoActions.size() - nMaxUndoActionCount;
389 while ( nNumToDelete > 0 )
391 size_t nPos =
m_xData->pActUndoArray->maUndoActions.size();
392 if (
nPos >
m_xData->pActUndoArray->nCurUndoAction )
394 aGuard.markForDeletion(
m_xData->pActUndoArray->Remove(
nPos-1 ) );
398 if ( nNumToDelete > 0 &&
m_xData->pActUndoArray->nCurUndoAction > 0 )
400 aGuard.markForDeletion(
m_xData->pActUndoArray->Remove(0) );
401 --
m_xData->pActUndoArray->nCurUndoAction;
405 if (
nPos ==
m_xData->pActUndoArray->maUndoActions.size() )
409 m_xData->pActUndoArray->nMaxUndoActions = nMaxUndoActionCount;
415 return m_xData->pActUndoArray->nMaxUndoActions;
421 while ( !
m_xData->pActUndoArray->maUndoActions.empty() )
423 size_t deletePos =
m_xData->pActUndoArray->maUndoActions.size() - 1;
424 i_guard.markForDeletion(
m_xData->pActUndoArray->Remove( deletePos ) );
427 m_xData->pActUndoArray->nCurUndoAction = 0;
437 UndoManagerGuard aGuard( *
m_xData );
440 "SfxUndoManager::Clear: suspicious call - do you really wish to clear the current level?" );
450 UndoManagerGuard aGuard( *
m_xData );
455 m_xData->mbClearUntilTopLevel =
true;
466 UndoManagerGuard aGuard( *
m_xData );
474 "SfxUndoManager::ClearRedo: suspicious call - do you really wish to clear the current level?" );
481 UndoManagerGuard aGuard( *
m_xData );
496 aGuard.cancelNotifications();
505 while (
m_xData->pActUndoArray->nCurUndoAction > 0 )
507 i_guard.markForDeletion(
m_xData->pActUndoArray->Remove( 0 ) );
508 --
m_xData->pActUndoArray->nCurUndoAction;
523 i_guard.markForDeletion( pUndoArray->
Remove( deletePos ) );
537 i_guard.markForDeletion( std::move(pAction) );
543 m_xData->pActUndoArray->maUndoActions[
m_xData->pActUndoArray->nCurUndoAction-1].pAction.get() :
nullptr;
544 if ( bTryMerge && pMergeWithAction )
546 bool bMerged = pMergeWithAction->
Merge( pAction.get() );
549 i_guard.markForDeletion( std::move(pAction) );
561 while(
m_xData->pActUndoArray->maUndoActions.size() >=
m_xData->pActUndoArray->nMaxUndoActions)
563 i_guard.markForDeletion(
m_xData->pActUndoArray->Remove(0) );
564 if (
m_xData->pActUndoArray->nCurUndoAction > 0)
566 --
m_xData->pActUndoArray->nCurUndoAction;
570 assert(!
"CurrentUndoAction going negative (!)");
578 m_xData->pActUndoArray->Insert( std::move(pAction),
m_xData->pActUndoArray->nCurUndoAction++ );
586 UndoManagerGuard aGuard( *
m_xData );
589 auto pActionTmp = pAction.get();
600 UndoManagerGuard aGuard( *
m_xData );
608 UndoManagerGuard aGuard( *
m_xData );
612 assert(nNo < pUndoArray->nCurUndoAction);
613 if( nNo < pUndoArray->nCurUndoAction )
621 UndoManagerGuard aGuard( *
m_xData );
623 assert(nNo < m_xData->pActUndoArray->nCurUndoAction);
624 if( nNo >=
m_xData->pActUndoArray->nCurUndoAction )
626 return m_xData->pActUndoArray->maUndoActions[
m_xData->pActUndoArray->nCurUndoAction-1-nNo].pAction.get();
633 UndoManagerGuard aGuard( *
m_xData );
637 m_xData->pActUndoArray->nCurUndoAction--;
642 aGuard.markForDeletion( std::move(
m_xData->pActUndoArray->maUndoActions[
nPos-1].pAction) );
645 m_xData->pActUndoArray->Remove(
646 m_xData->pActUndoArray->nCurUndoAction,
647 m_xData->pActUndoArray->maUndoActions.size() -
m_xData->pActUndoArray->nCurUndoAction );
654 UndoManagerGuard aGuard( *
m_xData );
673 UndoManagerGuard aGuard( *
m_xData );
674 assert( !
IsDoing() &&
"SfxUndoManager::Undo: *nested* Undo/Redo actions? How this?" );
677 LockGuard aLockGuard( *
this );
681 assert(!
"SfxUndoManager::Undo: not possible when within a list action!");
685 if (
m_xData->pActUndoArray->nCurUndoAction == 0 )
687 SAL_WARN(
"svl",
"SfxUndoManager::Undo: undo stack is empty!" );
693 size_t nCurrent =
m_xData->pActUndoArray->nCurUndoAction;
695 if (nCurrent >= nOffset + 1)
701 std::rotate(
m_xData->pActUndoArray->maUndoActions.data() + nCurrent - nOffset - 1,
702 m_xData->pActUndoArray->maUndoActions.data() + nCurrent - nOffset,
703 m_xData->pActUndoArray->maUndoActions.data() + nCurrent);
708 const OUString sActionComment = pAction->
GetComment();
713 auto aResetGuard(aGuard.clear());
714 if ( i_contextOrNull !=
nullptr )
723 size_t nCurAction = 0;
724 while ( nCurAction < m_xData->pActUndoArray->maUndoActions.size() )
726 if (
m_xData->pActUndoArray->maUndoActions[ nCurAction++ ].pAction.get() == pAction )
734 SAL_WARN(
"svl",
"SfxUndoManager::Undo: can't clear the Undo stack after the failure - some other party was faster ..." );
746 UndoManagerGuard aGuard( *
m_xData );
760 UndoManagerGuard aGuard( *
m_xData );
774 UndoManagerGuard aGuard( *
m_xData );
798 UndoManagerGuard aGuard( *
m_xData );
799 assert( !
IsDoing() &&
"SfxUndoManager::Redo: *nested* Undo/Redo actions? How this?" );
802 LockGuard aLockGuard( *
this );
806 assert(!
"SfxUndoManager::Redo: not possible when within a list action!");
810 if (
m_xData->pActUndoArray->nCurUndoAction >=
m_xData->pActUndoArray->maUndoActions.size() )
812 SAL_WARN(
"svl",
"SfxUndoManager::Redo: redo stack is empty!");
817 const OUString sActionComment = pAction->
GetComment();
822 auto aResetGuard(aGuard.clear());
823 if ( i_contextOrNull !=
nullptr )
832 size_t nCurAction = 0;
833 while ( nCurAction < m_xData->pActUndoArray->maUndoActions.size() )
835 if (
m_xData->pActUndoArray->maUndoActions[ nCurAction ].pAction.get() == pAction )
844 SAL_WARN(
"svl",
"SfxUndoManager::Redo: can't clear the Undo stack after the failure - some other party was faster ..." );
857 UndoManagerGuard aGuard( *
m_xData );
858 return m_xData->pActUndoArray->maUndoActions.size();
864 UndoManagerGuard aGuard( *
m_xData );
865 return m_xData->pActUndoArray->maUndoActions[
m_xData->pActUndoArray->maUndoActions.size() - 1 ].pAction
872 UndoManagerGuard aGuard( *
m_xData );
873 if ( !
m_xData->pActUndoArray->maUndoActions.empty() )
876 auto aResetGuard(aGuard.clear());
888 UndoManagerGuard aGuard( *
m_xData );
889 if ( !
m_xData->pActUndoArray->maUndoActions.empty() )
891 size_t nActionNo =
m_xData->pActUndoArray->maUndoActions.size() - 1;
892 return m_xData->pActUndoArray->maUndoActions[nActionNo].pAction->CanRepeat(
rTarget);
900 UndoManagerGuard aGuard( *
m_xData );
901 m_xData->aListeners.push_back( &i_listener );
907 UndoManagerGuard aGuard( *
m_xData );
908 auto lookup = std::find(
m_xData->aListeners.begin(),
m_xData->aListeners.end(), &i_listener);
909 if (lookup !=
m_xData->aListeners.end())
910 m_xData->aListeners.erase( lookup );
917 const OUString &rRepeatComment, sal_uInt16 nId,
920 UndoManagerGuard aGuard( *
m_xData );
925 if ( !
m_xData->maUndoArray.nMaxUndoActions )
931 m_xData->pActUndoArray = pAction;
940 UndoManagerGuard aGuard( *
m_xData );
953 UndoManagerGuard aGuard( *
m_xData );
957 while ( pLookup != &
m_xData->maUndoArray )
969 UndoManagerGuard aGuard( *
m_xData );
972 if (
m_xData->mbClearUntilTopLevel )
977 m_xData->mbClearUntilTopLevel =
false;
989 UndoManagerGuard aGuard( *
m_xData );
999 if ( !
m_xData->maUndoArray.nMaxUndoActions )
1004 SAL_WARN(
"svl",
"svl::SfxUndoManager::ImplLeaveListAction, called without calling EnterListAction()!" );
1008 assert(
m_xData->pActUndoArray->pFatherUndoArray);
1013 m_xData->pActUndoArray =
m_xData->pActUndoArray->pFatherUndoArray;
1016 const size_t nListActionElements = pArrayToLeave->
nCurUndoAction;
1017 if ( nListActionElements == 0 )
1019 i_guard.markForDeletion(
m_xData->pActUndoArray->Remove( --
m_xData->pActUndoArray->nCurUndoAction ) );
1030 ENSURE_OR_RETURN( pListAction,
"SfxUndoManager::ImplLeaveListAction: list action expected at this position!", nListActionElements );
1036 "SfxUndoManager::ImplLeaveListAction: cannot merge the list action if there's no other action on the same level - check this beforehand!" );
1037 if (
m_xData->pActUndoArray->nCurUndoAction > 1 )
1039 std::unique_ptr<SfxUndoAction> pPreviousAction =
m_xData->pActUndoArray->Remove(
m_xData->pActUndoArray->nCurUndoAction - 2 );
1040 --
m_xData->pActUndoArray->nCurUndoAction;
1041 pListAction->
SetComment( pPreviousAction->GetComment() );
1042 pListAction->
Insert( std::move(pPreviousAction), 0 );
1052 if (!pListAction->
maUndoActions[
n].pAction->GetComment().isEmpty())
1065 return nListActionElements;
1070 UndoManagerGuard aGuard( *
m_xData );
1073 "SfxUndoManager::MarkTopUndoAction(): suspicious call!" );
1075 "SfxUndoManager::MarkTopUndoAction(): mark overflow!");
1077 size_t const nActionPos =
m_xData->maUndoArray.nCurUndoAction;
1078 if (0 == nActionPos)
1084 m_xData->maUndoArray.maUndoActions[ nActionPos-1 ].aMarks.push_back(
1091 UndoManagerGuard aGuard( *
m_xData );
1097 else if (i_mark ==
m_xData->mnEmptyMark)
1103 for (
size_t i=0;
i<
m_xData->maUndoArray.maUndoActions.size(); ++
i )
1106 auto markPos = std::find(rAction.
aMarks.begin(), rAction.
aMarks.end(), i_mark);
1107 if (markPos != rAction.
aMarks.end())
1109 rAction.
aMarks.erase( markPos );
1113 SAL_WARN(
"svl",
"SfxUndoManager::RemoveMark: mark not found!");
1121 UndoManagerGuard aGuard( *
m_xData );
1123 size_t nActionPos =
m_xData->maUndoArray.nCurUndoAction;
1124 if ( nActionPos == 0 )
1126 return (i_mark ==
m_xData->mnEmptyMark);
1130 m_xData->maUndoArray.maUndoActions[ nActionPos-1 ];
1132 return std::find(rAction.
aMarks.begin(), rAction.
aMarks.end(), i_mark) != rAction.
aMarks.end();
1138 UndoManagerGuard aGuard( *
m_xData );
1142 assert(!
"SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!");
1146 aGuard.markForDeletion(
m_xData->maUndoArray.Remove( 0 ) );
1147 --
m_xData->maUndoArray.nCurUndoAction;
1153 UndoManagerGuard aGuard(*
m_xData);
1158 pWriter = xmlNewTextWriterFilename(
"undo.xml", 0);
1159 xmlTextWriterSetIndent(pWriter,1);
1160 (void)xmlTextWriterSetIndentString(pWriter, BAD_CAST(
" "));
1161 (void)xmlTextWriterStartDocument(pWriter,
nullptr,
nullptr,
nullptr);
1165 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SfxUndoManager"));
1166 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nUndoActionCount"), BAD_CAST(OString::number(
GetUndoActionCount()).getStr()));
1167 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nRedoActionCount"), BAD_CAST(OString::number(
GetRedoActionCount()).getStr()));
1169 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"undoActions"));
1175 (void)xmlTextWriterEndElement(pWriter);
1177 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"redoActions"));
1183 (void)xmlTextWriterEndElement(pWriter);
1185 (void)xmlTextWriterEndElement(pWriter);
1188 (void)xmlTextWriterEndDocument(pWriter);
1189 xmlFreeTextWriter(pWriter);
1196 boost::property_tree::ptree aRet;
1197 aRet.put(
"index",
nIndex);
1198 aRet.put(
"comment", pAction->
GetComment().toUtf8().getStr());
1199 aRet.put(
"viewId",
static_cast<sal_Int32
>(pAction->
GetViewShellId()));
1206 boost::property_tree::ptree aActions;
1211 aActions.push_back(std::make_pair(
"", aAction));
1214 boost::property_tree::ptree aTree;
1215 aTree.add_child(
"actions", aActions);
1216 std::stringstream aStream;
1217 boost::property_tree::write_json(aStream, aTree);
1218 return OUString::fromUtf8(aStream.str());
1223 boost::property_tree::ptree aActions;
1230 aActions.push_back(std::make_pair(
"", aAction));
1233 boost::property_tree::ptree aTree;
1234 aTree.add_child(
"actions", aActions);
1235 std::stringstream aStream;
1236 boost::property_tree::write_json(aStream, aTree);
1237 return OUString::fromUtf8(aStream.str());
1242 UndoManagerGuard aGuard(*
m_xData);
1249 return m_xData->maUndoArray.nCurUndoAction ||
m_xData->maUndoArray.maUndoActions.size() -
m_xData->maUndoArray.nCurUndoAction;
1255 if (
m_xData->mbEmptyActions != bEmptyActions)
1257 m_xData->mbEmptyActions = bEmptyActions;
1275 Impl( sal_uInt16 nId,
ViewShellId nViewShellId, OUString aComment, OUString aRepeatComment ) :
1286 return mpImpl->maComment;
1291 return mpImpl->mnViewShellId;
1296 mpImpl->maComment = rComment;
1301 return mpImpl->maRepeatComment;
1305 const OUString &rComment,
1306 const OUString &rRepeatComment,
1310 mpImpl(new
Impl(
nId, nViewShellId, rComment, rRepeatComment))
1377 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SfxListUndoAction"));
1378 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"size"), BAD_CAST(OString::number(
maUndoActions.size()).getStr()));
1384 (void)xmlTextWriterEndElement(pWriter);
css::util::DateTime GetUNODateTime() const
do not make use of these implementation details, unless you really really have to!
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
virtual OUString GetRepeatComment(SfxRepeatTarget &) const override
virtual void Repeat(SfxRepeatTarget &) override
void SetComment(const OUString &rComment)
void dumpAsXml(xmlTextWriterPtr pWriter) const override
SfxListUndoAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId, SfxUndoArray *pFather)
virtual void Undo() override
virtual void UndoWithContext(SfxUndoContext &i_context) override
virtual void RedoWithContext(SfxUndoContext &i_context) override
virtual OUString GetComment() const override
virtual void Redo() override
std::unique_ptr< Impl > mpImpl
virtual bool Merge(SfxUndoAction *pNextAction) override
virtual ~SfxListUndoAction() override
virtual bool CanRepeat(SfxRepeatTarget &) const override
virtual void Repeat(SfxRepeatTarget &)
virtual OUString GetRepeatComment(SfxRepeatTarget &) const
virtual ViewShellId GetViewShellId() const
ID of the view shell that created this undo action.
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
const DateTime & GetDateTime() const
Timestamp when this undo item was created.
virtual OUString GetComment() const
virtual bool CanRepeat(SfxRepeatTarget &) const
virtual void RedoWithContext(SfxUndoContext &i_context)
virtual void UndoWithContext(SfxUndoContext &i_context)
virtual ~SfxUndoAction() COVERITY_NOEXCEPT_FALSE
virtual bool Merge(SfxUndoAction *pNextAction)
virtual ~SfxUndoContext()=0
virtual size_t GetUndoOffset()
Don't undo the top undo action, but an earlier one.
is a callback interface for notifications about state changes of an SfxUndoManager
virtual void listActionEntered(const OUString &i_comment)=0
virtual void actionUndone(const OUString &i_actionComment)=0
virtual void actionRedone(const OUString &i_actionComment)=0
virtual void listActionLeft(const OUString &i_comment)=0
virtual void clearedRedo()=0
virtual void resetAll()=0
virtual void listActionCancelled()=0
virtual void undoActionAdded(const OUString &i_actionComment)=0
size_t LeaveListAction()
Leaves the list action entered with EnterListAction.
size_t GetMaxUndoActionCount() const
bool ImplIsUndoEnabled_Lock() const
void AddUndoListener(SfxUndoListener &i_listener)
Adds a new listener to be notified about changes in the UndoManager's state.
void ImplClearCurrentLevel_NoNotify(::svl::undo::impl::UndoManagerGuard &i_guard)
void ImplClearRedo_NoLock(bool const i_currentLevel)
void EnableUndo(bool bEnable)
enables (true) or disables (false) recording of undo actions
void Reset()
leaves any possible open list action (<member>IsInListAction</member>), and clears both the Undo and ...
virtual void Clear()
Clears both the Redo and the Undo stack.
size_t ImplGetRedoActionCount_Lock(bool const i_currentLevel=CurrentLevel) const
bool HasTopUndoActionMark(UndoStackMark const i_mark)
determines whether the top action on the Undo stack has a given mark
std::unique_ptr< SfxUndoManager_Data > m_xData
SfxUndoAction * GetRedoAction(size_t nNo=0) const
OUString GetUndoActionsInfo() const
Get info about all undo actions (comment, view shell id, etc.)
void ImplCheckEmptyActions()
virtual ~SfxUndoManager()
OUString GetRedoActionComment(size_t nNo=0, bool const i_currentLevel=CurrentLevel) const
bool IsInListAction() const
determines whether we're within a ListAction context, i.e. a LeaveListAction/LeaveAndMergeListAction ...
bool ImplUndo(SfxUndoContext *i_contextOrNull)
size_t LeaveAndMergeListAction()
Leaves the list action entered with EnterListAction, and forcefully merges the previous action on the...
OUString GetUndoActionComment(size_t nNo=0, bool const i_currentLevel=CurrentLevel) const
bool CanRepeat(SfxRepeatTarget &rTarget) const
void RemoveMark(UndoStackMark const i_mark)
removes a mark given by its ID.
static bool const TopLevel
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
Inserts a ListUndoAction and sets its UndoArray as current.
bool Repeat(SfxRepeatTarget &rTarget)
void dumpAsXml(xmlTextWriterPtr pWriter) const
void ImplClearRedo(::svl::undo::impl::UndoManagerGuard &i_guard, bool const i_currentLevel)
bool UndoWithContext(SfxUndoContext &i_context)
OUString GetRedoActionsInfo() const
Get info about all redo actions (comment, view shell id, etc.)
size_t ImplLeaveListAction(const bool i_merge, ::svl::undo::impl::UndoManagerGuard &i_guard)
void RemoveUndoListener(SfxUndoListener &i_listener)
SfxUndoManager(size_t nMaxUndoActionCount=20)
bool IsDoing() const
determines whether an Undo or Redo is currently running
virtual size_t GetRedoActionCount(bool const i_currentLevel=CurrentLevel) const
size_t GetListActionDepth() const
Determines how many nested list actions are currently open.
virtual void ClearRedo()
Clears the Redo stack.
void RemoveLastUndoAction()
Clears the redo stack and removes the top undo action.
bool ImplIsEmptyActions() const
OUString GetRepeatActionComment(SfxRepeatTarget &rTarget) const
void SetMaxUndoActionCount(size_t nMaxUndoActionCount)
bool IsEmptyActions() const
bool IsUndoEnabled() const
returns true if undo is currently enabled.
bool ImplAddUndoAction_NoNotify(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerge, bool bClearRedo, ::svl::undo::impl::UndoManagerGuard &i_guard)
void ImplEnableUndo_Lock(bool const i_enable)
bool ImplIsInListAction_Lock() const
UndoStackMark MarkTopUndoAction()
marks the current top-level element of the Undo stack, and returns a unique ID for it
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
size_t GetRepeatActionCount() const
virtual size_t GetUndoActionCount(bool const i_currentLevel=CurrentLevel) const
void ImplClearUndo(::svl::undo::impl::UndoManagerGuard &i_guard)
void RemoveOldestUndoAction()
removes the oldest Undo actions from the stack
bool RedoWithContext(SfxUndoContext &i_context)
SfxUndoAction * GetUndoAction(size_t nNo=0) const
static bool const CurrentLevel
bool ImplRedo(SfxUndoContext *i_contextOrNull)
virtual void EmptyActionsChanged()
void ClearAllLevels()
clears all undo actions on the current level, plus all undo actions on superordinate levels,...
SfxUndoManager & m_manager
LockGuard(SfxUndoManager &i_manager)
void scheduleNotification(UndoListenerStringMethod i_notificationMethod, const OUString &i_actionComment)
::std::vector< std::unique_ptr< SfxUndoAction > > m_aUndoActionsCleanup
::osl::ResettableMutexGuard m_aGuard
void scheduleNotification(UndoListenerVoidMethod i_notificationMethod)
schedules the given SfxUndoListener method to be called for all registered listeners.
void markForDeletion(std::unique_ptr< SfxUndoAction > i_action)
marks the given Undo action for deletion
SfxUndoManager_Data & m_rManagerData
UndoManagerGuard(SfxUndoManager_Data &i_managerData)
void cancelNotifications()
::std::vector< NotifyUndoListener > m_notifiers
#define ENSURE_OR_RETURN(c, m, r)
#define ENSURE_OR_RETURN_VOID(c, m)
struct _xmlTextWriter * xmlTextWriterPtr
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
void(SfxUndoListener::* UndoListenerVoidMethod)()
void(SfxUndoListener::* UndoListenerStringMethod)(const OUString &)
OUString toISO8601(const css::util::DateTime &rDateTime)
::std::vector< UndoStackMark > aMarks
Impl(sal_uInt16 nId, ViewShellId nViewShellId, OUString aComment, OUString aRepeatComment)
ViewShellId mnViewShellId
do not make use of these implementation details, unless you really really have to!
std::vector< MarkedUndoAction > maUndoActions
void Insert(std::unique_ptr< SfxUndoAction > i_action, size_t i_pos)
std::unique_ptr< SfxUndoAction > Remove(int idx)
SfxUndoArray * pFatherUndoArray
SfxUndoManager_Data(const SfxUndoManager_Data &)=delete
SfxUndoManager_Data(size_t i_nMaxUndoActionCount)
SfxUndoManager_Data & operator=(const SfxUndoManager_Data &)=delete
SfxUndoArray * pActUndoArray
bool mbClearUntilTopLevel
osl::ResettableMutexGuard & rGuard
ResetGuard(osl::ResettableMutexGuard &r)
::std::vector< SfxUndoListener * > UndoListeners
static boost::property_tree::ptree lcl_ActionToJson(size_t nIndex, SfxUndoAction const *pAction)
Returns a JSON representation of pAction.
UndoListenerVoidMethod m_notificationMethod
OUString m_sActionComment
UndoListenerStringMethod m_altNotificationMethod
o3tl::strong_int< sal_Int32, struct ViewShellIdTag > ViewShellId
sal_Int32 UndoStackMark
is a mark on the Undo stack