summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-05-28 08:26:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-05-28 09:48:09 +0200
commite84d05483cc5f30161dc5b15f93fb3bf71ed636e (patch)
tree2a343319cb4c1e06060b632de4fc840ba96bb70f /canvas
parent412ff42bf0a6d078b9a6fd1daa8d0eb0b9a78c4a (diff)
Make loplugin:simplifypointertobool handle parenthesized expressions
...as discussed as an open TODO in the commit message of fe6cce01c88d045a1fcf09acf049c34c22299b02 "Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr". The necessary changes across the code base have been done fully automatically with the rewriting plugin on Linux. (All those changes apparently involve uses of macro arguments wrapped in parentheses in the macro body, but always in conditionally-converted-to-bool contexts. In other contexts, such automatic rewriting would add the "bool" to the macro body, which would be wrong in general, but we apparently get away with that sloppy coding for now.) The parenExprs_ stack that fe6cce01c88d045a1fcf09acf049c34c22299b02 had introduced to treat such (then-undetected, it had turned out) parenthesized cases now turns out to not be needed after all. Change-Id: I2021f61c2e2805be7e18b38edf8744d186cac3cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95010 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/cairo/cairo_canvascustomsprite.cxx2
-rw-r--r--canvas/source/cairo/cairo_spritehelper.cxx2
-rw-r--r--canvas/source/opengl/ogl_canvascustomsprite.cxx2
-rw-r--r--canvas/source/opengl/ogl_textlayout.cxx2
-rw-r--r--canvas/source/tools/canvascustomspritehelper.cxx2
-rw-r--r--canvas/source/vcl/canvashelper.cxx4
6 files changed, 7 insertions, 7 deletions
diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx
index 0464a06d2b89..b885071787d5 100644
--- a/canvas/source/cairo/cairo_canvascustomsprite.cxx
+++ b/canvas/source/cairo/cairo_canvascustomsprite.cxx
@@ -42,7 +42,7 @@ namespace cairocanvas
maSize( ::canvas::tools::roundUp( rSpriteSize.Width ),
::canvas::tools::roundUp( rSpriteSize.Height ) )
{
- ENSURE_OR_THROW( rRefDevice.get(),
+ ENSURE_OR_THROW( rRefDevice,
"CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" );
SAL_INFO( "canvas.cairo", "sprite size: " << ::canvas::tools::roundUp( rSpriteSize.Width ) << ", " << ::canvas::tools::roundUp( rSpriteSize.Height ));
diff --git a/canvas/source/cairo/cairo_spritehelper.cxx b/canvas/source/cairo/cairo_spritehelper.cxx
index aafab160c51d..667f1ba249ba 100644
--- a/canvas/source/cairo/cairo_spritehelper.cxx
+++ b/canvas/source/cairo/cairo_spritehelper.cxx
@@ -45,7 +45,7 @@ namespace cairocanvas
void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize,
const SpriteCanvasRef& rSpriteCanvas )
{
- ENSURE_OR_THROW( rSpriteCanvas.get(),
+ ENSURE_OR_THROW( rSpriteCanvas,
"SpriteHelper::init(): Invalid device, sprite canvas or surface" );
mpSpriteCanvas = rSpriteCanvas;
diff --git a/canvas/source/opengl/ogl_canvascustomsprite.cxx b/canvas/source/opengl/ogl_canvascustomsprite.cxx
index c7ca59b28291..903a0edfc93b 100644
--- a/canvas/source/opengl/ogl_canvascustomsprite.cxx
+++ b/canvas/source/opengl/ogl_canvascustomsprite.cxx
@@ -38,7 +38,7 @@ namespace oglcanvas
mfAlpha(0.0),
mfPriority(0.0)
{
- ENSURE_OR_THROW( rRefDevice.get(),
+ ENSURE_OR_THROW( rRefDevice,
"CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" );
::canvas::tools::setIdentityAffineMatrix2D(maTransformation);
diff --git a/canvas/source/opengl/ogl_textlayout.cxx b/canvas/source/opengl/ogl_textlayout.cxx
index aa5a35296a97..89e7a16a681f 100644
--- a/canvas/source/opengl/ogl_textlayout.cxx
+++ b/canvas/source/opengl/ogl_textlayout.cxx
@@ -78,7 +78,7 @@ namespace oglcanvas
{
::osl::MutexGuard aGuard( m_aMutex );
- ENSURE_OR_THROW( mpFont.get(),
+ ENSURE_OR_THROW( mpFont,
"TextLayout::queryTextBounds(): invalid font" );
// fake text bounds by either taking the advancement values,
diff --git a/canvas/source/tools/canvascustomspritehelper.cxx b/canvas/source/tools/canvascustomspritehelper.cxx
index ef02a9d5a418..156936a05e53 100644
--- a/canvas/source/tools/canvascustomspritehelper.cxx
+++ b/canvas/source/tools/canvascustomspritehelper.cxx
@@ -164,7 +164,7 @@ namespace canvas
void CanvasCustomSpriteHelper::init( const geometry::RealSize2D& rSpriteSize,
const SpriteSurface::Reference& rOwningSpriteCanvas )
{
- ENSURE_OR_THROW( rOwningSpriteCanvas.get(),
+ ENSURE_OR_THROW( rOwningSpriteCanvas,
"CanvasCustomSpriteHelper::init(): Invalid owning sprite canvas" );
mpSpriteCanvas = rOwningSpriteCanvas;
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index 07dc45574e64..981a442a2e6c 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -994,7 +994,7 @@ namespace vclcanvas
const rendering::RenderState& renderState,
ColorType eColorType ) const
{
- ENSURE_OR_THROW( mpOutDevProvider.get(),
+ ENSURE_OR_THROW( mpOutDevProvider,
"outdev null. Are we disposed?" );
::canvas::tools::verifyInput( renderState,
@@ -1079,7 +1079,7 @@ namespace vclcanvas
const rendering::RenderState& renderState,
const uno::Reference< rendering::XCanvasFont >& xFont ) const
{
- ENSURE_OR_THROW( mpOutDevProvider.get(),
+ ENSURE_OR_THROW( mpOutDevProvider,
"outdev null. Are we disposed?" );
OutputDevice& rOutDev( mpOutDevProvider->getOutDev() );