diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-03 14:55:29 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-03 14:13:57 +0100 |
commit | 2a3f5d11522cd69f0ce221cde3a63b7e85e94b53 (patch) | |
tree | 51a9483a42769f64fff5b329af6604cdf5a5f7ff /vcl | |
parent | e73bf95c00168bbf7d312cd11c40d0581ebd928e (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I856345576ff5c10a41509a97ad4539272bd55568
Reviewed-on: https://gerrit.libreoffice.org/62803
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/bitmap/BitmapScaleSuperFilter.cxx | 7 | ||||
-rw-r--r-- | vcl/source/bitmap/BitmapTools.cxx | 8 | ||||
-rw-r--r-- | vcl/source/bitmap/bitmap.cxx | 10 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 5 | ||||
-rw-r--r-- | vcl/source/fontsubset/cff.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 25 |
6 files changed, 16 insertions, 42 deletions
diff --git a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx index ac6568925cee..71eacdb5a087 100644 --- a/vcl/source/bitmap/BitmapScaleSuperFilter.cxx +++ b/vcl/source/bitmap/BitmapScaleSuperFilter.cxx @@ -1066,11 +1066,8 @@ BitmapEx BitmapScaleSuperFilter::execute(BitmapEx const& rBitmap) const bRet = true; - if (bRet) - { - aBitmap.AdaptBitCount(aOutBmp); - aBitmap = aOutBmp; - } + aBitmap.AdaptBitCount(aOutBmp); + aBitmap = aOutBmp; } } diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index 13a133295b06..75aed6a48c8d 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -311,7 +311,6 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap, ::basegfx::B2DRectangle const & rDestRect, ::basegfx::B2DHomMatrix const & rLocalTransform ) { - bool bCopyBack( false ); const Size aBmpSize( rBitmap.GetSizePixel() ); Bitmap aSrcBitmap( rBitmap.GetBitmap() ); Bitmap aSrcAlpha; @@ -455,8 +454,6 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap, } } } - - bCopyBack = true; } else { @@ -466,10 +463,7 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap, } } - if( bCopyBack ) - return BitmapEx( aDstBitmap, AlphaMask( aDstAlpha ) ); - else - return BitmapEx(); + return BitmapEx(aDstBitmap, AlphaMask(aDstAlpha)); } diff --git a/vcl/source/bitmap/bitmap.cxx b/vcl/source/bitmap/bitmap.cxx index 2de0da7b1a72..6e6d27ce7506 100644 --- a/vcl/source/bitmap/bitmap.cxx +++ b/vcl/source/bitmap/bitmap.cxx @@ -852,15 +852,7 @@ Bitmap Bitmap::CreateDisplayBitmap( OutputDevice* pDisplay ) bool Bitmap::GetSystemData( BitmapSystemData& rData ) const { - bool bRet = false; - if (mxSalBmp) - { - SalBitmap* pSalBitmap = mxSalBmp.get(); - if( pSalBitmap ) - bRet = pSalBitmap->GetSystemData( rData ); - } - - return bRet; + return mxSalBmp && mxSalBmp->GetSystemData(rData); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index fcd2bafbe7d8..8c6c061a2bc6 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -3811,10 +3811,6 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) Image* pImg = IsChecked() ? rCtrlData.mpDisclosureMinus.get() : rCtrlData.mpDisclosurePlus.get(); - SAL_WARN_IF(!pImg, "vcl", "no disclosure image"); - if (!pImg) - return; - DrawImageFlags nStyle = DrawImageFlags::NONE; if (!IsEnabled()) nStyle |= DrawImageFlags::Disable; @@ -3825,7 +3821,6 @@ void DisclosureButton::ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) (aSize.Height() - aImgSize.Height()) / 2); aOff += aStateRect.TopLeft(); rRenderContext.DrawImage(aOff, *pImg, nStyle); - } void DisclosureButton::KeyInput( const KeyEvent& rKEvt ) diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index 5f233c13b862..fb4bb52ee719 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -1641,8 +1641,7 @@ void Type1Emitter::updateLen( int nTellPos, size_t nLength) if (fseek( mpFileOut, nTellPos, SEEK_SET) != 0) return; fwrite(cData, 1, sizeof(cData), mpFileOut); - if( nCurrPos >= 0) - (void)fseek(mpFileOut, nCurrPos, SEEK_SET); + (void)fseek(mpFileOut, nCurrPos, SEEK_SET); } inline size_t Type1Emitter::emitRawData(const char* pData, size_t nLength) const diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 8e60d8a7bbfc..ef2f0569e580 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -821,20 +821,17 @@ bool ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt ) { if ( rMEvt.GetClicks() == 1 ) { - if ( bTracking ) - { - Point aPos = pBorderWindow->GetPosPixel(); - Size aSize = pBorderWindow->GetOutputSizePixel(); - maFrameData.mnTrackX = aPos.X(); - maFrameData.mnTrackY = aPos.Y(); - maFrameData.mnTrackWidth = aSize.Width(); - maFrameData.mnTrackHeight = aSize.Height(); - - if ( maFrameData.mnHitTest & BorderWindowHitTest::Title ) - nDragFullTest = DragFullOptions::WindowMove; - else - nDragFullTest = DragFullOptions::WindowSize; - } + Point aPos = pBorderWindow->GetPosPixel(); + Size aSize = pBorderWindow->GetOutputSizePixel(); + maFrameData.mnTrackX = aPos.X(); + maFrameData.mnTrackY = aPos.Y(); + maFrameData.mnTrackWidth = aSize.Width(); + maFrameData.mnTrackHeight = aSize.Height(); + + if (maFrameData.mnHitTest & BorderWindowHitTest::Title) + nDragFullTest = DragFullOptions::WindowMove; + else + nDragFullTest = DragFullOptions::WindowSize; } else { |