[Libreoffice-commits] core.git: drawinglayer/source include/sal include/tools linguistic/source sd/source sfx2/source vcl/source
Tor Lillqvist
tml at collabora.com
Fri Mar 28 07:57:03 PDT 2014
drawinglayer/source/processor2d/vclprocessor2d.cxx | 4 -
include/sal/log-areas.dox | 2
include/tools/debug.hxx | 11 ----
linguistic/source/gciterator.cxx | 6 --
sd/source/core/PageListWatcher.cxx | 12 +----
sfx2/source/appl/fileobj.cxx | 14 -----
sfx2/source/doc/SfxDocumentMetaData.cxx | 39 +++++-----------
vcl/source/gdi/bmpfast.cxx | 50 +++++----------------
8 files changed, 37 insertions(+), 101 deletions(-)
New commits:
commit ae00e71afd36f7215669c34e8ea8cafaeed6e468
Author: Tor Lillqvist <tml at collabora.com>
Date: Fri Mar 28 16:43:39 2014 +0200
Bin rest of DBG_WARNING[123]
Change-Id: Iaaf36d012e353f73f083c9c0ebbbb6d0953b16c8
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index a0e8b40..b7c3bfe 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -192,7 +192,7 @@ namespace drawinglayer
switch( pTCPP->getTextEmphasisMark() )
{
default:
- DBG_WARNING1( "DrawingLayer: Unknown EmphasisMark style (%d)!", pTCPP->getTextEmphasisMark() );
+ SAL_WARN("drawinglayer", "Unknown EmphasisMark style " << pTCPP->getTextEmphasisMark() );
// fall through
case primitive2d::TEXT_EMPHASISMARK_NONE: eFontEmphasisMark = EMPHASISMARK_NONE; break;
case primitive2d::TEXT_EMPHASISMARK_DOT: eFontEmphasisMark = EMPHASISMARK_DOT; break;
@@ -217,7 +217,7 @@ namespace drawinglayer
switch( pTCPP->getTextRelief() )
{
default:
- DBG_WARNING1( "DrawingLayer: Unknown Relief style (%d)!", pTCPP->getTextRelief() );
+ SAL_WARN( "drawinglayer", "Unknown Relief style " << pTCPP->getTextRelief() );
// fall through
case primitive2d::TEXT_RELIEF_NONE: eFontRelief = RELIEF_NONE; break;
case primitive2d::TEXT_RELIEF_EMBOSSED: eFontRelief = RELIEF_EMBOSSED; break;
diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox
index 792d4a7..60a6aac 100644
--- a/include/sal/log-areas.dox
+++ b/include/sal/log-areas.dox
@@ -122,6 +122,7 @@ certain functionality.
@section Draw
@li @c sd
+ at li @c sd.core
@li @c sd.filter
@li @c sd.fwk
@li @c sd.slideshow
@@ -451,6 +452,7 @@ certain functionality.
@li @c configmgr
@li @c cppcanvas
@li @c cppcanvas.emf
+ at li @c drawinglayer
@li @c helpcompiler
@li @c linguistic
@li @c oox
diff --git a/include/tools/debug.hxx b/include/tools/debug.hxx
index 5574d0d..de606a1 100644
--- a/include/tools/debug.hxx
+++ b/include/tools/debug.hxx
@@ -35,7 +35,7 @@
Because the assertion macro (DBG_ASSERT) has been used for
true assertions as well as to log warnings, it maps to SAL_WARN instead of
standard assert. The warning and error macros (DBG_ASSERTWARNING,
- DBG_WARNING, DBG_WARNING1, ..., DBG_WARNING3, DBG_ERRORFILE) all map to
+ DBG_WARNING, DBG_ERRORFILE) all map to
SAL_INFO.
*/
@@ -317,12 +317,6 @@ public:
#define DBG_WARNING( aWarning ) \
SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning)
-#define DBG_WARNING1( aWarning, x1 ) \
- SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning, x1)
-#define DBG_WARNING2( aWarning, x1, x2 ) \
- SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning, x1, x2)
-#define DBG_WARNING3( aWarning, x1, x2, x3 ) \
- SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aWarning, x1, x2, x3)
#define DBG_ERRORFILE( aError ) \
SAL_DETAIL_INFO_IF_FORMAT(true, "legacy.tools", aError, __FILE__, __LINE__)
@@ -371,9 +365,6 @@ typedef const sal_Char* (*DbgUsr)(const void* pThis );
#define DBG_ASSERTWARNING( sCon, aWarning ) ((void)0)
#define DBG_ASSERT( sCon, aError ) ((void)0)
#define DBG_WARNING( aWarning ) ((void)0)
-#define DBG_WARNING1( aWarning, x1 ) ((void)0)
-#define DBG_WARNING2( aWarning, x1, x2 ) ((void)0)
-#define DBG_WARNING3( aWarning, x1, x2, x3 ) ((void)0)
#define DBG_ERRORFILE( aError ) ((void)0)
#define DBG_TESTSOLARMUTEX() ((void)0)
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index e96c9d0..73c010b 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -860,10 +860,8 @@ throw (uno::RuntimeException, std::exception)
}
catch (const ::uno::Exception &rE)
{
- (void) rE;
- // ignore
- DBG_WARNING1("processLinguServiceEvent: exception:\n%s",
- OUStringToOString(rE.Message, RTL_TEXTENCODING_UTF8).getStr());
+ // ignore
+ SAL_WARN("linguistic", "processLinguServiceEvent: exception: " << rE.Message);
}
}
}
diff --git a/sd/source/core/PageListWatcher.cxx b/sd/source/core/PageListWatcher.cxx
index 5b89332..ed73841 100644
--- a/sd/source/core/PageListWatcher.cxx
+++ b/sd/source/core/PageListWatcher.cxx
@@ -97,10 +97,8 @@ SdPage* ImpPageListWatcher::GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum)
pRetval = maPageVectorStandard[nPgNum];
else
{
- DBG_ASSERT(nPgNum <= maPageVectorStandard.size(),
- "ImpPageListWatcher::GetSdPage(PK_STANDARD): access out of range");
- DBG_WARNING2 (" %d > %d",
- nPgNum, nPgNum<maPageVectorStandard.size());
+ SAL_WARN( "sd.core",
+ "ImpPageListWatcher::GetSdPage(PK_STANDARD): page number " << nPgNum << " >= " << maPageVectorStandard.size() );
}
break;
}
@@ -110,10 +108,8 @@ SdPage* ImpPageListWatcher::GetSdPage(PageKind ePgKind, sal_uInt32 nPgNum)
pRetval = maPageVectorNotes[nPgNum];
else
{
- DBG_ASSERT(nPgNum <= maPageVectorNotes.size(),
- "ImpPageListWatcher::GetSdPage(PK_NOTES): access out of range");
- DBG_WARNING2(" %d > %d",
- nPgNum, nPgNum<maPageVectorNotes.size());
+ SAL_WARN( "sd.core",
+ "ImpPageListWatcher::GetSdPage(PK_NOTES): page number " << nPgNum << " >= " << maPageVectorStandard.size() );
}
break;
}
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 39db16de..509b17b 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -357,23 +357,13 @@ sal_Bool SvFileObject::GetGraphic_Impl( Graphic& rGrf, SvStream* pStream )
if( pStream && ERRCODE_IO_PENDING == pStream->GetError() )
pStream->ResetError();
-#ifdef DBG_UTIL
if( nRes )
{
if( xMed.Is() && !pStream )
- {
- DBG_WARNING3( "Graphic error [%d] - [%s] URL[%s]",
- nRes,
- xMed->GetPhysicalName().getStr(),
- sFileNm.getStr() );
- }
+ SAL_WARN( "sfx.appl", "Graphic error [" << nRes << "] - [" << xMed->GetPhysicalName() << "] URL[" << sFileNm << "]" );
else
- {
- DBG_WARNING2( "Graphic error [%d] - [%s]",
- nRes, sFileNm.getStr() );
- }
+ SAL_WARN( "sfx.appl", "Graphic error [" << nRes << "] - [" << sFileNm << "]" );
}
-#endif
return GRFILTER_OK == nRes;
}
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 3696aa6..83e8d7e 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -526,8 +526,7 @@ textToDateOrDateTime(css::util::Date & io_rd, css::util::DateTime & io_rdt,
&io_rd, io_rdt, o_rIsDateTime, &o_rTimeZone, i_text)) {
return true;
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid date: %s",
- OUStringToOString(i_text, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid date: " << i_text );
return false;
}
}
@@ -539,8 +538,7 @@ textToDateTime(css::util::DateTime & io_rdt, const OUString& i_text) throw ()
if (::sax::Converter::parseDateTime(io_rdt, 0, i_text)) {
return true;
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid date: %s",
- OUStringToOString(i_text, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid date: " << i_text);
return false;
}
}
@@ -592,8 +590,7 @@ throw ()
if (::sax::Converter::convertDuration(io_rDur, i_rText)) {
return true;
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid duration: %s",
- OUStringToOString(i_rText, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid duration: " << i_rText );
return false;
}
}
@@ -998,9 +995,7 @@ propsToStrings(css::uno::Reference<css::beans::XPropertySet> const & i_xPropSet)
as.push_back(std::make_pair(vt,
OUString("float")));
} else {
- DBG_WARNING1("SfxDocumentMetaData: unsupported property type: %s",
- OUStringToOString(any.getValueTypeName(),
- RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Unsupported property type: " << any.getValueTypeName() );
continue;
}
attrs.push_back(as);
@@ -1294,8 +1289,7 @@ void SAL_CALL SfxDocumentMetaData::init(
if (::sax::Converter::convertDouble(d, text)) {
any <<= d;
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid float: %s",
- OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid float: " << text);
continue;
}
} else if ( type == "date" ) {
@@ -1319,8 +1313,7 @@ void SAL_CALL SfxDocumentMetaData::init(
}
}
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid date: %s",
- OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid date: " << text);
continue;
}
} else if ( type == "time" ) {
@@ -1328,8 +1321,7 @@ void SAL_CALL SfxDocumentMetaData::init(
if (textToDuration(ud, text)) {
any <<= ud;
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid time: %s",
- OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid time: " << text);
continue;
}
} else if ( type == "boolean" ) {
@@ -1337,8 +1329,7 @@ void SAL_CALL SfxDocumentMetaData::init(
if (::sax::Converter::convertBool(b, text)) {
any <<= b;
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid boolean: %s",
- OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid boolean: " << text);
continue;
}
} else if ( type == "string" || true) { // default
@@ -1348,8 +1339,7 @@ void SAL_CALL SfxDocumentMetaData::init(
m_xUserDefined->addProperty(name,
css::beans::PropertyAttribute::REMOVABLE, any);
} catch (const css::beans::PropertyExistException &) {
- DBG_WARNING1("SfxDocumentMetaData: duplicate: %s",
- OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Duplicate: " << name);
// ignore; duplicate
} catch (const css::beans::IllegalTypeException &) {
OSL_TRACE("SfxDocumentMetaData: illegal type: %s",
@@ -1746,8 +1736,7 @@ SfxDocumentMetaData::getDocumentStatistics() throw (css::uno::RuntimeException,
if (!::sax::Converter::convertNumber(val, text, 0,
std::numeric_limits<sal_Int32>::max()) || (val < 0)) {
val = 0;
- DBG_WARNING1("SfxDocumentMetaData: invalid number: %s",
- OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr());
+ SAL_WARN("sfx.doc", "Invalid number: " << text);
}
any <<= val;
stat.Value = any;
@@ -1778,9 +1767,7 @@ SfxDocumentMetaData::setDocumentStatistics(
attributes.push_back(std::make_pair(s_stdStatAttrs[j],
buf.makeStringAndClear()));
} else {
- DBG_WARNING1("SfxDocumentMetaData: invalid statistic: %s",
- OUStringToOString(name, RTL_TEXTENCODING_UTF8)
- .getStr());
+ SAL_WARN("sfx.doc", "Invalid statistic: " << name);
}
break;
}
@@ -2217,9 +2204,7 @@ void SAL_CALL SfxDocumentMetaData::setModified( ::sal_Bool bModified )
throw;
} catch (const css::uno::Exception & e) {
// ignore
- DBG_WARNING1("SfxDocumentMetaData::setModified: exception:\n%s",
- OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
- (void) e;
+ SAL_WARN("sfx.doc", "setModified: exception: " << e.Message);
}
} else {
if (xMB.is()) {
diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 30c1ccf..949e21a 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -446,16 +446,10 @@ inline bool ImplConvertFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc
return ImplConvertToBitmap<BMP_FORMAT_32BIT_TC_RGBA>( aSrcType, rDst, rSrc );
}
-#ifdef DEBUG
static int nNotAccelerated = 0;
- if( rSrc.mnWidth * rSrc.mnHeight >= 4000 )
- if( ++nNotAccelerated == 100 )
- {
- int foo = 0; (void)foo; // so no warning is created when building on pro with debug
- DBG_WARNING2( "ImplConvertFromBitmap for not accelerated case (0x%04X->0x%04X)",
- rSrc.mnFormat, rDst.mnFormat );
- }
-#endif
+ SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100,
+ "vcl.gdi",
+ "ImplConvertFromBitmap for not accelerated case (" << std::hex << rSrc.mnFormat << "->" << rDst.mnFormat << ")" );
return false;
}
@@ -561,17 +555,10 @@ bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
return ImplConvertFromBitmap<BMP_FORMAT_32BIT_TC_RGBA>( rDst, rSrc );
}
-#ifdef DEBUG
static int nNotAccelerated = 0;
- if( rSrc.mnWidth * rSrc.mnHeight >= 4000 )
- {
- if( ++nNotAccelerated == 100 )
- {
- int foo = 0; (void)foo; // so no warning is created when building on pro with debug
- DBG_WARNING2( "ImplFastBitmapConversion for not accelerated case (0x%04X->0x%04X)", rSrc.mnFormat, rDst.mnFormat );
- }
- }
-#endif
+ SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100,
+ "vcl.gdi",
+ "ImplFastBitmapConversion for not accelerated case (" << std::hex << rSrc.mnFormat << "->" << rDst.mnFormat << ")" );
return false;
}
@@ -696,17 +683,10 @@ bool ImplBlendFromBitmap( BitmapBuffer& rDst, const BitmapBuffer& rSrc, const Bi
return ImplBlendToBitmap<BMP_FORMAT_32BIT_TC_RGBA>( aSrcType, rDst, rSrc, rMsk );
}
-#ifdef DEBUG
static int nNotAccelerated = 0;
- if( rSrc.mnWidth * rSrc.mnHeight >= 4000 )
- if( ++nNotAccelerated == 100 )
- {
- int foo = 0; (void)foo; // so no warning is created when building on pro with debug
- DBG_WARNING3( "ImplBlendFromBitmap for not accelerated case (0x%04X*0x%04X->0x%04X)",
- rSrc.mnFormat, rMsk.mnFormat, rDst.mnFormat );
- }
-#endif
-
+ SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100,
+ "vcl.gdi",
+ "ImplBlendFromBitmap for not accelerated case (" << std::hex << rSrc.mnFormat << "*" << rMsk.mnFormat << "->" << rDst.mnFormat );
return false;
}
@@ -819,16 +799,10 @@ bool ImplFastBitmapBlending( BitmapWriteAccess& rDstWA,
return ImplBlendFromBitmap<BMP_FORMAT_32BIT_TC_RGBA>( rDst, rSrc, rMsk );
}
-#ifdef DEBUG
static int nNotAccelerated = 0;
- if( rSrc.mnWidth * rSrc.mnHeight >= 4000 )
- if( ++nNotAccelerated == 100 )
- {
- int foo = 0; (void)foo; // so no warning is created when building on pro with debug
- DBG_WARNING3( "ImplFastBlend for not accelerated case (0x%04X*0x%04X->0x%04X)",
- rSrc.mnFormat, rMsk.mnFormat, rDst.mnFormat );
- }
-#endif
+ SAL_WARN_IF( rSrc.mnWidth * rSrc.mnHeight >= 4000 && ++nNotAccelerated == 100,
+ "vcl.gdi",
+ "ImplFastBlend for not accelerated case (" << std::hex << rSrc.mnFormat << "*" << rMsk.mnFormat << "->" << rDst.mnFormat << ")" );
return false;
}
More information about the Libreoffice-commits
mailing list