sw doc model xml dump: show SwUndoRedline and SwRedlineSaveDatas
I have a redline problem where the undo of reject doesn't restore all SwRedlineData of a SwRangeRedline; dumping these help deciding if the undo action is already created with the wrong info or just its execution is buggy. Change-Id: I19068e036e3eb421a6b4118d31095138eced5122 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184613 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
This commit is contained in:
@@ -1238,6 +1238,26 @@ bool SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) c
|
||||
return true;
|
||||
}
|
||||
|
||||
void SwRedlineSaveDatas::dumpAsXml(xmlTextWriterPtr pWriter) const
|
||||
{
|
||||
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwRedlineSaveDatas"));
|
||||
(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
|
||||
|
||||
for (const auto& rRedlineData : m_Data)
|
||||
{
|
||||
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("data"));
|
||||
const SwRedlineData* pData = rRedlineData.get();
|
||||
while (pData)
|
||||
{
|
||||
pData->dumpAsXml(pWriter);
|
||||
pData = pData->Next();
|
||||
}
|
||||
(void)xmlTextWriterEndElement(pWriter);
|
||||
}
|
||||
|
||||
(void)xmlTextWriterEndElement(pWriter);
|
||||
}
|
||||
|
||||
SwRedlineData::SwRedlineData( RedlineType eT, std::size_t nAut, sal_uInt32 nMovedID )
|
||||
: m_pNext( nullptr ), m_pExtraData( nullptr ),
|
||||
m_aStamp( DateTime::SYSTEM ),
|
||||
|
||||
@@ -82,6 +82,7 @@ public:
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
void SetRedlineCountDontCheck(bool bCheck) { m_Data[0]->m_bRedlineCountDontCheck=bCheck; }
|
||||
#endif
|
||||
void dumpAsXml(xmlTextWriterPtr pWriter) const;
|
||||
};
|
||||
|
||||
namespace sw {
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
#if OSL_DEBUG_LEVEL > 0
|
||||
void SetRedlineCountDontCheck(bool bCheck);
|
||||
#endif
|
||||
void dumpAsXml(xmlTextWriterPtr pWriter) const override;
|
||||
};
|
||||
|
||||
class SwUndoRedlineDelete final : public SwUndoRedline
|
||||
@@ -115,6 +116,7 @@ public:
|
||||
virtual void RepeatImpl( ::sw::RepeatContext & ) override;
|
||||
};
|
||||
|
||||
/// Undo for Edit -> Track Changes -> Reject.
|
||||
class SwUndoRejectRedline final : public SwUndoRedline
|
||||
{
|
||||
private:
|
||||
|
||||
@@ -97,6 +97,27 @@ void SwUndoRedline::SetRedlineCountDontCheck(bool bCheck)
|
||||
}
|
||||
#endif
|
||||
|
||||
void SwUndoRedline::dumpAsXml(xmlTextWriterPtr pWriter) const
|
||||
{
|
||||
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwUndoRedline"));
|
||||
(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
|
||||
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("symbol"), BAD_CAST(typeid(*this).name()));
|
||||
|
||||
const SwRedlineData* pRedlData = mpRedlData.get();
|
||||
while (pRedlData)
|
||||
{
|
||||
pRedlData->dumpAsXml(pWriter);
|
||||
pRedlData = pRedlData->Next();
|
||||
}
|
||||
|
||||
if (mpRedlSaveData)
|
||||
{
|
||||
mpRedlSaveData->dumpAsXml(pWriter);
|
||||
}
|
||||
|
||||
(void)xmlTextWriterEndElement(pWriter);
|
||||
}
|
||||
|
||||
void SwUndoRedline::UndoImpl(::sw::UndoRedoContext & rContext)
|
||||
{
|
||||
SwDoc& rDoc = rContext.GetDoc();
|
||||
|
||||
Reference in New Issue
Block a user