diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-22 10:33:55 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-12-22 19:33:55 +0100 |
commit | f0b4b944c1fc4ae894550fcade9cff1802780960 (patch) | |
tree | ae6a1ebaa0671c72f99f185fcc7191bd569e1ed2 /sw | |
parent | fe5527f1c6dc259af464a0593e86a2da2983b7ed (diff) |
Factor out SwFmtVertOrient::dumpAsXml() from nodedump
Change-Id: Ic1008f0879f121abf3786d7eda282cce189c461a
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/fmtornt.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/layout/atrfrm.cxx | 10 |
3 files changed, 15 insertions, 7 deletions
diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx index 17b08e8b12eb..9c72d89052f7 100644 --- a/sw/inc/fmtornt.hxx +++ b/sw/inc/fmtornt.hxx @@ -62,6 +62,8 @@ public: SwTwips GetPos() const { return m_nYPos; } void SetPos( SwTwips nNew ) { m_nYPos = nNew; } + + void dumpAsXml(struct _xmlTextWriter* pWriter) const; }; class SW_DLLPUBLIC SwFmtHoriOrient: public SfxPoolItem diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 7d18b6563e21..7ada0a0ced03 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -429,6 +429,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) case RES_FRM_SIZE: static_cast<const SwFmtFrmSize*>(pItem)->dumpAsXml(writer); break; + case RES_VERT_ORIENT: + static_cast<const SwFmtVertOrient*>(pItem)->dumpAsXml(writer); + break; default: bDone = false; break; } if (bDone) @@ -443,13 +446,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) boost::optional<OString> oValue; switch (pItem->Which()) { - case RES_VERT_ORIENT: - { - pWhich = "frame vertical orientation"; - const SwFmtVertOrient* pOrient = static_cast<const SwFmtVertOrient*>(pItem); - oValue = "orient: " + OString::number(pOrient->GetVertOrient()) + ", relation: " + OString::number(pOrient->GetRelationOrient()) + ", position: " + OString::number(pOrient->GetPos()); - break; - } case RES_HORI_ORIENT: { pWhich = "frame horizontal orientation"; diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 79517f21cd37..cdd9d25d7e2f 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1353,6 +1353,16 @@ bool SwFmtVertOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) return bRet; } +void SwFmtVertOrient::dumpAsXml(xmlTextWriterPtr pWriter) const +{ + xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtVertOrient")); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nYPos"), BAD_CAST(OString::number(m_nYPos).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eOrient"), BAD_CAST(OString::number(m_eOrient).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eRelation"), BAD_CAST(OString::number(m_eRelation).getStr())); + xmlTextWriterEndElement(pWriter); +} + // Partially implemented inline in hxx SwFmtHoriOrient::SwFmtHoriOrient( SwTwips nX, sal_Int16 eHori, sal_Int16 eRel, bool bPos ) |