Kaydet (Commit) 6d9d8a72 authored tarafından Noel Grandin's avatar Noel Grandin

Revert "loplugin:changetoolsgen in editeng..extensions" and reapply plugin

because I
(a) forgot to insert parentheses which changes the meaning of some expressions and
(b) I now use the AdjustFoo calls when changing unary operations, which reads much better

This reverts commit 2096aac8.

Change-Id: I4b5941c4119b95aaefb9180a0ca95a1dbb4ec317
Reviewed-on: https://gerrit.libreoffice.org/49844Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 1a839524
......@@ -1027,14 +1027,14 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion )
case PortionKind::HYPHENATOR:
{
aTmpSz = rPortion.GetSize();
aSz.setWidth( aSz.Width() + aTmpSz.Width() );
aSz.AdjustWidth(aTmpSz.Width() );
if ( aSz.Height() < aTmpSz.Height() )
aSz.setHeight( aTmpSz.Height() );
}
break;
case PortionKind::TAB:
{
aSz.setWidth( aSz.Width() + rPortion.GetSize().Width() );
aSz.AdjustWidth(rPortion.GetSize().Width() );
}
break;
case PortionKind::LINEBREAK: break;
......
......@@ -222,7 +222,7 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOri
Point aStartPos( rStartPos );
if ( IsVertical() )
{
aStartPos.setX( aStartPos.X() + GetPaperSize().Width() );
aStartPos.AdjustX(GetPaperSize().Width() );
aStartPos = Rotate( aStartPos, nOrientation, rStartPos );
}
pImpEditEngine->Paint( pOutDev, aBigRect, aStartPos, false, nOrientation );
......@@ -283,8 +283,8 @@ void EditEngine::Draw( OutputDevice* pOutDev, const tools::Rectangle& rOutRect,
{
Size aPixSz( 1, 0 );
aPixSz = pOutDev->PixelToLogic( aPixSz );
aClipRect.SetRight( aClipRect.Right() + aPixSz.Width() );
aClipRect.Bottom() += aPixSz.Width();
aClipRect.AdjustRight(aPixSz.Width() );
aClipRect.AdjustBottom(aPixSz.Width() );
}
pOutDev->IntersectClipRegion( aClipRect );
}
......@@ -1024,12 +1024,12 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
long nH = GetTextHeight( n );
Point P1( aViewStart.X() + n20 + n20*(n%2), aViewStart.Y() + aPos.Y() );
Point P2( P1 );
P2.setX( P2.X() + n20 );
P2.setY( P2.Y() + nH );
P2.AdjustX(n20 );
P2.AdjustY(nH );
pEditView->GetWindow()->SetLineColor();
pEditView->GetWindow()->SetFillColor( Color( (n%2) ? COL_YELLOW : COL_LIGHTGREEN ) );
pEditView->GetWindow()->DrawRect( tools::Rectangle( P1, P2 ) );
aPos.setY( aPos.Y() + nH );
aPos.AdjustY(nH );
}
}
bDone = false;
......@@ -1346,7 +1346,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
aPos = pEditView->pImpEditView->GetWindowPos( aPos );
aPos = pEditView->pImpEditView->GetWindow()->LogicToPixel( aPos );
aPos = pEditView->GetWindow()->OutputToScreenPixel( aPos );
aPos.setY( aPos.Y() - 3 );
aPos.AdjustY( -3 );
Help::ShowQuickHelp( pEditView->GetWindow(), tools::Rectangle( aPos, Size( 1, 1 ) ), aComplete, QuickHelpFlags::Bottom|QuickHelpFlags::Left );
}
}
......
......@@ -196,10 +196,10 @@ tools::Rectangle EditView::GetInvalidateRect() const
{
tools::Rectangle aRect( pImpEditView->aOutArea );
long nMore = pImpEditView->GetWindow()->PixelToLogic( Size( pImpEditView->GetInvalidateMore(), 0 ) ).Width();
aRect.SetLeft( aRect.Left() - nMore );
aRect.Right() += nMore;
aRect.SetTop( aRect.Top() - nMore );
aRect.Bottom() += nMore;
aRect.AdjustLeft( -nMore );
aRect.AdjustRight(nMore );
aRect.AdjustTop( -nMore );
aRect.AdjustBottom(nMore );
return aRect;
}
}
......
......@@ -55,9 +55,9 @@ static inline void lcl_AllignToPixel( Point& rPoint, OutputDevice const * pOutDe
rPoint = pOutDev->LogicToPixel( rPoint );
if ( nDiffX )
rPoint.setX( rPoint.X() + nDiffX );
rPoint.AdjustX(nDiffX );
if ( nDiffY )
rPoint.setY( rPoint.Y() + nDiffY );
rPoint.AdjustY(nDiffY );
rPoint = pOutDev->PixelToLogic( rPoint );
}
......@@ -322,8 +322,8 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion,
Point aTopLeft( aTmpRect.TopLeft() );
Point aBottomRight( aTmpRect.BottomRight() );
aTopLeft.setY( aTopLeft.Y() + nParaStart );
aBottomRight.Y() += nParaStart;
aTopLeft.AdjustY(nParaStart );
aBottomRight.AdjustY(nParaStart );
// Only paint if in the visible range ...
if ( aTopLeft.Y() > GetVisDocBottom() )
......@@ -907,13 +907,13 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
if ( aPaM.GetNode()->Len() && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) )
{
// If we are behind a portion, and the next portion has other direction, we must change position...
aEditCursor.SetLeft( aEditCursor.Right() = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GetCursorFlags::TextOnly|GetCursorFlags::PreferPortionStart ).Left() );
aEditCursor.Left() = aEditCursor.Right() = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GetCursorFlags::TextOnly|GetCursorFlags::PreferPortionStart ).Left();
sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, true );
const TextPortion& rTextPortion = pParaPortion->GetTextPortions()[nTextPortion];
if ( rTextPortion.GetKind() == PortionKind::TAB )
{
aEditCursor.SetRight( aEditCursor.Right() + rTextPortion.GetSize().Width() );
aEditCursor.AdjustRight(rTextPortion.GetSize().Width() );
}
else
{
......@@ -1048,8 +1048,8 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor )
GetCursor()->SetPos( aCursorRect.TopLeft() );
Size aCursorSz( aCursorRect.GetSize() );
// Rectangle is inclusive
aCursorSz.setWidth( --aCursorSz.Width() );
aCursorSz.Height()--;
aCursorSz.AdjustWidth( -1 );
aCursorSz.AdjustHeight( -1 );
if ( !aCursorSz.Width() || !aCursorSz.Height() )
{
long nCursorSz = pOutWin->GetSettings().GetStyleSettings().GetCursorSize();
......@@ -1166,20 +1166,20 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
// Vertical:
if ( !IsVertical() )
{
aNewVisArea.SetTop( aNewVisArea.Top() - ndY );
aNewVisArea.Bottom() -= ndY;
aNewVisArea.AdjustTop( -ndY );
aNewVisArea.AdjustBottom( -ndY );
}
else
{
if( IsTopToBottom() )
{
aNewVisArea.SetTop( aNewVisArea.Top() + ndX );
aNewVisArea.Bottom() += ndX;
aNewVisArea.AdjustTop(ndX );
aNewVisArea.AdjustBottom(ndX );
}
else
{
aNewVisArea.SetTop( aNewVisArea.Top() - ndX );
aNewVisArea.Bottom() -= ndX;
aNewVisArea.AdjustTop( -ndX );
aNewVisArea.AdjustBottom( -ndX );
}
}
if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Bottom() > static_cast<long>(pEditEngine->pImpEditEngine->GetTextHeight()) ) )
......@@ -1194,20 +1194,20 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
// Horizontal:
if ( !IsVertical() )
{
aNewVisArea.SetLeft( aNewVisArea.Left() - ndX );
aNewVisArea.Right() -= ndX;
aNewVisArea.AdjustLeft( -ndX );
aNewVisArea.AdjustRight( -ndX );
}
else
{
if (IsTopToBottom())
{
aNewVisArea.SetLeft( aNewVisArea.Left() - ndY );
aNewVisArea.Right() -= ndY;
aNewVisArea.AdjustLeft( -ndY );
aNewVisArea.AdjustRight( -ndY );
}
else
{
aNewVisArea.SetLeft( aNewVisArea.Left() + ndY );
aNewVisArea.Right() += ndY;
aNewVisArea.AdjustLeft(ndY );
aNewVisArea.AdjustRight(ndY );
}
}
if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Right() > static_cast<long>(pEditEngine->pImpEditEngine->CalcTextWidth( false )) ) )
......@@ -1787,8 +1787,8 @@ void ImpEditView::ShowDDCursor( const tools::Rectangle& rRect )
// Save background ...
tools::Rectangle aSaveRect( GetWindow()->LogicToPixel( rRect ) );
// prefer to save some more ...
aSaveRect.SetRight( aSaveRect.Right() + 1 );
aSaveRect.Bottom() += 1;
aSaveRect.AdjustRight(1 );
aSaveRect.AdjustBottom(1 );
#ifdef DBG_UTIL
Size aNewSzPx( aSaveRect.GetSize() );
......@@ -2212,20 +2212,20 @@ void ImpEditView::dragOver(const css::datatransfer::dnd::DropTargetDragEvent& rD
aEditCursor = GetWindow()->LogicToPixel( tools::Rectangle( aStartPos, aEndPos ) );
if ( !pEditEngine->IsVertical() )
{
aEditCursor.SetTop( --aEditCursor.Top() );
aEditCursor.SetBottom( ++aEditCursor.Bottom() );
aEditCursor.AdjustTop( -1 );
aEditCursor.AdjustBottom( 1 );
}
else
{
if( IsTopToBottom() )
{
aEditCursor.SetLeft( --aEditCursor.Left() );
aEditCursor.SetRight( ++aEditCursor.Right() );
aEditCursor.AdjustLeft( -1 );
aEditCursor.AdjustRight( 1 );
}
else
{
aEditCursor.SetLeft( ++aEditCursor.Left() );
aEditCursor.SetRight( --aEditCursor.Right() );
aEditCursor.AdjustLeft( 1 );
aEditCursor.AdjustRight( -1 );
}
}
aEditCursor = GetWindow()->PixelToLogic( aEditCursor );
......
......@@ -1396,8 +1396,8 @@ EditPaM ImpEditEngine::PageUp( const EditPaM& rPaM, EditView const * pView )
{
tools::Rectangle aRect = PaMtoEditCursor( rPaM );
Point aTopLeft = aRect.TopLeft();
aTopLeft.setY( aTopLeft.Y() - pView->GetVisArea().GetHeight() *9/10 );
aTopLeft.X() += nOnePixelInRef;
aTopLeft.AdjustY( -(pView->GetVisArea().GetHeight() *9/10) );
aTopLeft.AdjustX(nOnePixelInRef );
if ( aTopLeft.Y() < 0 )
{
aTopLeft.setY( 0 );
......@@ -1409,8 +1409,8 @@ EditPaM ImpEditEngine::PageDown( const EditPaM& rPaM, EditView const * pView )
{
tools::Rectangle aRect = PaMtoEditCursor( rPaM );
Point aBottomRight = aRect.BottomRight();
aBottomRight.setY( aBottomRight.Y() + pView->GetVisArea().GetHeight() *9/10 );
aBottomRight.X() += nOnePixelInRef;
aBottomRight.AdjustY(pView->GetVisArea().GetHeight() *9/10 );
aBottomRight.AdjustX(nOnePixelInRef );
long nHeight = GetTextHeight();
if ( aBottomRight.Y() > nHeight )
{
......@@ -3033,8 +3033,8 @@ tools::Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, GetCursorFlags nF
else
{
aEditCursor = GetEditCursor( pPortion, aPaM.GetIndex(), nFlags );
aEditCursor.SetTop( aEditCursor.Top() + nY );
aEditCursor.Bottom() += nY;
aEditCursor.AdjustTop(nY );
aEditCursor.AdjustBottom(nY );
return aEditCursor;
}
}
......@@ -3057,7 +3057,7 @@ EditPaM ImpEditEngine::GetPaM( Point aDocPos, bool bSmart )
if ( nY > aDocPos.Y() )
{
nY -= nTmpHeight;
aDocPos.setY( aDocPos.Y() - nY );
aDocPos.AdjustY( -nY );
// Skip invisible Portions:
while ( pPortion && !pPortion->IsVisible() )
{
......@@ -4244,7 +4244,7 @@ tools::Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32
nX = GetXPos( pPortion, pLine, nIndex, bool( nFlags & GetCursorFlags::PreferPortionStart ) );
}
aEditCursor.SetLeft( aEditCursor.Right() = nX );
aEditCursor.Left() = aEditCursor.Right() = nX;
if ( nFlags & GetCursorFlags::TextOnly )
aEditCursor.SetTop( aEditCursor.Bottom() - pLine->GetTxtHeight() + 1 );
......
......@@ -407,7 +407,7 @@ void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem,
if(pSize)
aGraphicSize = *pSize;
else
aGraphicSize.setWidth( aGraphicSize.Height() = 0 );
aGraphicSize.Width() = aGraphicSize.Height() = 0;
}
void SvxNumberFormat::SetGraphic( const OUString& rName )
......@@ -419,7 +419,7 @@ void SvxNumberFormat::SetGraphic( const OUString& rName )
if( eVertOrient == text::VertOrientation::NONE )
eVertOrient = text::VertOrientation::TOP;
aGraphicSize.setWidth( aGraphicSize.Height() = 0 );
aGraphicSize.Width() = aGraphicSize.Height() = 0;
}
sal_Int16 SvxNumberFormat::GetVertOrient() const
......
......@@ -372,7 +372,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt,
}
if( IsKern() && ( nLen > 1 ) )
aTxtSize.setWidth( aTxtSize.Width() + ( ( nLen-1 ) * long( nKern ) ) );
aTxtSize.AdjustWidth( ( nLen-1 ) * long( nKern ) );
return aTxtSize;
}
......@@ -409,7 +409,7 @@ Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
if( IsKern() && ( nLen > 1 ) )
{
aTxtSize.setWidth( aTxtSize.Width() + ( ( nLen-1 ) * long( nKern ) ) );
aTxtSize.AdjustWidth( ( nLen-1 ) * long( nKern ) );
if ( pDXArray )
{
......@@ -462,9 +462,9 @@ void SvxFont::QuickDrawText( OutputDevice *pOut,
nDiff /= 100;
if ( !IsVertical() )
aPos.setY( aPos.Y() - nDiff );
aPos.AdjustY( -nDiff );
else
aPos.setX( aPos.X() + nDiff );
aPos.AdjustX(nDiff );
}
if( IsCapital() )
......@@ -516,7 +516,7 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter,
else
nTmpEsc = nEsc;
Size aSize = GetFontSize();
aPos.setY( aPos.Y() - ( nTmpEsc * aSize.Height() ) / 100 );
aPos.AdjustY( -(( nTmpEsc * aSize.Height() ) / 100) );
}
Font aOldFont( ChgPhysFont( pOut ) );
Font aOldPrnFont( ChgPhysFont( pPrinter ) );
......@@ -611,8 +611,8 @@ void SvxDoGetCapitalSize::Do( const OUString &_rTxt, const sal_Int32 _nIdx,
aPartSize.setWidth( pOut->GetTextWidth( _rTxt, _nIdx, _nLen ) );
aPartSize.setHeight( pOut->GetTextHeight() );
}
aTxtSize.setWidth( aTxtSize.Width() + aPartSize.Width() );
aTxtSize.Width() += ( _nLen * long( nKern ) );
aTxtSize.AdjustWidth(aPartSize.Width() );
aTxtSize.AdjustWidth( _nLen * long( nKern ) );
}
Size SvxFont::GetCapitalSize( const OutputDevice *pOut, const OUString &rTxt,
......@@ -704,7 +704,7 @@ void SvxDoDrawCapital::Do( const OUString &_rTxt, const sal_Int32 _nIdx,
long nWidth = aPartSize.Width();
if ( nKern )
{
aPos.setX( aPos.X() + (nKern/2) );
aPos.AdjustX(nKern/2);
if ( _nLen ) nWidth += (_nLen*long(nKern));
}
pOut->DrawStretchText(aPos,nWidth-nKern,_rTxt,_nIdx,_nLen);
......@@ -716,7 +716,7 @@ void SvxDoDrawCapital::Do( const OUString &_rTxt, const sal_Int32 _nIdx,
pFont->SetPropr( nProp );
pFont->SetPhysFont( pOut );
aPos.setX( aPos.X() + nWidth-(nKern/2) );
aPos.AdjustX(nWidth-(nKern/2) );
}
/*************************************************************************
......
......@@ -967,7 +967,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
{
// aTextPos is Bottom, go to Baseline
FontMetric aMetric(pOutDev->GetFontMetric());
aTextPos.setY( aTextPos.Y() - aMetric.GetDescent() );
aTextPos.AdjustY( -(aMetric.GetDescent()) );
}
DrawingText(aTextPos, pPara->GetText(), 0, pPara->GetText().getLength(), pBuf.get(),
......@@ -1047,14 +1047,14 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
else
aStartPos.setX( rStartPos.X() + GetPaperSize().Width() - aBulletArea.Left() );
aEndPos = aStartPos;
aEndPos.setX( aEndPos.X() + nWidth );
aEndPos.AdjustX(nWidth );
}
else
{
aStartPos.setX( rStartPos.X() - aBulletArea.Bottom() );
aStartPos.setY( rStartPos.Y() + aBulletArea.Right() );
aEndPos = aStartPos;
aEndPos.setY( aEndPos.Y() + nWidth );
aEndPos.AdjustY(nWidth );
}
const Color& rOldLineColor = pOutDev->GetLineColor();
......@@ -1075,7 +1075,7 @@ void Outliner::InvalidateBullet(sal_Int32 nPara)
aRect.SetRight( aPos.X() );
aRect.SetTop( aPos.Y() );
aRect.SetBottom( aPos.Y() );
aRect.SetBottom( aRect.Bottom() + nLineHeight );
aRect.AdjustBottom(nLineHeight );
pView->GetWindow()->Invalidate( aRect );
}
......@@ -1547,7 +1547,7 @@ tools::Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, boo
FontMetric aMetric( pRefDev->GetFontMetric() );
// Leading on the first line ...
aTopLeft.setY( /* aInfos.nFirstLineOffset + */ aInfos.nFirstLineMaxAscent );
aTopLeft.setY( aTopLeft.Y() - aMetric.GetAscent() );
aTopLeft.AdjustY( -(aMetric.GetAscent()) );
pRefDev->SetFont( aOldFont );
}
}
......@@ -1556,11 +1556,11 @@ tools::Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, boo
// Horizontal:
if( pFmt->GetNumAdjust() == SvxAdjust::Right )
{
aTopLeft.setX( aTopLeft.X() + nBulletWidth - aBulletSize.Width() );
aTopLeft.AdjustX(nBulletWidth - aBulletSize.Width() );
}
else if( pFmt->GetNumAdjust() == SvxAdjust::Center )
{
aTopLeft.setX( aTopLeft.X() + ( nBulletWidth - aBulletSize.Width() ) / 2 );
aTopLeft.AdjustX(( nBulletWidth - aBulletSize.Width() ) / 2 );
}
if ( aTopLeft.X() < 0 ) // then push
......@@ -1572,7 +1572,7 @@ tools::Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, boo
{
Size aBulletSize( aBulletArea.GetSize() );
Point aBulletDocPos( aBulletArea.TopLeft() );
aBulletDocPos.setY( aBulletDocPos.Y() + pEditEngine->GetDocPosTopLeft( nPara ).Y() );
aBulletDocPos.AdjustY(pEditEngine->GetDocPosTopLeft( nPara ).Y() );
Point aBulletPos( aBulletDocPos );
if ( IsVertical() )
......@@ -1580,7 +1580,7 @@ tools::Rectangle Outliner::ImpCalcBulletArea( sal_Int32 nPara, bool bAdjust, boo
aBulletPos.setY( aBulletDocPos.X() );
aBulletPos.setX( GetPaperSize().Width() - aBulletDocPos.Y() );
// Rotate:
aBulletPos.setX( aBulletPos.X() - aBulletSize.Height() );
aBulletPos.AdjustX( -(aBulletSize.Height()) );
Size aSz( aBulletSize );
aBulletSize.setWidth( aSz.Height() );
aBulletSize.setHeight( aSz.Width() );
......
......@@ -254,10 +254,10 @@ sal_Int32 OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTa
Point aPaperPos( aMousePosWin );
tools::Rectangle aOutArea = pEditView->GetOutputArea();
tools::Rectangle aVisArea = pEditView->GetVisArea();
aPaperPos.setX( aPaperPos.X() - aOutArea.Left() );
aPaperPos.X() += aVisArea.Left();
aPaperPos.setY( aPaperPos.Y() - aOutArea.Top() );
aPaperPos.Y() += aVisArea.Top();
aPaperPos.AdjustX( -(aOutArea.Left()) );
aPaperPos.AdjustX(aVisArea.Left() );
aPaperPos.AdjustY( -(aOutArea.Top()) );
aPaperPos.AdjustY(aVisArea.Top() );
bool bBullet;
if ( pOwner->IsTextPos( aPaperPos, 0, &bBullet ) )
......
......@@ -88,8 +88,8 @@ Point SvxDrawOutlinerViewForwarder::LogicToPixel( const Point& rPoint, const Map
Point aPoint1( rPoint );
Point aTextOffset( GetTextOffset() );
aPoint1.setX( aPoint1.X() + aTextOffset.X() );
aPoint1.Y() += aTextOffset.Y();
aPoint1.AdjustX(aTextOffset.X() );
aPoint1.AdjustY(aTextOffset.Y() );
MapMode aMapMode(pOutDev->GetMapMode());
Point aPoint2( OutputDevice::LogicToLogic( aPoint1, rMapMode,
......@@ -115,8 +115,8 @@ Point SvxDrawOutlinerViewForwarder::PixelToLogic( const Point& rPoint, const Map
rMapMode ) );
Point aTextOffset( GetTextOffset() );
aPoint2.setX( aPoint2.X() - aTextOffset.X() );
aPoint2.Y() -= aTextOffset.Y();
aPoint2.AdjustX( -(aTextOffset.X()) );
aPoint2.AdjustY( -(aTextOffset.Y()) );
return aPoint2;
}
......
......@@ -755,7 +755,7 @@ namespace emfio
if ( pLineStyle->aLineInfo.GetStyle() == LineStyle::Dash )
{
aSize.setWidth( aSize.Width() + 1 );
aSize.AdjustWidth(1 );
long nDotLen = ImplMap( aSize ).Width();
pLineStyle->aLineInfo.SetDistance( nDotLen );
pLineStyle->aLineInfo.SetDotLen( nDotLen );
......@@ -1517,8 +1517,8 @@ namespace emfio
// check whether there is a font rotation applied via transformation
Point aP1( ImplMap( Point() ) );
Point aP2( ImplMap( Point( 0, 100 ) ) );
aP2.setX( aP2.X() - aP1.X() );
aP2.setY( aP2.Y() - aP1.Y() );
aP2.AdjustX( -(aP1.X()) );
aP2.AdjustY( -(aP1.Y()) );
double fX = aP2.X();
double fY = aP2.Y();
if ( fX )
......
......@@ -160,8 +160,8 @@ namespace emfio
Point aBR, aTL;
aBR = ReadYX();
aTL = ReadYX();
aBR.setX( --aBR.X() );
aBR.Y()--;
aBR.AdjustX( -1 );
aBR.AdjustY( -1 );
return tools::Rectangle( aTL, aBR );
}
......@@ -1479,10 +1479,10 @@ namespace emfio
bool bRet = true;
tools::Rectangle aBound;
aBound.Left() = RECT_MAX;
aBound.Top() = RECT_MAX;
aBound.Right() = RECT_MIN;
aBound.Bottom() = RECT_MIN;
aBound.SetLeft( RECT_MAX );
aBound.SetTop( RECT_MAX );
aBound.SetRight( RECT_MIN );
aBound.SetBottom( RECT_MIN );
bool bBoundsDetermined = false;
auto nPos = pStm->Tell();
......
......@@ -210,8 +210,8 @@ namespace pcr
if ( m_bIndentTitle )
{
Size aIndent( m_pTheParent->LogicToPixel(Size(8, 0), MapMode(MapUnit::MapAppFont)) );
aTitlePos.setX( aTitlePos.X() + aIndent.Width() );
aTitleSize.setWidth( aTitleSize.Width() - aIndent.Width() );
aTitlePos.AdjustX(aIndent.Width() );
aTitleSize.AdjustWidth( -(aIndent.Width()) );
}
m_aFtTitle->SetPosSizePixel( aTitlePos, aTitleSize );
}
......@@ -225,7 +225,7 @@ namespace pcr
Size aControlSize( m_aOutputSize.Width() - 4 - m_nNameWidth - nBrowseButtonSize - 4, m_pControlWindow->GetSizePixel().Height() );
if ( m_pAdditionalBrowseButton )
aControlSize.setWidth( aControlSize.Width() - nBrowseButtonSize + 4 );
aControlSize.AdjustWidth( -(nBrowseButtonSize + 4) );
m_pControlWindow->SetSizePixel( aControlSize );
}
......@@ -237,7 +237,7 @@ namespace pcr
if ( m_pAdditionalBrowseButton )
{
aButtonPos.setX( aButtonPos.X() - nBrowseButtonSize + 4 );
aButtonPos.AdjustX( -(nBrowseButtonSize + 4) );
m_pAdditionalBrowseButton->SetPosSizePixel( aButtonPos, aButtonSize );
}
}
......
......@@ -426,8 +426,8 @@ namespace pcr
tools::Rectangle aLinesArea( aPlayground );
if ( bPositionHelpWindow )
{
aLinesArea.SetBottom( aLinesArea.Bottom() - nHelpWindowHeight );
aLinesArea.Bottom() -= aHelpWindowDistance.Height();
aLinesArea.AdjustBottom( -nHelpWindowHeight );
aLinesArea.AdjustBottom( -(aHelpWindowDistance.Height()) );
}
m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
......@@ -447,7 +447,7 @@ namespace pcr
Size aVScrollSize( m_aVScroll->GetSizePixel() );
// adjust the playground's width
aLinesArea.SetRight( aLinesArea.Right() - aVScrollSize.Width() );
aLinesArea.AdjustRight( -(aVScrollSize.Width()) );
m_aLinesPlayground->SetPosSizePixel( aLinesArea.TopLeft(), aLinesArea.GetSize() );
// position the scrollbar
......@@ -556,7 +556,7 @@ namespace pcr
aSize.setHeight( m_nRowHeight );
aPos.setY( aPos.Y() + _nIndex * m_nRowHeight );
aPos.AdjustY(_nIndex * m_nRowHeight );
if ( _nIndex < m_aLines.size() )
{
......
......@@ -49,8 +49,8 @@ namespace pcr
void OBrowserPage::Resize()
{
Size aSize( GetOutputSizePixel() );
aSize.Width() -= LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT;
aSize.Height() -= LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM;
aSize.AdjustWidth( -(LAYOUT_BORDER_LEFT + LAYOUT_BORDER_RIGHT) );
aSize.AdjustHeight( -(LAYOUT_BORDER_TOP + LAYOUT_BORDER_BOTTOM) );
m_aListBox->SetPosSizePixel( Point( LAYOUT_BORDER_LEFT, LAYOUT_BORDER_TOP ), aSize );
}
......
......@@ -368,7 +368,7 @@ namespace pcr
if ( impl_textHitTest( rMEvt.GetPosPixel() ) )
m_aMouseButtonDownPos = rMEvt.GetPosPixel();
else
m_aMouseButtonDownPos.setX( m_aMouseButtonDownPos.Y() = -1 );
m_aMouseButtonDownPos.X() = m_aMouseButtonDownPos.Y() = -1;
}
......@@ -1101,7 +1101,7 @@ namespace pcr
aMePos = GetParent()->OutputToScreenPixel( aMePos );
::Size aSize=GetSizePixel();
::tools::Rectangle aRect(aMePos,aSize);
aSize.Height() = STD_HEIGHT;
aSize.setHeight( STD_HEIGHT );
m_pFloatingEdit->SetOutputSizePixel(aSize);
m_pFloatingEdit->StartPopupMode( aRect, FloatWinPopupFlags::Down );
......
......@@ -465,8 +465,8 @@ void GridWindow::drawGrid(vcl::RenderContext& rRenderContext)
std::sprintf(pBuf, "%g", fX);
OUString aMark(pBuf, strlen(pBuf), osl_getThreadTextEncoding());
Size aTextSize(rRenderContext.GetTextWidth(aMark), rRenderContext.GetTextHeight());
aPt.setX( aPt.X() - aTextSize.Width() / 2 );
aPt.Y() += aTextSize.Height() / 2;
aPt.AdjustX( -(aTextSize.Width() / 2) );
aPt.AdjustY(aTextSize.Height() / 2 );
rRenderContext.DrawText(aPt, aMark);
}
// draw horizontal lines
......@@ -478,8 +478,8 @@ void GridWindow::drawGrid(vcl::RenderContext& rRenderContext)
std::sprintf(pBuf, "%g", fY);
OUString aMark(pBuf, strlen(pBuf), osl_getThreadTextEncoding());
Size aTextSize(rRenderContext.GetTextWidth(aMark), rRenderContext.GetTextHeight());
aPt.setX( aPt.X() - aTextSize.Width() + 2 );
aPt.Y() -= aTextSize.Height() / 2;
aPt.AdjustX( -(aTextSize.Width() + 2) );
aPt.AdjustY( -(aTextSize.Height() / 2) );
rRenderContext.DrawText(aPt, aMark);
}
......
......@@ -532,14 +532,14 @@ void SaneDlg::InitFields()
pField->SetValue( 0 );
break;
case 2:
aMaxBottomRight.X() = PREVIEW_WIDTH;
aBottomRight.X() = PREVIEW_WIDTH;
aMaxBottomRight.setX( PREVIEW_WIDTH );
aBottomRight.setX( PREVIEW_WIDTH );
pField->SetMax( PREVIEW_WIDTH );
pField->SetValue( PREVIEW_WIDTH );
break;
case 3:
aMaxBottomRight.Y() = PREVIEW_HEIGHT;
aBottomRight.Y() = PREVIEW_HEIGHT;
aMaxBottomRight.setY( PREVIEW_HEIGHT );
aBottomRight.setY( PREVIEW_HEIGHT );
pField->SetMax( PREVIEW_HEIGHT );
pField->SetValue( PREVIEW_HEIGHT );
break;
......@@ -1275,9 +1275,9 @@ Point ScanPreview::GetLogicPos(const Point& rIn) const
aConvert.setY( PREVIEW_HEIGHT-1 );
aConvert.setX( aConvert.X() * ( maMaxBottomRight.X() - maMinTopLeft.X() ) );
aConvert.X() /= PREVIEW_WIDTH;
aConvert.setX( aConvert.X() / ( PREVIEW_WIDTH) );
aConvert.setY( aConvert.Y() * ( maMaxBottomRight.Y() - maMinTopLeft.Y() ) );
aConvert.Y() /= PREVIEW_HEIGHT;
aConvert.setY( aConvert.Y() / ( PREVIEW_HEIGHT) );