diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-08-22 23:01:41 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-25 09:27:09 +0200 |
commit | a00778f9d3c1ad3e09ee6519e4523c9ff96f9920 (patch) | |
tree | ae0978febc665df77945110e353fac498dc3cf0c /sw/source | |
parent | c5d47afc152fe5440ebe733203114962f84d63ca (diff) |
Dump table attributes and page description items
Adds the SwPageDesc name to the dumpAsXml output of the
SwFmtPageDesc / RES_PAGEDESC SfxPoolItem and dumps the tables
attibutes.
Adtittionally this renames the unknown field name, so it doesn't
produce wrong XML output (blamed by "xmllint --format") and adds
the hex node type to the start and end node XML output.
Reviewed on:
https://gerrit.libreoffice.org/11091
Change-Id: I3cde39d423e17909243675efdd39557a6bfffbd7
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/docnode/nodedump.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index f3041cfb5cb7..40bbecb08633 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -33,6 +33,8 @@ #include "redline.hxx" #include "section.hxx" #include "fmtclds.hxx" +#include "fmtpdsc.hxx" +#include "pagedesc.hxx" #include <swmodule.hxx> #include <svl/itemiter.hxx> #include <svl/intitem.hxx> @@ -258,7 +260,7 @@ void SwFldTypes::dumpAsXml( xmlTextWriterPtr w ) const writer.startElement("swfmtfld"); writer.writeFormatAttribute("ptr", "%p", pCurFldFmt); writer.writeFormatAttribute("pTxtAttr", "%p", pCurFldFmt->GetTxtFld()); - const char* name = "???"; + const char* name = "FIXME_unhandledfield"; switch(pCurFldFmt->GetField()->GetTyp()->Which()) { case RES_PAGENUMBERFLD: name = "swpagenumberfield"; break; @@ -321,6 +323,7 @@ void SwNode::dumpAsXml( xmlTextWriterPtr w ) } writer.startElement( name ); writer.writeFormatAttribute( "ptr", "%p", this ); + writer.writeFormatAttribute( "type", "0x%04x", GetNodeType() ); writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() ); writer.endElement(); if( GetNodeType() == ND_ENDNODE ) @@ -365,8 +368,17 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w ) } writer.startElement( name ); writer.writeFormatAttribute( "ptr", "%p", this ); + writer.writeFormatAttribute( "type", "0x%04x", GetNodeType() ); writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() ); + if (IsTableNode()) + { + writer.startElement("attrset"); + const SwAttrSet& rAttrSet = GetTableNode()->GetTable().GetFrmFmt()->GetAttrSet(); + lcl_dumpSfxItemSet(writer, &rAttrSet); + writer.endElement(); + } + // writer.endElement(); - it is a start node, so don't end, will make xml better nested } @@ -575,6 +587,12 @@ void lcl_dumpSfxItemSet(WriterHelper& writer, const SfxItemSet* pSet) case RES_SHADOW: pWhich = "shadow"; break; + case RES_PAGEDESC: + pWhich = "page description"; + const SwFmtPageDesc* pFmt = static_cast<const SwFmtPageDesc*>(pItem); + if (pFmt->GetPageDesc()) + oValue = "name: " + OUStringToOString(pFmt->GetPageDesc()->GetName(), RTL_TEXTENCODING_UTF8); + break; } if (pWhich) writer.writeFormatAttribute("which", "%s", BAD_CAST(pWhich)); |