diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-29 12:43:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-30 06:57:26 +0000 |
commit | 4d87443bf59c3242d58b56cc1583d73213ae1f2f (patch) | |
tree | c1f74fc569506299100b5063f14c09e46035a943 /vcl/source | |
parent | 8e812b87ff7f8c5bf2c6f8858646c55effd2eea3 (diff) |
loplugin:constantparam
Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c
Reviewed-on: https://gerrit.libreoffice.org/29321
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 32 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 2 |
2 files changed, 6 insertions, 28 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index c71355780b6e..7fa7b1a2f1e4 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -1883,7 +1883,7 @@ void TextEngine::RecalcTextPortion( sal_uInt32 nPara, sal_Int32 nStartPos, sal_I } } -void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange, TextSelection const* pSelection ) +void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pSelection ) { if ( !GetUpdateMode() ) return; @@ -1904,7 +1904,6 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd(); } - SAL_WARN_IF( pPaintRange && !(pPaintRange->GetStart() < pPaintRange->GetEnd()), "vcl", "ImpPaint: Paint-Range?!" ); const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings(); @@ -1917,8 +1916,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan return; const long nParaHeight = CalcParaHeight( nPara ); - if ( ( !pPaintArea || ( ( nY + nParaHeight ) > pPaintArea->Top() ) ) - && ( !pPaintRange || ( ( nPara >= pPaintRange->GetStart().GetPara() ) && ( nPara <= pPaintRange->GetEnd().GetPara() ) ) ) ) + if ( !pPaintArea || ( ( nY + nParaHeight ) > pPaintArea->Top() ) ) { // for all lines of the paragraph sal_Int32 nIndex = 0; @@ -1926,10 +1924,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan { Point aTmpPos( rStartPos.X() + rLine.GetStartX(), nY ); - if ( ( !pPaintArea || ( ( nY + mnCharHeight ) > pPaintArea->Top() ) ) - && ( !pPaintRange || ( - ( TextPaM( nPara, rLine.GetStart() ) < pPaintRange->GetEnd() ) && - ( TextPaM( nPara, rLine.GetEnd() ) > pPaintRange->GetStart() ) ) ) ) + if ( !pPaintArea || ( ( nY + mnCharHeight ) > pPaintArea->Top() ) ) { // for all Portions of the line nIndex = rLine.GetStart(); @@ -1946,10 +1941,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan aTmpPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nIndex, nIndex ); // only print if starting in the visible region - if ( ( ( aTmpPos.X() + nTxtWidth ) >= 0 ) - && ( !pPaintRange || ( - ( TextPaM( nPara, nIndex ) < pPaintRange->GetEnd() ) && - ( TextPaM( nPara, nIndex + pTextPortion->GetLen() ) > pPaintRange->GetStart() ) ) ) ) + if ( ( aTmpPos.X() + nTxtWidth ) >= 0 ) { switch ( pTextPortion->GetKind() ) { @@ -1966,20 +1958,6 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan sal_Int32 nTmpIndex = nIndex; sal_Int32 nEnd = nTmpIndex + pTextPortion->GetLen(); Point aPos = aTmpPos; - if ( pPaintRange ) - { - // maybe not print all of it - if ( ( pPaintRange->GetStart().GetPara() == nPara ) - && ( nTmpIndex < pPaintRange->GetStart().GetIndex() ) ) - { - nTmpIndex = pPaintRange->GetStart().GetIndex(); - } - if ( ( pPaintRange->GetEnd().GetPara() == nPara ) - && ( nEnd > pPaintRange->GetEnd().GetIndex() ) ) - { - nEnd = pPaintRange->GetEnd().GetIndex(); - } - } bool bDone = false; if ( pSelStart ) @@ -2034,7 +2012,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectan break; case PORTIONKIND_TAB: // for HideSelection() only Range, pSelection = 0. - if ( pSelStart || pPaintRange ) + if ( pSelStart ) { const Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) ); bool bDone = false; diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index df8414bab346..4893d30eeb53 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -314,7 +314,7 @@ void TextView::ImpPaint(vcl::RenderContext& rRenderContext, const Point& rStartP } } - mpImpl->mpTextEngine->ImpPaint(&rRenderContext, rStartPos, pPaintArea, nullptr, pSelection); + mpImpl->mpTextEngine->ImpPaint(&rRenderContext, rStartPos, pPaintArea, pSelection); } void TextView::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) |