diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-12 09:09:15 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-12 09:09:34 +0100 |
commit | 0042de4cf8ca02dd0fe9063266b69943d97b645b (patch) | |
tree | 5f1357c3224bf3f24c5358625490222d92b23bfe | |
parent | 92cef7eb344c9c9c7a6aa1489845a1b0eb346ead (diff) |
Factor out SvxProtectItem::dumpAsXml() from sw
Change-Id: I780afa7c5faa0f594257200c5c2c132cc49388b6
-rw-r--r-- | editeng/source/items/frmitems.cxx | 10 | ||||
-rw-r--r-- | include/editeng/protitem.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 7244b1de76db..f7902b21ab33 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -1256,6 +1256,16 @@ SfxPoolItem* SvxProtectItem::Create( SvStream& rStrm, sal_uInt16 ) const return pAttr; } +void SvxProtectItem::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("svxProtectItem")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("content"), BAD_CAST(OString::boolean(bCntnt).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(OString::boolean(bSize).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("position"), BAD_CAST(OString::boolean(bPos).getStr())); + xmlTextWriterEndElement(pWriter); +} + // class SvxShadowItem --------------------------------------------------- SvxShadowItem::SvxShadowItem( const sal_uInt16 nId, diff --git a/include/editeng/protitem.hxx b/include/editeng/protitem.hxx index 9c05284d914a..a21bb6b785a8 100644 --- a/include/editeng/protitem.hxx +++ b/include/editeng/protitem.hxx @@ -66,6 +66,7 @@ public: virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE; + void dumpAsXml(struct _xmlTextWriter* pWriter) const; }; inline SvxProtectItem::SvxProtectItem( const sal_uInt16 nId ) diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 092bf48de878..4f0e834896b4 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -479,6 +479,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) case XATTR_FILLBMP_STRETCH: static_cast<const XFillBmpStretchItem*>(pItem)->dumpAsXml(writer); break; + case RES_PROTECT: + static_cast<const SvxProtectItem*>(pItem)->dumpAsXml(writer); + break; default: bDone = false; break; } if (bDone) @@ -493,9 +496,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) boost::optional<OString> oValue; switch (pItem->Which()) { - case RES_PROTECT: - pWhich = "protect"; - break; case RES_EDIT_IN_READONLY: pWhich = "edit in read-only"; break; |