Kaydet (Commit) 4dbbf535 authored tarafından Miklos Vajna's avatar Miklos Vajna

Factor out SvxRsidItem::dumpAsXml() from sw

Change-Id: I60c57fa6a9f3619de717e7b2383dc420706b2886
üst 5f6af01f
...@@ -593,6 +593,7 @@ void SvxPostureItem::dumpAsXml(xmlTextWriterPtr pWriter) const ...@@ -593,6 +593,7 @@ void SvxPostureItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{ {
xmlTextWriterStartElement(pWriter, BAD_CAST("svxPostureItem")); xmlTextWriterStartElement(pWriter, BAD_CAST("svxPostureItem"));
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which()); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%d", GetValue());
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(GetValueTextByPos(GetValue()).toUtf8().getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(GetValueTextByPos(GetValue()).toUtf8().getStr()));
xmlTextWriterEndElement(pWriter); xmlTextWriterEndElement(pWriter);
} }
...@@ -726,6 +727,7 @@ void SvxWeightItem::dumpAsXml(xmlTextWriterPtr pWriter) const ...@@ -726,6 +727,7 @@ void SvxWeightItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{ {
xmlTextWriterStartElement(pWriter, BAD_CAST("svxWeightItem")); xmlTextWriterStartElement(pWriter, BAD_CAST("svxWeightItem"));
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which()); xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%d", GetValue());
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(GetValueTextByPos(GetValue()).toUtf8().getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("presentation"), BAD_CAST(GetValueTextByPos(GetValue()).toUtf8().getStr()));
xmlTextWriterEndElement(pWriter); xmlTextWriterEndElement(pWriter);
} }
...@@ -3559,4 +3561,13 @@ SfxPoolItem* SvxRsidItem::Create(SvStream& rIn, sal_uInt16 ) const ...@@ -3559,4 +3561,13 @@ SfxPoolItem* SvxRsidItem::Create(SvStream& rIn, sal_uInt16 ) const
{ {
return new SvxRsidItem( rIn, Which() ); return new SvxRsidItem( rIn, Which() );
} }
void SvxRsidItem::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("svxRsidItem"));
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("whichId"), "%d", Which());
xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("value"), "%" SAL_PRIuUINT32, GetValue());
xmlTextWriterEndElement(pWriter);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -29,6 +29,8 @@ public: ...@@ -29,6 +29,8 @@ public:
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const SAL_OVERRIDE; 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; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) SAL_OVERRIDE;
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
}; };
#endif // INCLUDED_EDITENG_RSIDITEM_HXX #endif // INCLUDED_EDITENG_RSIDITEM_HXX
...@@ -401,6 +401,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -401,6 +401,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_CHRATR_CTL_WEIGHT: case RES_CHRATR_CTL_WEIGHT:
static_cast<const SvxWeightItem*>(pItem)->dumpAsXml(writer); static_cast<const SvxWeightItem*>(pItem)->dumpAsXml(writer);
break; break;
case RES_CHRATR_RSID:
static_cast<const SvxRsidItem*>(pItem)->dumpAsXml(writer);
break;
default: bDone = false; break; default: bDone = false; break;
} }
if (bDone) if (bDone)
...@@ -415,14 +418,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -415,14 +418,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue; boost::optional<OString> oValue;
switch (pItem->Which()) switch (pItem->Which())
{ {
case RES_CHRATR_RSID:
{
pWhich = "character rsid";
css::uno::Any aAny;
static_cast<const SvxRsidItem*>(pItem)->QueryValue(aAny);
oValue = OString::number(aAny.get<sal_uInt32>());
break;
}
case RES_CHRATR_ROTATE: pWhich = "character rotation"; oValue = OString::number(static_cast<const SvxCharRotateItem*>(pItem)->GetValue()); break; case RES_CHRATR_ROTATE: pWhich = "character rotation"; oValue = OString::number(static_cast<const SvxCharRotateItem*>(pItem)->GetValue()); break;
case RES_PARATR_OUTLINELEVEL: pWhich = "paragraph outline level"; oValue = OString::number(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); break; case RES_PARATR_OUTLINELEVEL: pWhich = "paragraph outline level"; oValue = OString::number(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); break;
case RES_PARATR_NUMRULE: pWhich = "paragraph numbering rule"; oValue = OUStringToOString(static_cast<const SwNumRuleItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8); break; case RES_PARATR_NUMRULE: pWhich = "paragraph numbering rule"; oValue = OUStringToOString(static_cast<const SwNumRuleItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8); 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