From 9b25614939f7709e3d67949f49c4beeec0cdc534 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 29 May 2020 11:34:00 +0200 Subject: loplugin:simplifybool in dbaccess..framework Change-Id: I0d73bb7d8d3fde426edc0a10c0750758b68aceb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95099 Tested-by: Jenkins Reviewed-by: Noel Grandin --- drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx | 2 +- drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx | 2 +- drawinglayer/source/primitive2d/textbreakuphelper.cxx | 2 +- drawinglayer/source/processor3d/zbufferprocessor3d.cxx | 2 +- drawinglayer/source/tools/emfpfont.cxx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx index 2a1aefafa275..c857ba5c8e3d 100644 --- a/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx +++ b/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx @@ -40,7 +40,7 @@ void PolyPolygonGraphicPrimitive2D::create2DDecomposition( const GraphicType aType(rGraphic.GetType()); // is there a bitmap or a metafile (do we have content)? - if (!(GraphicType::Bitmap == aType || GraphicType::GdiMetafile == aType)) + if (GraphicType::Bitmap != aType && GraphicType::GdiMetafile != aType) return; const Size aPrefSize(rGraphic.GetPrefSize()); diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx index 1bfc47940a87..708b3f2ce48d 100644 --- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx @@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d const Graphic& rGraphic = rAttribute.getGraphic(); - if(!(GraphicType::Bitmap == rGraphic.GetType() || GraphicType::GdiMetafile == rGraphic.GetType())) + if(GraphicType::Bitmap != rGraphic.GetType() && GraphicType::GdiMetafile != rGraphic.GetType()) return; const Size aSize(rGraphic.GetPrefSize()); diff --git a/drawinglayer/source/primitive2d/textbreakuphelper.cxx b/drawinglayer/source/primitive2d/textbreakuphelper.cxx index 1139f19e8d06..df37aa01356e 100644 --- a/drawinglayer/source/primitive2d/textbreakuphelper.cxx +++ b/drawinglayer/source/primitive2d/textbreakuphelper.cxx @@ -55,7 +55,7 @@ namespace drawinglayer::primitive2d void TextBreakupHelper::breakupPortion(Primitive2DContainer& rTempResult, sal_Int32 nIndex, sal_Int32 nLength, bool bWordLineMode) { - if(!(nLength && !(nIndex == mrSource.getTextPosition() && nLength == mrSource.getTextLength()))) + if(!(nLength && (nIndex != mrSource.getTextPosition() || nLength != mrSource.getTextLength()))) return; // prepare values for new portion diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx index dc8a2f8aa962..6cd65d60b416 100644 --- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx +++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx @@ -274,7 +274,7 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi if(nSpanCount & 0x0001) return; - if(!(nLine >= 0 && nLine < static_cast(mrBuffer.getHeight()))) + if(nLine < 0 || nLine >= static_cast(mrBuffer.getHeight())) return; sal_uInt32 nXA(std::min(mrBuffer.getWidth(), static_cast(std::max(sal_Int32(0), basegfx::fround(rA.getX().getVal()))))); diff --git a/drawinglayer/source/tools/emfpfont.cxx b/drawinglayer/source/tools/emfpfont.cxx index a9ee61511234..f641fdd4d21b 100644 --- a/drawinglayer/source/tools/emfpfont.cxx +++ b/drawinglayer/source/tools/emfpfont.cxx @@ -56,7 +56,7 @@ namespace emfplushelper SAL_INFO("drawinglayer", "EMF+\tReserved: 0x" << reserved << std::dec); SAL_INFO("drawinglayer", "EMF+\tLength: " << length); - if (!(length > 0 && length < 0x4000)) + if (length <= 0 || length >= 0x4000) return; rtl_uString *pStr = rtl_uString_alloc(length); -- cgit