sw/source/core/docnode/nodedump.cxx | 38 ++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-)
New commits: commit bd44dcf8003d9a5936fb4a109561d403f8952ec2 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Apr 29 14:23:13 2014 +0200 sw doc model xml dump: include section properties Change-Id: I555c773b0dcc90c8efba5fd7d48b22278f2ef5a5 diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 11ebfa1..d4d70af 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -23,6 +23,8 @@ #include "fmtsrnd.hxx" #include "paratr.hxx" #include "redline.hxx" +#include "section.hxx" +#include "fmtclds.hxx" #include <swmodule.hxx> #include <svl/itemiter.hxx> #include <svl/intitem.hxx> @@ -119,6 +121,8 @@ static const char* TMP_FORMAT_I32 = "%" SAL_PRIdINT32; } +void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet); + void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel) { writer.startElement("sdrModel"); @@ -316,7 +320,7 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w ) name = "table"; break; case ND_SECTIONNODE: - name = "section"; + name = "sectionNode"; break; default: switch( GetStartNodeType()) @@ -345,6 +349,20 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w ) writer.startElement( name ); writer.writeFormatAttribute( "ptr", "%p", this ); writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() ); + + if (GetNodeType() == ND_SECTIONNODE) + { + SwSection& rSection = GetSectionNode()->GetSection(); + writer.startElement("section"); + + SwSectionFmt* pFmt = rSection.GetFmt(); + writer.startElement("swsectionfmt"); + lcl_dumpSfxItemSet(writer, &pFmt->GetAttrSet()); + writer.endElement(); + + writer.endElement(); + } + // writer.endElement(); - it is a start node, so don't end, will make xml better nested } @@ -389,7 +407,7 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) } case RES_CNTNT: { - pWhich = "frame content"; + pWhich = "content"; const SwFmtCntnt* pCntnt = static_cast<const SwFmtCntnt*>(pItem); oValue = "node index: " + OString::number(pCntnt->GetCntntIdx()->GetNode().GetIndex()); break; @@ -482,6 +500,22 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) } break; } + case RES_COL: + { + pWhich = "columns formatting"; + const SwFmtCol* pFmtCol = static_cast<const SwFmtCol*>(pItem); + oValue = "number of columns: " + OString::number(pFmtCol->GetColumns().size()); + break; + } + case RES_PROTECT: + pWhich = "protect"; + break; + case RES_EDIT_IN_READONLY: + pWhich = "edit in read-only"; + break; + case RES_COLUMNBALANCE: + pWhich = "column balance"; + break; } if (pWhich) writer.writeFormatAttribute("which", "%s", BAD_CAST(pWhich)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits