diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-21 13:38:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-22 14:14:48 +0200 |
commit | 7fb43031b7eec663768f5a4e78e60da86379df41 (patch) | |
tree | 026dd9b5a522aec8534763af074fc4a28ccfa58d /vcl | |
parent | 61ea11e51ceeaec7bf197a076cf40d96bd65ad07 (diff) |
loplugin:constantparam
Change-Id: Ibfe70492683ff3ec208cee95d8a11155ec54f690
Reviewed-on: https://gerrit.libreoffice.org/81314
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 7 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 87 |
2 files changed, 24 insertions, 70 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 135f86d1ef0a..8f1b27cfa940 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2457,7 +2457,7 @@ void TextEngine::RemoveAttribs( sal_uInt32 nPara ) } } -void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 nStart, sal_Int32 nEnd, bool bIdleFormatAndUpdate ) +void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 nStart, sal_Int32 nEnd ) { // For now do not check if Attributes overlap! @@ -2480,10 +2480,7 @@ void TextEngine::SetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 pTEParaPortion->MarkSelectionInvalid( nStart ); mbFormatted = false; - if ( bIdleFormatAndUpdate ) - IdleFormatAndUpdate( nullptr, 0xFFFF ); - else - FormatAndUpdate(); + IdleFormatAndUpdate( nullptr, 0xFFFF ); } } diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 5e410d05fb9b..f37499dff0b8 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -1441,7 +1441,7 @@ static Bitmap DetectEdges( const Bitmap& rBmp ) } /** Get contours in image */ -tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, bool bContourVert, +tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, const tools::Rectangle* pWorkRectPixel ) { Bitmap aWorkBmp; @@ -1476,88 +1476,45 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, bool bContourVert const long nStartX2 = nEndX1 - 1; const long nStartY1 = aWorkRect.Top() + 1; const long nEndY1 = aWorkRect.Bottom(); - const long nStartY2 = nEndY1 - 1; std::unique_ptr<Point[]> pPoints1; std::unique_ptr<Point[]> pPoints2; long nX, nY; sal_uInt16 nPolyPos = 0; const BitmapColor aBlack = pAcc->GetBestMatchingColor( COL_BLACK ); - if( bContourVert ) - { - pPoints1.reset(new Point[ nWidth ]); - pPoints2.reset(new Point[ nWidth ]); - - for( nX = nStartX1; nX < nEndX1; nX++ ) - { - nY = nStartY1; + pPoints1.reset(new Point[ nHeight ]); + pPoints2.reset(new Point[ nHeight ]); - // scan row from left to right - while( nY < nEndY1 ) - { - Scanline pScanline = pAcc->GetScanline( nY ); - if( aBlack == pAcc->GetPixelFromData( pScanline, nX ) ) - { - pPoints1[ nPolyPos ] = Point( nX, nY ); - nY = nStartY2; - - // this loop always breaks eventually as there is at least one pixel - while( true ) - { - // coverity[copy_paste_error : FALSE] - this is correct nX, not nY - if( aBlack == pAcc->GetPixelFromData( pScanline, nX ) ) - { - pPoints2[ nPolyPos ] = Point( nX, nY ); - break; - } - - nY--; - } - - nPolyPos++; - break; - } - - nY++; - } - } - } - else + for ( nY = nStartY1; nY < nEndY1; nY++ ) { - pPoints1.reset(new Point[ nHeight ]); - pPoints2.reset(new Point[ nHeight ]); + nX = nStartX1; + Scanline pScanline = pAcc->GetScanline( nY ); - for ( nY = nStartY1; nY < nEndY1; nY++ ) + // scan row from left to right + while( nX < nEndX1 ) { - nX = nStartX1; - Scanline pScanline = pAcc->GetScanline( nY ); - - // scan row from left to right - while( nX < nEndX1 ) + if( aBlack == pAcc->GetPixelFromData( pScanline, nX ) ) { - if( aBlack == pAcc->GetPixelFromData( pScanline, nX ) ) - { - pPoints1[ nPolyPos ] = Point( nX, nY ); - nX = nStartX2; + pPoints1[ nPolyPos ] = Point( nX, nY ); + nX = nStartX2; - // this loop always breaks eventually as there is at least one pixel - while( true ) + // this loop always breaks eventually as there is at least one pixel + while( true ) + { + if( aBlack == pAcc->GetPixelFromData( pScanline, nX ) ) { - if( aBlack == pAcc->GetPixelFromData( pScanline, nX ) ) - { - pPoints2[ nPolyPos ] = Point( nX, nY ); - break; - } - - nX--; + pPoints2[ nPolyPos ] = Point( nX, nY ); + break; } - nPolyPos++; - break; + nX--; } - nX++; + nPolyPos++; + break; } + + nX++; } } |