summaryrefslogtreecommitdiff
path: root/vcl/quartz
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 16:20:12 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 16:20:39 +0100
commitd1775349e4ea619aa7b634bcd7161374107038a1 (patch)
tree300c60723c49ec7601f6ac886f37805b5afa0a6a /vcl/quartz
parentaa4d195143fec01fba5c0a0f41950f1cbddbc9bd (diff)
loplugin:nullptr (automatic rewrite; Mac-specific code)
Change-Id: I90a955eb3e485723bb81e7164edcf60f7b0e94c7
Diffstat (limited to 'vcl/quartz')
-rw-r--r--vcl/quartz/ctfonts.cxx26
-rw-r--r--vcl/quartz/ctlayout.cxx30
-rw-r--r--vcl/quartz/salbmp.cxx36
-rw-r--r--vcl/quartz/salgdi.cxx78
-rw-r--r--vcl/quartz/salgdicommon.cxx56
-rw-r--r--vcl/quartz/salgdiutils.cxx22
-rw-r--r--vcl/quartz/salvd.cxx30
-rw-r--r--vcl/quartz/utils.cxx2
8 files changed, 140 insertions, 140 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index e5faad95a9da..8f352b885551 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -47,7 +47,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD )
: mpFontData( static_cast<CoreTextFontData const *>(rFSD.mpFontData) )
, mfFontStretch( 1.0 )
, mfFontRotation( 0.0 )
- , mpStyleDict( NULL )
+ , mpStyleDict( nullptr )
{
const FontSelectPattern* const pReqFont = &rFSD;
@@ -68,7 +68,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD )
// create the style object for CoreText font attributes
static const CFIndex nMaxDictSize = 16; // TODO: does this really suffice?
- mpStyleDict = CFDictionaryCreateMutable( NULL, nMaxDictSize,
+ mpStyleDict = CFDictionaryCreateMutable( nullptr, nMaxDictSize,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks );
@@ -81,7 +81,7 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD )
(mpFontData->GetWeight() != WEIGHT_DONTKNOW)) )
{
int nStroke = -lrint((3.5F * pReqFont->GetWeight()) / mpFontData->GetWeight());
- CFNumberRef rStroke = CFNumberCreate(NULL, kCFNumberSInt32Type, &nStroke);
+ CFNumberRef rStroke = CFNumberCreate(nullptr, kCFNumberSInt32Type, &nStroke);
CFDictionarySetValue(mpStyleDict, kCTStrokeWidthAttributeName, rStroke);
}
@@ -148,7 +148,7 @@ bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.11 kCTFontDefaultOrientation
const CTFontOrientation aFontOrientation = kCTFontDefaultOrientation; // TODO: horz/vert
SAL_WNODEPRECATED_DECLARATIONS_POP
- const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, aFontOrientation, &nCGGlyph, NULL, 1 );
+ const CGRect aCGRect = CTFontGetBoundingRectsForGlyphs( aCTFontRef, aFontOrientation, &nCGGlyph, nullptr, 1 );
rRect.Left() = lrint( aCGRect.origin.x );
rRect.Top() = lrint( aCGRect.origin.y );
@@ -215,7 +215,7 @@ bool CoreTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolyg
CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK;
// XXX: this is broken if the glyph came from fallback font
CTFontRef pCTFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName ));
- CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, NULL );
+ CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, nullptr );
if (!xPath)
{
return false;
@@ -251,7 +251,7 @@ int CoreTextFontData::GetFontTable( const char pTagName[5], unsigned char* pResu
// get the raw table length
CTFontDescriptorRef pFontDesc = reinterpret_cast<CTFontDescriptorRef>( GetFontId());
- CTFontRef rCTFont = CTFontCreateWithFontDescriptor( pFontDesc, 0.0, NULL);
+ CTFontRef rCTFont = CTFontCreateWithFontDescriptor( pFontDesc, 0.0, nullptr);
const uint32_t opts( kCTFontTableOptionNoOptions );
CFDataRef pDataRef = CTFontCopyTable( rCTFont, nTagCode, opts);
CFRelease( rCTFont);
@@ -297,7 +297,7 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool
const OUString aUILang = Application::GetSettings().GetUILanguageTag().getLanguage();
CFStringRef pUILang = CFStringCreateWithCharacters( kCFAllocatorDefault,
aUILang.getStr(), aUILang.getLength() );
- CFStringRef pLang = NULL;
+ CFStringRef pLang = nullptr;
CFStringRef pFamilyName = static_cast<CFStringRef>(
CTFontDescriptorCopyLocalizedAttribute( pFD, kCTFontFamilyNameAttribute, &pLang ));
@@ -337,7 +337,7 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool
// get symbolic trait
// TODO: use other traits such as MonoSpace/Condensed/Expanded or Vertical too
SInt64 nSymbolTrait = 0;
- CFNumberRef pSymbolNum = NULL;
+ CFNumberRef pSymbolNum = nullptr;
if( CFDictionaryGetValueIfPresent( pAttrDict, kCTFontSymbolicTrait, reinterpret_cast<const void**>(&pSymbolNum) ) )
{
CFNumberGetValue( pSymbolNum, kCFNumberSInt64Type, &nSymbolTrait );
@@ -425,8 +425,8 @@ static void CTFontEnumCallBack( const void* pValue, void* pContext )
}
SystemFontList::SystemFontList()
- : mpCTFontCollection( NULL )
- , mpCTFontArray( NULL )
+ : mpCTFontCollection( nullptr )
+ , mpCTFontArray( nullptr )
{}
SystemFontList::~SystemFontList()
@@ -468,7 +468,7 @@ CoreTextFontData* SystemFontList::GetFontDataFromId( sal_IntPtr nFontId ) const
CTFontContainer::const_iterator it = maFontContainer.find( nFontId );
if( it == maFontContainer.end() )
{
- return NULL;
+ return nullptr;
}
return (*it).second;
}
@@ -477,7 +477,7 @@ bool SystemFontList::Init()
{
// enumerate available system fonts
static const int nMaxDictEntries = 8;
- CFMutableDictionaryRef pCFDict = CFDictionaryCreateMutable( NULL,
+ CFMutableDictionaryRef pCFDict = CFDictionaryCreateMutable( nullptr,
nMaxDictEntries,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks );
@@ -500,7 +500,7 @@ SystemFontList* GetCoretextFontList()
if( !pList->Init() )
{
delete pList;
- return NULL;
+ return nullptr;
}
return pList;
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 5d03b7a3abd2..61ddecc82a80 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -85,8 +85,8 @@ private:
CTLayout::CTLayout( const CoreTextStyle* pTextStyle )
: mpTextStyle( pTextStyle )
- , mpAttrString( NULL )
- , mpCTLine( NULL )
+ , mpAttrString( nullptr )
+ , mpCTLine( nullptr )
, mnCharCount( 0 )
, mnTrailingSpaceCount( 0 )
, mfTrailingSpaceWidth( 0.0 )
@@ -115,13 +115,13 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs )
// release an eventual older layout
if( mpAttrString )
CFRelease( mpAttrString );
- mpAttrString = NULL;
+ mpAttrString = nullptr;
if( mpCTLine )
{
SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" );
CFRelease( mpCTLine );
}
- mpCTLine = NULL;
+ mpCTLine = nullptr;
// initialize the new layout
SalLayout::AdjustLayout( rArgs );
@@ -134,12 +134,12 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs )
const sal_Unicode *pStr = rArgs.mrStr.getStr();
// create the CoreText line layout
- CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL,
+ CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( nullptr,
pStr + mnMinCharPos,
mnCharCount,
kCFAllocatorNull );
// CFAttributedStringCreate copies the attribues parameter
- mpAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
+ mpAttrString = CFAttributedStringCreate( nullptr, aCFText, mpTextStyle->GetStyleDict() );
mpCTLine = CTLineCreateWithAttributedString( mpAttrString );
SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") =p " << mpCTLine );
CFRelease( aCFText);
@@ -212,11 +212,11 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" );
CFRelease( mpCTLine );
const sal_Unicode *pStr = rArgs.mrStr.getStr();
- CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL,
+ CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( nullptr,
pStr + mnMinCharPos,
mnCharCount - mnTrailingSpaceCount,
kCFAllocatorNull );
- CFAttributedStringRef pAttrStr = CFAttributedStringCreate( NULL,
+ CFAttributedStringRef pAttrStr = CFAttributedStringCreate( nullptr,
aCFText,
mpTextStyle->GetStyleDict() );
mpCTLine = CTLineCreateWithAttributedString( pAttrStr );
@@ -489,9 +489,9 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i
{
nStart = 0;
}
- const PhysicalFontFace* pFallbackFont = NULL;
- CTFontRef pFont = NULL;
- CTFontDescriptorRef pFontDesc = NULL;
+ const PhysicalFontFace* pFallbackFont = nullptr;
+ CTFontRef pFont = nullptr;
+ CTFontDescriptorRef pFontDesc = nullptr;
ImplDevFontAttributes rDevFontAttr;
boost::ptr_vector<CTRunData>::const_iterator iter = m_vRunData.begin();
@@ -510,7 +510,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i
{
pFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpTextStyle->GetStyleDict(), kCTFontAttributeName ));
pFontDesc = CTFontCopyFontDescriptor( iter->m_pFont );
- rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, NULL );
+ rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, nullptr );
}
}
int i = nStart;
@@ -537,7 +537,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i
}
else
{
- *(pFallbackFonts++) = NULL;
+ *(pFallbackFonts++) = nullptr;
}
}
if( i == nStart )
@@ -559,7 +559,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i
{
pFont = static_cast<CTFontRef>(CFDictionaryGetValue( mpTextStyle->GetStyleDict(), kCTFontAttributeName ));
pFontDesc = CTFontCopyFontDescriptor( iter->m_pFont );
- rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, NULL );
+ rDevFontAttr = DevFontFromCTFontDescriptor( pFontDesc, nullptr );
}
}
}
@@ -576,7 +576,7 @@ DeviceCoordinate CTLayout::GetTextWidth() const
if( mfCachedWidth < 0.0 )
{
- mfCachedWidth = CTLineGetTypographicBounds( mpCTLine, NULL, NULL, NULL);
+ mfCachedWidth = CTLineGetTypographicBounds( mpCTLine, nullptr, nullptr, nullptr);
}
return mfCachedWidth;
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index bbf1a54c9436..9683066eecca 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -93,8 +93,8 @@ static bool isValidBitCount( sal_uInt16 nBitCount )
}
QuartzSalBitmap::QuartzSalBitmap()
- : mxGraphicContext( NULL )
- , mxCachedImage( NULL )
+ : mxGraphicContext( nullptr )
+ , mxCachedImage( nullptr )
, mnBits(0)
, mnWidth(0)
, mnHeight(0)
@@ -211,14 +211,14 @@ void QuartzSalBitmap::DestroyContext()
{
SAL_INFO("vcl.cg", "CGImageRelease(" << mxCachedImage << ")" );
CGImageRelease( mxCachedImage );
- mxCachedImage = NULL;
+ mxCachedImage = nullptr;
}
if( mxGraphicContext )
{
SAL_INFO("vcl.cg", "CGContextRelease(" << mxGraphicContext << ")" );
CGContextRelease( mxGraphicContext );
- mxGraphicContext = NULL;
+ mxGraphicContext = nullptr;
maContextBuffer.reset();
}
}
@@ -275,7 +275,7 @@ bool QuartzSalBitmap::CreateContext()
}
catch( const std::bad_alloc& )
{
- mxGraphicContext = 0;
+ mxGraphicContext = nullptr;
}
}
@@ -290,7 +290,7 @@ bool QuartzSalBitmap::CreateContext()
if( !mxGraphicContext )
maContextBuffer.reset();
- return mxGraphicContext != NULL;
+ return mxGraphicContext != nullptr;
}
bool QuartzSalBitmap::AllocateUserData()
@@ -328,7 +328,7 @@ bool QuartzSalBitmap::AllocateUserData()
if (!alloc)
{
SAL_WARN( "vcl.quartz", "bad alloc " << mnBytesPerRow << "x" << mnHeight);
- maUserBuffer.reset( static_cast<sal_uInt8*>(NULL) );
+ maUserBuffer.reset( static_cast<sal_uInt8*>(nullptr) );
mnBytesPerRow = 0;
}
#ifdef DBG_UTIL
@@ -341,7 +341,7 @@ bool QuartzSalBitmap::AllocateUserData()
}
#endif
- return maUserBuffer.get() != 0;
+ return maUserBuffer.get() != nullptr;
}
namespace {
@@ -569,7 +569,7 @@ ImplPixelFormat* ImplPixelFormat::GetFormat( sal_uInt16 nBits, const BitmapPalet
return nullptr;
}
- return 0;
+ return nullptr;
}
} // namespace
@@ -747,7 +747,7 @@ BitmapBuffer* QuartzSalBitmap::AcquireBuffer( BitmapAccessMode /*nMode*/ )
{
// fprintf(stderr,"ASB::Acq(%dx%d,d=%d)\n",mnWidth,mnHeight,mnBits);
// TODO: AllocateUserData();
- return NULL;
+ return nullptr;
}
BitmapBuffer* pBuffer = new BitmapBuffer;
@@ -828,14 +828,14 @@ CGImageRef QuartzSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, i
{
if( !const_cast<QuartzSalBitmap*>(this)->CreateContext() )
{
- return NULL;
+ return nullptr;
}
}
mxCachedImage = CGBitmapContextCreateImage( mxGraphicContext );
SAL_INFO("vcl.cg", "CGBitmapContextCreateImage(" << mxGraphicContext << ") = " << mxCachedImage );
}
- CGImageRef xCroppedImage = NULL;
+ CGImageRef xCroppedImage = nullptr;
// short circuit if there is nothing to crop
if( !nX && !nY && (mnWidth == nNewWidth) && (mnHeight == nNewHeight) )
{
@@ -864,7 +864,7 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
{
CGImageRef xImage( CreateCroppedImage( nX, nY, nWidth, nHeight ) );
if( !xImage )
- return NULL;
+ return nullptr;
CGImageRef xMask = rMask.CreateCroppedImage( nX, nY, nWidth, nHeight );
if( !xMask )
@@ -888,10 +888,10 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
CGContextDrawImage( xMaskContext, xImageRect, xMask );
SAL_INFO("vcl.cg", "CFRelease(" << xMask << ")" );
CFRelease( xMask );
- CGDataProviderRef xDataProvider( CGDataProviderCreateWithData( NULL,
+ CGDataProviderRef xDataProvider( CGDataProviderCreateWithData( nullptr,
pMaskMem, nHeight * nMaskBytesPerRow, &CFRTLFree ) );
- static const CGFloat* pDecode = NULL;
+ static const CGFloat* pDecode = nullptr;
xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8, nMaskBytesPerRow, xDataProvider, pDecode, false );
SAL_INFO("vcl.cg", "CGImageMaskCreate(" << nWidth << "," << nHeight << ",8,8) = " << xMask );
CFRelease( xDataProvider );
@@ -919,7 +919,7 @@ CGImageRef QuartzSalBitmap::CreateWithMask( const QuartzSalBitmap& rMask,
CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int nY, int nWidth,
int nHeight, SalColor nMaskColor ) const
{
- CGImageRef xMask = 0;
+ CGImageRef xMask = nullptr;
if( maUserBuffer.get() && (nX + nWidth <= mnWidth) && (nY + nHeight <= mnHeight) )
{
const sal_uInt32 nDestBytesPerRow = nWidth << 2;
@@ -953,8 +953,8 @@ CGImageRef QuartzSalBitmap::CreateColorMask( int nX, int nY, int nWidth,
pSource += mnBytesPerRow;
}
- CGDataProviderRef xDataProvider( CGDataProviderCreateWithData(NULL, pMaskBuffer, nHeight * nDestBytesPerRow, &CFRTLFree) );
- xMask = CGImageCreate(nWidth, nHeight, 8, 32, nDestBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaPremultipliedFirst, xDataProvider, NULL, true, kCGRenderingIntentDefault);
+ CGDataProviderRef xDataProvider( CGDataProviderCreateWithData(nullptr, pMaskBuffer, nHeight * nDestBytesPerRow, &CFRTLFree) );
+ xMask = CGImageCreate(nWidth, nHeight, 8, 32, nDestBytesPerRow, GetSalData()->mxRGBSpace, kCGImageAlphaPremultipliedFirst, xDataProvider, nullptr, true, kCGRenderingIntentDefault);
SAL_INFO("vcl.cg", "CGImageCreate(" << nWidth << "x" << nHeight << "x8) = " << xMask );
CFRelease(xDataProvider);
}
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index ec7b0e006d09..32bbb4fe61a1 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -77,7 +77,7 @@ CoreTextFontData::~CoreTextFontData()
{
if( mpCharMap )
{
- mpCharMap = 0;
+ mpCharMap = nullptr;
}
}
@@ -100,7 +100,7 @@ const FontCharMapPtr CoreTextFontData::GetFontCharMap() const
// get the CMAP byte size
// allocate a buffer for the CMAP raw data
- const int nBufSize = GetFontTable( "cmap", NULL );
+ const int nBufSize = GetFontTable( "cmap", nullptr );
DBG_ASSERT( (nBufSize > 0), "CoreTextFontData::GetFontCharMap : GetFontTable1 failed!\n");
if( nBufSize <= 0 )
return mpCharMap;
@@ -138,7 +138,7 @@ bool CoreTextFontData::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilit
int nBufSize = 0;
// prepare to get the GSUB table raw data
- nBufSize = GetFontTable( "GSUB", NULL );
+ nBufSize = GetFontTable( "GSUB", nullptr );
if( nBufSize > 0 )
{
// allocate a buffer for the GSUB raw data
@@ -151,7 +151,7 @@ bool CoreTextFontData::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilit
vcl::getTTScripts(maFontCapabilities.maGSUBScriptTags, pGSUBTable, nRawLength);
}
}
- nBufSize = GetFontTable( "OS/2", NULL );
+ nBufSize = GetFontTable( "OS/2", nullptr );
if( nBufSize > 0 )
{
// allocate a buffer for the OS/2 raw data
@@ -180,7 +180,7 @@ void CoreTextFontData::ReadOs2Table() const
mbHasOs2Table = false;
// prepare to get the OS/2 table raw data
- const int nBufSize = GetFontTable( "OS/2", NULL );
+ const int nBufSize = GetFontTable( "OS/2", nullptr );
DBG_ASSERT( (nBufSize > 0), "CoreTextFontData::ReadOs2Table : GetFontTable1 failed!\n");
if( nBufSize <= 0 )
return;
@@ -207,7 +207,7 @@ void CoreTextFontData::ReadMacCmapEncoding() const
mbCmapEncodingRead = true;
- const int nBufSize = GetFontTable( "cmap", NULL );
+ const int nBufSize = GetFontTable( "cmap", nullptr );
if( nBufSize <= 0 )
return;
@@ -224,26 +224,26 @@ void CoreTextFontData::ReadMacCmapEncoding() const
}
AquaSalGraphics::AquaSalGraphics()
- : mxLayer( NULL )
- , mrContext( NULL )
+ : mxLayer( nullptr )
+ , mrContext( nullptr )
#ifdef MACOSX
- , mpFrame( NULL )
+ , mpFrame( nullptr )
#endif
#if OSL_DEBUG_LEVEL > 0
, mnContextStackDepth( 0 )
#endif
- , mpXorEmulation( NULL )
+ , mpXorEmulation( nullptr )
, mnXorMode( 0 )
, mnWidth( 0 )
, mnHeight( 0 )
, mnBitmapDepth( 0 )
, mnRealDPIX( 0 )
, mnRealDPIY( 0 )
- , mxClipPath( NULL )
+ , mxClipPath( nullptr )
, maLineColor( COL_WHITE )
, maFillColor( COL_BLACK )
- , mpFontData( NULL )
- , mpTextStyle( NULL )
+ , mpFontData( nullptr )
+ , mpTextStyle( nullptr )
, maTextColor( COL_BLACK )
, mbNonAntialiasedText( false )
, mbPrinter( false )
@@ -290,13 +290,13 @@ AquaSalGraphics::~AquaSalGraphics()
// destroy backbuffer bitmap context that we created ourself
SAL_INFO("vcl.cg", "CGContextRelease(" << mrContext << ")" );
CGContextRelease( mrContext );
- mrContext = NULL;
+ mrContext = nullptr;
}
}
SalGraphicsImpl* AquaSalGraphics::GetImpl() const
{
- return NULL;
+ return nullptr;
}
void AquaSalGraphics::SetTextColor( SalColor nSalColor )
@@ -316,8 +316,8 @@ static bool AddTempDevFont(const OUString& rFontFileURL)
OSL_VERIFY( !osl::FileBase::getSystemPathFromFileURL( rFontFileURL, aUSytemPath ) );
OString aCFileName = OUStringToOString( aUSytemPath, RTL_TEXTENCODING_UTF8 );
- CFStringRef rFontPath = CFStringCreateWithCString(NULL, aCFileName.getStr(), kCFStringEncodingUTF8);
- CFURLRef rFontURL = CFURLCreateWithFileSystemPath(NULL, rFontPath, kCFURLPOSIXPathStyle, true);
+ CFStringRef rFontPath = CFStringCreateWithCString(nullptr, aCFileName.getStr(), kCFStringEncodingUTF8);
+ CFURLRef rFontURL = CFURLCreateWithFileSystemPath(nullptr, rFontPath, kCFURLPOSIXPathStyle, true);
CFErrorRef error;
bool success = CTFontManagerRegisterFontsForURL(rFontURL, kCTFontManagerScopeProcess, &error);
@@ -390,7 +390,7 @@ void AquaSalGraphics::ClearDevFontCache()
{
SalData* pSalData = GetSalData();
delete pSalData->mpFontList;
- pSalData->mpFontList = NULL;
+ pSalData->mpFontList = nullptr;
}
bool AquaSalGraphics::AddTempDevFont( PhysicalFontCollection*,
@@ -419,12 +419,12 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac
{
// release the text style
delete mpTextStyle;
- mpTextStyle = NULL;
+ mpTextStyle = nullptr;
// handle NULL request meaning: release-font-resources request
if( !pReqFont )
{
- mpFontData = NULL;
+ mpFontData = nullptr;
return 0;
}
@@ -508,8 +508,8 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData,
const CoreTextFontData* pMacFont = static_cast<const CoreTextFontData*>(pFontData);
// short circuit for CFF-only fonts
- const int nCffSize = pMacFont->GetFontTable( "CFF ", NULL);
- if( pJustCFF != NULL )
+ const int nCffSize = pMacFont->GetFontTable( "CFF ", nullptr);
+ if( pJustCFF != nullptr )
{
*pJustCFF = (nCffSize > 0);
if( *pJustCFF)
@@ -525,27 +525,27 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData,
}
// get font table availability and size in bytes
- const int nHeadSize = pMacFont->GetFontTable( "head", NULL);
+ const int nHeadSize = pMacFont->GetFontTable( "head", nullptr);
if( nHeadSize <= 0)
return false;
- const int nMaxpSize = pMacFont->GetFontTable( "maxp", NULL);
+ const int nMaxpSize = pMacFont->GetFontTable( "maxp", nullptr);
if( nMaxpSize <= 0)
return false;
- const int nCmapSize = pMacFont->GetFontTable( "cmap", NULL);
+ const int nCmapSize = pMacFont->GetFontTable( "cmap", nullptr);
if( nCmapSize <= 0)
return false;
- const int nNameSize = pMacFont->GetFontTable( "name", NULL);
+ const int nNameSize = pMacFont->GetFontTable( "name", nullptr);
if( nNameSize <= 0)
return false;
- const int nHheaSize = pMacFont->GetFontTable( "hhea", NULL);
+ const int nHheaSize = pMacFont->GetFontTable( "hhea", nullptr);
if( nHheaSize <= 0)
return false;
- const int nHmtxSize = pMacFont->GetFontTable( "hmtx", NULL);
+ const int nHmtxSize = pMacFont->GetFontTable( "hmtx", nullptr);
if( nHmtxSize <= 0)
return false;
@@ -554,11 +554,11 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData,
int nGlyfSize = 0;
if( nCffSize <= 0)
{
- nLocaSize = pMacFont->GetFontTable( "loca", NULL);
+ nLocaSize = pMacFont->GetFontTable( "loca", nullptr);
if( nLocaSize <= 0)
return false;
- nGlyfSize = pMacFont->GetFontTable( "glyf", NULL);
+ nGlyfSize = pMacFont->GetFontTable( "glyf", nullptr);
if( nGlyfSize <= 0)
return false;
}
@@ -566,9 +566,9 @@ bool AquaSalGraphics::GetRawFontData( const PhysicalFontFace* pFontData,
int nPrepSize = 0, nCvtSize = 0, nFpgmSize = 0;
if( nGlyfSize) // TODO: reduce PDF size by making hint subsetting optional
{
- nPrepSize = pMacFont->GetFontTable( "prep", NULL);
- nCvtSize = pMacFont->GetFontTable( "cvt ", NULL);
- nFpgmSize = pMacFont->GetFontTable( "fpgm", NULL);
+ nPrepSize = pMacFont->GetFontTable( "prep", nullptr);
+ nCvtSize = pMacFont->GetFontTable( "cvt ", nullptr);
+ nFpgmSize = pMacFont->GetFontTable( "fpgm", nullptr);
}
// prepare a byte buffer for a fake font
@@ -705,7 +705,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV
}
ByteVector aBuffer;
- if( !GetRawFontData( pFontData, aBuffer, NULL ) )
+ if( !GetRawFontData( pFontData, aBuffer, nullptr ) )
return;
// TODO: modernize psprint's horrible fontsubset C-API
@@ -713,7 +713,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV
// that can preserve change history after file renames
// use the font subsetter to get the widths
- TrueTypeFont* pSftFont = NULL;
+ TrueTypeFont* pSftFont = nullptr;
int nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont);
if( nRC != SF_OK )
return;
@@ -760,7 +760,7 @@ void AquaSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFontData, bool bV
}
}
- pMap = 0;
+ pMap = nullptr;
}
::CloseTTFont( pSftFont );
@@ -770,7 +770,7 @@ const Ucs2SIntMap* AquaSalGraphics::GetFontEncodingVector( const PhysicalFontFac
const Ucs2OStrMap** /*ppNonEncoded*/,
std::set<sal_Unicode> const** )
{
- return NULL;
+ return nullptr;
}
const void* AquaSalGraphics::GetEmbedFontData( const PhysicalFontFace*,
@@ -780,7 +780,7 @@ const void* AquaSalGraphics::GetEmbedFontData( const PhysicalFontFace*,
FontSubsetInfo&,
long* /*pDataLen*/ )
{
- return NULL;
+ return nullptr;
}
void AquaSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ )
@@ -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!=NULL), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n");
+ DBG_ASSERT( (pData!=nullptr), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n");
}
bool AquaSalGraphics::IsFlipped() const
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 6135eff3bae7..385c8761715f 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -123,7 +123,7 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
{
// first point => just move there
SAL_INFO( "vcl.cg", "CGPathMoveToPoint(" << xPath << ",NULL," << aPoint.getX() << "," << aPoint.getY() << ")");
- CGPathMoveToPoint( xPath, NULL, aPoint.getX(), aPoint.getY() );
+ CGPathMoveToPoint( xPath, nullptr, aPoint.getX(), aPoint.getY() );
continue;
}
@@ -137,7 +137,7 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
if( !bPendingCurve ) // line segment
{
SAL_INFO( "vcl.cg", "CGPathAddLineToPoint(" << xPath << ",NULL," << aPoint.getX() << "," << aPoint.getY() << ")");
- CGPathAddLineToPoint( xPath, NULL, aPoint.getX(), aPoint.getY() );
+ CGPathAddLineToPoint( xPath, nullptr, aPoint.getX(), aPoint.getY() );
}
else // cubic bezier segment
{
@@ -150,7 +150,7 @@ static void AddPolygonToPath( CGMutablePathRef xPath,
}
SAL_INFO( "vcl.cg", "CGPathAddCurveToPoint(" << xPath << ",NULL," << aCP1.getX() << "," << aCP1.getY() << "," <<
aCP2.getX() << "," << aCP2.getY() << "," << aPoint.getX() << "," << aPoint.getY() << ")" );
- CGPathAddCurveToPoint( xPath, NULL, aCP1.getX(), aCP1.getY(),
+ CGPathAddCurveToPoint( xPath, nullptr, aCP1.getX(), aCP1.getY(),
aCP2.getX(), aCP2.getY(), aPoint.getX(), aPoint.getY() );
}
}
@@ -215,7 +215,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
// make the subsetter provide the requested subset
FILE* pOutFile = fopen( aToFile.getStr(), "wb" );
- bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL,
+ bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, nullptr,
pGlyphIds, pEncoding, nGlyphCount, pGlyphWidths );
fclose( pOutFile );
return bRC;
@@ -226,7 +226,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
// that can preserve change history after file renames
// prepare data for psprint's font subsetter
- TrueTypeFont* pSftFont = NULL;
+ TrueTypeFont* pSftFont = nullptr;
int nRC = ::OpenTTFontBuffer( static_cast<void*>(&aBuffer[0]), aBuffer.size(), 0, &pSftFont);
if( nRC != SF_OK )
{
@@ -332,7 +332,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile,
// write subset into destination file
nRC = ::CreateTTFromTTGlyphs( pSftFont, aToFile.getStr(), aShortIDs,
- aTempEncs, nGlyphCount, 0, NULL, 0 );
+ aTempEncs, nGlyphCount, 0, nullptr, 0 );
::CloseTTFont(pSftFont);
return (nRC == SF_OK);
}
@@ -551,7 +551,7 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
// TODO: if( mnBitmapDepth > 0 )
{
const CGSize aSrcSize = CGSizeMake(nSrcWidth, nSrcHeight);
- xSrcLayer = CGLayerCreateWithContext( xCopyContext, aSrcSize, NULL );
+ xSrcLayer = CGLayerCreateWithContext( xCopyContext, aSrcSize, nullptr );
SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCopyContext << "," << aSrcSize << ",NULL) = " << xSrcLayer );
const CGContextRef xSrcContext = CGLayerGetContext( xSrcLayer );
@@ -679,7 +679,7 @@ bool AquaSalGraphics::drawTransformedBitmap(
}
// get the Quartz image
- CGImageRef xImage = NULL;
+ CGImageRef xImage = nullptr;
const Size aSize = rSrcBitmap.GetSize();
const QuartzSalBitmap& rSrcSalBmp = static_cast<const QuartzSalBitmap&>(rSrcBitmap);
const QuartzSalBitmap* pMaskSalBmp = static_cast<const QuartzSalBitmap*>(pAlphaBmp);
@@ -1469,7 +1469,7 @@ SalBitmap* AquaSalGraphics::getBitmap( long nX, long nY, long nDX, long nDY
if( !pBitmap->Create( mxLayer, mnBitmapDepth, nX, nY, nDX, nDY) )
{
delete pBitmap;
- pBitmap = NULL;
+ pBitmap = nullptr;
}
return pBitmap;
}
@@ -1788,9 +1788,9 @@ void AquaSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalIn
void AquaSalGraphics::Pattern50Fill()
{
static const CGFloat aFillCol[4] = { 1,1,1,1 };
- static const CGPatternCallbacks aCallback = { 0, &DrawPattern50, NULL };
+ static const CGPatternCallbacks aCallback = { 0, &DrawPattern50, nullptr };
static const CGColorSpaceRef mxP50Space = CGColorSpaceCreatePattern( GetSalData()->mxRGBSpace );
- static const CGPatternRef mxP50Pattern = CGPatternCreate( NULL, CGRectMake( 0, 0, 4, 4 ),
+ static const CGPatternRef mxP50Pattern = CGPatternCreate( nullptr, CGRectMake( 0, 0, 4, 4 ),
CGAffineTransformIdentity, 4, 4,
kCGPatternTilingConstantSpacing,
false, &aCallback );
@@ -1810,7 +1810,7 @@ void AquaSalGraphics::ResetClipRegion()
{
SAL_INFO( "vcl.cg", "CGPathRelease(" << mxClipPath << ")" );
CGPathRelease( mxClipPath );
- mxClipPath = NULL;
+ mxClipPath = nullptr;
}
if( CheckContext() )
{
@@ -1916,7 +1916,7 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& i_rClip )
{
SAL_INFO( "vcl.cg", "CGPathRelease(" << mxClipPath << ")" );
CGPathRelease( mxClipPath );
- mxClipPath = NULL;
+ mxClipPath = nullptr;
}
mxClipPath = CGPathCreateMutable();
SAL_INFO( "vcl.cg", "CGPathCreateMutable() = " << mxClipPath );
@@ -1946,7 +1946,7 @@ bool AquaSalGraphics::setClipRegion( const vcl::Region& i_rClip )
{
const CGRect aRect = CGRectMake( aRectIter->Left(), aRectIter->Top(), nW, nH);
SAL_INFO( "vcl.cg", "CGPathAddRect(" << mxClipPath << ",NULL," << aRect << ")" );
- CGPathAddRect( mxClipPath, NULL, aRect );
+ CGPathAddRect( mxClipPath, nullptr, aRect );
}
}
}
@@ -1995,11 +1995,11 @@ void AquaSalGraphics::SetXORMode( bool bSet, bool bInvertOnly )
return;
}
- if( (mpXorEmulation == NULL) && !bSet )
+ if( (mpXorEmulation == nullptr) && !bSet )
{
return;
}
- if( (mpXorEmulation != NULL) && (bSet == mpXorEmulation->IsEnabled()) )
+ if( (mpXorEmulation != nullptr) && (bSet == mpXorEmulation->IsEnabled()) )
{
return;
}
@@ -2042,12 +2042,12 @@ void AquaSalGraphics::updateResolution()
#endif
XorEmulation::XorEmulation()
- : m_xTargetLayer( NULL )
- , m_xTargetContext( NULL )
- , m_xMaskContext( NULL )
- , m_xTempContext( NULL )
- , m_pMaskBuffer( NULL )
- , m_pTempBuffer( NULL )
+ : m_xTargetLayer( nullptr )
+ , m_xTargetContext( nullptr )
+ , m_xMaskContext( nullptr )
+ , m_xTempContext( nullptr )
+ , m_pMaskBuffer( nullptr )
+ , m_pTempBuffer( nullptr )
, m_nBufferLongs( 0 )
, m_bIsEnabled( false )
{
@@ -2058,7 +2058,7 @@ XorEmulation::~XorEmulation()
{
SAL_INFO( "vcl.quartz", "XorEmulation::~XorEmulation() this=" << this );
Disable();
- SetTarget( 0, 0, 0, NULL, NULL );
+ SetTarget( 0, 0, 0, nullptr, nullptr );
}
void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
@@ -2075,8 +2075,8 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
SAL_INFO( "vcl.cg", "CGContextRelease(" << m_xMaskContext << ")" );
CGContextRelease( m_xMaskContext );
delete[] m_pMaskBuffer;
- m_xMaskContext = NULL;
- m_pMaskBuffer = NULL;
+ m_xMaskContext = nullptr;
+ m_pMaskBuffer = nullptr;
// cleanup the temp context if needed
if( m_xTempContext )
@@ -2084,8 +2084,8 @@ void XorEmulation::SetTarget( int nWidth, int nHeight, int nTargetDepth,
SAL_INFO( "vcl.cg", "CGContextRelease(" << m_xTempContext << ")" );
CGContextRelease( m_xTempContext );
delete[] m_pTempBuffer;
- m_xTempContext = NULL;
- m_pTempBuffer = NULL;
+ m_xTempContext = nullptr;
+ m_pTempBuffer = nullptr;
}
}
@@ -2180,7 +2180,7 @@ bool XorEmulation::UpdateTarget()
// update the temp bitmap buffer if needed
if( m_xTempContext )
{
- SAL_WARN_IF( m_xTargetContext == NULL, "vcl.quartz", "Target layer is NULL");
+ SAL_WARN_IF( m_xTargetContext == nullptr, "vcl.quartz", "Target layer is NULL");
SAL_INFO( "vcl.cg", "CGContextDrawLayerAtPoint(" << m_xTempContext << "," << CGPointZero << "," << m_xTargetLayer << ")" );
CGContextDrawLayerAtPoint( m_xTempContext, CGPointZero, m_xTargetLayer );
}
diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index f1426203be7a..75458d2cc004 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -55,7 +55,7 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon
if( mxClipPath )
{
CGPathRelease( mxClipPath );
- mxClipPath = NULL;
+ mxClipPath = nullptr;
}
if( mrContext )
@@ -70,7 +70,7 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon
void AquaSalGraphics::InvalidateContext()
{
UnsetState();
- mrContext = 0;
+ mrContext = nullptr;
}
void AquaSalGraphics::UnsetState()
@@ -79,13 +79,13 @@ void AquaSalGraphics::UnsetState()
{
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << mrContext << ")" );
CGContextRestoreGState( mrContext );
- mrContext = 0;
+ mrContext = nullptr;
}
if( mxClipPath )
{
SAL_INFO( "vcl.cg", "CGPathRelease(" << mxClipPath << ")" );
CGPathRelease( mxClipPath );
- mxClipPath = NULL;
+ mxClipPath = nullptr;
}
}
@@ -100,8 +100,8 @@ bool AquaSalGraphics::CheckContext()
const unsigned int nWidth = mpFrame->maGeometry.nWidth;
const unsigned int nHeight = mpFrame->maGeometry.nHeight;
- CGContextRef rReleaseContext = 0;
- CGLayerRef rReleaseLayer = NULL;
+ CGContextRef rReleaseContext = nullptr;
+ CGLayerRef rReleaseLayer = nullptr;
// check if a new drawing context is needed (e.g. after a resize)
if( (unsigned(mnWidth) != nWidth) || (unsigned(mnHeight) != nHeight) )
@@ -111,8 +111,8 @@ bool AquaSalGraphics::CheckContext()
// prepare to release the corresponding resources
rReleaseContext = mrContext;
rReleaseLayer = mxLayer;
- mrContext = NULL;
- mxLayer = NULL;
+ mrContext = nullptr;
+ mxLayer = nullptr;
}
if( !mrContext )
@@ -120,7 +120,7 @@ bool AquaSalGraphics::CheckContext()
const CGSize aLayerSize = { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) };
NSGraphicsContext* pNSGContext = [NSGraphicsContext graphicsContextWithWindow: mpFrame->getNSWindow()];
CGContextRef xCGContext = static_cast<CGContextRef>([pNSGContext graphicsPort]);
- mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, NULL );
+ mxLayer = CGLayerCreateWithContext( xCGContext, aLayerSize, nullptr );
SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aLayerSize << ",NULL) = " << mxLayer );
if( mxLayer )
{
@@ -166,7 +166,7 @@ bool AquaSalGraphics::CheckContext()
}
DBG_ASSERT( mrContext || mbPrinter, "<<<WARNING>>> AquaSalGraphics::CheckContext() FAILED!!!!\n" );
- return (mrContext != NULL);
+ return (mrContext != nullptr);
}
CGContextRef AquaSalGraphics::GetContext()
@@ -191,7 +191,7 @@ void AquaSalGraphics::UpdateWindow( NSRect& )
}
NSGraphicsContext* pContext = [NSGraphicsContext currentContext];
- if( (mxLayer != NULL) && (pContext != NULL) )
+ if( (mxLayer != nullptr) && (pContext != nullptr) )
{
CGContextRef rCGContext = static_cast<CGContextRef>([pContext graphicsPort]);
SAL_INFO( "vcl.cg", "[[NSGraphicsContext currentContext] graphicsPort] = " << rCGContext );
diff --git a/vcl/quartz/salvd.cxx b/vcl/quartz/salvd.cxx
index 5427eb096940..485ac2018757 100644
--- a/vcl/quartz/salvd.cxx
+++ b/vcl/quartz/salvd.cxx
@@ -65,13 +65,13 @@ SalVirtualDevice* AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics,
AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX, long &nDY,
sal_uInt16 nBitCount, const SystemGraphicsData *pData )
: mbGraphicsUsed( false )
- , mxBitmapContext( NULL )
+ , mxBitmapContext( nullptr )
, mnBitmapDepth( 0 )
- , mxLayer( NULL )
+ , mxLayer( nullptr )
{
SAL_INFO( "vcl.virdev", "AquaSalVirtualDevice::AquaSalVirtualDevice() this=" << this
<< " size=(" << nDX << "x" << nDY << ") bitcount=" << nBitCount <<
- " pData=" << pData << " context=" << (pData ? pData->rCGContext : 0) );
+ " pData=" << pData << " context=" << (pData ? pData->rCGContext : nullptr) );
if( pGraphic && pData && pData->rCGContext )
{
@@ -88,7 +88,7 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long &nDX
{
nDY = 1;
}
- mxLayer = CGLayerCreateWithContext( pData->rCGContext, CGSizeMake( nDX, nDY), NULL );
+ mxLayer = CGLayerCreateWithContext( pData->rCGContext, CGSizeMake( nDX, nDY), nullptr );
// Interrogate the context as to its real size
if (mxLayer)
{
@@ -137,9 +137,9 @@ AquaSalVirtualDevice::~AquaSalVirtualDevice()
if( mpGraphics )
{
- mpGraphics->SetVirDevGraphics( NULL, NULL );
+ mpGraphics->SetVirDevGraphics( nullptr, nullptr );
delete mpGraphics;
- mpGraphics = 0;
+ mpGraphics = nullptr;
}
Destroy();
}
@@ -151,7 +151,7 @@ void AquaSalVirtualDevice::Destroy()
if( mbForeignContext )
{
// Do not delete mxContext that we have received from outside VCL
- mxLayer = NULL;
+ mxLayer = nullptr;
return;
}
@@ -159,11 +159,11 @@ void AquaSalVirtualDevice::Destroy()
{
if( mpGraphics )
{
- mpGraphics->SetVirDevGraphics( NULL, NULL );
+ mpGraphics->SetVirDevGraphics( nullptr, nullptr );
}
SAL_INFO( "vcl.cg", "CGLayerRelease(" << mxLayer << ")" );
CGLayerRelease( mxLayer );
- mxLayer = NULL;
+ mxLayer = nullptr;
}
if( mxBitmapContext )
@@ -172,7 +172,7 @@ void AquaSalVirtualDevice::Destroy()
rtl_freeMemory( pRawData );
SAL_INFO( "vcl.cg", "CGContextRelease(" << mxBitmapContext << ")" );
CGContextRelease( mxBitmapContext );
- mxBitmapContext = NULL;
+ mxBitmapContext = nullptr;
}
}
@@ -180,7 +180,7 @@ SalGraphics* AquaSalVirtualDevice::AcquireGraphics()
{
if( mbGraphicsUsed || !mpGraphics )
{
- return 0;
+ return nullptr;
}
mbGraphicsUsed = true;
return mpGraphics;
@@ -216,7 +216,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
Destroy();
// create a Quartz layer matching to the intended virdev usage
- CGContextRef xCGContext = NULL;
+ CGContextRef xCGContext = nullptr;
if( mnBitmapDepth && (mnBitmapDepth < 16) )
{
mnBitmapDepth = 8; // TODO: are 1bit vdevs worth it?
@@ -251,7 +251,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
{
// ensure we don't reuse a dead AquaSalFrame on the very
// unlikely case of no other frame to use
- pSalFrame = NULL;
+ pSalFrame = nullptr;
}
// update the frame reference
mpGraphics->setGraphicsFrame( pSalFrame );
@@ -308,7 +308,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
SAL_WARN_IF( !xCGContext, "vcl.quartz", "No context" );
const CGSize aNewSize = { static_cast<CGFloat>(nDX), static_cast<CGFloat>(nDY) };
- mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, NULL );
+ mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, nullptr );
SAL_INFO( "vcl.cg", "CGLayerCreateWithContext(" << xCGContext << "," << aNewSize << ",NULL) = " << mxLayer );
if( mxLayer && mpGraphics )
@@ -319,7 +319,7 @@ bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
mpGraphics->SetVirDevGraphics( mxLayer, xDrawContext, mnBitmapDepth );
}
- return (mxLayer != NULL);
+ return (mxLayer != nullptr);
}
long AquaSalVirtualDevice::GetWidth() const
diff --git a/vcl/quartz/utils.cxx b/vcl/quartz/utils.cxx
index 86832ff88be9..7194ad3963ef 100644
--- a/vcl/quartz/utils.cxx
+++ b/vcl/quartz/utils.cxx
@@ -29,7 +29,7 @@
OUString GetOUString( CFStringRef rStr )
{
- if( rStr == 0 )
+ if( rStr == nullptr )
{
return OUString();
}