[Libreoffice-commits] .: sal/inc sw/source

2012-11-02 Thread Libreoffice Gerrit user
 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(-)

New commits:
commit 091b9e46ece9bb94a67c8867e0d33f4e4bee6fad
Author: Luboš Luňák 
Date:   Fri Nov 2 19:18:57 2012 +0100

change std::clog debug output to SAL_INFO, so that it can be turned off

Change-Id: I92af860af6ac82302458cdd894f3ad038a863b49

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 777994e..b6af6f8 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 4280a0a..5762722 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 1a30749..c8b4636 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())

[Libreoffice-commits] .: sal/inc sw/source

2012-06-08 Thread Miklos Vajna
 sal/inc/sal/log-areas.dox  |2 +
 sw/source/core/text/porlay.cxx |   66 -
 2 files changed, 35 insertions(+), 33 deletions(-)

New commits:
commit e8c290f48f3f0396e278c7664ec84ff06aeb00b7
Author: Miklos Vajna 
Date:   Fri Jun 8 13:15:12 2012 +0200

SwLineLayout: OSL_ENSURE -> SAL_WARN_IF

Change-Id: I948344caeb9d48906732683ff9ba424f525c05d8

diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 246b969..c30bc0b 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -46,8 +46,10 @@ certain functionality.
 
 @section Writer
 
+@li @c sw.core - Writer core
 @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)
 
 */
+/* vim:set ft=cpp shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index feb7588..3e76d1f 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -340,8 +340,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, 
SwTxtFormatInfo &rInf )
 // portion spanning to the end or the next fixed portion
 while( pPos )
 {
-OSL_ENSURE( POR_LIN != pPos->GetWhichPor(),
-"SwLineLayout::CalcLine: don't use SwLinePortions !" );
+SAL_WARN_IF( POR_LIN == pPos->GetWhichPor(),
+"sw.core", "SwLineLayout::CalcLine: don't use 
SwLinePortions !" );
 
 // Null portions are eliminated. They can form if two FlyFrms
 // overlap.
@@ -386,8 +386,8 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, 
SwTxtFormatInfo &rInf )
 KSHORT nPosHeight = pPos->Height();
 KSHORT nPosAscent = pPos->GetAscent();
 
-OSL_ENSURE( nPosHeight >= nPosAscent,
-"SwLineLayout::CalcLine: bad ascent or height" );
+SAL_WARN_IF( nPosHeight < nPosAscent,
+"sw.core", "SwLineLayout::CalcLine: bad ascent or 
height" );
 
 if( pPos->IsHangingPortion() )
 {
@@ -547,7 +547,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, 
SwTxtFormatInfo &rInf )
 // Robust:
 if( nLineWidth < Width() )
 Width( nLineWidth );
-OSL_ENSURE( nLineWidth >= Width(), "SwLineLayout::CalcLine: line is 
bursting" );
+SAL_WARN_IF( nLineWidth < Width(), "sw.core", "SwLineLayout::CalcLine: 
line is bursting" );
 SetDummy( bTmpDummy );
 SetRedline( rLine.GetRedln() &&
 rLine.GetRedln()->CheckLine( rLine.GetStart(), rLine.GetEnd() ) );
@@ -643,7 +643,7 @@ SwScriptInfo::~SwScriptInfo()
 
 sal_uInt8 SwScriptInfo::WhichFont( xub_StrLen nIdx, const String* pTxt, const 
SwScriptInfo* pSI )
 {
-OSL_ENSURE( pTxt || pSI,"How should I determine the script type?" );
+SAL_WARN_IF( !pTxt && !pSI, "sw.core", "How should I determine the script 
type?" );
 sal_uInt16 nScript;
 
 // First we try to use our SwScriptInfo
@@ -737,7 +737,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, 
sal_Bool bRTL )
 // if change position = 0 we do not use any data from the arrays
 // because by deleting all characters of the first group at the 
beginning
 // of a paragraph nScript is set to a wrong value
-OSL_ENSURE( CountScriptChg(), "Where're my changes of script?" );
+SAL_WARN_IF( !CountScriptChg(), "sw.core", "Where're my changes of 
script?" );
 while( nCnt < CountScriptChg() )
 {
 if ( nChg > GetScriptChg( nCnt ) )
@@ -845,9 +845,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, 
sal_Bool bRTL )
 
 nScript = (sal_uInt8)GetI18NScriptTypeOfLanguage( 
(sal_uInt16)GetAppLanguage() );
 
-OSL_ENSURE( i18n::ScriptType::LATIN == nScript ||
-i18n::ScriptType::ASIAN == nScript ||
-i18n::ScriptType::COMPLEX == nScript, "Wrong default language" 
);
+SAL_WARN_IF( i18n::ScriptType::LATIN != nScript &&
+i18n::ScriptType::ASIAN != nScript &&
+i18n::ScriptType::COMPLEX != nScript, "sw.core", "Wrong 
default language" );
 
 nChg = nEnd;
 
@@ -870,9 +870,9 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, 
sal_Bool bRTL )
 
 while ( nChg < rTxt.Len() || ( aScriptChanges.empty() && !rTxt.Len() ) )
 {
-OSL_ENSURE( i18n::ScriptType::WEAK != nScript,
-"Inserting WEAK into SwScriptInfo structure" );
-OSL_ENSURE( STRING_LEN != nChg, "65K? Strange length of script 
section" );
+SAL_WARN_IF( i18n::ScriptType::WEAK == nScript,
+"sw.core", "Inserting WEAK into SwScriptInfo structure" );
+SAL_WARN_IF( STRING_LEN == nChg, "sw.core", "65K? Strange length of 
script section" );
 
 xub_StrLen nSearchStt = nChg;
 nChg = (