summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-06-12 20:11:20 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-17 06:38:57 +0000
commit9c79945ca62b18213728cdd23d9f390304aee1de (patch)
tree94bb9cc30cbb5bb5508875d80fcf975b673fe0ac /vcl/quartz
parent29e91d5eedd2bf20504ce9ada625d33fec19dc9e (diff)
convert DBG_ASSERT in vcl
Change-Id: I732fb1a789f90ca7a7f393cc41a6afe84fecf3d3 Reviewed-on: https://gerrit.libreoffice.org/26200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/ctfonts.cxx2
-rw-r--r--vcl/quartz/ctlayout.cxx2
-rw-r--r--vcl/quartz/salbmp.cxx2
-rw-r--r--vcl/quartz/salgdi.cxx22
-rw-r--r--vcl/quartz/salgdicommon.cxx2
-rw-r--r--vcl/quartz/salgdiutils.cxx4
6 files changed, 17 insertions, 17 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 5f4347bff585..5bd6e7ba2a18 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -248,7 +248,7 @@ LogicalFontInstance* CoreTextFontFace::CreateFontInstance( /*const*/ FontSelectP
int CoreTextFontFace::GetFontTable( const char pTagName[5], unsigned char* pResultBuf ) const
{
- DBG_ASSERT( pTagName[4]=='\0', "CoreTextFontFace::GetFontTable with invalid tagname!\n" );
+ SAL_WARN_IF( pTagName[4]!='\0', "vcl", "CoreTextFontFace::GetFontTable with invalid tagname!\n" );
const CTFontTableTag nTagCode = (pTagName[0]<<24) + (pTagName[1]<<16) + (pTagName[2]<<8) + (pTagName[3]<<0);
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 6bdcad30b8bd..0c46c95f6589 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -698,7 +698,7 @@ sal_Int32 CTLayout::GetTextBreak( DeviceCoordinate nMaxWidth, DeviceCoordinate n
void CTLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const
{
- DBG_ASSERT( ((nMaxIndex>0)&&!(nMaxIndex&1)),
+ SAL_WARN_IF( (nMaxIndex<=0) || (nMaxIndex&1), "vcl",
"CTLayout::GetCaretPositions() : invalid number of caret pairs requested");
// initialize the caret positions
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 4ec080947c11..7c44fb2e55e0 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -109,7 +109,7 @@ QuartzSalBitmap::~QuartzSalBitmap()
bool QuartzSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
int nX, int nY, int nWidth, int nHeight )
{
- DBG_ASSERT( xLayer, "QuartzSalBitmap::Create() from non-layered context" );
+ SAL_WARN_IF( !xLayer, "vcl", "QuartzSalBitmap::Create() from non-layered context" );
// sanitize input parameters
if( nX < 0 ) {
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 67d1d820f6bf..c28290a99828 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -103,18 +103,18 @@ const FontCharMapPtr CoreTextFontFace::GetFontCharMap() const
// get the CMAP byte size
// allocate a buffer for the CMAP raw data
const int nBufSize = GetFontTable( "cmap", nullptr );
- DBG_ASSERT( (nBufSize > 0), "CoreTextFontFace::GetFontCharMap : GetFontTable1 failed!\n");
+ SAL_WARN_IF( (nBufSize <= 0), "vcl", "CoreTextFontFace::GetFontCharMap : GetFontTable1 failed!\n");
if( nBufSize <= 0 )
return mxCharMap;
// get the CMAP raw data
std::vector<unsigned char> aBuffer( nBufSize );
const int nRawLength = GetFontTable( "cmap", &aBuffer[0] );
- DBG_ASSERT( (nRawLength > 0), "CoreTextFontFace::GetFontCharMap : GetFontTable2 failed!\n");
+ SAL_WARN_IF( (nRawLength <= 0), "vcl", "CoreTextFontFace::GetFontCharMap : GetFontTable2 failed!\n");
if( nRawLength <= 0 )
return mxCharMap;
- DBG_ASSERT( (nBufSize==nRawLength), "CoreTextFontFace::GetFontCharMap : ByteCount mismatch!\n");
+ SAL_WARN_IF( (nBufSize!=nRawLength), "vcl", "CoreTextFontFace::GetFontCharMap : ByteCount mismatch!\n");
// parse the CMAP
CmapResult aCmapResult;
@@ -183,18 +183,18 @@ void CoreTextFontFace::ReadOs2Table() const
// prepare to get the OS/2 table raw data
const int nBufSize = GetFontTable( "OS/2", nullptr );
- DBG_ASSERT( (nBufSize > 0), "CoreTextFontFace::ReadOs2Table : GetFontTable1 failed!\n");
+ SAL_WARN_IF( (nBufSize <= 0), "vcl", "CoreTextFontFace::ReadOs2Table : GetFontTable1 failed!\n");
if( nBufSize <= 0 )
return;
// get the OS/2 raw data
std::vector<unsigned char> aBuffer( nBufSize );
const int nRawLength = GetFontTable( "cmap", &aBuffer[0] );
- DBG_ASSERT( (nRawLength > 0), "CoreTextFontFace::ReadOs2Table : GetFontTable2 failed!\n");
+ SAL_WARN_IF( (nRawLength <= 0), "vcl", "CoreTextFontFace::ReadOs2Table : GetFontTable2 failed!\n");
if( nRawLength <= 0 )
return;
- DBG_ASSERT( (nBufSize==nRawLength), "CoreTextFontFace::ReadOs2Table : ByteCount mismatch!\n");
+ SAL_WARN_IF( (nBufSize!=nRawLength), "vcl", "CoreTextFontFace::ReadOs2Table : ByteCount mismatch!\n");
mbHasOs2Table = true;
// parse the OS/2 raw data
@@ -218,7 +218,7 @@ void CoreTextFontFace::ReadMacCmapEncoding() const
const int nRawLength = GetFontTable( "cmap", &aBuffer[0] );
if( nRawLength < 24 )
return;
- DBG_ASSERT( (nBufSize==nRawLength), "CoreTextFontFace::ReadMacCmapEncoding : ByteCount mismatch!\n");
+ SAL_WARN_IF( (nBufSize!=nRawLength), "vcl", "CoreTextFontFace::ReadMacCmapEncoding : ByteCount mismatch!\n");
const unsigned char* pCmap = &aBuffer[0];
if( GetUShort( pCmap ) != 0x0000 )
@@ -368,7 +368,7 @@ static void AddLocalTempFontDirs()
void AquaSalGraphics::GetDevFontList( PhysicalFontCollection* pFontCollection )
{
- DBG_ASSERT( pFontCollection, "AquaSalGraphics::GetDevFontList(NULL) !");
+ SAL_WARN_IF( !pFontCollection, "vcl", "AquaSalGraphics::GetDevFontList(NULL) !");
AddLocalTempFontDirs();
@@ -683,7 +683,7 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData,
nOfs += nPrepSize;
}
- DBG_ASSERT( (nOfs==nTotalSize), "AquaSalGraphics::CreateFontSubset (nOfs!=nTotalSize)");
+ SAL_WARN_IF( (nOfs!=nTotalSize), "vcl", "AquaSalGraphics::CreateFontSubset (nOfs!=nTotalSize)");
return true;
}
@@ -741,7 +741,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV
}
FontCharMapPtr xFCMap = mpFontData->GetFontCharMap();
- DBG_ASSERT( xFCMap && xFCMap->GetCharCount(), "no charmap" );
+ SAL_WARN_IF( !xFCMap || !xFCMap->GetCharCount(), "vcl", "no charmap" );
// get unicode<->glyph encoding
// TODO? avoid sft mapping by using the xFCMap itself
@@ -788,7 +788,7 @@ void AquaSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ )
// TODO: implementing this only makes sense when the implementation of
// AquaSalGraphics::GetEmbedFontData() returns non-NULL
(void)pData;
- DBG_ASSERT( (pData!=nullptr), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n");
+ SAL_WARN_IF( (pData==nullptr), "vcl", "AquaSalGraphics::FreeEmbedFontData() is not implemented\n");
}
bool AquaSalGraphics::IsFlipped() const
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 9b966c6767ac..4f90876ec2ef 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -2027,7 +2027,7 @@ void AquaSalGraphics::SetXORMode( bool bSet )
void AquaSalGraphics::updateResolution()
{
- DBG_ASSERT( mbWindow, "updateResolution on inappropriate graphics" );
+ SAL_WARN_IF( !mbWindow, "vcl", "updateResolution on inappropriate graphics" );
initResolution( (mbWindow && mpFrame) ? mpFrame->getNSWindow() : nil );
}
diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index 13050e4ce5d9..7a5850e2ac8c 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -163,7 +163,7 @@ bool AquaSalGraphics::CheckContext()
}
}
- DBG_ASSERT( mrContext || mbPrinter, "<<<WARNING>>> AquaSalGraphics::CheckContext() FAILED!!!!\n" );
+ SAL_WARN_IF( !mrContext && !mbPrinter, "vcl", "<<<WARNING>>> AquaSalGraphics::CheckContext() FAILED!!!!\n" );
return (mrContext != nullptr);
}
@@ -216,7 +216,7 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
}
else
{
- DBG_ASSERT( mpFrame->mbInitShow, "UpdateWindow called on uneligible graphics" );
+ SAL_WARN_IF( !mpFrame->mbInitShow, "vcl", "UpdateWindow called on uneligible graphics" );
}
}