[Libreoffice-commits] core.git: editeng/source include/editeng sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Jan 12 00:10:04 PST 2015
editeng/source/items/frmitems.cxx | 10 ++++++++++
include/editeng/protitem.hxx | 1 +
sw/source/core/docnode/nodedump.cxx | 6 +++---
3 files changed, 14 insertions(+), 3 deletions(-)
New commits:
commit 0042de4cf8ca02dd0fe9063266b69943d97b645b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jan 12 09:09:15 2015 +0100
Factor out SvxProtectItem::dumpAsXml() from sw
Change-Id: I780afa7c5faa0f594257200c5c2c132cc49388b6
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 7244b1d..f7902b2 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 9c05284..a21bb6b 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 092bf48..4f0e834 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;
More information about the Libreoffice-commits
mailing list