summaryrefslogtreecommitdiff
path: root/svtools/source/graphic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:25:17 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:48 +0100
commit28f4bee7bd7378141d8569186162e1a3166eb012 (patch)
tree97cb855eec76da937068cda5c5f0f7d5bcd61e47 /svtools/source/graphic
parentbf057fab3c0d17bf2832c8d9fc6d34b1b859e660 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I7fc4b4d5c895f241cfb052b009e943e073f3befe
Diffstat (limited to 'svtools/source/graphic')
-rw-r--r--svtools/source/graphic/descriptor.cxx8
-rw-r--r--svtools/source/graphic/graphic.cxx4
-rw-r--r--svtools/source/graphic/grfcache.cxx28
-rw-r--r--svtools/source/graphic/grfmgr.cxx34
-rw-r--r--svtools/source/graphic/grfmgr2.cxx8
-rw-r--r--svtools/source/graphic/provider.cxx8
-rw-r--r--svtools/source/graphic/renderer.cxx4
7 files changed, 47 insertions, 47 deletions
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index 6db1ffa47839..eff107dd3a02 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -54,7 +54,7 @@ namespace unographic {
GraphicDescriptor::GraphicDescriptor() :
::comphelper::PropertySetHelper( createPropertySetInfo(), SAL_NO_ACQUIRE ),
- mpGraphic( NULL ),
+ mpGraphic( nullptr ),
meType( GRAPHIC_NONE ),
mnBitsPerPixel ( 0 ),
mbTransparent ( false ),
@@ -96,7 +96,7 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL )
aURL = *pURL;
::GraphicDescriptor aDescriptor( rIStm, &aURL );
- mpGraphic = NULL;
+ mpGraphic = nullptr;
maMimeType.clear();
meType = GRAPHIC_NONE;
mnBitsPerPixel = 0;
@@ -104,7 +104,7 @@ void GraphicDescriptor::implCreate( SvStream& rIStm, const OUString* pURL )
if( aDescriptor.Detect( true ) && aDescriptor.GetFileFormat() != GraphicFileFormat::NOT )
{
- const char* pMimeType = NULL;
+ const char* pMimeType = nullptr;
sal_uInt8 cType = graphic::GraphicType::EMPTY;
switch( aDescriptor.GetFileFormat() )
@@ -351,7 +351,7 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry**
case( GFX_LINK_TYPE_NATIVE_SVG ): pMimeType = MIMETYPE_SVG; break;
default:
- pMimeType = NULL;
+ pMimeType = nullptr;
break;
}
diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx
index 1a29182b45a1..980f04bc11d1 100644
--- a/svtools/source/graphic/graphic.cxx
+++ b/svtools/source/graphic/graphic.cxx
@@ -34,7 +34,7 @@ using namespace com::sun::star;
namespace unographic {
Graphic::Graphic() :
- mpGraphic( NULL )
+ mpGraphic( nullptr )
{
}
@@ -237,7 +237,7 @@ const ::Graphic* Graphic::getImplementation( const uno::Reference< uno::XInterfa
throw()
{
uno::Reference< lang::XUnoTunnel > xTunnel( rxIFace, uno::UNO_QUERY );
- return( xTunnel.is() ? reinterpret_cast< ::Graphic* >( xTunnel->getSomething( ::Graphic::getUnoTunnelId() ) ) : NULL );
+ return( xTunnel.is() ? reinterpret_cast< ::Graphic* >( xTunnel->getSomething( ::Graphic::getUnoTunnelId() ) ) : nullptr );
}
diff --git a/svtools/source/graphic/grfcache.cxx b/svtools/source/graphic/grfcache.cxx
index 9d0e6c58ed1c..fd30407e1db7 100644
--- a/svtools/source/graphic/grfcache.cxx
+++ b/svtools/source/graphic/grfcache.cxx
@@ -178,9 +178,9 @@ public:
GraphicCacheEntry::GraphicCacheEntry( const GraphicObject& rObj ) :
maID ( rObj ),
- mpBmpEx ( NULL ),
- mpMtf ( NULL ),
- mpAnimation ( NULL ),
+ mpBmpEx ( nullptr ),
+ mpMtf ( nullptr ),
+ mpAnimation ( nullptr ),
mbSwappedAll ( true )
{
mbSwappedAll = !ImplInit( rObj );
@@ -208,13 +208,13 @@ bool GraphicCacheEntry::ImplInit( const GraphicObject& rObj )
const Graphic& rGraphic = rObj.GetGraphic();
if( mpBmpEx )
- delete mpBmpEx, mpBmpEx = NULL;
+ delete mpBmpEx, mpBmpEx = nullptr;
if( mpMtf )
- delete mpMtf, mpMtf = NULL;
+ delete mpMtf, mpMtf = nullptr;
if( mpAnimation )
- delete mpAnimation, mpAnimation = NULL;
+ delete mpAnimation, mpAnimation = nullptr;
switch( rGraphic.GetType() )
{
@@ -361,9 +361,9 @@ void GraphicCacheEntry::GraphicObjectWasSwappedOut( const GraphicObject& /*rObj*
if( mbSwappedAll )
{
- delete mpBmpEx, mpBmpEx = NULL;
- delete mpMtf, mpMtf = NULL;
- delete mpAnimation, mpAnimation = NULL;
+ delete mpBmpEx, mpBmpEx = nullptr;
+ delete mpMtf, mpMtf = nullptr;
+ delete mpAnimation, mpAnimation = nullptr;
// #119176# also reset SvgData
maSvgData.reset();
@@ -408,7 +408,7 @@ public:
const GraphicObject& rObj, const GraphicAttr& rAttr,
const BitmapEx& rBmpEx ) :
mpRefCacheEntry( pRefCacheEntry ),
- mpMtf( NULL ), mpBmpEx( new BitmapEx( rBmpEx ) ),
+ mpMtf( nullptr ), mpBmpEx( new BitmapEx( rBmpEx ) ),
maAttr( rAttr ), maOutSizePix( pOut->LogicToPixel( rSz ) ),
mnCacheSize( GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) ),
mnOutDevDrawMode( pOut->GetDrawMode() ),
@@ -421,7 +421,7 @@ public:
const GraphicObject& rObj, const GraphicAttr& rAttr,
const GDIMetaFile& rMtf ) :
mpRefCacheEntry( pRefCacheEntry ),
- mpMtf( new GDIMetaFile( rMtf ) ), mpBmpEx( NULL ),
+ mpMtf( new GDIMetaFile( rMtf ) ), mpBmpEx( nullptr ),
maAttr( rAttr ), maOutSizePix( pOut->LogicToPixel( rSz ) ),
mnCacheSize( GetNeededSize( pOut, rPt, rSz, rObj, rAttr ) ),
mnOutDevDrawMode( pOut->GetDrawMode() ),
@@ -984,7 +984,7 @@ void GraphicCache::GraphicObjectWasSwappedIn( const GraphicObject& rObj )
if( pEntry->GetID().IsEmpty() )
{
ReleaseGraphicObject( rObj );
- AddGraphicObject( rObj, (Graphic&) rObj.GetGraphic(), NULL, NULL );
+ AddGraphicObject( rObj, (Graphic&) rObj.GetGraphic(), nullptr, nullptr );
}
else
pEntry->GraphicObjectWasSwappedIn( rObj );
@@ -1160,7 +1160,7 @@ bool GraphicCache::DrawDisplayCacheObj( OutputDevice* pOut, const Point& rPt, co
const Point aPtPixel( pOut->LogicToPixel( rPt ) );
const Size aSzPixel( pOut->LogicToPixel( rSz ) );
const GraphicCacheEntry* pCacheEntry = ImplGetCacheEntry( rObj );
- GraphicDisplayCacheEntry* pDisplayCacheEntry = NULL;
+ GraphicDisplayCacheEntry* pDisplayCacheEntry = nullptr;
GraphicDisplayCacheEntryList::iterator it = maDisplayCache.begin();
bool bRet = false;
@@ -1224,7 +1224,7 @@ bool GraphicCache::ImplFreeDisplayCacheSpace( sal_uLong nSizeToFree )
GraphicCacheEntry* GraphicCache::ImplGetCacheEntry( const GraphicObject& rObj )
{
- GraphicCacheEntry* pRet = NULL;
+ GraphicCacheEntry* pRet = nullptr;
for(
GraphicCacheEntryList::iterator it = maGraphicCache.begin();
diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx
index 9289c43421b0..eef174cba873 100644
--- a/svtools/source/graphic/grfmgr.cxx
+++ b/svtools/source/graphic/grfmgr.cxx
@@ -46,7 +46,7 @@ using com::sun::star::uno::Sequence;
using com::sun::star::container::XNameContainer;
using com::sun::star::beans::XPropertySet;
-GraphicManager* GraphicObject::mpGlobalMgr = NULL;
+GraphicManager* GraphicObject::mpGlobalMgr = nullptr;
struct GrfSimpleCacheObj
{
@@ -99,7 +99,7 @@ GraphicObject::GraphicObject( const GraphicObject& rGraphicObj, const GraphicMan
{
ImplConstruct();
ImplAssignGraphicData();
- ImplSetGraphicManager( pMgr, NULL, &rGraphicObj );
+ ImplSetGraphicManager( pMgr, nullptr, &rGraphicObj );
if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
SetSwapState();
}
@@ -126,7 +126,7 @@ GraphicObject::~GraphicObject()
mpMgr->ImplUnregisterObj( *this );
if( ( mpMgr == mpGlobalMgr ) && !mpGlobalMgr->ImplHasObjects() )
- delete mpGlobalMgr, mpGlobalMgr = NULL;
+ delete mpGlobalMgr, mpGlobalMgr = nullptr;
}
delete mpSwapOutTimer;
@@ -135,10 +135,10 @@ GraphicObject::~GraphicObject()
void GraphicObject::ImplConstruct()
{
- mpMgr = NULL;
+ mpMgr = nullptr;
maSwapStreamHdl = Link<const GraphicObject*, SvStream*>();
- mpSwapOutTimer = NULL;
- mpSimpleCache = NULL;
+ mpSwapOutTimer = nullptr;
+ mpSimpleCache = nullptr;
mnAnimationLoopCount = 0;
mbAutoSwapped = false;
mbIsInSwapIn = false;
@@ -177,7 +177,7 @@ void GraphicObject::ImplSetGraphicManager( const GraphicManager* pMgr, const OSt
mpMgr->ImplUnregisterObj( *this );
if( ( mpMgr == mpGlobalMgr ) && !mpGlobalMgr->ImplHasObjects() )
- delete mpGlobalMgr, mpGlobalMgr = NULL;
+ delete mpGlobalMgr, mpGlobalMgr = nullptr;
}
if( !pMgr )
@@ -350,7 +350,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj )
mpMgr->ImplUnregisterObj( *this );
maSwapStreamHdl = Link<const GraphicObject*, SvStream*>();
- delete mpSimpleCache, mpSimpleCache = NULL;
+ delete mpSimpleCache, mpSimpleCache = nullptr;
maGraphic = rGraphicObj.GetGraphic();
maAttr = rGraphicObj.maAttr;
@@ -359,7 +359,7 @@ GraphicObject& GraphicObject::operator=( const GraphicObject& rGraphicObj )
ImplAssignGraphicData();
mbAutoSwapped = false;
mpMgr = rGraphicObj.mpMgr;
- mpMgr->ImplRegisterObj( *this, maGraphic, NULL, &rGraphicObj );
+ mpMgr->ImplRegisterObj( *this, maGraphic, nullptr, &rGraphicObj );
if( rGraphicObj.HasUserData() && rGraphicObj.IsSwappedOut() )
SetSwapState();
}
@@ -400,7 +400,7 @@ void GraphicObject::SetAttr( const GraphicAttr& rAttr )
maAttr = rAttr;
if( mpSimpleCache && ( mpSimpleCache->maAttr != rAttr ) )
- delete mpSimpleCache, mpSimpleCache = NULL;
+ delete mpSimpleCache, mpSimpleCache = nullptr;
}
void GraphicObject::SetLink()
@@ -454,7 +454,7 @@ void GraphicObject::SetSwapStreamHdl(const Link<const GraphicObject*, SvStream*>
mpSwapOutTimer->Start();
}
else
- delete mpSwapOutTimer, mpSwapOutTimer = NULL;
+ delete mpSwapOutTimer, mpSwapOutTimer = nullptr;
}
void GraphicObject::FireSwapInRequest()
@@ -464,14 +464,14 @@ void GraphicObject::FireSwapInRequest()
void GraphicObject::FireSwapOutRequest()
{
- ImplAutoSwapOutHdl( NULL );
+ ImplAutoSwapOutHdl( nullptr );
}
void GraphicObject::GraphicManagerDestroyed()
{
// we're alive, but our manager doesn't live anymore ==> connect to default manager
- mpMgr = NULL;
- ImplSetGraphicManager( NULL );
+ mpMgr = nullptr;
+ ImplSetGraphicManager( nullptr );
}
bool GraphicObject::IsCached( OutputDevice* pOut, const Point& rPt, const Size& rSz,
@@ -577,7 +577,7 @@ bool GraphicObject::Draw( OutputDevice* pOut, const Point& rPt, const Size& rSz,
bool GraphicObject::DrawTiled( OutputDevice* pOut, const Rectangle& rArea, const Size& rSize,
const Size& rOffset, const GraphicAttr* pAttr, GraphicManagerDrawFlags nFlags, int nTileCacheSize1D )
{
- if( pOut == NULL || rSize.Width() == 0 || rSize.Height() == 0 )
+ if( pOut == nullptr || rSize.Width() == 0 || rSize.Height() == 0 )
return false;
const MapMode aOutMapMode( pOut->GetMapMode() );
@@ -684,9 +684,9 @@ void GraphicObject::SetGraphic( const Graphic& rGraphic, const GraphicObject* pC
mbAutoSwapped = false;
ImplAssignGraphicData();
maLink.clear();
- delete mpSimpleCache, mpSimpleCache = NULL;
+ delete mpSimpleCache, mpSimpleCache = nullptr;
- mpMgr->ImplRegisterObj( *this, maGraphic, 0, pCopyObj);
+ mpMgr->ImplRegisterObj( *this, maGraphic, nullptr, pCopyObj);
if( mpSwapOutTimer )
mpSwapOutTimer->Start();
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index c6eae94a354b..45176740e8d0 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -794,9 +794,9 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib
Bitmap aMsk( rBmpEx.GetMask() );
const BitmapColor aB( pWriteAccess->GetBestMatchingColor( Color( COL_BLACK ) ) );
const BitmapColor aW( pWriteAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
- BitmapReadAccess* pMAcc = NULL;
+ BitmapReadAccess* pMAcc = nullptr;
- if( !aMsk || ( ( pMAcc = aMsk.AcquireReadAccess() ) != NULL ) )
+ if( !aMsk || ( ( pMAcc = aMsk.AcquireReadAccess() ) != nullptr ) )
{
std::unique_ptr<long[]> pMapLX(new long[ aUnrotatedWidth ]);
std::unique_ptr<long[]> pMapLY(new long[ aUnrotatedHeight ]);
@@ -1126,7 +1126,7 @@ bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
for( nCurPos = 0, pAct = rOutMtf.FirstAction(); pAct;
pAct = rOutMtf.NextAction(), nCurPos++ )
{
- MetaAction* pModAct = NULL;
+ MetaAction* pModAct = nullptr;
switch( pAct->GetType() )
{
case MetaActionType::FONT:
@@ -1992,7 +1992,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice& rOut, const Point& rPosPixel,
int nX, nY;
// #107607# Use logical coordinates for metafile playing, too
- bool bDrawInPixel( rOut.GetConnectMetaFile() == NULL && GRAPHIC_BITMAP == GetType() );
+ bool bDrawInPixel( rOut.GetConnectMetaFile() == nullptr && GRAPHIC_BITMAP == GetType() );
bool bRet = false;
// #105229# Switch off mapping (converting to logic and back to
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index ca850ebc1714..d13cae8b7474 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -481,12 +481,12 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co
aExtHeader.xExt = nExtWidth;
aExtHeader.yExt = nExtHeight;
aExtHeader.mapMode = nExtMapMode;
- WMF_EXTERNALHEADER *pExtHeader = NULL;
+ WMF_EXTERNALHEADER *pExtHeader = nullptr;
if ( nExtMapMode > 0 )
pExtHeader = &aExtHeader;
if( ( rFilter.ImportGraphic( aVCLGraphic, aPath, *pIStm,
- GRFILTER_FORMAT_DONTKNOW, NULL, GraphicFilterImportFlags::NONE, pExtHeader ) == GRFILTER_OK ) &&
+ GRFILTER_FORMAT_DONTKNOW, nullptr, GraphicFilterImportFlags::NONE, pExtHeader ) == GRFILTER_OK ) &&
( aVCLGraphic.GetType() != GRAPHIC_NONE ) )
{
::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic;
@@ -758,7 +758,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
if( pOStm )
{
uno::Sequence< beans::PropertyValue > aFilterDataSeq;
- const char* pFilterShortName = NULL;
+ const char* pFilterShortName = nullptr;
for( i = 0; i < rMediaProperties.getLength(); ++i )
{
@@ -837,7 +837,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
{
rFilter.ExportGraphic( aGraphic, aPath, aMemStrm,
rFilter.GetExportFormatNumberForShortName( OUString::createFromAscii( pFilterShortName ) ),
- ( aFilterDataSeq.getLength() ? &aFilterDataSeq : NULL ) );
+ ( aFilterDataSeq.getLength() ? &aFilterDataSeq : nullptr ) );
}
aMemStrm.Seek( STREAM_SEEK_TO_END );
pOStm->Write( aMemStrm.GetData(), aMemStrm.Tell() );
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index 297166fb858c..593f8e12b504 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -44,7 +44,7 @@ namespace {
GraphicRendererVCL::GraphicRendererVCL() :
::comphelper::PropertySetHelper( createPropertySetInfo() ),
- mpOutDev( NULL )
+ mpOutDev( nullptr )
{
}
@@ -200,7 +200,7 @@ void GraphicRendererVCL::_setPropertyValues( const comphelper::PropertyMapEntry*
else
{
mxDevice.clear();
- mpOutDev = NULL;
+ mpOutDev = nullptr;
}
}
break;