From c40c7a8c364bd8f1d7777e803e5a6b0cfddeaca3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:11:10 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: I9e064592c4ee18a600aadfa20b3c89ecafc818d4 --- canvas/source/cairo/cairo_canvas.cxx | 2 +- canvas/source/cairo/cairo_canvashelper.cxx | 44 ++++++++++++------------ canvas/source/cairo/cairo_canvashelper.hxx | 4 +-- canvas/source/cairo/cairo_canvashelper_text.cxx | 10 +++--- canvas/source/cairo/cairo_devicehelper.cxx | 8 ++--- canvas/source/cairo/cairo_spritecanvas.cxx | 2 +- canvas/source/cairo/cairo_spritecanvashelper.cxx | 8 ++--- canvas/source/cairo/cairo_spritedevicehelper.cxx | 4 +-- canvas/source/cairo/cairo_spritehelper.cxx | 2 +- canvas/source/cairo/cairo_textlayout.cxx | 6 ++-- canvas/source/opengl/ogl_canvashelper.cxx | 30 ++++++++-------- canvas/source/opengl/ogl_spritecanvas.cxx | 2 +- canvas/source/opengl/ogl_spritedevicehelper.cxx | 8 ++--- canvas/source/tools/elapsedtime.cxx | 2 +- canvas/source/tools/page.hxx | 6 ++-- canvas/source/tools/parametricpolypolygon.cxx | 2 +- canvas/source/vcl/bitmapbackbuffer.cxx | 2 +- canvas/source/vcl/canvas.cxx | 2 +- canvas/source/vcl/canvasbitmap.cxx | 2 +- canvas/source/vcl/canvasbitmaphelper.cxx | 16 ++++----- canvas/source/vcl/canvashelper.cxx | 36 +++++++++---------- canvas/source/vcl/canvashelper_texturefill.cxx | 2 +- canvas/source/vcl/impltools.cxx | 8 ++--- canvas/source/vcl/impltools.hxx | 2 +- canvas/source/vcl/spritecanvashelper.cxx | 14 ++++---- canvas/source/vcl/spritehelper.cxx | 2 +- canvas/source/vcl/textlayout.cxx | 10 +++--- canvas/source/vcl/windowoutdevholder.cxx | 2 +- include/canvas/canvastools.hxx | 4 +-- 29 files changed, 121 insertions(+), 121 deletions(-) diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 589d585121ba..dd65071cfeea 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -79,7 +79,7 @@ namespace cairocanvas maArguments[0] >>= nPtr; OutputDevice* pOutDev = reinterpret_cast(nPtr); - ENSURE_ARG_OR_THROW( pOutDev != NULL, + ENSURE_ARG_OR_THROW( pOutDev != nullptr, "Canvas::initialize: invalid OutDev pointer" ); awt::Rectangle aBounds; diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 030f7e0f4ea8..af94c38d2259 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -66,8 +66,8 @@ using namespace ::com::sun::star; namespace cairocanvas { CanvasHelper::CanvasHelper() : - mpSurfaceProvider(NULL), - mpDevice(NULL), + mpSurfaceProvider(nullptr), + mpDevice(nullptr), mpVirtualDevice(), mbHaveAlpha(), mpCairo(), @@ -81,8 +81,8 @@ namespace cairocanvas mpSurface.reset(); mpCairo.reset(); mpVirtualDevice.disposeAndClear(); - mpDevice = NULL; - mpSurfaceProvider = NULL; + mpDevice = nullptr; + mpSurfaceProvider = nullptr; } void CanvasHelper::init( const ::basegfx::B2ISize& rSizePixel, @@ -408,7 +408,7 @@ namespace cairocanvas bHasAlpha = xBitmap->hasAlpha(); SurfaceSharedPtr pSurface = surfaceFromXBitmap( xBitmap ); if( pSurface ) - data = NULL; + data = nullptr; else { ::BitmapEx aBmpEx = bitmapExFromXBitmap(xBitmap); @@ -420,7 +420,7 @@ namespace cairocanvas if( !aBmpEx.IsTransparent() && !aBmpEx.IsAlpha() ) { pSurface = rSurfaceProvider->createSurface( aBitmap ); - data = NULL; + data = nullptr; bHasAlpha = false; } @@ -429,7 +429,7 @@ namespace cairocanvas AlphaMask aAlpha = aBmpEx.GetAlpha(); ::BitmapReadAccess* pBitmapReadAcc = aBitmap.AcquireReadAccess(); - ::BitmapReadAccess* pAlphaReadAcc = NULL; + ::BitmapReadAccess* pAlphaReadAcc = nullptr; const long nWidth = pBitmapReadAcc->Width(); const long nHeight = pBitmapReadAcc->Height(); long nX, nY; @@ -704,7 +704,7 @@ namespace cairocanvas static cairo_pattern_t* patternFromParametricPolyPolygon( ::canvas::ParametricPolyPolygon& rPolygon ) { - cairo_pattern_t* pPattern = NULL; + cairo_pattern_t* pPattern = nullptr; const ::canvas::ParametricPolyPolygon::Values aValues = rPolygon.getValues(); double x0, x1, y0, y1, cx, cy, r0, r1; @@ -750,7 +750,7 @@ namespace cairocanvas const css::rendering::Texture& aTexture ( (*pTextures)[0] ); if( aTexture.Bitmap.is() ) { - unsigned char* data = NULL; + unsigned char* data = nullptr; bool bHasAlpha = false; SurfaceSharedPtr pSurface = surfaceFromXBitmap( (*pTextures)[0].Bitmap, pDevice, data, bHasAlpha ); @@ -1149,7 +1149,7 @@ namespace cairocanvas mxDevice->stopPerfTrace( &aTimer, "drawPolyPolygon" ); #endif - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* , @@ -1232,7 +1232,7 @@ namespace cairocanvas #endif // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* , @@ -1243,7 +1243,7 @@ namespace cairocanvas const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* , @@ -1255,7 +1255,7 @@ namespace cairocanvas const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* , @@ -1265,7 +1265,7 @@ namespace cairocanvas const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO - return uno::Reference< rendering::XPolyPolygon2D >(NULL); + return uno::Reference< rendering::XPolyPolygon2D >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* , @@ -1294,7 +1294,7 @@ namespace cairocanvas mxDevice->stopPerfTrace( &aTimer, "fillPolyPolygon" ); #endif - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* , @@ -1313,7 +1313,7 @@ namespace cairocanvas cairo_restore( mpCairo.get() ); } - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* , @@ -1324,7 +1324,7 @@ namespace cairocanvas const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) { // TODO - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmapSurface( const rendering::XCanvas* pCanvas, @@ -1336,7 +1336,7 @@ namespace cairocanvas bool bHasAlpha ) { SurfaceSharedPtr pSurface=pInputSurface; - uno::Reference< rendering::XCachedPrimitive > rv(NULL); + uno::Reference< rendering::XCachedPrimitive > rv(nullptr); geometry::IntegerSize2D aBitmapSize = rSize; if( mpCairo ) @@ -1454,7 +1454,7 @@ namespace cairocanvas #endif uno::Reference< rendering::XCachedPrimitive > rv; - unsigned char* data = NULL; + unsigned char* data = nullptr; bool bHasAlpha = false; SurfaceSharedPtr pSurface = surfaceFromXBitmap( xBitmap, mpSurfaceProvider, data, bHasAlpha ); geometry::IntegerSize2D aSize = xBitmap->getSize(); @@ -1467,7 +1467,7 @@ namespace cairocanvas free( data ); } else - rv.set(NULL); + rv.set(nullptr); #ifdef CAIRO_CANVAS_PERF_TRACE mxDevice->stopPerfTrace( &aTimer, "drawBitmap" ); @@ -1487,7 +1487,7 @@ namespace cairocanvas #endif uno::Reference< rendering::XCachedPrimitive > rv; - unsigned char* data = NULL; + unsigned char* data = nullptr; bool bHasAlpha = false; SurfaceSharedPtr pSurface = surfaceFromXBitmap( xBitmap, mpSurfaceProvider, data, bHasAlpha ); geometry::IntegerSize2D aSize = xBitmap->getSize(); @@ -1500,7 +1500,7 @@ namespace cairocanvas free( data ); } else - rv.set(NULL); + rv.set(nullptr); #ifdef CAIRO_CANVAS_PERF_TRACE mxDevice->stopPerfTrace( &aTimer, "drawBitmap" ); diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx index 84e0d68cb21a..f03f9d3f3a7c 100644 --- a/canvas/source/cairo/cairo_canvashelper.hxx +++ b/canvas/source/cairo/cairo_canvashelper.hxx @@ -218,8 +218,8 @@ namespace cairocanvas void doPolyPolygonPath( const css::uno::Reference< css::rendering::XPolyPolygon2D >& xPolyPolygon, Operation aOperation, bool bNoLineJoin = false, - const css::uno::Sequence< css::rendering::Texture >* pTextures=NULL, - cairo_t* pCairo=NULL ) const; + const css::uno::Sequence< css::rendering::Texture >* pTextures=nullptr, + cairo_t* pCairo=nullptr ) const; css::uno::Reference< css::rendering::XCachedPrimitive > implDrawBitmapSurface( const css::rendering::XCanvas* pCanvas, diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index cec836cc77e6..6f37f7f310b2 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -240,7 +240,7 @@ namespace cairocanvas if (!aRegion.IsEmpty() && !aRegion.IsNull()) { doPolyPolygonImplementation(aRegion.GetAsB2DPolyPolygon(), Clip, mpCairo.get(), - NULL, mpSurfaceProvider, rendering::FillRule_EVEN_ODD); + nullptr, mpSurfaceProvider, rendering::FillRule_EVEN_ODD); } } @@ -273,7 +273,7 @@ namespace cairocanvas #endif ::Point aOutpos; if( !setupTextOutput( *mpVirtualDevice.get(), pOwner, aOutpos, viewState, renderState, xFont ) ) - return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary + return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary // change text direction and layout mode ComplexTextLayoutMode nLayoutMode(TEXT_LAYOUT_DEFAULT); @@ -307,7 +307,7 @@ namespace cairocanvas pTextLayout->draw(mpCairo, *mpVirtualDevice, aOutpos, viewState, renderState); } - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* pOwner, @@ -341,7 +341,7 @@ namespace cairocanvas ::Point aOutpos; if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xLayoutedText->getFont() ) ) - return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary + return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary clip_cairo_from_dev(*mpVirtualDevice); @@ -355,7 +355,7 @@ namespace cairocanvas "CanvasHelper::drawTextLayout(): TextLayout not compatible with this canvas" ); } - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } } diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx index a0ebb42abf98..2f214ad15e1f 100644 --- a/canvas/source/cairo/cairo_devicehelper.cxx +++ b/canvas/source/cairo/cairo_devicehelper.cxx @@ -40,8 +40,8 @@ using namespace ::com::sun::star; namespace cairocanvas { DeviceHelper::DeviceHelper() : - mpSurfaceProvider( NULL ), - mpRefDevice( NULL ), + mpSurfaceProvider( nullptr ), + mpRefDevice( nullptr ), mpSurface() { } @@ -71,8 +71,8 @@ namespace cairocanvas { // release all references mpSurface.reset(); - mpRefDevice = NULL; - mpSurfaceProvider = NULL; + mpRefDevice = nullptr; + mpSurfaceProvider = nullptr; } void DeviceHelper::setSize( const ::basegfx::B2ISize& rSize ) diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index dae8e0a5749d..9c6dd667029a 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -80,7 +80,7 @@ namespace cairocanvas vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if( !pParentWindow ) throw lang::NoSupportException( - "Parent window not VCL window, or canvas out-of-process!", NULL); + "Parent window not VCL window, or canvas out-of-process!", nullptr); bool bHasCairo = pParentWindow->SupportsCairo(); ENSURE_ARG_OR_THROW(bHasCairo, diff --git a/canvas/source/cairo/cairo_spritecanvashelper.cxx b/canvas/source/cairo/cairo_spritecanvashelper.cxx index a1b16436739c..03fa5597e319 100644 --- a/canvas/source/cairo/cairo_spritecanvashelper.cxx +++ b/canvas/source/cairo/cairo_spritecanvashelper.cxx @@ -89,8 +89,8 @@ namespace cairocanvas } SpriteCanvasHelper::SpriteCanvasHelper() : - mpRedrawManager( NULL ), - mpOwningSpriteCanvas( NULL ), + mpRedrawManager( nullptr ), + mpOwningSpriteCanvas( nullptr ), mpCompositingSurface(), maCompositingSurfaceSize(), mbCompositingSurfaceDirty(true) @@ -110,8 +110,8 @@ namespace cairocanvas void SpriteCanvasHelper::disposing() { mpCompositingSurface.reset(); - mpOwningSpriteCanvas = NULL; - mpRedrawManager = NULL; + mpOwningSpriteCanvas = nullptr; + mpRedrawManager = nullptr; // forward to base CanvasHelper::disposing(); diff --git a/canvas/source/cairo/cairo_spritedevicehelper.cxx b/canvas/source/cairo/cairo_spritedevicehelper.cxx index 467b4a8738ec..b2a263f5c447 100644 --- a/canvas/source/cairo/cairo_spritedevicehelper.cxx +++ b/canvas/source/cairo/cairo_spritedevicehelper.cxx @@ -41,7 +41,7 @@ namespace cairocanvas { SpriteDeviceHelper::SpriteDeviceHelper() : - mpSpriteCanvas( NULL ), + mpSpriteCanvas( nullptr ), mpBufferSurface(), maSize(), mbFullScreen( false ) @@ -65,7 +65,7 @@ namespace cairocanvas { // release all references mpBufferSurface.reset(); - mpSpriteCanvas = NULL; + mpSpriteCanvas = nullptr; } bool SpriteDeviceHelper::showBuffer( bool, bool ) diff --git a/canvas/source/cairo/cairo_spritehelper.cxx b/canvas/source/cairo/cairo_spritehelper.cxx index 0a78151299af..c6c03a90da88 100644 --- a/canvas/source/cairo/cairo_spritehelper.cxx +++ b/canvas/source/cairo/cairo_spritehelper.cxx @@ -133,7 +133,7 @@ namespace cairocanvas rClip )); doPolyPolygonImplementation( aClipPoly, Clip, pCairo.get(), - NULL, SurfaceProviderRef(mpSpriteCanvas.get()), + nullptr, SurfaceProviderRef(mpSpriteCanvas.get()), rClip->getFillRule() ); } diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx index 3bfd1dd29b8d..2f4af89fb2c9 100644 --- a/canvas/source/cairo/cairo_textlayout.cxx +++ b/canvas/source/cairo/cairo_textlayout.cxx @@ -341,7 +341,7 @@ namespace cairocanvas aSysLayoutData = rOutDev.GetSysTextLayoutData(rOutpos, maText.Text, ::canvas::tools::numeric_cast(maText.StartPosition), ::canvas::tools::numeric_cast(maText.Length), - maLogicalAdvancements.getLength() ? aOffsets.get() : NULL); + maLogicalAdvancements.getLength() ? aOffsets.get() : nullptr); // Sort them so that all glyphs on the same glyph fallback level are consecutive std::sort(aSysLayoutData.rGlyphData.begin(), aSysLayoutData.rGlyphData.end(), compareFallbacks); @@ -432,7 +432,7 @@ namespace cairocanvas /** * Setup font **/ - cairo_font_face_t* font_face = NULL; + cairo_font_face_t* font_face = nullptr; #if defined CAIRO_HAS_FT_FONT font_face = cairo_ft_font_face_create_for_ft_face(static_cast(rSysFontData.nFontId), @@ -563,7 +563,7 @@ namespace cairocanvas const rendering::ViewState& viewState, const rendering::RenderState& renderState ) const { - ENSURE_OR_THROW( outputOffsets!=NULL, + ENSURE_OR_THROW( outputOffsets!=nullptr, "TextLayout::setupTextOffsets offsets NULL" ); ::basegfx::B2DHomMatrix aMatrix; diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx index 919015fec3a7..ae37f1e6e08d 100644 --- a/canvas/source/opengl/ogl_canvashelper.cxx +++ b/canvas/source/opengl/ogl_canvashelper.cxx @@ -362,8 +362,8 @@ namespace oglcanvas } CanvasHelper::CanvasHelper() : - mpDevice( NULL ), - mpDeviceHelper( NULL ), + mpDevice( nullptr ), + mpDeviceHelper( nullptr ), mpRecordedActions() {} @@ -382,8 +382,8 @@ namespace oglcanvas { RecordVectorT aThrowaway; mpRecordedActions.swap( aThrowaway ); - mpDevice = NULL; - mpDeviceHelper = NULL; + mpDevice = nullptr; + mpDeviceHelper = nullptr; } void CanvasHelper::init( rendering::XGraphicDevice& rDevice, @@ -478,7 +478,7 @@ namespace oglcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* /*pCanvas*/, @@ -505,7 +505,7 @@ namespace oglcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, @@ -516,7 +516,7 @@ namespace oglcanvas const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, @@ -528,7 +528,7 @@ namespace oglcanvas const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* /*pCanvas*/, @@ -538,7 +538,7 @@ namespace oglcanvas const rendering::StrokeAttributes& /*strokeAttributes*/ ) { // TODO - return uno::Reference< rendering::XPolyPolygon2D >(NULL); + return uno::Reference< rendering::XPolyPolygon2D >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* /*pCanvas*/, @@ -563,7 +563,7 @@ namespace oglcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTexturedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, @@ -659,7 +659,7 @@ namespace oglcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* /*pCanvas*/, @@ -670,7 +670,7 @@ namespace oglcanvas const uno::Reference< geometry::XMapping2D >& /*xMapping*/ ) { // TODO - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* /*pCanvas*/, @@ -701,7 +701,7 @@ namespace oglcanvas sal_Int8 /*textDirection*/ ) { // TODO - but not used from slideshow - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* /*pCanvas*/, @@ -797,7 +797,7 @@ namespace oglcanvas } // TODO - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* /*pCanvas*/, @@ -862,7 +862,7 @@ namespace oglcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmapModulated( const rendering::XCanvas* pCanvas, diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx index 0f7c7d020369..ed4d3144ee68 100644 --- a/canvas/source/opengl/ogl_spritecanvas.cxx +++ b/canvas/source/opengl/ogl_spritecanvas.cxx @@ -63,7 +63,7 @@ namespace oglcanvas vcl::Window* pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); if( !pParentWindow ) throw lang::NoSupportException( - "Parent window not VCL window, or canvas out-of-process!", NULL); + "Parent window not VCL window, or canvas out-of-process!", nullptr); awt::Rectangle aRect; maArguments[2] >>= aRect; diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index da344267f668..0932e0cfc8f9 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -75,8 +75,8 @@ namespace oglcanvas { SpriteDeviceHelper::SpriteDeviceHelper() : - mpDevice(NULL), - mpSpriteCanvas(NULL), + mpDevice(nullptr), + mpSpriteCanvas(nullptr), maActiveSprites(), maLastUpdate(), mpTextureCache(new TextureCache()), @@ -135,8 +135,8 @@ namespace oglcanvas void SpriteDeviceHelper::disposing() { // release all references - mpSpriteCanvas = NULL; - mpDevice = NULL; + mpSpriteCanvas = nullptr; + mpDevice = nullptr; mpTextureCache.reset(); if( mxContext->isInitialized() ) diff --git a/canvas/source/tools/elapsedtime.cxx b/canvas/source/tools/elapsedtime.cxx index 8922f5ca055d..d080c789a290 100644 --- a/canvas/source/tools/elapsedtime.cxx +++ b/canvas/source/tools/elapsedtime.cxx @@ -156,7 +156,7 @@ void ElapsedTime::adjustTimer( double fOffset, bool /*bLimitToLastQueriedTime*/ double ElapsedTime::getCurrentTime() const { - return m_pTimeBase.get() == 0 + return m_pTimeBase.get() == nullptr ? getSystemTime() : m_pTimeBase->getElapsedTimeImpl(); } diff --git a/canvas/source/tools/page.hxx b/canvas/source/tools/page.hxx index c456a2983570..f2c3ff054214 100644 --- a/canvas/source/tools/page.hxx +++ b/canvas/source/tools/page.hxx @@ -81,14 +81,14 @@ namespace canvas /// Creates a 'naked' fragment. explicit PageFragment( const ::basegfx::B2ISize& rSize ) : - mpPage(NULL), + mpPage(nullptr), maRect(rSize), mpBuffer(), maSourceOffset() { } - bool isNaked() const { return (mpPage == NULL); } + bool isNaked() const { return (mpPage == nullptr); } const SurfaceRect& getRect() const { return maRect; } const ::basegfx::B2IPoint& getPos() const { return maRect.maPos; } const ::basegfx::B2ISize& getSize() const { return maRect.maSize; } @@ -101,7 +101,7 @@ namespace canvas if(mpPage) mpPage->free(pFragment); - mpPage=NULL; + mpPage=nullptr; } bool select( bool bRefresh ) diff --git a/canvas/source/tools/parametricpolypolygon.cxx b/canvas/source/tools/parametricpolypolygon.cxx index 8b273cd5e9cd..29b35a389f10 100644 --- a/canvas/source/tools/parametricpolypolygon.cxx +++ b/canvas/source/tools/parametricpolypolygon.cxx @@ -116,7 +116,7 @@ namespace canvas // TODO: NYI } - return NULL; + return nullptr; } ParametricPolyPolygon* ParametricPolyPolygon::createLinearHorizontalGradient( diff --git a/canvas/source/vcl/bitmapbackbuffer.cxx b/canvas/source/vcl/bitmapbackbuffer.cxx index 81e47d28660f..3f7fdd0b27c3 100644 --- a/canvas/source/vcl/bitmapbackbuffer.cxx +++ b/canvas/source/vcl/bitmapbackbuffer.cxx @@ -32,7 +32,7 @@ namespace vclcanvas BitmapBackBuffer::BitmapBackBuffer( const BitmapEx& rBitmap, const OutputDevice& rRefDevice ) : maBitmap( rBitmap ), - mpVDev( NULL ), + mpVDev( nullptr ), mrRefDevice( rRefDevice ), mbBitmapContentIsCurrent( false ), mbVDevContentIsCurrent( false ) diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index 77c0d3e60568..e1e5842c751e 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -99,7 +99,7 @@ namespace vclcanvas if( !pOutDev ) throw lang::NoSupportException( OUString( "Passed OutDev invalid!" ), - NULL); + nullptr); OutDevProviderSharedPtr pOutdevProvider( new OutDevHolder(*pOutDev) ); diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index 27bb69748fbc..3bb99f1acbfe 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.cxx @@ -42,7 +42,7 @@ namespace vclcanvas // create bitmap for given reference device // ======================================== const sal_uInt16 nBitCount( (sal_uInt16)24U ); - const BitmapPalette* pPalette = NULL; + const BitmapPalette* pPalette = nullptr; Bitmap aBitmap( rSize, nBitCount, pPalette ); diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index 885e5f8befe8..28ab1aaf93b0 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.cxx @@ -137,7 +137,7 @@ namespace vclcanvas nullptr : aAlpha.AcquireReadAccess(), aAlpha ); - ENSURE_OR_THROW( pReadAccess.get() != NULL, + ENSURE_OR_THROW( pReadAccess.get() != nullptr, "Could not acquire read access to bitmap" ); // TODO(F1): Support more formats. @@ -156,7 +156,7 @@ namespace vclcanvas yGetScanlineFormat() ) { @@ -457,14 +457,14 @@ namespace vclcanvas nullptr : aAlpha.AcquireWriteAccess(), aAlpha ); - ENSURE_OR_THROW( pWriteAccess.get() != NULL, + ENSURE_OR_THROW( pWriteAccess.get() != nullptr, "Could not acquire write access to bitmap" ); pWriteAccess->SetPixel( pos.Y, pos.X, BitmapColor( color[ 0 ], color[ 1 ], color[ 2 ] ) ); - if( pAlphaWriteAccess.get() != NULL ) + if( pAlphaWriteAccess.get() != nullptr ) pAlphaWriteAccess->SetPixel( pos.Y, pos.X, BitmapColor( 255 - color[ 3 ] ) ); bCopyBack = true; @@ -509,7 +509,7 @@ namespace vclcanvas Bitmap::ScopedReadAccess pAlphaReadAccess( aAlpha.IsEmpty() ? nullptr : aAlpha.AcquireReadAccess(), aAlpha ); - ENSURE_OR_THROW( pReadAccess.get() != NULL, + ENSURE_OR_THROW( pReadAccess.get() != nullptr, "Could not acquire read access to bitmap" ); uno::Sequence< sal_Int8 > aRes( 4 ); @@ -520,7 +520,7 @@ namespace vclcanvas pRes[ 1 ] = aColor.GetGreen(); pRes[ 2 ] = aColor.GetBlue(); - if( pAlphaReadAccess.get() != NULL ) + if( pAlphaReadAccess.get() != nullptr ) pRes[ 3 ] = pAlphaReadAccess->GetPixel( pos.Y, pos.X ).GetIndex(); else pRes[ 3 ] = sal_uInt8(255); diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index a671520ac5a3..97f9e7656a4e 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -118,7 +118,7 @@ namespace vclcanvas void CanvasHelper::disposing() { - mpDevice = NULL; + mpDevice = nullptr; mpProtectedOutDev.reset(); mpOutDev.reset(); mp2ndOutDev.reset(); @@ -322,7 +322,7 @@ namespace vclcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokePolyPolygon( const rendering::XCanvas* , @@ -452,7 +452,7 @@ namespace vclcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTexturedPolyPolygon( const rendering::XCanvas* , @@ -462,7 +462,7 @@ namespace vclcanvas const uno::Sequence< rendering::Texture >& , const rendering::StrokeAttributes& ) { - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::strokeTextureMappedPolyPolygon( const rendering::XCanvas* , @@ -473,7 +473,7 @@ namespace vclcanvas const uno::Reference< geometry::XMapping2D >& , const rendering::StrokeAttributes& ) { - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XPolyPolygon2D > CanvasHelper::queryStrokeShapes( const rendering::XCanvas* , @@ -482,7 +482,7 @@ namespace vclcanvas const rendering::RenderState& , const rendering::StrokeAttributes& ) { - return uno::Reference< rendering::XPolyPolygon2D >(NULL); + return uno::Reference< rendering::XPolyPolygon2D >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillPolyPolygon( const rendering::XCanvas* , @@ -530,7 +530,7 @@ namespace vclcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::fillTextureMappedPolyPolygon( const rendering::XCanvas* , @@ -540,7 +540,7 @@ namespace vclcanvas const uno::Sequence< rendering::Texture >& , const uno::Reference< geometry::XMapping2D >& ) { - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* , @@ -583,7 +583,7 @@ namespace vclcanvas ::Point aOutpos; if( !setupTextOutput( aOutpos, viewState, renderState, xFont ) ) - return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary + return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary // change text direction and layout mode ComplexTextLayoutMode nLayoutMode(TEXT_LAYOUT_DEFAULT); @@ -622,7 +622,7 @@ namespace vclcanvas } } - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawTextLayout( const rendering::XCanvas* , @@ -648,7 +648,7 @@ namespace vclcanvas ::Point aOutpos; if( !setupTextOutput( aOutpos, viewState, renderState, xLayoutedText->getFont() ) ) - return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary + return uno::Reference< rendering::XCachedPrimitive >(nullptr); // no output necessary // TODO(F2): What about the offset scalings? // TODO(F2): alpha @@ -664,7 +664,7 @@ namespace vclcanvas "TextLayout not compatible with this canvas" ); } - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::implDrawBitmap( const rendering::XCanvas* pCanvas, @@ -746,7 +746,7 @@ namespace vclcanvas // Returning a cache object is not useful, the XBitmap // itself serves this purpose - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } else { @@ -869,7 +869,7 @@ namespace vclcanvas } // Nothing rendered - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } uno::Reference< rendering::XCachedPrimitive > CanvasHelper::drawBitmap( const rendering::XCanvas* pCanvas, @@ -951,7 +951,7 @@ namespace vclcanvas Bitmap::ScopedReadAccess pReadAccess( aBitmap ); - ENSURE_OR_THROW( pReadAccess.get() != NULL, + ENSURE_OR_THROW( pReadAccess.get() != nullptr, "Could not acquire read access to OutDev bitmap" ); const sal_Int32 nWidth( rect.X2 - rect.X1 ); @@ -1002,7 +1002,7 @@ namespace vclcanvas const Rectangle aRect( vcl::unotools::rectangleFromIntegerRectangle2D(rect) ); const sal_uInt16 nBitCount( ::std::min( (sal_uInt16)24U, (sal_uInt16)rOutDev.GetBitCount() ) ); - const BitmapPalette* pPalette = NULL; + const BitmapPalette* pPalette = nullptr; if( nBitCount <= 8 ) { @@ -1028,7 +1028,7 @@ namespace vclcanvas { Bitmap::ScopedWriteAccess pWriteAccess( aBitmap ); - ENSURE_OR_THROW( pWriteAccess.get() != NULL, + ENSURE_OR_THROW( pWriteAccess.get() != nullptr, "Could not acquire write access to OutDev bitmap" ); // for the time being, always read as RGB @@ -1201,7 +1201,7 @@ namespace vclcanvas eColorType == IGNORE_COLOR ? 0 : 3 ); OutputDevice& rOutDev( mpOutDev->getOutDev() ); - OutputDevice* p2ndOutDev = NULL; + OutputDevice* p2ndOutDev = nullptr; rOutDev.EnableMapMode( false ); rOutDev.SetAntialiasing( AntialiasingFlags::EnableB2dDraw ); diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx index 155498f749ad..8f85a4f5b797 100644 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -1103,7 +1103,7 @@ namespace vclcanvas } // TODO(P1): Provide caching here. - return uno::Reference< rendering::XCachedPrimitive >(NULL); + return uno::Reference< rendering::XCachedPrimitive >(nullptr); } } diff --git a/canvas/source/vcl/impltools.cxx b/canvas/source/vcl/impltools.cxx index e930b9ff0b3b..be277286fafc 100644 --- a/canvas/source/vcl/impltools.cxx +++ b/canvas/source/vcl/impltools.cxx @@ -257,8 +257,8 @@ namespace vclcanvas nullptr, aSrcAlpha ); - if( pReadAccess.get() == NULL || - (pAlphaReadAccess.get() == NULL && rBitmap.IsTransparent()) ) + if( pReadAccess.get() == nullptr || + (pAlphaReadAccess.get() == nullptr && rBitmap.IsTransparent()) ) { // TODO(E2): Error handling! ENSURE_OR_THROW( false, @@ -315,8 +315,8 @@ namespace vclcanvas Bitmap::ScopedWriteAccess pAlphaWriteAccess( aDstAlpha ); - if( pWriteAccess.get() != NULL && - pAlphaWriteAccess.get() != NULL && + if( pWriteAccess.get() != nullptr && + pAlphaWriteAccess.get() != nullptr && rTransform.isInvertible() ) { // we're doing inverse mapping here, i.e. mapping diff --git a/canvas/source/vcl/impltools.hxx b/canvas/source/vcl/impltools.hxx index 0661347b4ab1..62f10814a0c6 100644 --- a/canvas/source/vcl/impltools.hxx +++ b/canvas/source/vcl/impltools.hxx @@ -129,7 +129,7 @@ namespace vclcanvas } explicit OutDevStateKeeper( const OutDevProviderSharedPtr& rOutDev ) : - mpOutDev( rOutDev.get() ? &(rOutDev->getOutDev()) : NULL ), + mpOutDev( rOutDev.get() ? &(rOutDev->getOutDev()) : nullptr ), mbMappingWasEnabled( mpOutDev && mpOutDev->IsMapModeEnabled() ), mnAntiAliasing( mpOutDev ? mpOutDev->GetAntialiasing() : AntialiasingFlags::NONE ) { diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx index 02c9fe40558f..bba2e051bb33 100644 --- a/canvas/source/vcl/spritecanvashelper.cxx +++ b/canvas/source/vcl/spritecanvashelper.cxx @@ -116,8 +116,8 @@ namespace vclcanvas } SpriteCanvasHelper::SpriteCanvasHelper() : - mpRedrawManager( NULL ), - mpOwningSpriteCanvas( NULL ), + mpRedrawManager( nullptr ), + mpOwningSpriteCanvas( nullptr ), maVDev(VclPtr::Create()), maLastUpdate(), mbShowFrameInfo( false ), @@ -150,8 +150,8 @@ namespace vclcanvas void SpriteCanvasHelper::disposing() { - mpRedrawManager = NULL; - mpOwningSpriteCanvas = NULL; + mpRedrawManager = nullptr; + mpOwningSpriteCanvas = nullptr; // forward to base CanvasHelper::disposing(); @@ -213,7 +213,7 @@ namespace vclcanvas const Size aOutDevSize( rBackOutDev.GetOutputSizePixel() ); const Point aEmptyPoint(0,0); - vcl::Window* pTargetWindow = NULL; + vcl::Window* pTargetWindow = nullptr; if( rOutDev.GetOutDevType() == OUTDEV_WINDOW ) { pTargetWindow = &static_cast(rOutDev); // TODO(Q3): Evil downcast. @@ -552,7 +552,7 @@ namespace vclcanvas OUString text( ::rtl::math::doubleToUString( denominator == 0.0 ? 100.0 : 1.0/denominator, rtl_math_StringFormat_F, - 2,'.',NULL,' ') ); + 2,'.',nullptr,' ') ); // pad with leading space while( text.getLength() < 6 ) @@ -641,7 +641,7 @@ namespace vclcanvas OUString text( ::rtl::math::doubleToUString( nMemUsage / 1048576.0, rtl_math_StringFormat_F, - 2,'.',NULL,' ') ); + 2,'.',nullptr,' ') ); // pad with leading space while( text.getLength() < 4 ) diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx index c58507a1b7ad..f28bc73624f8 100644 --- a/canvas/source/vcl/spritehelper.cxx +++ b/canvas/source/vcl/spritehelper.cxx @@ -324,7 +324,7 @@ namespace vclcanvas OUString text( ::rtl::math::doubleToUString( getPriority(), rtl_math_StringFormat_F, - 2,'.',NULL,' ') ); + 2,'.',nullptr,' ') ); rTargetSurface.DrawText( aOutPos+Point(2,2), text ); SAL_INFO( "canvas.vcl", diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index dab9f45ad45c..d86fb802583c 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -111,11 +111,11 @@ namespace vclcanvas const rendering::ViewState aViewState( geometry::AffineMatrix2D(1,0,0, 0,1,0), - NULL); + nullptr); rendering::RenderState aRenderState ( geometry::AffineMatrix2D(1,0,0,0,1,0), - NULL, + nullptr, uno::Sequence(4), rendering::CompositeOperation::SOURCE); @@ -164,11 +164,11 @@ namespace vclcanvas const rendering::ViewState aViewState( geometry::AffineMatrix2D(1,0,0, 0,1,0), - NULL); + nullptr); rendering::RenderState aRenderState ( geometry::AffineMatrix2D(1,0,0,0,1,0), - NULL, + nullptr, uno::Sequence(4), rendering::CompositeOperation::SOURCE); @@ -444,7 +444,7 @@ namespace vclcanvas const rendering::ViewState& viewState, const rendering::RenderState& renderState ) const { - ENSURE_OR_THROW( outputOffsets!=NULL, + ENSURE_OR_THROW( outputOffsets!=nullptr, "TextLayout::setupTextOffsets offsets NULL" ); ::basegfx::B2DHomMatrix aMatrix; diff --git a/canvas/source/vcl/windowoutdevholder.cxx b/canvas/source/vcl/windowoutdevholder.cxx index 6246dfd45c17..1afde92172f1 100644 --- a/canvas/source/vcl/windowoutdevholder.cxx +++ b/canvas/source/vcl/windowoutdevholder.cxx @@ -36,7 +36,7 @@ namespace vclcanvas if( !pWindow ) throw lang::NoSupportException( "Parent window not VCL window, or canvas out-of-process!", - NULL); + nullptr); return *pWindow; } } diff --git a/include/canvas/canvastools.hxx b/include/canvas/canvastools.hxx index 99cde2657b0a..33f9060c3909 100644 --- a/include/canvas/canvastools.hxx +++ b/include/canvas/canvastools.hxx @@ -384,7 +384,7 @@ namespace canvas #endif throw css::uno::RuntimeException( "numeric_cast detected data loss", - NULL ); + nullptr ); } return static_cast(arg); @@ -558,7 +558,7 @@ namespace canvas CANVASTOOLS_DLLPUBLIC void clipOutDev(const css::rendering::ViewState& viewState, const css::rendering::RenderState& renderState, OutputDevice& rOutDev, - OutputDevice* p2ndOutDev=NULL); + OutputDevice* p2ndOutDev=nullptr); } } -- cgit