summaryrefslogtreecommitdiff
path: root/cppcanvas/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-03 10:52:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-04 08:23:43 +0200
commitb83ac35bf46ecbebf7f806235eca38a71e521c32 (patch)
tree660cb00ba4045c7238e9d43176196339ecf901f0 /cppcanvas/source
parent7b905c8f1d520ae1aaf4bd2fbb6a3325b404ea95 (diff)
loplugin:simplifypointertobool improve (2)
to look for the x.get() == null pattern, which can be simplified to !x Change-Id: I0eddf93257ab53ab31949961d7c33ac2dd7288ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95400 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppcanvas/source')
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx2
-rw-r--r--cppcanvas/source/wrapper/basegfxfactory.cxx6
-rw-r--r--cppcanvas/source/wrapper/implbitmap.cxx4
-rw-r--r--cppcanvas/source/wrapper/implcustomsprite.cxx2
-rw-r--r--cppcanvas/source/wrapper/implpolypolygon.cxx2
-rw-r--r--cppcanvas/source/wrapper/vclfactory.cxx2
6 files changed, 9 insertions, 9 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 8e7b03559447..efd276991370 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2860,7 +2860,7 @@ namespace cppcanvas::internal
// make sure canvas and graphic device are valid; action
// creation don't check that every time
- if( rCanvas.get() == nullptr ||
+ if( !rCanvas ||
!rCanvas->getUNOCanvas().is() ||
!rCanvas->getUNOCanvas()->getDevice().is() )
{
diff --git a/cppcanvas/source/wrapper/basegfxfactory.cxx b/cppcanvas/source/wrapper/basegfxfactory.cxx
index 8f11c6bb4a49..5b06bcfd9715 100644
--- a/cppcanvas/source/wrapper/basegfxfactory.cxx
+++ b/cppcanvas/source/wrapper/basegfxfactory.cxx
@@ -40,7 +40,7 @@ namespace cppcanvas
OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"BaseGfxFactory::createPolyPolygon(): Invalid canvas" );
- if( rCanvas.get() == nullptr )
+ if( !rCanvas )
return PolyPolygonSharedPtr();
uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
@@ -59,7 +59,7 @@ namespace cppcanvas
OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"BaseGfxFactory::createBitmap(): Invalid canvas" );
- if( rCanvas.get() == nullptr )
+ if( !rCanvas )
return BitmapSharedPtr();
uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
@@ -77,7 +77,7 @@ namespace cppcanvas
OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"BaseGfxFactory::createBitmap(): Invalid canvas" );
- if( rCanvas.get() == nullptr )
+ if( !rCanvas )
return BitmapSharedPtr();
uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );
diff --git a/cppcanvas/source/wrapper/implbitmap.cxx b/cppcanvas/source/wrapper/implbitmap.cxx
index 4ca8980a1b15..9b7883f053a3 100644
--- a/cppcanvas/source/wrapper/implbitmap.cxx
+++ b/cppcanvas/source/wrapper/implbitmap.cxx
@@ -56,7 +56,7 @@ namespace cppcanvas::internal
OSL_ENSURE( pCanvas && pCanvas->getUNOCanvas().is(),
"ImplBitmap::draw: invalid canvas" );
- if( pCanvas.get() == nullptr ||
+ if( !pCanvas ||
!pCanvas->getUNOCanvas().is() )
{
return false;
@@ -77,7 +77,7 @@ namespace cppcanvas::internal
OSL_ENSURE( pCanvas && pCanvas->getUNOCanvas().is(),
"ImplBitmap::drawAlphaModulated(): invalid canvas" );
- if( pCanvas.get() == nullptr ||
+ if( !pCanvas ||
!pCanvas->getUNOCanvas().is() )
{
return;
diff --git a/cppcanvas/source/wrapper/implcustomsprite.cxx b/cppcanvas/source/wrapper/implcustomsprite.cxx
index e30adf085374..71fe28a6682a 100644
--- a/cppcanvas/source/wrapper/implcustomsprite.cxx
+++ b/cppcanvas/source/wrapper/implcustomsprite.cxx
@@ -57,7 +57,7 @@ namespace cppcanvas::internal
return CanvasSharedPtr();
// cache content canvas C++ wrapper
- if( mpLastCanvas.get() == nullptr ||
+ if( !mpLastCanvas ||
mpLastCanvas->getUNOCanvas() != xCanvas )
{
mpLastCanvas = std::make_shared<ImplCanvas>( xCanvas );
diff --git a/cppcanvas/source/wrapper/implpolypolygon.cxx b/cppcanvas/source/wrapper/implpolypolygon.cxx
index 54f0fe30818c..308d3dace114 100644
--- a/cppcanvas/source/wrapper/implpolypolygon.cxx
+++ b/cppcanvas/source/wrapper/implpolypolygon.cxx
@@ -91,7 +91,7 @@ namespace cppcanvas::internal
OSL_ENSURE( pCanvas && pCanvas->getUNOCanvas().is(),
"ImplBitmap::draw: invalid canvas" );
- if( pCanvas.get() == nullptr ||
+ if( !pCanvas ||
!pCanvas->getUNOCanvas().is() )
return false;
diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx
index 9d286ec7d8d3..a750b2e88066 100644
--- a/cppcanvas/source/wrapper/vclfactory.cxx
+++ b/cppcanvas/source/wrapper/vclfactory.cxx
@@ -59,7 +59,7 @@ namespace cppcanvas
OSL_ENSURE( rCanvas && rCanvas->getUNOCanvas().is(),
"VCLFactory::createBitmap(): Invalid canvas" );
- if( rCanvas.get() == nullptr )
+ if( !rCanvas )
return BitmapSharedPtr();
uno::Reference< rendering::XCanvas > xCanvas( rCanvas->getUNOCanvas() );