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

Factor out SwFmtFrmSize::dumpAsXml() from nodedump

Change-Id: Idcf24d40876230a0e34f2f816dfe414b4a143f53
üst b1e0d30e
...@@ -97,6 +97,8 @@ public: ...@@ -97,6 +97,8 @@ public:
void SetHeightPercentRelation ( sal_Int16 n ) { m_eHeightPercentRelation = n; } void SetHeightPercentRelation ( sal_Int16 n ) { m_eHeightPercentRelation = n; }
void SetWidthPercent ( sal_uInt8 n ) { m_nWidthPercent = n; } void SetWidthPercent ( sal_uInt8 n ) { m_nWidthPercent = n; }
void SetWidthPercentRelation ( sal_Int16 n ) { m_eWidthPercentRelation = n; } void SetWidthPercentRelation ( sal_Int16 n ) { m_eWidthPercentRelation = n; }
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
}; };
inline const SwFmtFrmSize &SwAttrSet::GetFrmSize(bool bInP) const inline const SwFmtFrmSize &SwAttrSet::GetFrmSize(bool bInP) const
......
...@@ -426,6 +426,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -426,6 +426,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_CNTNT: case RES_CNTNT:
static_cast<const SwFmtCntnt*>(pItem)->dumpAsXml(writer); static_cast<const SwFmtCntnt*>(pItem)->dumpAsXml(writer);
break; break;
case RES_FRM_SIZE:
static_cast<const SwFmtFrmSize*>(pItem)->dumpAsXml(writer);
break;
default: bDone = false; break; default: bDone = false; break;
} }
if (bDone) if (bDone)
...@@ -440,14 +443,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) ...@@ -440,14 +443,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_FRM_SIZE:
{
pWhich = "frame size";
const SwFmtFrmSize* pSize = static_cast<const SwFmtFrmSize*>(pItem);
oValue = "height size type: " + OString::number(pSize->GetHeightSizeType()) + ", height: " + OString::number(pSize->GetHeight())
+ ", width size type: " + OString::number(pSize->GetWidthSizeType()) + ", width: " + OString::number(pSize->GetWidth());
break;
}
case RES_VERT_ORIENT: case RES_VERT_ORIENT:
{ {
pWhich = "frame vertical orientation"; pWhich = "frame vertical orientation";
......
...@@ -411,6 +411,25 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) ...@@ -411,6 +411,25 @@ bool SwFmtFrmSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return bRet; return bRet;
} }
void SwFmtFrmSize::dumpAsXml(xmlTextWriterPtr pWriter) const
{
xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtFrmSize"));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
std::stringstream aSize;
aSize << m_aSize;
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(aSize.str().c_str()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrmHeightType"), BAD_CAST(OString::number(m_eFrmHeightType).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrmWidthType"), BAD_CAST(OString::number(m_eFrmWidthType).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidthPercent"), BAD_CAST(OString::number(m_nWidthPercent).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eWidthPercentRelation"), BAD_CAST(OString::number(m_eWidthPercentRelation).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nHeightPercent"), BAD_CAST(OString::number(m_nHeightPercent).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eHeightPercentRelation"), BAD_CAST(OString::number(m_eHeightPercentRelation).getStr()));
xmlTextWriterEndElement(pWriter);
}
// Partially implemented inline in hxx // Partially implemented inline in hxx
SwFmtFillOrder::SwFmtFillOrder( SwFillOrder nFO ) SwFmtFillOrder::SwFmtFillOrder( SwFillOrder nFO )
: SfxEnumItem( RES_FILL_ORDER, sal_uInt16(nFO) ) : SfxEnumItem( RES_FILL_ORDER, sal_uInt16(nFO) )
......
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