From 091b9e46ece9bb94a67c8867e0d33f4e4bee6fad Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 2 Nov 2012 19:18:57 +0100 Subject: change std::clog debug output to SAL_INFO, so that it can be turned off Change-Id: I92af860af6ac82302458cdd894f3ad038a863b49 --- sal/inc/sal/log-areas.dox | 1 + sw/source/filter/ww8/WW8Sttbf.cxx | 10 +--- sw/source/filter/ww8/WW8TableInfo.cxx | 91 ++++++++++------------------------- sw/source/filter/ww8/rtfexport.cxx | 11 ----- sw/source/filter/ww8/wrtw8nds.cxx | 13 ++--- sw/source/filter/ww8/wrtww8.cxx | 74 +++++++++------------------- sw/source/filter/ww8/ww8par.cxx | 4 +- 7 files changed, 56 insertions(+), 148 deletions(-) diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox index 777994e19707..b6af6f85bcb7 100644 --- a/sal/inc/sal/log-areas.dox +++ b/sal/inc/sal/log-areas.dox @@ -183,6 +183,7 @@ certain functionality. @li @c sw.rtf - .rtf export filter @li @c sw.uno - Writer UNO interfaces @li @c sw.ww8 - .doc/.docx export filter, .doc import filter (not writerfilter) +@li @c sw.ww8.level2 - further info for sw.ww8 @section xmloff diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx index 4280a0a09a0d..5762722f54c8 100644 --- a/sw/source/filter/ww8/WW8Sttbf.cxx +++ b/sw/source/filter/ww8/WW8Sttbf.cxx @@ -98,14 +98,8 @@ namespace ww8 #endif } -#if OSL_DEBUG_LEVEL > 1 - char sBuffer[256]; - snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"", - nOffset, nCount); - ::std::clog << "" - << rtl::OUStringToOString( aResult, RTL_TEXTENCODING_UTF8 ).getStr() << "" - << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "" << aResult << "" ); return aResult; diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 1a30749e13b2..c8b4636c731f 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -393,8 +393,7 @@ void WW8TableNodeInfo::setEndOfLine(bool bEndOfLine) pInner->setEndOfLine(bEndOfLine); #ifdef DBG_UTIL - ::std::clog << "" - << toString() << "" << ::std::endl; + SAL_INFO( "sw.ww8", "" << toString() << "" ); #endif } @@ -404,8 +403,7 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell) pInner->setEndOfCell(bEndOfCell); #ifdef DBG_UTIL - ::std::clog << "" - << toString() << "" << ::std::endl; + SAL_INFO( "sw.ww8", "" << toString() << "" ); #endif } @@ -416,8 +414,7 @@ void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable) pInner->setFirstInTable(bFirstInTable); #ifdef DBG_UTIL - ::std::clog << "" - << toString() << "" << ::std::endl; + SAL_INFO( "sw.ww8", "" << toString() << "" ); #endif } @@ -427,10 +424,8 @@ void WW8TableNodeInfo::setVertMerge(bool bVertMerge) pInner->setVertMerge(bVertMerge); - #ifdef DBG_UTIL - ::std::clog << "" - << toString() << "" << ::std::endl; + SAL_INFO( "sw.ww8", "" << toString() << "" ); #endif } @@ -449,9 +444,7 @@ void WW8TableNodeInfo::setNext(WW8TableNodeInfo * pNext) mpNext = pNext; #ifdef DBG_UTIL - ::std::clog << "" << toString() << "" - << pNext->toString() << "" - << ::std::endl; + SAL_INFO( "sw.ww8", "" << toString() << "" << pNext->toString() << "" ); #endif } @@ -576,15 +569,9 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable) { SwRect aRect = aTableCellInfo.getRect(); -#ifdef DBG_UTIL - static char sBuffer[1024]; - ::std::clog << "" << ::std::endl; - - snprintf(sBuffer, sizeof(sBuffer), - "", - aRect.Top(), aRect.Bottom(), aRect.Left(), aRect.Right()); - ::std::clog << sBuffer << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); + SAL_INFO( "sw.ww8", "" ); const SwTableBox * pTableBox = aTableCellInfo.getTableBox(); const SwStartNode * pSttNd = pTableBox->GetSttNd(); @@ -613,9 +600,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable) while (!bDone); } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); } pPrev = reorderByLayout(pTable); @@ -625,9 +610,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable) void WW8TableInfo::processSwTable(const SwTable * pTable) { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); WW8TableNodeInfo * pPrev = NULL; @@ -636,8 +619,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable) pPrev = processSwTableByLayout(pTable); #ifdef DBG_UTIL - WW8TableCellGrid::Pointer_t pCellGrid(getCellGridForTable(pTable)); - ::std::clog << pCellGrid->toString() << ::std::endl; + SAL_INFO( "sw.ww8", getCellGridForTable(pTable)->toString()); #endif } else @@ -660,9 +642,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable) pPrev->setNextNode(pEndNode); } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); } WW8TableNodeInfo * @@ -671,10 +651,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable, sal_uInt32 nRow, sal_uInt32 nDepth, WW8TableNodeInfo * pPrev) { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); const SwTableBoxes & rBoxes = pTableLine->GetTabBoxes(); @@ -687,9 +664,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable, pPrev = processTableBox(pTable, pBox, nRow, n, nDepth, n == rBoxes.size() - 1, pPrev); } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); return pPrev; } @@ -702,10 +677,8 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox, sal_uInt32 nCell, sal_uInt32 nDepth) { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); const SwTableLines & rLines = pBox->GetTabLines(); WW8TableNodeInfo::Pointer_t pNodeInfo; @@ -742,9 +715,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox, } } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); return pNodeInfo; } @@ -758,10 +729,8 @@ WW8TableInfo::processTableBox(const SwTable * pTable, bool bEndOfLine, WW8TableNodeInfo * pPrev) { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); WW8TableNodeInfo::Pointer_t pNodeInfo; const SwTableLines & rLines = pBox->GetTabLines(); @@ -837,9 +806,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable, } } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); return pPrev; } @@ -889,9 +856,8 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo } #ifdef DBG_UTIL - ::std::clog << pNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pNodeInfo->toString()); #endif - return pNodeInfo; } @@ -1035,7 +1001,7 @@ WW8TableNodeInfo * WW8TableInfo::reorderByLayout(const SwTable * pTable) WW8TableCellGrid::Pointer_t pCellGrid = getCellGridForTable(pTable); #ifdef DBG_UTIL - ::std::clog << pCellGrid->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pCellGrid->toString()); #endif pCellGrid->addShadowCells(); @@ -1108,9 +1074,7 @@ void WW8TableCellGrid::insert(const SwRect & rRect, void WW8TableCellGrid::addShadowCells() { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); RowTops_t::const_iterator aTopsIt = getRowTopsBegin(); @@ -1183,9 +1147,7 @@ void WW8TableCellGrid::addShadowCells() ++aTopsIt; } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); } WW8TableNodeInfo * WW8TableCellGrid::connectCells() @@ -1440,10 +1402,7 @@ void WW8TableCellGridRow::insert(const CellInfo & rCellInfo) m_pCellInfos->insert(rCellInfo); #ifdef DBG_UTIL - ::std::clog << "" - << rCellInfo.toString() - << "" - << ::std::endl; + SAL_INFO( "sw.ww8", "" << rCellInfo.toString() << "" ); #endif } diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 4ae68d2be8f0..33ab00928488 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -468,13 +468,6 @@ void RtfExport::WritePageDescTable() void RtfExport::ExportDocument_Impl() { -#if OSL_DEBUG_LEVEL > 1 - // MSWordExportBase::WriteText and others write debug messages to std::clog - // which is not interesting while debugging RtfExport - std::ostringstream aOss; - std::streambuf *pOldBuf = std::clog.rdbuf(aOss.rdbuf()); -#endif - // Make the header Strm() << '{' << OOO_STRING_SVTOOLS_RTF_RTF << '1' << OOO_STRING_SVTOOLS_RTF_ANSI; @@ -681,10 +674,6 @@ void RtfExport::ExportDocument_Impl() WriteMainText(); Strm() << '}'; - -#if OSL_DEBUG_LEVEL > 1 - std::clog.rdbuf(pOldBuf); -#endif } void RtfExport::PrepareNewPageDesc( const SfxItemSet* pSet, diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index e0713fa5a2c9..9159ba6e8c93 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -1556,9 +1556,8 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS if ( pTextNodeInfo.get() != NULL ) { #ifdef DBG_UTIL - ::std::clog << pTextNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); #endif - TableInfoCell( pTextNodeInfoInner ); } @@ -1744,9 +1743,7 @@ void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nA void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo( mpTableInfo->getTableNodeInfo( &rNode ) ); @@ -2056,7 +2053,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) if ( pTextNodeInfo.get() != NULL ) { #ifdef DBG_UTIL - ::std::clog << pTextNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pTextNodeInfo->toString()); #endif AttrOutput().TableInfoCell( pTextNodeInfoInner ); @@ -2357,9 +2354,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode ) AttrOutput().EndParagraph( pTextNodeInfoInner ); -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); } void WW8AttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo ) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index ac44ff8e4c05..d4a6fdbb0bdb 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1637,9 +1637,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, xub_StrLen nLen, bool bUnicode, rtl_TextEncoding eChrSet) { -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "" ); if( nLen ) { @@ -1650,9 +1648,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, { String sOut( rStr.Copy( nStt, nLen ) ); -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << ::rtl::OUStringToOString(sOut, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", sOut ); if (bUnicode) SwWW8Writer::WriteString16(Strm(), sOut, false); @@ -1661,9 +1657,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, } else { -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << ::rtl::OUStringToOString(rStr, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", rStr ); if (bUnicode) SwWW8Writer::WriteString16(Strm(), rStr, false); @@ -1672,9 +1666,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt, } } -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "" ); } void WW8Export::WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) @@ -2140,9 +2132,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t for( aIt = pTableBoxes->begin(); aIt != aItEnd; ++aIt, ++aItRowSpans) { -#if OSL_DEBUG_LEVEL > 1 sal_uInt16 npOCount = m_rWW8Export.pO->size(); -#endif const SwTableBox * pTabBox1 = *aIt; const SwFrmFmt * pBoxFmt = NULL; @@ -2168,10 +2158,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t else m_rWW8Export.Out_SwFmtTableBox( *m_rWW8Export.pO, NULL); // 8/16 Byte -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "" << m_rWW8Export.pO->size() - npOCount << "" - << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "" << ( m_rWW8Export.pO->size() - npOCount ) << "" ); } } @@ -2444,16 +2431,12 @@ void MSWordExportBase::WriteText() ::SetProgressState( nPos, pCurPam->GetDoc()->GetDocShell() ); } -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "" ); } void WW8Export::WriteMainText() { -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "" ); pFib->fcMin = Strm().Tell(); @@ -2476,9 +2459,7 @@ void WW8Export::WriteMainText() if( pLastNd ) nLastFmtId = GetId( (SwTxtFmtColl&)pLastNd->GetAnyFmtColl() ); -#if OSL_DEBUG_LEVEL > 1 - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8.level2", "" ); } bool MSWordExportBase::IsInTable() const @@ -3608,7 +3589,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer ShortToSVBT16( m_rWW8Export.nStyleBeforeFly, nStyle ); #ifdef DBG_UTIL - ::std::clog << "" << pNodeInfoInner->toString(); + SAL_INFO( "sw.ww8", "" << pNodeInfoInner->toString()); #endif m_rWW8Export.pO->clear(); @@ -3637,9 +3618,8 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer if (pNodeInfoInner->isEndOfCell()) { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); + m_rWW8Export.WriteCR(pNodeInfoInner); m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nStyle, (sal_uInt8*)&nStyle+2 ); // Style # @@ -3672,9 +3652,8 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer if (pNodeInfoInner->isEndOfLine()) { -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); + TableRowEnd(pNodeInfoInner->getDepth()); ShortToSVBT16(0, nStyle); @@ -3684,9 +3663,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer m_rWW8Export.pO->clear(); } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); } void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) @@ -3698,9 +3675,8 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) if (pNodeInfo.get() != NULL) { #ifdef DBG_UTIL - ::std::clog << pNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pNodeInfo->toString()); #endif - const ww8::WW8TableNodeInfo::Inners_t aInners = pNodeInfo->getInners(); ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aIt(aInners.rbegin()); ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aEnd(aInners.rend()); @@ -3712,25 +3688,23 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode) ++aIt; } } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + SAL_INFO( "sw.ww8", "" ); } void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) { + SAL_INFO( "sw.ww8", "" #ifdef DBG_UTIL -// whoever has need of the missing function should go and implement it! -// This piece of code always breaks builds... -// ::std::clog << "" << dbg_out(&rNode) << ::std::endl; + << dbg_out(&rNode) #endif + ); ww8::WW8TableNodeInfo::Pointer_t pNodeInfo = mpTableInfo->getTableNodeInfo( &rNode ); if (pNodeInfo.get() != NULL) - { + { #ifdef DBG_UTIL - ::std::clog << pNodeInfo->toString() << ::std::endl; + SAL_INFO( "sw.ww8", pNodeInfo->toString()); #endif const ww8::WW8TableNodeInfo::Inners_t aInners = pNodeInfo->getInners(); @@ -3742,10 +3716,8 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode ) AttrOutput().TableNodeInfoInner(pInner); ++aIt; } - } -#ifdef DBG_UTIL - ::std::clog << "" << ::std::endl; -#endif + } + SAL_INFO( "sw.ww8", "" ); } const NfKeywordTable & MSWordExportBase::GetNfKeywordTable() diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 6d785be3dde9..4110bfc401a8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3183,11 +3183,9 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) if (!maFtnStack.empty()) cInsert = 0x2; break; -#if OSL_DEBUG_LEVEL > 1 default: - ::std::clog << "" << ::std::endl; + SAL_INFO( "sw.ww8.level2", "" ); break; -#endif } if( '\x0' != cInsert ) -- cgit