From 3b3cfa0e016de7712200785bc70ef2d6a5877113 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 24 Nov 2014 09:02:46 +0100 Subject: Factor out EditTextObject::dumpAsXml() from SwDoc::dumpAsXml() Change-Id: I1dae910e9d14db56d6388a71d76b1a479d5786b0 --- editeng/CppunitTest_editeng_core.mk | 1 + editeng/Library_editeng.mk | 1 + editeng/source/editeng/editobj.cxx | 13 +++++++++++++ 3 files changed, 15 insertions(+) (limited to 'editeng') diff --git a/editeng/CppunitTest_editeng_core.mk b/editeng/CppunitTest_editeng_core.mk index f66caec8a243..ea7f6896b52b 100644 --- a/editeng/CppunitTest_editeng_core.mk +++ b/editeng/CppunitTest_editeng_core.mk @@ -44,6 +44,7 @@ $(eval $(call gb_CppunitTest_use_libraries,editeng_core, \ $(eval $(call gb_CppunitTest_use_externals,editeng_core,\ boost_headers \ icuuc \ + libxml2 \ )) $(eval $(call gb_CppunitTest_set_include,editeng_core,\ diff --git a/editeng/Library_editeng.mk b/editeng/Library_editeng.mk index 22f4c086085d..0e9c6c2c4a21 100644 --- a/editeng/Library_editeng.mk +++ b/editeng/Library_editeng.mk @@ -152,6 +152,7 @@ $(eval $(call gb_Library_use_externals,editeng,\ boost_headers \ icuuc \ icu_headers \ + libxml2 \ )) # Runtime dependency for unit-tests diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index b100bd47299d..89bc9fe86aea 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -464,6 +464,19 @@ void EditTextObject::Dump() const } #endif +void EditTextObject::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("editTextObject")); + sal_Int32 nCount = GetParagraphCount(); + for (sal_Int32 i = 0; i < nCount; ++i) + { + xmlTextWriterStartElement(pWriter, BAD_CAST("paragraph")); + xmlTextWriterWriteString(pWriter, BAD_CAST(GetText(i).toUtf8().getStr())); + xmlTextWriterEndElement(pWriter); + } + xmlTextWriterEndElement(pWriter); +} + // from SfxItemPoolUser void EditTextObjectImpl::ObjectInDestruction(const SfxItemPool& rSfxItemPool) { -- cgit