summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
diff options
context:
space:
mode:
authorHenning Brinkmann <hbrinkm@openoffice.org>2011-02-22 15:30:07 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-17 16:05:31 +0200
commit3b6ddf6f0ce1be4b13ccecbc6fe74a2c0d716dfb (patch)
treefdc53b2ff3867f1938ebc1661532a839cb701cca /writerfilter/source/dmapper/DomainMapperTableHandler.cxx
parenta6ad96a9509f78ce8ece37fc64e430023e65904a (diff)
debug table structure, remove lcl_printProperties [hg:08e908d8968c]
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx58
1 files changed, 58 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 55bc9c9c2920..6d91594d1a91 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -46,6 +46,58 @@ using namespace ::std;
#define DEFAULT_CELL_MARGIN 108 //default cell margin, not documented
#ifdef DEBUG_DMAPPER_TABLE_HANDLER
+XMLTag::Pointer_t handleToTag(Handle_t & rHandle)
+{
+ XMLTag::Pointer_t pTag(new XMLTag("handle"));
+
+ pTag->chars(rHandle->getString());
+
+ return pTag;
+}
+
+void cellSequenceToTags(XMLTag::Pointer_t pTag, CellSequence_t & rCellSequence)
+{
+ sal_Int32 nCount = rCellSequence.getLength();
+ pTag->addAttr("count", nCount);
+
+ for (sal_Int32 n = 0; n < nCount; n++)
+ {
+ Handle_t aHandle = rCellSequence[n];
+ pTag->addTag(handleToTag(aHandle));
+ }
+}
+
+void rowSequenceToTags(XMLTag::Pointer_t pTag, RowSequence_t & rRowSequence)
+{
+ sal_Int32 nCount = rRowSequence.getLength();
+ pTag->addAttr("count", nCount);
+
+ for (sal_Int32 n = 0; n < nCount; n++)
+ {
+ CellSequence_t & rCells = rRowSequence[n];
+ XMLTag::Pointer_t pCellTag(new XMLTag("cell"));
+ cellSequenceToTags(pCellTag, rCells);
+ pTag->addTag(pCellTag);
+ }
+}
+
+XMLTag::Pointer_t tableSequenceToTag(TableSequence_t & rTableSequence)
+{
+ XMLTag::Pointer_t pTag(new XMLTag("table"));
+ sal_Int32 nCount = rTableSequence.getLength();
+ pTag->addAttr("count", nCount);
+
+ for (sal_Int32 n = 0; n < nCount; n++)
+ {
+ RowSequence_t & rRowSequence = rTableSequence[n];
+ XMLTag::Pointer_t pRowTag(new XMLTag("row"));
+ rowSequenceToTags(pRowTag, rRowSequence);
+ pTag->addTag(pRowTag);
+ }
+
+ return pTag;
+}
+
static void lcl_printProperties( PropertyMapPtr pProps )
{
if( pProps.get() )
@@ -722,6 +774,12 @@ void DomainMapperTableHandler::endTable()
{
try
{
+#ifdef DEBUG_DMAPPER_TABLE_HANDLER
+ XMLTag::Pointer_t pTag = tableSequenceToTag(*m_pTableSeq);
+ dmapper_logger->addTag(pTag);
+
+ ::std::clog << pTag->toTree() << ::std::endl;
+#endif
uno::Reference<text::XTextTable> xTable = m_xText->convertToTable(*m_pTableSeq,
aCellProperties,
aRowProperties,