diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-01 22:05:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-01 22:08:18 +0200 |
commit | aa3a17653bcc049edd5764f3ec18ba78ba697a9c (patch) | |
tree | af250ef6faf2230051ac3cb9c4683c1c0904ed73 | |
parent | 0d2d4288596a39f74f29b626f06624be6725a06e (diff) |
Partially revert "Removed dead code"
This partially reverts commit 1e2c9be36ba9f94a27b3aa73c87ceb3d52e100dc,
CellInfo::toString and WW8TableCellGrid::toString is still needed with
dbglevel>1.
-rw-r--r-- | sw/source/filter/ww8/WW8TableInfo.cxx | 103 | ||||
-rw-r--r-- | sw/source/filter/ww8/WW8TableInfo.hxx | 4 |
2 files changed, 107 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 4e449e6d17..2883e98a0b 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -1014,6 +1014,27 @@ bool CellInfo::operator < (const CellInfo & aCellInfo) const return aRet; } +#if OSL_DEBUG_LEVEL > 1 +::std::string CellInfo::toString() const +{ + static char sBuffer[256]; + + snprintf(sBuffer, sizeof(sBuffer), + "<cellinfo left=\"%ld\"" + " right=\"%ld\"" + " top=\"%ld\"" + " bottom=\"%ld\"" + " node=\"%p\"/>", + left(), + right(), + top(), + bottom(), + m_pNodeInfo); + + return sBuffer; +} +#endif + WW8TableNodeInfo * WW8TableInfo::reorderByLayout(const SwTable * pTable) { WW8TableNodeInfo * pPrev = NULL; @@ -1280,6 +1301,88 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells() return pLastNodeInfo; } +#if OSL_DEBUG_LEVEL > 1 +string WW8TableCellGrid::toString() +{ + string sResult = "<WW8TableCellGrid>"; + + RowTops_t::const_iterator aTopsIt = getRowTopsBegin(); + static char sBuffer[1024]; + while (aTopsIt != getRowTopsEnd()) + { + sprintf(sBuffer, "<row y=\"%ld\">", *aTopsIt); + sResult += sBuffer; + + CellInfoMultiSet::const_iterator aCellIt = getCellsBegin(*aTopsIt); + CellInfoMultiSet::const_iterator aCellsEnd = getCellsEnd(*aTopsIt); + + while (aCellIt != aCellsEnd) + { + snprintf(sBuffer, sizeof(sBuffer), "<cellInfo top=\"%ld\" bottom=\"%ld\" left=\"%ld\" right=\"%ld\">", + aCellIt->top(), aCellIt->bottom(), aCellIt->left(), aCellIt->right()); + sResult += sBuffer; + + WW8TableNodeInfo * pInfo = aCellIt->getTableNodeInfo(); + if (pInfo != NULL) + sResult += pInfo->toString(); + else + sResult += "<shadow/>\n"; + + sResult += "</cellInfo>\n"; + ++aCellIt; + } + + WW8TableCellGridRow::Pointer_t pRow = getRow(*aTopsIt); + WidthsPtr pWidths = pRow->getWidths(); + if (pWidths != NULL) + { + sResult += "<widths>"; + + Widths::const_iterator aItEnd = pWidths->end(); + for (Widths::const_iterator aIt = pWidths->begin(); + aIt != aItEnd; + ++aIt) + { + if (aIt != pWidths->begin()) + sResult += ", "; + + snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIxUINT32 "", *aIt); + sResult += sBuffer; + } + + sResult += "</widths>"; + } + + RowSpansPtr pRowSpans = pRow->getRowSpans(); + if (pRowSpans.get() != NULL) + { + sResult += "<rowspans>"; + + RowSpans::const_iterator aItEnd = pRowSpans->end(); + for (RowSpans::const_iterator aIt = pRowSpans->begin(); + aIt != aItEnd; + ++aIt) + { + if (aIt != pRowSpans->begin()) + sResult += ", "; + + snprintf(sBuffer, sizeof(sBuffer), "%" SAL_PRIxUINT32 "", *aIt); + sResult += sBuffer; + } + + sResult += "</rowspans>"; + } + + sResult += "</row>\n"; + ++aTopsIt; + } + + sResult += "</WW8TableCellGrid>\n"; + + return sResult; +} +#endif + TableBoxVectorPtr WW8TableCellGrid::getTableBoxesOfRow (WW8TableNodeInfoInner * pNodeInfoInner) { diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index 3979db3bf2..96baf314cf 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -246,7 +246,9 @@ public: void addShadowCells(); WW8TableNodeInfo * connectCells(); +#if OSL_DEBUG_LEVEL > 1 string toString(); +#endif TableBoxVectorPtr getTableBoxesOfRow(WW8TableNodeInfoInner * pNodeInfo); WidthsPtr getWidthsOfRow(WW8TableNodeInfoInner * pNodeInfo); @@ -352,7 +354,9 @@ public: m_nFmtFrmWidth = nFmtFrmWidth; } +#if OSL_DEBUG_LEVEL > 1 ::std::string toString() const; +#endif }; } |