[Libreoffice-commits] core.git: sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 28 16:46:17 UTC 2020


 sw/source/core/inc/UndoDraw.hxx |    1 +
 sw/source/core/undo/undraw.cxx  |   23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)

New commits:
commit 15f2bf415bb25324eaf26ea87ef8b724a090b942
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Oct 28 12:16:15 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Oct 28 17:45:01 2020 +0100

    sw: add an xml dumper for SwUndoDrawDelete
    
    Change-Id: I1b06cce99ae0a45b1765d2259d3d14fbb89e6676
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104929
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx
index f4117a6fd61e..468db932a476 100644
--- a/sw/source/core/inc/UndoDraw.hxx
+++ b/sw/source/core/inc/UndoDraw.hxx
@@ -127,6 +127,7 @@ public:
     virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
 
     void AddObj( SwDrawFrameFormat*, const SdrMark& );
+    void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDODRAW_HXX
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index f355d8263df3..9ed78bd680a3 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -556,4 +556,27 @@ void SwUndoDrawDelete::AddObj( SwDrawFrameFormat* pFormat,
     m_pMarkList->InsertEntry( rMark );
 }
 
+void SwUndoDrawDelete::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("SwUndoDrawDelete"));
+
+    for (size_t i = 0; i < m_pMarkList->GetMarkCount(); ++i)
+    {
+        SwUndoGroupObjImpl& rObj = m_pObjArray[i];
+        xmlTextWriterStartElement(pWriter, BAD_CAST("SwUndoGroupObjImpl"));
+        xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"),
+                                    BAD_CAST(OString::number(i).getStr()));
+
+        if (rObj.pFormat)
+        {
+            xmlTextWriterStartElement(pWriter, BAD_CAST("pFormat"));
+            rObj.pFormat->dumpAsXml(pWriter);
+            xmlTextWriterEndElement(pWriter);
+        }
+        xmlTextWriterEndElement(pWriter);
+    }
+
+    xmlTextWriterEndElement(pWriter);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list