summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:28:29 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:32:00 +0100
commitd3b6cb7ec2da4afb5687c9d28b2be2f96e6aa7b1 (patch)
treee9d209d6d5f06cacd8e0df78c7f6b8ad45d74be5 /vcl/headless
parent45979047abbd9da7a29401f298e8ef9ab58ad337 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpbmp.cxx2
-rw-r--r--vcl/headless/svpframe.cxx24
-rw-r--r--vcl/headless/svpgdi.cxx2
-rw-r--r--vcl/headless/svpinst.cxx16
-rw-r--r--vcl/headless/svpprn.cxx16
-rw-r--r--vcl/headless/svptextrender.cxx20
6 files changed, 40 insertions, 40 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index d0fdf923c0ab..de06cd00ea00 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -136,7 +136,7 @@ sal_uInt16 SvpSalBitmap::GetBitCount() const
BitmapBuffer* SvpSalBitmap::AcquireBuffer( BitmapAccessMode )
{
- BitmapBuffer* pBuf = NULL;
+ BitmapBuffer* pBuf = nullptr;
if( m_aBitmap.get() )
{
pBuf = new BitmapBuffer();
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index f3f2ccef41f8..b881d2ca1e67 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -32,7 +32,7 @@
using namespace basebmp;
using namespace basegfx;
-SvpSalFrame* SvpSalFrame::s_pFocusFrame = NULL;
+SvpSalFrame* SvpSalFrame::s_pFocusFrame = nullptr;
#ifdef IOS
#define SvpSalGraphics AquaSalGraphics
@@ -125,19 +125,19 @@ SvpSalFrame::~SvpSalFrame()
if( s_pFocusFrame == this )
{
// SAL_DEBUG("SvpSalFrame::~SvpSalFrame: losing focus: " << this);
- s_pFocusFrame = NULL;
+ s_pFocusFrame = nullptr;
// call directly here, else an event for a destroyed frame would be dispatched
- CallCallback( SALEVENT_LOSEFOCUS, NULL );
+ CallCallback( SALEVENT_LOSEFOCUS, nullptr );
// if the handler has not set a new focus frame
// pass focus to another frame, preferably a document style window
- if( s_pFocusFrame == NULL )
+ if( s_pFocusFrame == nullptr )
{
const std::list< SalFrame* >& rFrames( m_pInstance->getFrames() );
for( std::list< SalFrame* >::const_iterator it = rFrames.begin(); it != rFrames.end(); ++it )
{
SvpSalFrame* pFrame = const_cast<SvpSalFrame*>(static_cast<const SvpSalFrame*>(*it));
if( pFrame->m_bVisible &&
- pFrame->m_pParent == NULL &&
+ pFrame->m_pParent == nullptr &&
(pFrame->m_nStyle & (SalFrameStyleFlags::MOVEABLE |
SalFrameStyleFlags::SIZEABLE |
SalFrameStyleFlags::CLOSEABLE) )
@@ -162,7 +162,7 @@ void SvpSalFrame::GetFocus()
s_pFocusFrame->LoseFocus();
// SAL_DEBUG("SvpSalFrame::GetFocus(): " << this);
s_pFocusFrame = this;
- m_pInstance->PostEvent( this, NULL, SALEVENT_GETFOCUS );
+ m_pInstance->PostEvent( this, nullptr, SALEVENT_GETFOCUS );
}
}
@@ -171,8 +171,8 @@ void SvpSalFrame::LoseFocus()
if( s_pFocusFrame == this )
{
// SAL_DEBUG("SvpSalFrame::LoseFocus: " << this);
- m_pInstance->PostEvent( this, NULL, SALEVENT_LOSEFOCUS );
- s_pFocusFrame = NULL;
+ m_pInstance->PostEvent( this, nullptr, SALEVENT_LOSEFOCUS );
+ s_pFocusFrame = nullptr;
}
}
@@ -235,7 +235,7 @@ void SvpSalFrame::Show( bool bVisible, bool bNoActivate )
{
// SAL_DEBUG("SvpSalFrame::Show: showing: " << this);
m_bVisible = true;
- m_pInstance->PostEvent( this, NULL, SALEVENT_RESIZE );
+ m_pInstance->PostEvent( this, nullptr, SALEVENT_RESIZE );
if( ! bNoActivate )
GetFocus();
}
@@ -243,7 +243,7 @@ void SvpSalFrame::Show( bool bVisible, bool bNoActivate )
{
// SAL_DEBUG("SvpSalFrame::Show: hiding: " << this);
m_bVisible = false;
- m_pInstance->PostEvent( this, NULL, SALEVENT_RESIZE );
+ m_pInstance->PostEvent( this, nullptr, SALEVENT_RESIZE );
LoseFocus();
}
else
@@ -307,7 +307,7 @@ void SvpSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_u
}
}
if( m_bVisible )
- m_pInstance->PostEvent( this, NULL, SALEVENT_RESIZE );
+ m_pInstance->PostEvent( this, nullptr, SALEVENT_RESIZE );
#endif
}
@@ -339,7 +339,7 @@ SalFrame* SvpSalFrame::GetParent() const
void SvpSalFrame::SetWindowState( const SalFrameState *pState )
{
- if (pState == NULL)
+ if (pState == nullptr)
return;
// Request for position or size change
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 3131410aac6e..fc7d5fa70e0a 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -822,7 +822,7 @@ bool SvpSalGraphics::drawEPS( long, long, long, long, void*, sal_uLong )
cairo_t* SvpSalGraphics::createCairoContext(const basebmp::BitmapDeviceSharedPtr &rBuffer)
{
if (!isCairoCompatible(rBuffer))
- return NULL;
+ return nullptr;
basegfx::B2IVector size = rBuffer->getSize();
sal_Int32 nStride = rBuffer->getScanlineStride();
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 1c47be33c295..0d3aa65d3805 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -60,7 +60,7 @@ bool SvpSalInstance::isFrameAlive( const SalFrame* pFrame ) const
return false;
}
-SvpSalInstance* SvpSalInstance::s_pDefaultInstance = NULL;
+SvpSalInstance* SvpSalInstance::s_pDefaultInstance = nullptr;
SvpSalInstance::SvpSalInstance( SalYieldMutex *pMutex ) :
SalGenericInstance( pMutex )
@@ -100,14 +100,14 @@ SvpSalInstance::SvpSalInstance( SalYieldMutex *pMutex ) :
}
}
m_aEventGuard = osl_createMutex();
- if( s_pDefaultInstance == NULL )
+ if( s_pDefaultInstance == nullptr )
s_pDefaultInstance = this;
}
SvpSalInstance::~SvpSalInstance()
{
if( s_pDefaultInstance == this )
- s_pDefaultInstance = NULL;
+ s_pDefaultInstance = nullptr;
// close 'wakeup' pipe.
close (m_pTimeoutFDS[0]);
@@ -173,7 +173,7 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
if( m_aTimeout.tv_sec ) // timer is started
{
timeval aTimeOfDay;
- gettimeofday( &aTimeOfDay, 0 );
+ gettimeofday( &aTimeOfDay, nullptr );
if( aTimeOfDay >= m_aTimeout )
{
bRet = true;
@@ -200,7 +200,7 @@ bool SvpSalInstance::CheckTimeout( bool bExecuteTimers )
SalFrame* SvpSalInstance::CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle )
{
- return new SvpSalFrame( this, NULL, nStyle, false, SVP_DEFAULT_BITMAP_FORMAT, pParent );
+ return new SvpSalFrame( this, nullptr, nStyle, false, SVP_DEFAULT_BITMAP_FORMAT, pParent );
}
SalFrame* SvpSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
@@ -317,7 +317,7 @@ void SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong
{
timeval Timeout;
// determine remaining timeout.
- gettimeofday (&Timeout, 0);
+ gettimeofday (&Timeout, nullptr);
nTimeoutMS = (m_aTimeout.tv_sec - Timeout.tv_sec) * 1000
+ m_aTimeout.tv_usec/1000 - Timeout.tv_usec/1000;
if( nTimeoutMS < 0 )
@@ -364,7 +364,7 @@ bool SvpSalInstance::AnyInput( VclInputFlags nType )
SalSession* SvpSalInstance::CreateSalSession()
{
- return NULL;
+ return nullptr;
}
void* SvpSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes )
@@ -384,7 +384,7 @@ void SvpSalInstance::StopTimer()
void SvpSalInstance::StartTimer( sal_uLong nMS )
{
timeval aPrevTimeout (m_aTimeout);
- gettimeofday (&m_aTimeout, 0);
+ gettimeofday (&m_aTimeout, nullptr);
m_nTimeoutMS = nMS;
m_aTimeout += m_nTimeoutMS;
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index cc7034930bd0..fd5047ed135e 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -89,8 +89,8 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
}
// copy input slot
- const PPDKey* pKey = NULL;
- const PPDValue* pValue = NULL;
+ const PPDKey* pKey = nullptr;
+ const PPDValue* pValue = nullptr;
pJobSetup->mnPaperBin = 0xffff;
if( rData.m_pParser )
@@ -109,8 +109,8 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
}
// copy duplex
- pKey = NULL;
- pValue = NULL;
+ pKey = nullptr;
+ pValue = nullptr;
pJobSetup->meDuplexMode = DUPLEX_UNKNOWN;
if( rData.m_pParser )
@@ -140,7 +140,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
rtl_freeMemory( pJobSetup->mpDriverData );
int nBytes;
- void* pBuffer = NULL;
+ void* pBuffer = nullptr;
if( rData.getStreamBuffer( pBuffer, nBytes ) )
{
pJobSetup->mnDriverDataLen = nBytes;
@@ -149,7 +149,7 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData )
else
{
pJobSetup->mnDriverDataLen = 0;
- pJobSetup->mpDriverData = NULL;
+ pJobSetup->mpDriverData = nullptr;
}
}
@@ -220,7 +220,7 @@ void SvpSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
pInfo->maDriver = rInfo.m_aDriverName;
pInfo->maLocation = rInfo.m_aLocation;
pInfo->maComment = rInfo.m_aComment;
- pInfo->mpSysData = NULL;
+ pInfo->mpSysData = nullptr;
sal_Int32 nIndex = 0;
while( nIndex != -1 )
@@ -257,7 +257,7 @@ void SvpSalInstance::PostPrintersChanged()
const std::list< SalFrame* >& rList = SvpSalInstance::s_pDefaultInstance->getFrames();
for( std::list< SalFrame* >::const_iterator it = rList.begin();
it != rList.end(); ++it )
- SvpSalInstance::s_pDefaultInstance->PostEvent( *it, NULL, SALEVENT_PRINTERCHANGED );
+ SvpSalInstance::s_pDefaultInstance->PostEvent( *it, nullptr, SALEVENT_PRINTERCHANGED );
}
GenPspGraphics *SvpSalInstance::CreatePrintGraphics()
diff --git a/vcl/headless/svptextrender.cxx b/vcl/headless/svptextrender.cxx
index d8e4e162da44..c4bc49e827ab 100644
--- a/vcl/headless/svptextrender.cxx
+++ b/vcl/headless/svptextrender.cxx
@@ -116,7 +116,7 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont,
if( rGlyphData.ExtDataRef().meInfo != nBmpFormat )
{
SvpGcpHelper* pGcpHelper = rGlyphData.ExtDataRef().mpData;
- bool bNew = pGcpHelper == 0;
+ bool bNew = pGcpHelper == nullptr;
if( bNew )
pGcpHelper = new SvpGcpHelper;
@@ -162,7 +162,7 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont,
SvpGcpHelper* pGcpHelper = static_cast<SvpGcpHelper*>(
rGlyphData.ExtDataRef().mpData);
- assert(pGcpHelper != 0);
+ assert(pGcpHelper != nullptr);
rTargetPos += B2IPoint( pGcpHelper->maRawBitmap.mnXOffset, pGcpHelper->maRawBitmap.mnYOffset );
return pGcpHelper->maBitmapDev;
}
@@ -176,7 +176,7 @@ void SvpGlyphPeer::RemovingGlyph( GlyphData& rGlyphData )
{
SvpGcpHelper* pGcpHelper = rGlyphData.ExtDataRef().mpData;
rGlyphData.ExtDataRef().meInfo = basebmp::Format::NONE;
- rGlyphData.ExtDataRef().mpData = 0;
+ rGlyphData.ExtDataRef().mpData = nullptr;
delete pGcpHelper;
}
@@ -186,7 +186,7 @@ SvpTextRender::SvpTextRender(SvpSalGraphics& rParent)
, m_eTextFmt(basebmp::Format::EightBitGrey)
{
for( int i = 0; i < MAX_FALLBACK; ++i )
- m_pServerFont[i] = NULL;
+ m_pServerFont[i] = nullptr;
}
sal_uInt16 SvpTextRender::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel )
@@ -194,11 +194,11 @@ sal_uInt16 SvpTextRender::SetFont( FontSelectPattern* pIFSD, int nFallbackLevel
// release all no longer needed font resources
for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
{
- if( m_pServerFont[i] != NULL )
+ if( m_pServerFont[i] != nullptr )
{
// old server side font is no longer referenced
SvpGlyphCache::GetInstance().UncacheFont( *m_pServerFont[i] );
- m_pServerFont[i] = NULL;
+ m_pServerFont[i] = nullptr;
}
}
@@ -228,7 +228,7 @@ void SvpTextRender::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLev
if( nFallbackLevel >= MAX_FALLBACK )
return;
- if( m_pServerFont[nFallbackLevel] != NULL )
+ if( m_pServerFont[nFallbackLevel] != nullptr )
{
long rDummyFactor;
m_pServerFont[nFallbackLevel]->FetchFontMetric( *pMetric, rDummyFactor );
@@ -238,7 +238,7 @@ void SvpTextRender::GetFontMetric( ImplFontMetricData* pMetric, int nFallbackLev
const FontCharMapPtr SvpTextRender::GetFontCharMap() const
{
if( !m_pServerFont[0] )
- return NULL;
+ return nullptr;
const FontCharMapPtr pFCMap = m_pServerFont[0]->GetFontCharMap();
return pFCMap;
@@ -409,7 +409,7 @@ bool SvpTextRender::GetGlyphOutline( sal_GlyphId aGlyphId, B2DPolyPolygon& rPoly
SalLayout* SvpTextRender::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel )
{
- GenericSalLayout* pLayout = NULL;
+ GenericSalLayout* pLayout = nullptr;
if( m_pServerFont[ nFallbackLevel ] )
pLayout = new ServerFontLayout( *m_pServerFont[ nFallbackLevel ] );
@@ -453,7 +453,7 @@ SystemFontData SvpTextRender::GetSysFontData( int nFallbackLevel ) const
if (nFallbackLevel >= MAX_FALLBACK) nFallbackLevel = MAX_FALLBACK - 1;
if (nFallbackLevel < 0 ) nFallbackLevel = 0;
- if (m_pServerFont[nFallbackLevel] != NULL)
+ if (m_pServerFont[nFallbackLevel] != nullptr)
{
ServerFont* rFont = m_pServerFont[nFallbackLevel];
aSysFontData.nFontId = rFont->GetFtFace();