diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-13 10:28:14 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-09-13 16:14:47 +0200 |
commit | c010ed6ba4302534ac712efc923a8a8bf1d0896b (patch) | |
tree | fd1efea7b571ab97658cfbf221141ef2cb487474 /editeng | |
parent | a915b14640ecf53756771363c2a29468cafc2717 (diff) |
impress: extend dumpAsXml to style information in ContentInfo nodes
Change-Id: I783f6ad9b71f18c070537e4806381a103960b6eb
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editobj.cxx | 21 | ||||
-rw-r--r-- | editeng/source/editeng/editobj2.hxx | 8 |
2 files changed, 26 insertions, 3 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 6637a344d4bd..7b8f00b96123 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -164,6 +164,25 @@ void ContentInfo::SetText( const OUString& rStr ) maText = svl::SharedString(rStr.pData, nullptr); } +void ContentInfo::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("contentInfo")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("style"), BAD_CAST(aStyle.toUtf8().getStr())); + xmlTextWriterStartElement(pWriter, BAD_CAST("text")); + xmlTextWriterWriteString(pWriter, BAD_CAST(GetText().toUtf8().getStr())); + xmlTextWriterEndElement(pWriter); + aParaAttribs.dumpAsXml(pWriter); + for (size_t i=0; i<aAttribs.size(); ++i) + { + xmlTextWriterStartElement(pWriter, BAD_CAST("attribs")); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("start"), "%d", aAttribs[i]->GetStart()); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("end"), "%d", aAttribs[i]->GetEnd()); + aAttribs[i]->GetItem()->dumpAsXml(pWriter); + xmlTextWriterEndElement(pWriter); + } + xmlTextWriterEndElement(pWriter); +} + const WrongList* ContentInfo::GetWrongList() const { return mpWrongs.get(); @@ -444,7 +463,7 @@ void EditTextObject::dumpAsXml(xmlTextWriterPtr pWriter) const for (sal_Int32 i = 0; i < nCount; ++i) { xmlTextWriterStartElement(pWriter, BAD_CAST("paragraph")); - xmlTextWriterWriteString(pWriter, BAD_CAST(GetText(i).toUtf8().getStr())); + mpImpl->aContents[i]->dumpAsXml(pWriter); xmlTextWriterEndElement(pWriter); } xmlTextWriterEndElement(pWriter); diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index cd5d53a68ce1..20558a1ea12a 100644 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -114,13 +114,14 @@ public: typedef std::vector<std::unique_ptr<XEditAttribute> > XEditAttributesType; private: - svl::SharedString maText; + svl::SharedString maText; OUString aStyle; XEditAttributesType aAttribs; SfxStyleFamily eFamily; SfxItemSet aParaAttribs; - std::unique_ptr<WrongList> mpWrongs; + std::unique_ptr<WrongList> + mpWrongs; ContentInfo( SfxItemPool& rPool ); ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse ); @@ -135,6 +136,8 @@ public: OUString GetText() const; void SetText( const OUString& rStr ); + void dumpAsXml(struct _xmlTextWriter* pWriter) const; + const XEditAttributesType& GetAttribs() const { return aAttribs; } XEditAttributesType& GetAttribs() { return aAttribs; } @@ -159,6 +162,7 @@ public: class EditTextObjectImpl { +friend class EditTextObject; public: typedef std::vector<std::unique_ptr<ContentInfo> > ContentInfosType; |