summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-22 10:33:59 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-22 19:33:56 +0100
commitcc15d898721f90412cf03ff76e4163cc91251d67 (patch)
tree7a506190099cc612e37f27633a55229a206937df /sw
parentf0b4b944c1fc4ae894550fcade9cff1802780960 (diff)
Factor out SwFmtHoriOrient::dumpAsXml() from nodedump
Change-Id: I63ec35abcd7e69147ff4f98b1989875967c470fe
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/fmtornt.hxx2
-rw-r--r--sw/source/core/docnode/nodedump.cxx10
-rw-r--r--sw/source/core/layout/atrfrm.cxx11
3 files changed, 16 insertions, 7 deletions
diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx
index 9c72d89052f7..53049313986d 100644
--- a/sw/inc/fmtornt.hxx
+++ b/sw/inc/fmtornt.hxx
@@ -99,6 +99,8 @@ public:
bool IsPosToggle() const { return bPosToggle; }
void SetPosToggle( bool bNew ) { bPosToggle = bNew; }
+
+ void dumpAsXml(struct _xmlTextWriter* pWriter) const;
};
inline SwFmtVertOrient &SwFmtVertOrient::operator=( const SwFmtVertOrient &rCpy )
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 7ada0a0ced03..971f6b8c6d0c 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -432,6 +432,9 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
case RES_VERT_ORIENT:
static_cast<const SwFmtVertOrient*>(pItem)->dumpAsXml(writer);
break;
+ case RES_HORI_ORIENT:
+ static_cast<const SwFmtHoriOrient*>(pItem)->dumpAsXml(writer);
+ break;
default: bDone = false; break;
}
if (bDone)
@@ -446,13 +449,6 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet)
boost::optional<OString> oValue;
switch (pItem->Which())
{
- case RES_HORI_ORIENT:
- {
- pWhich = "frame horizontal orientation";
- const SwFmtHoriOrient* pOrient = static_cast<const SwFmtHoriOrient*>(pItem);
- oValue = "orient: " + OString::number(pOrient->GetHoriOrient()) + ", relation: " + OString::number(pOrient->GetRelationOrient()) + ", position: " + OString::number(pOrient->GetPos());
- break;
- }
case RES_ANCHOR:
{
pWhich = "frame anchor";
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index cdd9d25d7e2f..070bb4ba061b 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -1454,6 +1454,17 @@ bool SwFmtHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
return bRet;
}
+void SwFmtHoriOrient::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+ xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtHoriOrient"));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST(OString::number(Which()).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nXPos"), BAD_CAST(OString::number(nXPos).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eOrient"), BAD_CAST(OString::number(eOrient).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eRelation"), BAD_CAST(OString::number(eRelation).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("bPosToggle"), BAD_CAST(OString::boolean(bPosToggle).getStr()));
+ xmlTextWriterEndElement(pWriter);
+}
+
// Partially implemented inline in hxx
SwFmtAnchor::SwFmtAnchor( RndStdIds nRnd, sal_uInt16 nPage )
: SfxPoolItem( RES_ANCHOR ),