diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-21 15:56:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-22 20:18:57 +0100 |
commit | 4a8968039a2e1d9e7aee10433ced1f59c0392d7a (patch) | |
tree | 7074b5b4a94b5d509487872b8201bc5872dc107e /vcl/source/edit | |
parent | 1d7f96a324a4c2ab82a04513c6a38dc31fd061fa (diff) |
loplugin:changetoolsgen in vcl
Change-Id: I0fc68cf51fb23ed9bb86a5087e8247c81b024494
Reviewed-on: https://gerrit.libreoffice.org/50107
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/edit')
-rw-r--r-- | vcl/source/edit/texteng.cxx | 34 | ||||
-rw-r--r-- | vcl/source/edit/textview.cxx | 76 | ||||
-rw-r--r-- | vcl/source/edit/vclmedit.cxx | 54 |
3 files changed, 82 insertions, 82 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 06d96b716fe5..3f49d65f5037 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -859,8 +859,8 @@ tools::Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, bool bSpecial } aEditCursor = GetEditCursor( rPaM, bSpecial ); - aEditCursor.Top() += nY; - aEditCursor.Bottom() += nY; + aEditCursor.AdjustTop(nY ); + aEditCursor.AdjustBottom(nY ); return aEditCursor; } @@ -905,9 +905,9 @@ tools::Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, bool bSpecial, tools::Rectangle aEditCursor; - aEditCursor.Top() = nY; + aEditCursor.SetTop( nY ); nY += mnCharHeight; - aEditCursor.Bottom() = nY-1; + aEditCursor.SetBottom( nY-1 ); // search within the line long nX = ImpGetXPos( rPaM.GetPara(), pLine, rPaM.GetIndex(), bPreferPortionStart ); @@ -1028,7 +1028,7 @@ TextPaM TextEngine::GetPaM( const Point& rDocPos ) { nY -= nTmpHeight; Point aPosInPara( rDocPos ); - aPosInPara.Y() -= nY; + aPosInPara.AdjustY( -nY ); TextPaM aPaM( nPortion, 0 ); aPaM.GetIndex() = ImpFindIndex( nPortion, aPosInPara ); @@ -1469,7 +1469,7 @@ void TextEngine::UpdateViews( TextView* pCurView ) // translate into window coordinates Point aNewPos = pView->GetWindowPos( aClipRect.TopLeft() ); if ( IsRightToLeft() ) - aNewPos.X() -= aOutSz.Width() - 1; + aNewPos.AdjustX( -(aOutSz.Width() - 1) ); aClipRect.SetPos( aNewPos ); pView->GetWindow()->Invalidate( aClipRect ); @@ -1542,7 +1542,7 @@ void TextEngine::FormatDoc() } else { - maInvalidRect.Bottom() = nY + CalcParaHeight( nPara ); + maInvalidRect.SetBottom( nY + CalcParaHeight( nPara ) ); } if ( mnCurTextWidth >= 0 ) @@ -1556,7 +1556,7 @@ void TextEngine::FormatDoc() } else if ( bGrow ) { - maInvalidRect.Bottom() = nY + CalcParaHeight( nPara ); + maInvalidRect.SetBottom( nY + CalcParaHeight( nPara ) ); } nY += CalcParaHeight( nPara ); if ( !mbHasMultiLineParas && pTEParaPortion->GetLines().size() > 1 ) @@ -1569,13 +1569,13 @@ void TextEngine::FormatDoc() const long nDiff = nNewHeight - mnCurTextHeight; if ( nNewHeight < mnCurTextHeight ) { - maInvalidRect.Bottom() = std::max( nNewHeight, mnCurTextHeight ); + maInvalidRect.SetBottom( std::max( nNewHeight, mnCurTextHeight ) ); if ( maInvalidRect.IsEmpty() ) { - maInvalidRect.Top() = 0; + maInvalidRect.SetTop( 0 ); // Left and Right are not evaluated, but set because of IsEmpty - maInvalidRect.Left() = 0; - maInvalidRect.Right() = mnMaxTextWidth; + maInvalidRect.SetLeft( 0 ); + maInvalidRect.SetRight( mnMaxTextWidth ); } } @@ -1943,7 +1943,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools: ImpInitLayoutMode( pOutDev /*, pTextPortion->IsRightToLeft() */); const long nTxtWidth = pTextPortion->GetWidth(); - aTmpPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nIndex, nIndex ); + aTmpPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nIndex, nIndex ) ); // only print if starting in the visible region if ( ( aTmpPos.X() + nTxtWidth ) >= 0 ) @@ -1977,7 +1977,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools: { const sal_Int32 nL = pSelStart->GetIndex() - nTmpIndex; pOutDev->SetFont( aFont); - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ); + aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ) ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL ); nTmpIndex = nTmpIndex + nL; @@ -1991,7 +1991,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools: const Color aOldTextColor = pOutDev->GetTextColor(); pOutDev->SetTextColor( rStyleSettings.GetHighlightTextColor() ); pOutDev->SetTextFillColor( rStyleSettings.GetHighlightColor() ); - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ); + aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ) ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL ); pOutDev->SetTextColor( aOldTextColor ); pOutDev->SetTextFillColor(); @@ -2002,7 +2002,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools: if ( nTmpIndex < nEnd ) { nL = nEnd-nTmpIndex; - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ); + aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ) ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex ); } bDone = true; @@ -2010,7 +2010,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools: } if ( !bDone ) { - aPos.X() = rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nEnd ); + aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nEnd ) ); pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex ); } } diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 1e27ab15e340..0d063ae1e091 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -349,15 +349,15 @@ void TextView::ImpHighlight( const TextSelection& rSel ) nEndIndex = nStartIndex; tools::Rectangle aTmpRect( mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), false ) ); - aTmpRect.Top() += nY; - aTmpRect.Bottom() += nY; + aTmpRect.AdjustTop(nY ); + aTmpRect.AdjustBottom(nY ); Point aTopLeft( aTmpRect.TopLeft() ); aTmpRect = mpImpl->mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), true ); - aTmpRect.Top() += nY; - aTmpRect.Bottom() += nY; + aTmpRect.AdjustTop(nY ); + aTmpRect.AdjustBottom(nY ); Point aBottomRight( aTmpRect.BottomRight() ); - aBottomRight.X()--; + aBottomRight.AdjustX( -1 ); // only paint if in the visible region if ( ( aTopLeft.X() < aBottomRight.X() ) && ( aBottomRight.Y() >= aVisArea.Top() ) ) @@ -966,14 +966,14 @@ void TextView::Scroll( long ndX, long ndY ) Point aNewStartPos( mpImpl->maStartDocPos ); // Vertical: - aNewStartPos.Y() -= ndY; + aNewStartPos.AdjustY( -ndY ); if ( aNewStartPos.Y() < 0 ) - aNewStartPos.Y() = 0; + aNewStartPos.setY( 0 ); // Horizontal: - aNewStartPos.X() -= ndX; + aNewStartPos.AdjustX( -ndX ); if ( aNewStartPos.X() < 0 ) - aNewStartPos.X() = 0; + aNewStartPos.setX( 0 ); long nDiffX = mpImpl->maStartDocPos.X() - aNewStartPos.X(); long nDiffY = mpImpl->maStartDocPos.Y() - aNewStartPos.Y(); @@ -1540,10 +1540,10 @@ TextPaM TextView::PageUp( const TextPaM& rPaM ) { tools::Rectangle aRect = mpImpl->mpTextEngine->PaMtoEditCursor( rPaM ); Point aTopLeft = aRect.TopLeft(); - aTopLeft.Y() -= mpImpl->mpWindow->GetOutputSizePixel().Height() * 9/10; - aTopLeft.X() += 1; + aTopLeft.AdjustY( -(mpImpl->mpWindow->GetOutputSizePixel().Height() * 9/10) ); + aTopLeft.AdjustX(1 ); if ( aTopLeft.Y() < 0 ) - aTopLeft.Y() = 0; + aTopLeft.setY( 0 ); TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aTopLeft ); return aPaM; @@ -1553,11 +1553,11 @@ TextPaM TextView::PageDown( const TextPaM& rPaM ) { tools::Rectangle aRect = mpImpl->mpTextEngine->PaMtoEditCursor( rPaM ); Point aBottomRight = aRect.BottomRight(); - aBottomRight.Y() += mpImpl->mpWindow->GetOutputSizePixel().Height() * 9/10; - aBottomRight.X() += 1; + aBottomRight.AdjustY(mpImpl->mpWindow->GetOutputSizePixel().Height() * 9/10 ); + aBottomRight.AdjustX(1 ); long nHeight = mpImpl->mpTextEngine->GetTextHeight(); if ( aBottomRight.Y() > nHeight ) - aBottomRight.Y() = nHeight-1; + aBottomRight.setY( nHeight-1 ); TextPaM aPaM = mpImpl->mpTextEngine->GetPaM( aBottomRight ); return aPaM; @@ -1603,21 +1603,21 @@ void TextView::ImpShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bSpec TETextPortion* pTextPortion = pParaPortion->GetTextPortions()[ nTextPortion ]; if ( pTextPortion->GetKind() == PORTIONKIND_TAB ) { - aEditCursor.Right() += pTextPortion->GetWidth(); + aEditCursor.AdjustRight(pTextPortion->GetWidth() ); } else { TextPaM aNext = CursorRight( TextPaM( aPaM.GetPara(), aPaM.GetIndex() ), sal_uInt16(css::i18n::CharacterIteratorMode::SKIPCELL) ); - aEditCursor.Right() = mpImpl->mpTextEngine->GetEditCursor( aNext, true ).Left(); + aEditCursor.SetRight( mpImpl->mpTextEngine->GetEditCursor( aNext, true ).Left() ); } } } Size aOutSz = mpImpl->mpWindow->GetOutputSizePixel(); if ( aEditCursor.GetHeight() > aOutSz.Height() ) - aEditCursor.Bottom() = aEditCursor.Top() + aOutSz.Height() - 1; + aEditCursor.SetBottom( aEditCursor.Top() + aOutSz.Height() - 1 ); - aEditCursor.Left() -= 1; + aEditCursor.AdjustLeft( -1 ); if ( bGotoCursor // #i81283# protect maStartDocPos against initialization problems @@ -1634,26 +1634,26 @@ void TextView::ImpShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bSpec if ( aEditCursor.Bottom() > nVisEndY ) { - aNewStartPos.Y() += ( aEditCursor.Bottom() - nVisEndY ); + aNewStartPos.AdjustY( aEditCursor.Bottom() - nVisEndY); } else if ( aEditCursor.Top() < nVisStartY ) { - aNewStartPos.Y() -= ( nVisStartY - aEditCursor.Top() ); + aNewStartPos.AdjustY( -( nVisStartY - aEditCursor.Top() ) ); } if ( aEditCursor.Right() >= nVisEndX ) { - aNewStartPos.X() += ( aEditCursor.Right() - nVisEndX ); + aNewStartPos.AdjustX( aEditCursor.Right() - nVisEndX ); // do you want some more? - aNewStartPos.X() += nMoreX; + aNewStartPos.AdjustX(nMoreX ); } else if ( aEditCursor.Left() <= nVisStartX ) { - aNewStartPos.X() -= ( nVisStartX - aEditCursor.Left() ); + aNewStartPos.AdjustX( -( nVisStartX - aEditCursor.Left() ) ); // do you want some more? - aNewStartPos.X() -= nMoreX; + aNewStartPos.AdjustX( -nMoreX ); } // X can be wrong for the 'some more' above: @@ -1666,16 +1666,16 @@ void TextView::ImpShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bSpec nMaxX = 0; if ( aNewStartPos.X() < 0 ) - aNewStartPos.X() = 0; + aNewStartPos.setX( 0 ); else if ( aNewStartPos.X() > nMaxX ) - aNewStartPos.X() = nMaxX; + aNewStartPos.setX( nMaxX ); // Y should not be further down than needed long nYMax = mpImpl->mpTextEngine->GetTextHeight() - aOutSz.Height(); if ( nYMax < 0 ) nYMax = 0; if ( aNewStartPos.Y() > nYMax ) - aNewStartPos.Y() = nYMax; + aNewStartPos.setY( nYMax ); if ( aNewStartPos != mpImpl->maStartDocPos ) Scroll( -(aNewStartPos.X() - mpImpl->maStartDocPos.X()), -(aNewStartPos.Y() - mpImpl->maStartDocPos.Y()) ); @@ -1684,8 +1684,8 @@ void TextView::ImpShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bSpec if ( aEditCursor.Right() < aEditCursor.Left() ) { long n = aEditCursor.Left(); - aEditCursor.Left() = aEditCursor.Right(); - aEditCursor.Right() = n; + aEditCursor.SetLeft( aEditCursor.Right() ); + aEditCursor.SetRight( n ); } Point aPoint( GetWindowPos( !mpImpl->mpTextEngine->IsRightToLeft() ? aEditCursor.TopLeft() : aEditCursor.TopRight() ) ); @@ -1776,7 +1776,7 @@ void TextView::ImpShowDDCursor() if ( !mpImpl->mpDDInfo->mbVisCursor ) { tools::Rectangle aCursor = mpImpl->mpTextEngine->PaMtoEditCursor( mpImpl->mpDDInfo->maDropPos, true ); - aCursor.Right()++; + aCursor.AdjustRight( 1 ); aCursor.SetPos( GetWindowPos( aCursor.TopLeft() ) ); mpImpl->mpDDInfo->maCursor.SetWindow( mpImpl->mpWindow ); @@ -2034,7 +2034,7 @@ Point TextView::ImpGetOutputStartPos( const Point& rStartDocPos ) const if ( mpImpl->mpTextEngine->IsRightToLeft() ) { Size aSz = mpImpl->mpWindow->GetOutputSizePixel(); - aStartPos.X() = rStartDocPos.X() + aSz.Width() - 1; // -1: Start is 0 + aStartPos.setX( rStartDocPos.X() + aSz.Width() - 1 ); // -1: Start is 0 } return aStartPos; } @@ -2045,16 +2045,16 @@ Point TextView::GetDocPos( const Point& rWindowPos ) const Point aPoint; - aPoint.Y() = rWindowPos.Y() + mpImpl->maStartDocPos.Y(); + aPoint.setY( rWindowPos.Y() + mpImpl->maStartDocPos.Y() ); if ( !mpImpl->mpTextEngine->IsRightToLeft() ) { - aPoint.X() = rWindowPos.X() + mpImpl->maStartDocPos.X(); + aPoint.setX( rWindowPos.X() + mpImpl->maStartDocPos.X() ); } else { Size aSz = mpImpl->mpWindow->GetOutputSizePixel(); - aPoint.X() = ( aSz.Width() - 1 ) - rWindowPos.X() + mpImpl->maStartDocPos.X(); + aPoint.setX( ( aSz.Width() - 1 ) - rWindowPos.X() + mpImpl->maStartDocPos.X() ); } return aPoint; @@ -2066,16 +2066,16 @@ Point TextView::GetWindowPos( const Point& rDocPos ) const Point aPoint; - aPoint.Y() = rDocPos.Y() - mpImpl->maStartDocPos.Y(); + aPoint.setY( rDocPos.Y() - mpImpl->maStartDocPos.Y() ); if ( !mpImpl->mpTextEngine->IsRightToLeft() ) { - aPoint.X() = rDocPos.X() - mpImpl->maStartDocPos.X(); + aPoint.setX( rDocPos.X() - mpImpl->maStartDocPos.X() ); } else { Size aSz = mpImpl->mpWindow->GetOutputSizePixel(); - aPoint.X() = ( aSz.Width() - 1 ) - ( rDocPos.X() - mpImpl->maStartDocPos.X() ); + aPoint.setX( ( aSz.Width() - 1 ) - ( rDocPos.X() - mpImpl->maStartDocPos.X() ) ); } return aPoint; diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 0bc1ea45589b..40c2c0731f08 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -248,8 +248,8 @@ void ImpVclMEdit::ImpInitScrollBars() { ImpSetScrollBarRanges(); Size aCharBox; - aCharBox.Width() = mpTextWindow->GetTextWidth( OUString(sampleChar) ); - aCharBox.Height() = mpTextWindow->GetTextHeight(); + aCharBox.setWidth( mpTextWindow->GetTextWidth( OUString(sampleChar) ) ); + aCharBox.setHeight( mpTextWindow->GetTextHeight() ); Size aOutSz = mpTextWindow->GetOutputSizePixel(); if ( mpHScrollBar ) { @@ -370,9 +370,9 @@ void ImpVclMEdit::Resize() nSBWidth = pVclMultiLineEdit->CalcZoom( nSBWidth ); if ( mpHScrollBar ) - aSz.Height() -= nSBWidth+1; + aSz.AdjustHeight( -(nSBWidth+1) ); if ( mpVScrollBar ) - aSz.Width() -= nSBWidth+1; + aSz.AdjustWidth( -(nSBWidth+1) ); if ( !mpHScrollBar ) mpTextWindow->GetTextEngine()->SetMaxTextWidth( aSz.Width() ); @@ -385,7 +385,7 @@ void ImpVclMEdit::Resize() if( AllSettings::GetLayoutRTL() ) { mpVScrollBar->setPosSizePixel( 0, 0, nSBWidth, aSz.Height() ); - aTextWindowPos.X() += nSBWidth; + aTextWindowPos.AdjustX(nSBWidth ); } else mpVScrollBar->setPosSizePixel( aEditSize.Width()-nSBWidth, 0, nSBWidth, aSz.Height() ); @@ -395,12 +395,12 @@ void ImpVclMEdit::Resize() mpScrollBox->setPosSizePixel( aSz.Width(), aSz.Height(), nSBWidth, nSBWidth ); Size aTextWindowSize( aSz ); - aTextWindowSize.Width() -= maTextWindowOffset.X(); - aTextWindowSize.Height() -= maTextWindowOffset.Y(); + aTextWindowSize.AdjustWidth( -(maTextWindowOffset.X()) ); + aTextWindowSize.AdjustHeight( -(maTextWindowOffset.Y()) ); if ( aTextWindowSize.Width() < 0 ) - aTextWindowSize.Width() = 0; + aTextWindowSize.setWidth( 0 ); if ( aTextWindowSize.Height() < 0 ) - aTextWindowSize.Height() = 0; + aTextWindowSize.setHeight( 0 ); Size aOldTextWindowSize( mpTextWindow->GetSizePixel() ); mpTextWindow->SetPosSizePixel( aTextWindowPos, aTextWindowSize ); @@ -598,9 +598,9 @@ Size ImpVclMEdit::CalcMinimumSize() const mpTextWindow->GetTextEngine()->GetTextHeight() ); if ( mpHScrollBar ) - aSz.Height() += mpHScrollBar->GetSizePixel().Height(); + aSz.AdjustHeight(mpHScrollBar->GetSizePixel().Height() ); if ( mpVScrollBar ) - aSz.Width() += mpVScrollBar->GetSizePixel().Width(); + aSz.AdjustWidth(mpVScrollBar->GetSizePixel().Width() ); return aSz; } @@ -611,23 +611,23 @@ Size ImpVclMEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const Size aSz; Size aCharSz; - aCharSz.Width() = mpTextWindow->GetTextWidth( OUString(sampleChar) ); - aCharSz.Height() = mpTextWindow->GetTextHeight(); + aCharSz.setWidth( mpTextWindow->GetTextWidth( OUString(sampleChar) ) ); + aCharSz.setHeight( mpTextWindow->GetTextHeight() ); if ( nLines ) - aSz.Height() = nLines*aCharSz.Height(); + aSz.setHeight( nLines*aCharSz.Height() ); else - aSz.Height() = mpTextWindow->GetTextEngine()->GetTextHeight(); + aSz.setHeight( mpTextWindow->GetTextEngine()->GetTextHeight() ); if ( nColumns ) - aSz.Width() = nColumns*aCharSz.Width(); + aSz.setWidth( nColumns*aCharSz.Width() ); else - aSz.Width() = mpTextWindow->GetTextEngine()->CalcTextWidth(); + aSz.setWidth( mpTextWindow->GetTextEngine()->CalcTextWidth() ); if ( mpHScrollBar ) - aSz.Height() += mpHScrollBar->GetSizePixel().Height(); + aSz.AdjustHeight(mpHScrollBar->GetSizePixel().Height() ); if ( mpVScrollBar ) - aSz.Width() += mpVScrollBar->GetSizePixel().Width(); + aSz.AdjustWidth(mpVScrollBar->GetSizePixel().Width() ); return aSz; } @@ -1222,8 +1222,8 @@ Size VclMultiLineEdit::CalcMinimumSize() const sal_Int32 nLeft, nTop, nRight, nBottom; static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); - aSz.Width() += nLeft+nRight; - aSz.Height() += nTop+nBottom; + aSz.AdjustWidth(nLeft+nRight ); + aSz.AdjustHeight(nTop+nBottom ); return aSz; } @@ -1242,8 +1242,8 @@ Size VclMultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const if ( nLines < 1 ) nLines = 1; - aSz.Height() = nLines * nLineHeight; - aSz.Height() += nTop+nBottom; + aSz.setHeight( nLines * nLineHeight ); + aSz.AdjustHeight(nTop+nBottom ); return aSz; } @@ -1254,8 +1254,8 @@ Size VclMultiLineEdit::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) c sal_Int32 nLeft, nTop, nRight, nBottom; static_cast<vcl::Window*>(const_cast<VclMultiLineEdit *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); - aSz.Width() += nLeft+nRight; - aSz.Height() += nTop+nBottom; + aSz.AdjustWidth(nLeft+nRight ); + aSz.AdjustHeight(nTop+nBottom ); return aSz; } @@ -1387,7 +1387,7 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& sal_uLong nLines = static_cast<sal_uLong>(aSize.Height() / aTextSz.Height()); if ( !nLines ) nLines = 1; - aTextSz.Height() = nLines*aTextSz.Height(); + aTextSz.setHeight( nLines*aTextSz.Height() ); long nOnePixel = GetDrawPixel( pDev, 1 ); long nOffX = 3*nOnePixel; long nOffY = 2*nOnePixel; @@ -1397,7 +1397,7 @@ void VclMultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& { tools::Rectangle aClip( aPos, aSize ); if ( aTextSz.Height() > aSize.Height() ) - aClip.Bottom() += aTextSz.Height() - aSize.Height() + 1; // so that HP-printer does not 'optimize-away' + aClip.AdjustBottom(aTextSz.Height() - aSize.Height() + 1 ); // so that HP-printer does not 'optimize-away' pDev->IntersectClipRegion( aClip ); } |