Kaydet (Commit) 0042de4c authored tarafından Miklos Vajna's avatar Miklos Vajna

Factor out SvxProtectItem::dumpAsXml() from sw

Change-Id: I780afa7c5faa0f594257200c5c2c132cc49388b6
üst 92cef7eb
......@@ -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,
......
......@@ -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 )
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment