editeng/source/items/numitem.cxx |    7 +++++++
 include/editeng/numitem.hxx      |    5 +++++
 sw/source/core/doc/number.cxx    |   11 +++++++++++
 3 files changed, 23 insertions(+)

New commits:
commit f807c8bbbc041a7896838fc213d30f2f30768b4a
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Mar 2 11:45:37 2020 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue Mar 3 07:57:40 2020 +0100

    sw doc model xml dump: show numbering type
    
    Change-Id: I6d2145469b8153c86294c40e1b3dfcc9d65ced60
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89819
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 67b4dcadafd9..00af4303064a 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -152,6 +152,13 @@ OUString SvxNumberType::GetNumStr( sal_Int32 nNo, const 
css::lang::Locale& rLoca
     return OUString();
 }
 
+void SvxNumberType::dumpAsXml( xmlTextWriterPtr pWriter ) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("SvxNumberType"));
+    xmlTextWriterWriteAttribute(pWriter, BAD_CAST("NumType"), 
BAD_CAST(OString::number(nNumType).getStr()));
+    xmlTextWriterEndElement(pWriter);
+}
+
 SvxNumberFormat::SvxNumberFormat( SvxNumType eType )
     : SvxNumberType(eType),
       eNumAdjust(SvxAdjust::Left),
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 399250c9c13a..e70281c7b0a1 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -52,6 +52,9 @@ namespace com::sun::star::lang { struct Locale; }
 
 
 #define LINK_TOKEN  0x80 //indicate linked bitmaps - for use in dialog only
+
+typedef struct _xmlTextWriter* xmlTextWriterPtr;
+
 class EDITENG_DLLPUBLIC SvxNumberType
 {
     static sal_Int32 nRefCount;
@@ -81,6 +84,8 @@ public:
                                css::style::NumberingType::CHAR_SPECIAL != 
nNumType &&
                                css::style::NumberingType::BITMAP != nNumType;
                     }
+
+    void dumpAsXml(xmlTextWriterPtr w) const;
 };
 
 class EDITENG_DLLPUBLIC SvxNumberFormat : public SvxNumberType
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 0db3e7820bc3..26540353ddba 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -1029,6 +1029,17 @@ void SwNumRule::dumpAsXml(xmlTextWriterPtr pWriter) const
     xmlTextWriterWriteAttribute(pWriter, BAD_CAST("msName"), 
BAD_CAST(msName.toUtf8().getStr()));
     xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mnPoolFormatId"), 
BAD_CAST(OString::number(mnPoolFormatId).getStr()));
     xmlTextWriterWriteAttribute(pWriter, BAD_CAST("mbAutoRuleFlag"), 
BAD_CAST(OString::boolean(mbAutoRuleFlag).getStr()));
+
+    for (const auto& pFormat : maFormats)
+    {
+        if (!pFormat)
+        {
+            continue;
+        }
+
+        pFormat->dumpAsXml(pWriter);
+    }
+
     xmlTextWriterEndElement(pWriter);
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to