svl: expose redo actions in SfxUndoManager::dumpAsXml()
To see if an undo action is actually deleted or just moved to the redo stack. Change-Id: I40632ea29353e50b643b8b1831d5ffdf443ca75a Reviewed-on: https://gerrit.libreoffice.org/27871 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
This commit is contained in:
@@ -1254,6 +1254,8 @@ void SfxUndoManager::RemoveOldestUndoAction()
|
|||||||
|
|
||||||
void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const
|
void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const
|
||||||
{
|
{
|
||||||
|
UndoManagerGuard aGuard(*m_xData);
|
||||||
|
|
||||||
bool bOwns = false;
|
bool bOwns = false;
|
||||||
if (!pWriter)
|
if (!pWriter)
|
||||||
{
|
{
|
||||||
@@ -1264,9 +1266,23 @@ void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const
|
|||||||
|
|
||||||
xmlTextWriterStartElement(pWriter, BAD_CAST("sfxUndoManager"));
|
xmlTextWriterStartElement(pWriter, BAD_CAST("sfxUndoManager"));
|
||||||
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nUndoActionCount"), BAD_CAST(OString::number(GetUndoActionCount()).getStr()));
|
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nUndoActionCount"), BAD_CAST(OString::number(GetUndoActionCount()).getStr()));
|
||||||
|
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nRedoActionCount"), BAD_CAST(OString::number(GetRedoActionCount()).getStr()));
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(pWriter, BAD_CAST("undoActions"));
|
||||||
for (size_t i = 0; i < GetUndoActionCount(); ++i)
|
for (size_t i = 0; i < GetUndoActionCount(); ++i)
|
||||||
GetUndoAction(i)->dumpAsXml(pWriter);
|
{
|
||||||
|
const SfxUndoArray* pUndoArray = m_xData->pActUndoArray;
|
||||||
|
pUndoArray->aUndoActions[pUndoArray->nCurUndoAction - 1 - i].pAction->dumpAsXml(pWriter);
|
||||||
|
}
|
||||||
|
xmlTextWriterEndElement(pWriter);
|
||||||
|
|
||||||
|
xmlTextWriterStartElement(pWriter, BAD_CAST("redoActions"));
|
||||||
|
for (size_t i = 0; i < GetRedoActionCount(); ++i)
|
||||||
|
{
|
||||||
|
const SfxUndoArray* pUndoArray = m_xData->pActUndoArray;
|
||||||
|
pUndoArray->aUndoActions[pUndoArray->nCurUndoAction + i].pAction->dumpAsXml(pWriter);
|
||||||
|
}
|
||||||
|
xmlTextWriterEndElement(pWriter);
|
||||||
|
|
||||||
xmlTextWriterEndElement(pWriter);
|
xmlTextWriterEndElement(pWriter);
|
||||||
if (bOwns)
|
if (bOwns)
|
||||||
|
Reference in New Issue
Block a user