diff options
99 files changed, 2136 insertions, 2136 deletions
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx index ad72868545a5..a7126aa5d89b 100644 --- a/vcl/backendtest/VisualBackendTest.cxx +++ b/vcl/backendtest/VisualBackendTest.cxx @@ -59,8 +59,8 @@ void drawBitmapCentered(tools::Rectangle const & rRect, Bitmap aBitmap, vcl::Ren Point aPoint(rRect.TopLeft()); - aPoint.X() += (nWidth - aBitmapSize.Width()) / 2; - aPoint.Y() += (nHeight - aBitmapSize.Height()) / 2; + aPoint.AdjustX((nWidth - aBitmapSize.Width()) / 2 ); + aPoint.AdjustY((nHeight - aBitmapSize.Height()) / 2 ); rRenderContext.DrawBitmap(aPoint, aBitmap); } diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index 7fee229c2c9d..28b64508bd81 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -247,8 +247,8 @@ Size SvpSalBitmap::GetSize() const if (mpDIB) { - aSize.Width() = mpDIB->mnWidth; - aSize.Height() = mpDIB->mnHeight; + aSize.setWidth( mpDIB->mnWidth ); + aSize.setHeight( mpDIB->mnHeight ); } return aSize; diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index 359c4da67957..7d0be09a1b12 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -924,8 +924,8 @@ void OpenGLSalGraphicsImpl::DrawRegionBand( const RegionBand& rRegion ) for(tools::Rectangle & rRect : aRects) { - rRect.Bottom() += 1; - rRect.Right() += 1; + rRect.AdjustBottom(1 ); + rRect.AdjustRight(1 ); ADD_VERTICE( rRect.TopLeft() ); ADD_VERTICE( rRect.TopRight() ); ADD_VERTICE( rRect.BottomLeft() ); @@ -1974,10 +1974,10 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPoly, return false; } - aBoundRect.Left()--; - aBoundRect.Top()--; - aBoundRect.Right()++; - aBoundRect.Bottom()++; + aBoundRect.AdjustLeft( -1 ); + aBoundRect.AdjustTop( -1 ); + aBoundRect.AdjustRight( 1 ); + aBoundRect.AdjustBottom( 1 ); PreDraw( XOROption::IMPLEMENT_XOR ); diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 7172bc709612..da6ad774d57d 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -331,11 +331,11 @@ void HelpTextWindow::SetHelpText( const OUString& rHelpText ) if ( mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN) { Size aSize; - aSize.Height() = GetTextHeight(); + aSize.setHeight( GetTextHeight() ); if ( mnStyle & QuickHelpFlags::CtrlText ) - aSize.Width() = GetCtrlTextWidth( maHelpText ); + aSize.setWidth( GetCtrlTextWidth( maHelpText ) ); else - aSize.Width() = GetTextWidth( maHelpText ); + aSize.setWidth( GetTextWidth( maHelpText ) ); maTextRect = tools::Rectangle( Point( HELPTEXTMARGIN_QUICK, HELPTEXTMARGIN_QUICK ), aSize ); } else // HELPWINSTYLE_BALLOON @@ -410,8 +410,8 @@ void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const tools::Rec rRenderContext.DrawRect(tools::Rectangle(Point(), aSz)); if (mnHelpWinStyle == HELPWINSTYLE_BALLOON) { - aSz.Width() -= 2; - aSz.Height() -= 2; + aSz.AdjustWidth( -2 ); + aSz.AdjustHeight( -2 ); Color aColor(rRenderContext.GetLineColor()); rRenderContext.SetLineColor(COL_GRAY); rRenderContext.DrawRect(tools::Rectangle(Point(1, 1), aSz)); @@ -468,8 +468,8 @@ IMPL_LINK( HelpTextWindow, TimerHdl, Timer*, pTimer, void) Size HelpTextWindow::CalcOutSize() const { Size aSz = maTextRect.GetSize(); - aSz.Width() += 2*maTextRect.Left(); - aSz.Height() += 2*maTextRect.Top(); + aSz.AdjustWidth(2*maTextRect.Left() ); + aSz.AdjustHeight(2*maTextRect.Top() ); return aSz; } @@ -600,11 +600,11 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, Quic if ( !(nStyle & QuickHelpFlags::NoAutoPos) ) { long nScreenHeight = aScreenRect.GetHeight(); - aPos.X() -= 4; + aPos.AdjustX( -4 ); if ( aPos.Y() > aScreenRect.Top()+nScreenHeight-(nScreenHeight/4) ) - aPos.Y() -= aSz.Height()+4; + aPos.AdjustY( -(aSz.Height()+4) ); else - aPos.Y() += 21; + aPos.AdjustY(21 ); } } else @@ -613,8 +613,8 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, Quic // so the mouse pointer does not cover it if ( aPos == aMousePos ) { - aPos.X() += 12; - aPos.Y() += 16; + aPos.AdjustX(12 ); + aPos.AdjustY(16 ); } } @@ -629,39 +629,39 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, Quic aPos = devHelpArea.Center(); if ( nStyle & QuickHelpFlags::Left ) - aPos.X() = devHelpArea.Left(); + aPos.setX( devHelpArea.Left() ); else if ( nStyle & QuickHelpFlags::Right ) - aPos.X() = devHelpArea.Right(); + aPos.setX( devHelpArea.Right() ); if ( nStyle & QuickHelpFlags::Top ) - aPos.Y() = devHelpArea.Top(); + aPos.setY( devHelpArea.Top() ); else if ( nStyle & QuickHelpFlags::Bottom ) - aPos.Y() = devHelpArea.Bottom(); + aPos.setY( devHelpArea.Bottom() ); // which direction? if ( nStyle & QuickHelpFlags::Left ) ; else if ( nStyle & QuickHelpFlags::Right ) - aPos.X() -= aSz.Width(); + aPos.AdjustX( -(aSz.Width()) ); else - aPos.X() -= aSz.Width()/2; + aPos.AdjustX( -(aSz.Width()/2) ); if ( nStyle & QuickHelpFlags::Top ) ; else if ( nStyle & QuickHelpFlags::Bottom ) - aPos.Y() -= aSz.Height(); + aPos.AdjustY( -(aSz.Height()) ); else - aPos.Y() -= aSz.Height()/2; + aPos.AdjustY( -(aSz.Height()/2) ); } if ( aPos.X() < aScreenRect.Left() ) - aPos.X() = aScreenRect.Left(); + aPos.setX( aScreenRect.Left() ); else if ( ( aPos.X() + aSz.Width() ) > aScreenRect.Right() ) - aPos.X() = aScreenRect.Right() - aSz.Width(); + aPos.setX( aScreenRect.Right() - aSz.Width() ); if ( aPos.Y() < aScreenRect.Top() ) - aPos.Y() = aScreenRect.Top(); + aPos.setY( aScreenRect.Top() ); else if ( ( aPos.Y() + aSz.Height() ) > aScreenRect.Bottom() ) - aPos.Y() = aScreenRect.Bottom() - aSz.Height(); + aPos.setY( aScreenRect.Bottom() - aSz.Height() ); if( ! (nStyle & QuickHelpFlags::NoEvadePointer) ) { diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 800f0be14d96..ad07f3e644cc 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -883,8 +883,8 @@ ImplSVEvent * Application::PostMouseEvent( VclEventId nEvent, vcl::Window *pWin, { Point aTransformedPos( pMouseEvent->GetPosPixel() ); - aTransformedPos.X() += pWin->GetOutOffXPixel(); - aTransformedPos.Y() += pWin->GetOutOffYPixel(); + aTransformedPos.AdjustX(pWin->GetOutOffXPixel() ); + aTransformedPos.AdjustY(pWin->GetOutOffYPixel() ); const MouseEvent aTransformedEvent( aTransformedPos, pMouseEvent->GetClicks(), pMouseEvent->GetMode(), pMouseEvent->GetButtons(), pMouseEvent->GetModifier() ); diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 249f8be08aec..4b6ff1ddc3a5 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -257,8 +257,8 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, nTextStyle &= ~DrawTextFlags::Mnemonic; } - aImageSize.Width() = CalcZoom( aImageSize.Width() ); - aImageSize.Height() = CalcZoom( aImageSize.Height() ); + aImageSize.setWidth( CalcZoom( aImageSize.Width() ) ); + aImageSize.setHeight( CalcZoom( aImageSize.Height() ) ); // Drawing text or symbol only is simple, use style and output rectangle if (bHasSymbol && !bDrawImage && !bDrawText) @@ -308,16 +308,16 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, aSymbol = tools::Rectangle(Point(), Size(nSymbolHeight, nSymbolHeight)); ImplCalcSymbolRect(aSymbol); - aRect.Left() += 3 * nSymbolHeight / 2; - aTSSize.Width() = 3 * nSymbolHeight / 2; + aRect.AdjustLeft(3 * nSymbolHeight / 2 ); + aTSSize.setWidth( 3 * nSymbolHeight / 2 ); } else { aSymbol = tools::Rectangle(Point(), rSize); ImplCalcSymbolRect(aSymbol); - aTSSize.Width() = aSymbol.GetWidth(); + aTSSize.setWidth( aSymbol.GetWidth() ); } - aTSSize.Height() = aSymbol.GetHeight(); + aTSSize.setHeight( aSymbol.GetHeight() ); aSymbolSize = aSymbol.GetSize(); } @@ -330,7 +330,7 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, (eImageAlign == ImageAlign::Right) || (eImageAlign == ImageAlign::RightBottom)) { - aRect.Right() -= (aImageSize.Width() + nImageSep); + aRect.AdjustRight( -sal_Int32(aImageSize.Width() + nImageSep) ); } else if ((eImageAlign == ImageAlign::TopLeft) || (eImageAlign == ImageAlign::Top) || @@ -339,16 +339,16 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, (eImageAlign == ImageAlign::Bottom) || (eImageAlign == ImageAlign::BottomRight)) { - aRect.Bottom() -= (aImageSize.Height() + nImageSep); + aRect.AdjustBottom( -sal_Int32(aImageSize.Height() + nImageSep) ); } aRect = GetControlTextRect(*pDev, aRect, aText, nTextStyle, &aDeviceTextSize); aTextSize = aRect.GetSize(); - aTSSize.Width() += aTextSize.Width(); + aTSSize.AdjustWidth(aTextSize.Width() ); if (aTSSize.Height() < aTextSize.Height()) - aTSSize.Height() = aTextSize.Height(); + aTSSize.setHeight( aTextSize.Height() ); if (bAddImageSep && bDrawImage) { @@ -358,66 +358,66 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, } } - aMax.Width() = std::max(aTSSize.Width(), aImageSize.Width()); - aMax.Height() = std::max(aTSSize.Height(), aImageSize.Height()); + aMax.setWidth( std::max(aTSSize.Width(), aImageSize.Width()) ); + aMax.setHeight( std::max(aTSSize.Height(), aImageSize.Height()) ); // Now calculate the output area for the image and the text according to the image align flags if ((eImageAlign == ImageAlign::Left) || (eImageAlign == ImageAlign::Right)) { - aImagePos.Y() = rPos.Y() + (aMax.Height() - aImageSize.Height()) / 2; - aTextPos.Y() = rPos.Y() + (aMax.Height() - aTSSize.Height()) / 2; + aImagePos.setY( rPos.Y() + (aMax.Height() - aImageSize.Height()) / 2 ); + aTextPos.setY( rPos.Y() + (aMax.Height() - aTSSize.Height()) / 2 ); } else if ((eImageAlign == ImageAlign::LeftBottom) || (eImageAlign == ImageAlign::RightBottom)) { - aImagePos.Y() = rPos.Y() + aMax.Height() - aImageSize.Height(); - aTextPos.Y() = rPos.Y() + aMax.Height() - aTSSize.Height(); + aImagePos.setY( rPos.Y() + aMax.Height() - aImageSize.Height() ); + aTextPos.setY( rPos.Y() + aMax.Height() - aTSSize.Height() ); } else if ((eImageAlign == ImageAlign::Top) || (eImageAlign == ImageAlign::Bottom)) { - aImagePos.X() = rPos.X() + (aMax.Width() - aImageSize.Width()) / 2; - aTextPos.X() = rPos.X() + (aMax.Width() - aTSSize.Width()) / 2; + aImagePos.setX( rPos.X() + (aMax.Width() - aImageSize.Width()) / 2 ); + aTextPos.setX( rPos.X() + (aMax.Width() - aTSSize.Width()) / 2 ); } else if ((eImageAlign == ImageAlign::TopRight) || (eImageAlign == ImageAlign::BottomRight)) { - aImagePos.X() = rPos.X() + aMax.Width() - aImageSize.Width(); - aTextPos.X() = rPos.X() + aMax.Width() - aTSSize.Width(); + aImagePos.setX( rPos.X() + aMax.Width() - aImageSize.Width() ); + aTextPos.setX( rPos.X() + aMax.Width() - aTSSize.Width() ); } if ((eImageAlign == ImageAlign::LeftTop) || (eImageAlign == ImageAlign::Left) || (eImageAlign == ImageAlign::LeftBottom)) { - aTextPos.X() = rPos.X() + aImageSize.Width() + nImageSep; + aTextPos.setX( rPos.X() + aImageSize.Width() + nImageSep ); } else if ((eImageAlign == ImageAlign::RightTop) || (eImageAlign == ImageAlign::Right) || (eImageAlign == ImageAlign::RightBottom)) { - aImagePos.X() = rPos.X() + aTSSize.Width() + nImageSep; + aImagePos.setX( rPos.X() + aTSSize.Width() + nImageSep ); } else if ((eImageAlign == ImageAlign::TopLeft) || (eImageAlign == ImageAlign::Top) || (eImageAlign == ImageAlign::TopRight)) { - aTextPos.Y() = rPos.Y() + aImageSize.Height() + nImageSep; + aTextPos.setY( rPos.Y() + aImageSize.Height() + nImageSep ); } else if ((eImageAlign == ImageAlign::BottomLeft) || (eImageAlign == ImageAlign::Bottom) || (eImageAlign == ImageAlign::BottomRight)) { - aImagePos.Y() = rPos.Y() + aTSSize.Height() + nImageSep; + aImagePos.setY( rPos.Y() + aTSSize.Height() + nImageSep ); } else if (eImageAlign == ImageAlign::Center) { - aImagePos.X() = rPos.X() + (aMax.Width() - aImageSize.Width()) / 2; - aImagePos.Y() = rPos.Y() + (aMax.Height() - aImageSize.Height()) / 2; - aTextPos.X() = rPos.X() + (aMax.Width() - aTSSize.Width()) / 2; - aTextPos.Y() = rPos.Y() + (aMax.Height() - aTSSize.Height()) / 2; + aImagePos.setX( rPos.X() + (aMax.Width() - aImageSize.Width()) / 2 ); + aImagePos.setY( rPos.Y() + (aMax.Height() - aImageSize.Height()) / 2 ); + aTextPos.setX( rPos.X() + (aMax.Width() - aTSSize.Width()) / 2 ); + aTextPos.setY( rPos.Y() + (aMax.Height() - aTSSize.Height()) / 2 ); } aUnion = tools::Rectangle(aImagePos, aImageSize); aUnion.Union(tools::Rectangle(aTextPos, aTSSize)); @@ -450,15 +450,15 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, if (nXOffset < 0) nXOffset = 0; if (nYOffset < 0) nYOffset = 0; - aImagePos.X() += nXOffset; - aImagePos.Y() += nYOffset; - aTextPos.X() += nXOffset; - aTextPos.Y() += nYOffset; + aImagePos.AdjustX(nXOffset ); + aImagePos.AdjustY(nYOffset ); + aTextPos.AdjustX(nXOffset ); + aTextPos.AdjustY(nYOffset ); // set rPos and rSize to the union rSize = aUnion.GetSize(); - rPos.X() += nXOffset; - rPos.Y() += nYOffset; + rPos.AdjustX(nXOffset ); + rPos.AdjustY(nYOffset ); if (bHasSymbol) { @@ -470,7 +470,7 @@ void Button::ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, else { *pSymbolRect = tools::Rectangle(aTextPos, aSymbolSize); - aTextPos.X() += 3 * nSymbolHeight / 2; + aTextPos.AdjustX(3 * nSymbolHeight / 2 ); } if (mpButtonData->mbSmallSymbol) { @@ -511,20 +511,20 @@ void Button::ImplSetFocusRect(const tools::Rectangle &rFocusRect) if (!aFocusRect.IsEmpty()) { - aFocusRect.Left()--; - aFocusRect.Top()--; - aFocusRect.Right()++; - aFocusRect.Bottom()++; + aFocusRect.AdjustLeft( -1 ); + aFocusRect.AdjustTop( -1 ); + aFocusRect.AdjustRight( 1 ); + aFocusRect.AdjustBottom( 1 ); } if (aFocusRect.Left() < aOutputRect.Left()) - aFocusRect.Left() = aOutputRect.Left(); + aFocusRect.SetLeft( aOutputRect.Left() ); if (aFocusRect.Top() < aOutputRect.Top()) - aFocusRect.Top() = aOutputRect.Top(); + aFocusRect.SetTop( aOutputRect.Top() ); if (aFocusRect.Right() > aOutputRect.Right()) - aFocusRect.Right() = aOutputRect.Right(); + aFocusRect.SetRight( aOutputRect.Right() ); if (aFocusRect.Bottom() > aOutputRect.Bottom()) - aFocusRect.Bottom() = aOutputRect.Bottom(); + aFocusRect.SetBottom( aOutputRect.Bottom() ); mpButtonData->maFocusRect = aFocusRect; } @@ -868,11 +868,11 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice* pDev, DrawFlags nDrawFl long nSymbolSize = pDev->GetTextHeight() / 2 + 1; nSeparatorX = aInRect.Right() - 2*nSymbolSize; - aSize.Width() -= 2*nSymbolSize; + aSize.AdjustWidth( -(2*nSymbolSize) ); // center symbol rectangle in the separated area - aSymbolRect.Right() -= nSymbolSize/2; - aSymbolRect.Left() = aSymbolRect.Right() - nSymbolSize; + aSymbolRect.AdjustRight( -(nSymbolSize/2) ); + aSymbolRect.SetLeft( aSymbolRect.Right() - nSymbolSize ); ImplDrawAlignedImage( pDev, aPos, aSize, nImageSep, nDrawFlags, nTextStyle, nullptr, true ); @@ -1064,10 +1064,10 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) //ImplDrawPushButtonFrame( &aWin, aInRect, nButtonStyle & ~DrawButtonFlags::Pressed ); // looks better this way as symbols were displaced slightly using the above approach - aInRect.Top()+=4; - aInRect.Bottom()-=4; - aInRect.Left()+=4; - aInRect.Right()-=4; + aInRect.AdjustTop(4 ); + aInRect.AdjustBottom( -4 ); + aInRect.AdjustLeft(4 ); + aInRect.AdjustRight( -4 ); // prepare single line hint (needed on mac to decide between normal push button and // rectangular bevel button look) @@ -1102,10 +1102,10 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) tools::Rectangle aTempRect(aInRect); if (bRollOver) ImplDrawPushButtonFrame(rRenderContext, aTempRect, nButtonStyle); - aInRect.Left() += 2; - aInRect.Top() += 2; - aInRect.Right() -= 2; - aInRect.Bottom() -= 2; + aInRect.AdjustLeft(2 ); + aInRect.AdjustTop(2 ); + aInRect.AdjustRight( -2 ); + aInRect.AdjustBottom( -2 ); } else { @@ -1157,8 +1157,8 @@ void PushButton::ImplSetDefButton( bool bSet ) { // adjust pos/size when toggling from non-default to default aPos.Move(-dLeft, -dTop); - aSize.Width() += dLeft + dRight; - aSize.Height() += dTop + dBottom; + aSize.AdjustWidth(dLeft + dRight ); + aSize.AdjustHeight(dTop + dBottom ); } ImplGetButtonState() |= DrawButtonFlags::Default; } @@ -1168,8 +1168,8 @@ void PushButton::ImplSetDefButton( bool bSet ) { // adjust pos/size when toggling from default to non-default aPos.Move(dLeft, dTop); - aSize.Width() -= dLeft + dRight; - aSize.Height() -= dTop + dBottom; + aSize.AdjustWidth( -(dLeft + dRight) ); + aSize.AdjustHeight( -(dTop + dBottom) ); } ImplGetButtonState() &= ~DrawButtonFlags::Default; } @@ -1635,21 +1635,21 @@ Size PushButton::CalcMinimumSize() const mnDDStyle == PushButtonDropdownStyle::SplitMenuButton ) { long nSymbolSize = GetTextHeight() / 2 + 1; - aSize.Width() += 2*nSymbolSize; + aSize.AdjustWidth(2*nSymbolSize ); } if ( !PushButton::GetText().isEmpty() && ! (ImplGetButtonState() & DrawButtonFlags::NoText) ) { Size textSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), PushButton::GetText(), ImplGetTextStyle( DrawFlags::NONE ) ).GetSize(); - aSize.Width() += textSize.Width(); - aSize.Height() = std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ); + aSize.AdjustWidth(textSize.Width() ); + aSize.setHeight( std::max( aSize.Height(), long( textSize.Height() * 1.15 ) ) ); } // cf. ImplDrawPushButton ... if( (GetStyle() & WB_SMALLSTYLE) == 0 ) { - aSize.Width() += 24; - aSize.Height() += 12; + aSize.AdjustWidth(24 ); + aSize.AdjustHeight(12 ); } return CalcWindowSize( aSize ); @@ -1943,13 +1943,13 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) Size aImageSize = maImage.GetSizePixel(); bool bEnabled = IsEnabled(); - aImageSize.Width() = CalcZoom(aImageSize.Width()); - aImageSize.Height() = CalcZoom(aImageSize.Height()); + aImageSize.setWidth( CalcZoom(aImageSize.Width()) ); + aImageSize.setHeight( CalcZoom(aImageSize.Height()) ); - aImageRect.Left()++; - aImageRect.Top()++; - aImageRect.Right()--; - aImageRect.Bottom()--; + aImageRect.AdjustLeft( 1 ); + aImageRect.AdjustTop( 1 ); + aImageRect.AdjustRight( -1 ); + aImageRect.AdjustBottom( -1 ); // display border and selection status aImageRect = aDecoView.DrawFrame(aImageRect, DrawFrameStyle::DoubleIn); @@ -1968,17 +1968,17 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) Image* pImage = &maImage; Point aImagePos(aImageRect.TopLeft()); - aImagePos.X() += (aImageRect.GetWidth() - aImageSize.Width()) / 2; - aImagePos.Y() += (aImageRect.GetHeight() - aImageSize.Height()) / 2; + aImagePos.AdjustX((aImageRect.GetWidth() - aImageSize.Width()) / 2 ); + aImagePos.AdjustY((aImageRect.GetHeight() - aImageSize.Height()) / 2 ); if (IsZoom()) rRenderContext.DrawImage(aImagePos, aImageSize, *pImage, nImageStyle); else rRenderContext.DrawImage(aImagePos, *pImage, nImageStyle); - aImageRect.Left()++; - aImageRect.Top()++; - aImageRect.Right()--; - aImageRect.Bottom()--; + aImageRect.AdjustLeft( 1 ); + aImageRect.AdjustTop( 1 ); + aImageRect.AdjustRight( -1 ); + aImageRect.AdjustBottom( -1 ); ImplSetFocusRect(aImageRect); @@ -1988,16 +1988,16 @@ void RadioButton::ImplDrawRadioButtonState(vcl::RenderContext& rRenderContext) rRenderContext.SetFillColor(); if ((aImageSize.Width() >= 20) || (aImageSize.Height() >= 20)) { - aImageRect.Left()++; - aImageRect.Top()++; - aImageRect.Right()--; - aImageRect.Bottom()--; + aImageRect.AdjustLeft( 1 ); + aImageRect.AdjustTop( 1 ); + aImageRect.AdjustRight( -1 ); + aImageRect.AdjustBottom( -1 ); } rRenderContext.DrawRect(aImageRect); - aImageRect.Left()++; - aImageRect.Top()++; - aImageRect.Right()--; - aImageRect.Bottom()--; + aImageRect.AdjustLeft( 1 ); + aImageRect.AdjustTop( 1 ); + aImageRect.AdjustRight( -1 ); + aImageRect.AdjustBottom( -1 ); rRenderContext.DrawRect(aImageRect); } @@ -2029,8 +2029,8 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() ); Size aSize( rSize ); Point aPos( rPos ); - aPos.X() += rImageSize.Width() + nImageSep; - aSize.Width() -= rImageSize.Width() + nImageSep; + aPos.AdjustX(rImageSize.Width() + nImageSep ); + aSize.AdjustWidth( -(rImageSize.Width() + nImageSep) ); // if the text rect height is smaller than the height of the image // then for single lines the default should be centered text @@ -2039,43 +2039,43 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, { nTextStyle &= ~DrawTextFlags(DrawTextFlags::Top|DrawTextFlags::Bottom); nTextStyle |= DrawTextFlags::VCenter; - aSize.Height() = rImageSize.Height(); + aSize.setHeight( rImageSize.Height() ); } ImplDrawAlignedImage( pDev, aPos, aSize, 1, nDrawFlags, nTextStyle ); rMouseRect = tools::Rectangle( aPos, aSize ); - rMouseRect.Left() = rPos.X(); + rMouseRect.SetLeft( rPos.X() ); - rStateRect.Left() = rPos.X(); - rStateRect.Top() = rMouseRect.Top(); + rStateRect.SetLeft( rPos.X() ); + rStateRect.SetTop( rMouseRect.Top() ); if ( aSize.Height() > rImageSize.Height() ) - rStateRect.Top() += ( aSize.Height() - rImageSize.Height() ) / 2; + rStateRect.AdjustTop(( aSize.Height() - rImageSize.Height() ) / 2 ); else { - rStateRect.Top() -= ( rImageSize.Height() - aSize.Height() ) / 2; + rStateRect.AdjustTop( -(( rImageSize.Height() - aSize.Height() ) / 2) ); if( rStateRect.Top() < 0 ) - rStateRect.Top() = 0; + rStateRect.SetTop( 0 ); } - rStateRect.Right() = rStateRect.Left() + rImageSize.Width()-1; - rStateRect.Bottom() = rStateRect.Top() + rImageSize.Height()-1; + rStateRect.SetRight( rStateRect.Left() + rImageSize.Width()-1 ); + rStateRect.SetBottom( rStateRect.Top() + rImageSize.Height()-1 ); if ( rStateRect.Bottom() > rMouseRect.Bottom() ) - rMouseRect.Bottom() = rStateRect.Bottom(); + rMouseRect.SetBottom( rStateRect.Bottom() ); } else { - rStateRect.Left() = rPos.X(); + rStateRect.SetLeft( rPos.X() ); if ( nWinStyle & WB_VCENTER ) - rStateRect.Top() = rPos.Y()+((rSize.Height()-rImageSize.Height())/2); + rStateRect.SetTop( rPos.Y()+((rSize.Height()-rImageSize.Height())/2) ); else if ( nWinStyle & WB_BOTTOM ) - rStateRect.Top() = rPos.Y()+rSize.Height()-rImageSize.Height(); //-1; + rStateRect.SetTop( rPos.Y()+rSize.Height()-rImageSize.Height() ); //-1; else - rStateRect.Top() = rPos.Y(); - rStateRect.Right() = rStateRect.Left()+rImageSize.Width()-1; - rStateRect.Bottom() = rStateRect.Top()+rImageSize.Height()-1; + rStateRect.SetTop( rPos.Y() ); + rStateRect.SetRight( rStateRect.Left()+rImageSize.Width()-1 ); + rStateRect.SetBottom( rStateRect.Top()+rImageSize.Height()-1 ); rMouseRect = rStateRect; ImplSetFocusRect( rStateRect ); @@ -2095,26 +2095,26 @@ void RadioButton::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, Size aTmpSize( (aImageSize.Width()+8), (aImageSize.Height()+8) ); if ( bTopImage ) { - aImageRect.Left() = (rSize.Width()-aTmpSize.Width())/2; - aImageRect.Top() = (rSize.Height()-(aTmpSize.Height()+nTextHeight+6))/2; + aImageRect.SetLeft( (rSize.Width()-aTmpSize.Width())/2 ); + aImageRect.SetTop( (rSize.Height()-(aTmpSize.Height()+nTextHeight+6))/2 ); } else - aImageRect.Top() = (rSize.Height()-aTmpSize.Height())/2; + aImageRect.SetTop( (rSize.Height()-aTmpSize.Height())/2 ); - aImageRect.Right() = aImageRect.Left()+aTmpSize.Width(); - aImageRect.Bottom() = aImageRect.Top()+aTmpSize.Height(); + aImageRect.SetRight( aImageRect.Left()+aTmpSize.Width() ); + aImageRect.SetBottom( aImageRect.Top()+aTmpSize.Height() ); // display text Point aTxtPos = rPos; if ( bTopImage ) { - aTxtPos.X() += (rSize.Width()-nTextWidth)/2; - aTxtPos.Y() += aImageRect.Bottom()+6; + aTxtPos.AdjustX((rSize.Width()-nTextWidth)/2 ); + aTxtPos.AdjustY(aImageRect.Bottom()+6 ); } else { - aTxtPos.X() += aImageRect.Right()+8; - aTxtPos.Y() += (rSize.Height()-nTextHeight)/2; + aTxtPos.AdjustX(aImageRect.Right()+8 ); + aTxtPos.AdjustY((rSize.Height()-nTextHeight)/2 ); } pDev->DrawCtrlText( aTxtPos, aText, 0, aText.getLength() ); } @@ -2136,8 +2136,8 @@ void RadioButton::ImplDrawRadioButton(vcl::RenderContext& rRenderContext) else aImageSize = maImage.GetSizePixel(); - aImageSize.Width() = CalcZoom(aImageSize.Width()); - aImageSize.Height() = CalcZoom(aImageSize.Height()); + aImageSize.setWidth( CalcZoom(aImageSize.Width()) ); + aImageSize.setHeight( CalcZoom(aImageSize.Height()) ); // Draw control text ImplDraw(&rRenderContext, DrawFlags::NONE, Point(), GetOutputSizePixel(), @@ -2422,21 +2422,21 @@ void RadioButton::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize tools::Rectangle aStateRect; tools::Rectangle aMouseRect; - aImageSize.Width() = CalcZoom( aImageSize.Width() ); - aImageSize.Height() = CalcZoom( aImageSize.Height() ); - aBrd1Size.Width() = CalcZoom( aBrd1Size.Width() ); - aBrd1Size.Height() = CalcZoom( aBrd1Size.Height() ); - aBrd2Size.Width() = CalcZoom( aBrd2Size.Width() ); - aBrd2Size.Height() = CalcZoom( aBrd2Size.Height() ); + aImageSize.setWidth( CalcZoom( aImageSize.Width() ) ); + aImageSize.setHeight( CalcZoom( aImageSize.Height() ) ); + aBrd1Size.setWidth( CalcZoom( aBrd1Size.Width() ) ); + aBrd1Size.setHeight( CalcZoom( aBrd1Size.Height() ) ); + aBrd2Size.setWidth( CalcZoom( aBrd2Size.Width() ) ); + aBrd2Size.setHeight( CalcZoom( aBrd2Size.Height() ) ); if ( !aBrd1Size.Width() ) - aBrd1Size.Width() = 1; + aBrd1Size.setWidth( 1 ); if ( !aBrd1Size.Height() ) - aBrd1Size.Height() = 1; + aBrd1Size.setHeight( 1 ); if ( !aBrd2Size.Width() ) - aBrd2Size.Width() = 1; + aBrd2Size.setWidth( 1 ); if ( !aBrd2Size.Height() ) - aBrd2Size.Height() = 1; + aBrd2Size.setHeight( 1 ); pDev->Push(); pDev->SetMapMode(); @@ -2836,7 +2836,7 @@ void RadioButton::ImplSetMinimumNWFSize() if( aSize.Height() > aCurSize.Height() ) { - aCurSize.Height() = aSize.Height(); + aCurSize.setHeight( aSize.Height() ); SetSizePixel( aCurSize ); } } @@ -2852,8 +2852,8 @@ Size RadioButton::CalcMinimumSize() const else { aSize = maImage.GetSizePixel(); - aSize.Width() += 8; - aSize.Height() += 8; + aSize.AdjustWidth(8 ); + aSize.AdjustHeight(8 ); } OUString aText = GetText(); @@ -2864,21 +2864,21 @@ Size RadioButton::CalcMinimumSize() const Size aTextSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize(); - aSize.Width()+=2; // for focus rect + aSize.AdjustWidth(2 ); // for focus rect if (!bTopImage) { - aSize.Width() += ImplGetImageToTextDistance(); - aSize.Width() += aTextSize.Width(); + aSize.AdjustWidth(ImplGetImageToTextDistance() ); + aSize.AdjustWidth(aTextSize.Width() ); if ( aSize.Height() < aTextSize.Height() ) - aSize.Height() = aTextSize.Height(); + aSize.setHeight( aTextSize.Height() ); } else { - aSize.Height() += 6; - aSize.Height() += GetTextHeight(); + aSize.AdjustHeight(6 ); + aSize.AdjustHeight(GetTextHeight() ); if ( aSize.Width() < aTextSize.Width() ) - aSize.Width() = aTextSize.Width(); + aSize.setWidth( aTextSize.Width() ); } } @@ -2897,13 +2897,13 @@ void RadioButton::ShowFocus(const tools::Rectangle& rRect) ImplControlValue aControlValue; tools::Rectangle aInRect(Point(0, 0), GetSizePixel()); - aInRect.Left() = rRect.Left(); // exclude the radio element itself from the focusrect + aInRect.SetLeft( rRect.Left() ); // exclude the radio element itself from the focusrect //to-do, figure out a better solution here - aInRect.Left()-=2; - aInRect.Right()+=2; - aInRect.Top()-=2; - aInRect.Bottom()+=2; + aInRect.AdjustLeft( -2 ); + aInRect.AdjustRight(2 ); + aInRect.AdjustTop( -2 ); + aInRect.AdjustBottom(2 ); DrawNativeControl(ControlType::Radiobutton, ControlPart::Focus, aInRect, ControlState::FOCUSED, aControlValue, OUString()); @@ -3048,8 +3048,8 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, const long nImageSep = GetDrawPixel( pDev, ImplGetImageToTextDistance() ); Size aSize( rSize ); Point aPos( rPos ); - aPos.X() += rImageSize.Width() + nImageSep; - aSize.Width() -= rImageSize.Width() + nImageSep; + aPos.AdjustX(rImageSize.Width() + nImageSep ); + aSize.AdjustWidth( -(rImageSize.Width() + nImageSep) ); // if the text rect height is smaller than the height of the image // then for single lines the default should be centered text @@ -3058,46 +3058,46 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, { nTextStyle &= ~DrawTextFlags(DrawTextFlags::Top|DrawTextFlags::Bottom); nTextStyle |= DrawTextFlags::VCenter; - aSize.Height() = rImageSize.Height(); + aSize.setHeight( rImageSize.Height() ); } ImplDrawAlignedImage( pDev, aPos, aSize, 1, nDrawFlags, nTextStyle ); rMouseRect = tools::Rectangle( aPos, aSize ); - rMouseRect.Left() = rPos.X(); - rStateRect.Left() = rPos.X(); - rStateRect.Top() = rMouseRect.Top(); + rMouseRect.SetLeft( rPos.X() ); + rStateRect.SetLeft( rPos.X() ); + rStateRect.SetTop( rMouseRect.Top() ); if ( aSize.Height() > rImageSize.Height() ) - rStateRect.Top() += ( aSize.Height() - rImageSize.Height() ) / 2; + rStateRect.AdjustTop(( aSize.Height() - rImageSize.Height() ) / 2 ); else { - rStateRect.Top() -= ( rImageSize.Height() - aSize.Height() ) / 2; + rStateRect.AdjustTop( -(( rImageSize.Height() - aSize.Height() ) / 2) ); if( rStateRect.Top() < 0 ) - rStateRect.Top() = 0; + rStateRect.SetTop( 0 ); } - rStateRect.Right() = rStateRect.Left()+rImageSize.Width()-1; - rStateRect.Bottom() = rStateRect.Top()+rImageSize.Height()-1; + rStateRect.SetRight( rStateRect.Left()+rImageSize.Width()-1 ); + rStateRect.SetBottom( rStateRect.Top()+rImageSize.Height()-1 ); if ( rStateRect.Bottom() > rMouseRect.Bottom() ) - rMouseRect.Bottom() = rStateRect.Bottom(); + rMouseRect.SetBottom( rStateRect.Bottom() ); } else { if ( mbLegacyNoTextAlign && ( nWinStyle & WB_CENTER ) ) - rStateRect.Left() = rPos.X()+((rSize.Width()-rImageSize.Width())/2); + rStateRect.SetLeft( rPos.X()+((rSize.Width()-rImageSize.Width())/2) ); else if ( mbLegacyNoTextAlign && ( nWinStyle & WB_RIGHT ) ) - rStateRect.Left() = rPos.X()+rSize.Width()-rImageSize.Width(); + rStateRect.SetLeft( rPos.X()+rSize.Width()-rImageSize.Width() ); else - rStateRect.Left() = rPos.X(); + rStateRect.SetLeft( rPos.X() ); if ( nWinStyle & WB_VCENTER ) - rStateRect.Top() = rPos.Y()+((rSize.Height()-rImageSize.Height())/2); + rStateRect.SetTop( rPos.Y()+((rSize.Height()-rImageSize.Height())/2) ); else if ( nWinStyle & WB_BOTTOM ) - rStateRect.Top() = rPos.Y()+rSize.Height()-rImageSize.Height(); + rStateRect.SetTop( rPos.Y()+rSize.Height()-rImageSize.Height() ); else - rStateRect.Top() = rPos.Y(); - rStateRect.Right() = rStateRect.Left()+rImageSize.Width()-1; - rStateRect.Bottom() = rStateRect.Top()+rImageSize.Height()-1; + rStateRect.SetTop( rPos.Y() ); + rStateRect.SetRight( rStateRect.Left()+rImageSize.Width()-1 ); + rStateRect.SetBottom( rStateRect.Top()+rImageSize.Height()-1 ); // provide space for focusrect // note: this assumes that the control's size was adjusted // accordingly in Get/LoseFocus, so the onscreen position won't change @@ -3114,8 +3114,8 @@ void CheckBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, void CheckBox::ImplDrawCheckBox(vcl::RenderContext& rRenderContext) { Size aImageSize = ImplGetCheckImageSize(); - aImageSize.Width() = CalcZoom( aImageSize.Width() ); - aImageSize.Height() = CalcZoom( aImageSize.Height() ); + aImageSize.setWidth( CalcZoom( aImageSize.Width() ) ); + aImageSize.setHeight( CalcZoom( aImageSize.Height() ) ); HideFocus(); @@ -3278,21 +3278,21 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, tools::Rectangle aStateRect; tools::Rectangle aMouseRect; - aImageSize.Width() = CalcZoom( aImageSize.Width() ); - aImageSize.Height() = CalcZoom( aImageSize.Height() ); - aBrd1Size.Width() = CalcZoom( aBrd1Size.Width() ); - aBrd1Size.Height() = CalcZoom( aBrd1Size.Height() ); - aBrd2Size.Width() = CalcZoom( aBrd2Size.Width() ); - aBrd2Size.Height() = CalcZoom( aBrd2Size.Height() ); + aImageSize.setWidth( CalcZoom( aImageSize.Width() ) ); + aImageSize.setHeight( CalcZoom( aImageSize.Height() ) ); + aBrd1Size.setWidth( CalcZoom( aBrd1Size.Width() ) ); + aBrd1Size.setHeight( CalcZoom( aBrd1Size.Height() ) ); + aBrd2Size.setWidth( CalcZoom( aBrd2Size.Width() ) ); + aBrd2Size.setHeight( CalcZoom( aBrd2Size.Height() ) ); if ( !aBrd1Size.Width() ) - aBrd1Size.Width() = 1; + aBrd1Size.setWidth( 1 ); if ( !aBrd1Size.Height() ) - aBrd1Size.Height() = 1; + aBrd1Size.setHeight( 1 ); if ( !aBrd2Size.Width() ) - aBrd2Size.Width() = 1; + aBrd2Size.setWidth( 1 ); if ( !aBrd2Size.Height() ) - aBrd2Size.Height() = 1; + aBrd2Size.setHeight( 1 ); if ( !nCheckWidth ) nCheckWidth = 1; @@ -3311,10 +3311,10 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, pDev->SetLineColor(); pDev->SetFillColor( Color( COL_BLACK ) ); pDev->DrawRect( aStateRect ); - aStateRect.Left() += aBrd1Size.Width(); - aStateRect.Top() += aBrd1Size.Height(); - aStateRect.Right() -= aBrd1Size.Width(); - aStateRect.Bottom() -= aBrd1Size.Height(); + aStateRect.AdjustLeft(aBrd1Size.Width() ); + aStateRect.AdjustTop(aBrd1Size.Height() ); + aStateRect.AdjustRight( -(aBrd1Size.Width()) ); + aStateRect.AdjustBottom( -(aBrd1Size.Height()) ); if ( meState == TRISTATE_INDET ) pDev->SetFillColor( Color( COL_LIGHTGRAY ) ); else @@ -3323,10 +3323,10 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, if ( meState == TRISTATE_TRUE ) { - aStateRect.Left() += aBrd2Size.Width(); - aStateRect.Top() += aBrd2Size.Height(); - aStateRect.Right() -= aBrd2Size.Width(); - aStateRect.Bottom() -= aBrd2Size.Height(); + aStateRect.AdjustLeft(aBrd2Size.Width() ); + aStateRect.AdjustTop(aBrd2Size.Height() ); + aStateRect.AdjustRight( -(aBrd2Size.Width()) ); + aStateRect.AdjustBottom( -(aBrd2Size.Height()) ); Point aPos11( aStateRect.TopLeft() ); Point aPos12( aStateRect.BottomRight() ); Point aPos21( aStateRect.TopRight() ); @@ -3341,18 +3341,18 @@ void CheckBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, { if ( !(i % 2) ) { - aTempPos11.X() = aPos11.X()+nDX; - aTempPos12.X() = aPos12.X()+nDX; - aTempPos21.X() = aPos21.X()+nDX; - aTempPos22.X() = aPos22.X()+nDX; + aTempPos11.setX( aPos11.X()+nDX ); + aTempPos12.setX( aPos12.X()+nDX ); + aTempPos21.setX( aPos21.X()+nDX ); + aTempPos22.setX( aPos22.X()+nDX ); } else { nDX++; - aTempPos11.X() = aPos11.X()-nDX; - aTempPos12.X() = aPos12.X()-nDX; - aTempPos21.X() = aPos21.X()-nDX; - aTempPos22.X() = aPos22.X()-nDX; + aTempPos11.setX( aPos11.X()-nDX ); + aTempPos12.setX( aPos12.X()-nDX ); + aTempPos21.setX( aPos21.X()-nDX ); + aTempPos22.setX( aPos22.X()-nDX ); } pDev->DrawLine( aTempPos11, aTempPos12 ); pDev->DrawLine( aTempPos21, aTempPos22 ); @@ -3378,8 +3378,8 @@ void CheckBox::GetFocus() Point aPos( GetPosPixel() ); Size aSize( GetSizePixel() ); aPos.Move(-1,-1); - aSize.Height() += 2; - aSize.Width() += 2; + aSize.AdjustHeight(2 ); + aSize.AdjustWidth(2 ); setPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() ); Invalidate(); } @@ -3409,8 +3409,8 @@ void CheckBox::LoseFocus() Point aPos( GetPosPixel() ); Size aSize( GetSizePixel() ); aPos.Move(1,1); - aSize.Height() -= 2; - aSize.Width() -= 2; + aSize.AdjustHeight( -2 ); + aSize.AdjustWidth( -2 ); setPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() ); Invalidate(); } @@ -3672,7 +3672,7 @@ void CheckBox::ImplSetMinimumNWFSize() if( aSize.Height() > aCurSize.Height() ) { - aCurSize.Height() = aSize.Height(); + aCurSize.setHeight( aSize.Height() ); SetSizePixel( aCurSize ); } } @@ -3694,11 +3694,11 @@ Size CheckBox::CalcMinimumSize( long nMaxWidth ) const Size aTextSize = GetTextRect( tools::Rectangle( Point(), Size( nMaxWidth > 0 ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ), aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize(); - aSize.Width()+=2; // for focus rect - aSize.Width() += ImplGetImageToTextDistance(); - aSize.Width() += aTextSize.Width(); + aSize.AdjustWidth(2 ); // for focus rect + aSize.AdjustWidth(ImplGetImageToTextDistance() ); + aSize.AdjustWidth(aTextSize.Width() ); if ( aSize.Height() < aTextSize.Height() ) - aSize.Height() = aTextSize.Height(); + aSize.setHeight( aTextSize.Height() ); } else { @@ -3725,13 +3725,13 @@ void CheckBox::ShowFocus(const tools::Rectangle& rRect) ImplControlValue aControlValue; tools::Rectangle aInRect(Point(0, 0), GetSizePixel()); - aInRect.Left() = rRect.Left(); // exclude the checkbox itself from the focusrect + aInRect.SetLeft( rRect.Left() ); // exclude the checkbox itself from the focusrect //to-do, figure out a better solution here - aInRect.Left()-=2; - aInRect.Right()+=2; - aInRect.Top()-=2; - aInRect.Bottom()+=2; + aInRect.AdjustLeft( -2 ); + aInRect.AdjustRight(2 ); + aInRect.AdjustTop( -2 ); + aInRect.AdjustBottom(2 ); DrawNativeControl(ControlType::Checkbox, ControlPart::Focus, aInRect, ControlState::FOCUSED, aControlValue, OUString()); diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 8e1cc649cb31..990e24454a4c 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -540,9 +540,9 @@ void ComboBox::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, { Size aPrefSz = m_pImpl->m_pFloatWin->GetPrefSize(); if ((nFlags & PosSizeFlags::Height) && (nHeight >= 2*m_pImpl->m_nDDHeight)) - aPrefSz.Height() = nHeight-m_pImpl->m_nDDHeight; + aPrefSz.setHeight( nHeight-m_pImpl->m_nDDHeight ); if ( nFlags & PosSizeFlags::Width ) - aPrefSz.Width() = nWidth; + aPrefSz.setWidth( nWidth ); m_pImpl->m_pFloatWin->SetPrefSize( aPrefSz ); if (IsAutoSizeEnabled()) @@ -1029,28 +1029,28 @@ Size ComboBox::CalcMinimumSize() const if (!IsDropDownBox()) { aSz = m_pImpl->m_pImplLB->CalcSize( m_pImpl->m_pImplLB->GetEntryList()->GetEntryCount() ); - aSz.Height() += m_pImpl->m_nDDHeight; + aSz.AdjustHeight(m_pImpl->m_nDDHeight ); } else { - aSz.Height() = Edit::CalcMinimumSizeForText(GetText()).Height(); - aSz.Width() = m_pImpl->m_pImplLB->GetMaxEntryWidth(); + aSz.setHeight( Edit::CalcMinimumSizeForText(GetText()).Height() ); + aSz.setWidth( m_pImpl->m_pImplLB->GetMaxEntryWidth() ); } if (m_pImpl->m_nMaxWidthChars != -1) { long nMaxWidth = m_pImpl->m_nMaxWidthChars * approximate_char_width(); - aSz.Width() = std::min(aSz.Width(), nMaxWidth); + aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); } if (IsDropDownBox()) - aSz.Width() += getMaxWidthScrollBarAndDownButton(); + aSz.AdjustWidth(getMaxWidthScrollBarAndDownButton() ); ComboBoxBounds aBounds(m_pImpl->calcComboBoxDropDownComponentBounds( Size(0xFFFF, 0xFFFF), Size(0xFFFF, 0xFFFF))); - aSz.Width() += aBounds.aSubEditPos.X()*2; + aSz.AdjustWidth(aBounds.aSubEditPos.X()*2 ); - aSz.Width() += ImplGetExtraXOffset() * 2; + aSz.AdjustWidth(ImplGetExtraXOffset() * 2 ); aSz = CalcWindowSize( aSz ); return aSz; @@ -1061,21 +1061,21 @@ Size ComboBox::CalcAdjustedSize( const Size& rPrefSize ) const Size aSz = rPrefSize; sal_Int32 nLeft, nTop, nRight, nBottom; static_cast<vcl::Window*>(const_cast<ComboBox *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); - aSz.Height() -= nTop+nBottom; + aSz.AdjustHeight( -(nTop+nBottom) ); if ( !IsDropDownBox() ) { long nEntryHeight = CalcBlockSize( 1, 1 ).Height(); long nLines = aSz.Height() / nEntryHeight; if ( nLines < 1 ) nLines = 1; - aSz.Height() = nLines * nEntryHeight; - aSz.Height() += m_pImpl->m_nDDHeight; + aSz.setHeight( nLines * nEntryHeight ); + aSz.AdjustHeight(m_pImpl->m_nDDHeight ); } else { - aSz.Height() = m_pImpl->m_nDDHeight; + aSz.setHeight( m_pImpl->m_nDDHeight ); } - aSz.Height() += nTop+nBottom; + aSz.AdjustHeight(nTop+nBottom ); aSz = CalcWindowSize( aSz ); return aSz; @@ -1091,31 +1091,31 @@ Size ComboBox::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const if ( nLines ) { if ( !IsDropDownBox() ) - aSz.Height() = m_pImpl->m_pImplLB->CalcSize( nLines ).Height() + m_pImpl->m_nDDHeight; + aSz.setHeight( m_pImpl->m_pImplLB->CalcSize( nLines ).Height() + m_pImpl->m_nDDHeight ); else - aSz.Height() = m_pImpl->m_nDDHeight; + aSz.setHeight( m_pImpl->m_nDDHeight ); } else - aSz.Height() = aMinSz.Height(); + aSz.setHeight( aMinSz.Height() ); // width if ( nColumns ) - aSz.Width() = nColumns * approximate_char_width(); + aSz.setWidth( nColumns * approximate_char_width() ); else - aSz.Width() = aMinSz.Width(); + aSz.setWidth( aMinSz.Width() ); if ( IsDropDownBox() ) - aSz.Width() += getMaxWidthScrollBarAndDownButton(); + aSz.AdjustWidth(getMaxWidthScrollBarAndDownButton() ); if ( !IsDropDownBox() ) { if ( aSz.Width() < aMinSz.Width() ) - aSz.Height() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustHeight(GetSettings().GetStyleSettings().GetScrollBarSize() ); if ( aSz.Height() < aMinSz.Height() ) - aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() ); } - aSz.Width() += ImplGetExtraXOffset() * 2; + aSz.AdjustWidth(ImplGetExtraXOffset() * 2 ); aSz = CalcWindowSize( aSz ); return aSz; @@ -1217,17 +1217,17 @@ void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, D tools::Rectangle aTextRect( aPos, aSize ); - aTextRect.Left() += 3*nOnePixel; - aTextRect.Right() -= 3*nOnePixel; - aTextRect.Top() += nEditHeight + nOnePixel; - aTextRect.Bottom() = aTextRect.Top() + nTextHeight; + aTextRect.AdjustLeft(3*nOnePixel ); + aTextRect.AdjustRight( -(3*nOnePixel) ); + aTextRect.AdjustTop(nEditHeight + nOnePixel ); + aTextRect.SetBottom( aTextRect.Top() + nTextHeight ); // the drawing starts here for ( sal_Int32 n = 0; n < nLines; ++n ) { pDev->DrawText( aTextRect, m_pImpl->m_pImplLB->GetEntryList()->GetEntryText( n+nTEntry ), nTextStyle ); - aTextRect.Top() += nTextHeight; - aTextRect.Bottom() += nTextHeight; + aTextRect.AdjustTop(nTextHeight ); + aTextRect.AdjustBottom(nTextHeight ); } } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 644438d53bf6..1d011da56520 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -536,7 +536,7 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl bool bDrawSelection = maSelection.Len() && (HasFocus() || (GetStyle() & WB_NOHIDESELECTION) || mbActivePopup); - aPos.X() = mnXOffset + ImplGetExtraXOffset(); + aPos.setX( mnXOffset + ImplGetExtraXOffset() ); if (bPaintPlaceholderText) { rRenderContext.DrawText(aPos, maPlaceholderText); @@ -558,8 +558,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl for(sal_Int32 i = 0; i < nLen; ++i) { tools::Rectangle aRect(aPos, Size(10, nTH)); - aRect.Left() = pDX[2 * i] + mnXOffset + ImplGetExtraXOffset(); - aRect.Right() = pDX[2 * i + 1] + mnXOffset + ImplGetExtraXOffset(); + aRect.SetLeft( pDX[2 * i] + mnXOffset + ImplGetExtraXOffset() ); + aRect.SetRight( pDX[2 * i + 1] + mnXOffset + ImplGetExtraXOffset() ); aRect.Justify(); bool bHighlight = false; if (i >= aTmpSel.Min() && i < aTmpSel.Max()) @@ -636,8 +636,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl while (nIndex < mpIMEInfos->nLen && mpIMEInfos->pAttribs[nIndex] == nAttr) // #112631# check nIndex before using it { tools::Rectangle aRect( aPos, Size( 10, nTH ) ); - aRect.Left() = pDX[2 * (nIndex + mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraXOffset(); - aRect.Right() = pDX[2 * (nIndex + mpIMEInfos->nPos) + 1] + mnXOffset + ImplGetExtraXOffset(); + aRect.SetLeft( pDX[2 * (nIndex + mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraXOffset() ); + aRect.SetRight( pDX[2 * (nIndex + mpIMEInfos->nPos) + 1] + mnXOffset + ImplGetExtraXOffset() ); aRect.Justify(); aClip.Union(aRect); nIndex++; @@ -986,8 +986,8 @@ void Edit::ImplClearBackground(vcl::RenderContext& rRenderContext, const tools:: */ Point aTmpPoint; tools::Rectangle aRect(aTmpPoint, GetOutputSizePixel()); - aRect.Left() = nXStart; - aRect.Right() = nXEnd; + aRect.SetLeft( nXStart ); + aRect.SetRight( nXEnd ); if( !(ImplUseNativeBorder(rRenderContext, GetStyle()) || IsPaintTransparent())) rRenderContext.Erase(aRect); @@ -1008,8 +1008,8 @@ void Edit::ImplPaintBorder(vcl::RenderContext const & rRenderContext, long nXSta Point aTmpPoint; tools::Rectangle aRect(aTmpPoint, GetOutputSizePixel()); - aRect.Left() = nXStart; - aRect.Right() = nXEnd; + aRect.SetLeft( nXStart ); + aRect.SetRight( nXEnd ); if (ImplUseNativeBorder(rRenderContext, GetStyle()) || IsPaintTransparent()) { @@ -1800,8 +1800,8 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF else nTextStyle |= DrawTextFlags::Left; - aTextRect.Left() += nOffX; - aTextRect.Right() -= nOffX; + aTextRect.AdjustLeft(nOffX ); + aTextRect.AdjustRight( -nOffX ); OUString aText = ImplGetText(); long nTextHeight = pDev->GetTextHeight(); @@ -1815,7 +1815,7 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, DrawF { tools::Rectangle aClip( aPos, aSize ); if ( nTextHeight > aSize.Height() ) - aClip.Bottom() += nTextHeight-aSize.Height()+1; // prevent HP printers from 'optimizing' + aClip.AdjustBottom(nTextHeight-aSize.Height()+1 ); // prevent HP printers from 'optimizing' pDev->IntersectClipRegion( aClip ); } @@ -2151,7 +2151,7 @@ void Edit::Command( const CommandEvent& rCEvt ) for ( int nIndex = 0; nIndex < mpIMEInfos->nLen; ++nIndex ) { tools::Rectangle aRect( aPos, Size( 10, nTH ) ); - aRect.Left() = pDX[2*(nIndex+mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraXOffset(); + aRect.SetLeft( pDX[2*(nIndex+mpIMEInfos->nPos)] + mnXOffset + ImplGetExtraXOffset() ); aRects[ nIndex ] = aRect; } SetCompositionCharRect( aRects.get(), mpIMEInfos->nLen ); @@ -2706,9 +2706,9 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const else aString = rString; - aSize.Height() = GetTextHeight(); - aSize.Width() = GetTextWidth(aString); - aSize.Width() += ImplGetExtraXOffset() * 2; + aSize.setHeight( GetTextHeight() ); + aSize.setWidth( GetTextWidth(aString) ); + aSize.AdjustWidth(ImplGetExtraXOffset() * 2 ); // do not create edit fields in which one cannot enter anything // a default minimum width should exist for at least 3 characters @@ -2717,10 +2717,10 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const //function, so undo the first one with CalcOutputSize Size aMinSize(CalcOutputSize(CalcSize(3))); if (aSize.Width() < aMinSize.Width()) - aSize.Width() = aMinSize.Width(); + aSize.setWidth( aMinSize.Width() ); } - aSize.Height() += ImplGetExtraYOffset() * 2; + aSize.AdjustHeight(ImplGetExtraYOffset() * 2 ); aSize = CalcWindowSize( aSize ); @@ -2732,7 +2732,7 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const aControlValue, aBound, aContent)) { if (aBound.GetHeight() > aSize.Height()) - aSize.Height() = aBound.GetHeight(); + aSize.setHeight( aBound.GetHeight() ); } return aSize; } @@ -2760,8 +2760,8 @@ Size Edit::CalcSize(sal_Int32 nChars) const // width for N characters, independent from content. // works only correct for fixed fonts, average otherwise Size aSz( GetTextWidth( "x" ), GetTextHeight() ); - aSz.Width() *= nChars; - aSz.Width() += ImplGetExtraXOffset() * 2; + aSz.setWidth( aSz.Width() * nChars ); + aSz.AdjustWidth(ImplGetExtraXOffset() * 2 ); aSz = CalcWindowSize( aSz ); return aSz; } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 6df9b1478285..11ffeca1321a 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -870,7 +870,7 @@ namespace string::padToLength(aBuf, aBuf.getLength() + nDigits, '9'); } aMaxTextSize = rSpinField.CalcMinimumSizeForText(sBuf.makeStringAndClear()); - aRet.Width() = std::min(aRet.Width(), aMaxTextSize.Width()); + aRet.setWidth( std::min(aRet.Width(), aMaxTextSize.Width()) ); return aRet; } @@ -903,8 +903,8 @@ Size NumericBox::CalcMinimumSize() const if (IsDropDownBox()) { Size aComboSugg(ComboBox::CalcMinimumSize()); - aRet.Width() = std::max(aRet.Width(), aComboSugg.Width()); - aRet.Height() = std::max(aRet.Height(), aComboSugg.Height()); + aRet.setWidth( std::max(aRet.Width(), aComboSugg.Width()) ); + aRet.setHeight( std::max(aRet.Height(), aComboSugg.Height()) ); } return aRet; @@ -1687,8 +1687,8 @@ Size MetricBox::CalcMinimumSize() const if (IsDropDownBox()) { Size aComboSugg(ComboBox::CalcMinimumSize()); - aRet.Width() = std::max(aRet.Width(), aComboSugg.Width()); - aRet.Height() = std::max(aRet.Height(), aComboSugg.Height()); + aRet.setWidth( std::max(aRet.Width(), aComboSugg.Width()) ); + aRet.setHeight( std::max(aRet.Height(), aComboSugg.Height()) ); } return aRet; diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index d417f97ece07..d61199e69aa7 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -145,7 +145,7 @@ void FixedText::ImplDraw(OutputDevice* pDev, DrawFlags nDrawFlags, Point aPos = rPos; if ( nWinStyle & WB_EXTRAOFFSET ) - aPos.X() += 2; + aPos.AdjustX(2 ); if ( nWinStyle & WB_PATHELLIPSIS ) { @@ -325,13 +325,13 @@ Size FixedText::CalcMinimumTextSize( Control const *pControl, long nMaxWidth ) Size aSize = getTextDimensions(pControl, pControl->GetText(), nMaxWidth); if ( pControl->GetStyle() & WB_EXTRAOFFSET ) - aSize.Width() += 2; + aSize.AdjustWidth(2 ); // GetTextRect cannot take an empty string if ( aSize.Width() < 0 ) - aSize.Width() = 0; + aSize.setWidth( 0 ); if ( aSize.Height() <= 0 ) - aSize.Height() = pControl->GetTextHeight(); + aSize.setHeight( pControl->GetTextHeight() ); return aSize; } @@ -525,9 +525,9 @@ void FixedLine::ImplDraw(vcl::RenderContext& rRenderContext) SetFont(aFont); Point aStartPt(aOutSize.Width() / 2, aOutSize.Height() - 1); if (nWinStyle & WB_VCENTER) - aStartPt.Y() -= (aOutSize.Height() - nWidth) / 2; + aStartPt.AdjustY( -((aOutSize.Height() - nWidth) / 2) ); Point aTextPt(aStartPt); - aTextPt.X() -= GetTextHeight() / 2; + aTextPt.AdjustX( -(GetTextHeight() / 2) ); rRenderContext.DrawText(aTextPt, aText, 0, aText.getLength()); rRenderContext.Pop(); if (aOutSize.Height() - aStartPt.Y() > FIXEDLINE_TEXT_BORDER) diff --git a/vcl/source/control/group.cxx b/vcl/source/control/group.cxx index a9dd7cf8af7b..eec8f922bbf7 100644 --- a/vcl/source/control/group.cxx +++ b/vcl/source/control/group.cxx @@ -128,8 +128,8 @@ void GroupBox::ImplDraw( OutputDevice* pDev, DrawFlags nDrawFlags, } else { - aRect.Left() += GROUP_BORDER; - aRect.Right() -= GROUP_BORDER; + aRect.AdjustLeft(GROUP_BORDER ); + aRect.AdjustRight( -(GROUP_BORDER) ); aRect = pDev->GetTextRect( aRect, aText, nTextStyle ); nTop = rPos.Y(); nTop += aRect.GetHeight() / 2; diff --git a/vcl/source/control/imgctrl.cxx b/vcl/source/control/imgctrl.cxx index 265d018bbffe..9c471d0d5655 100644 --- a/vcl/source/control/imgctrl.cxx +++ b/vcl/source/control/imgctrl.cxx @@ -60,8 +60,8 @@ namespace Point lcl_centerWithin( const tools::Rectangle& _rArea, const Size& _rObjectSize ) { Point aPos( _rArea.TopLeft() ); - aPos.X() += ( _rArea.GetWidth() - _rObjectSize.Width() ) / 2; - aPos.Y() += ( _rArea.GetHeight() - _rObjectSize.Height() ) / 2; + aPos.AdjustX(( _rArea.GetWidth() - _rObjectSize.Width() ) / 2 ); + aPos.AdjustY(( _rArea.GetHeight() - _rObjectSize.Height() ) / 2 ); return aPos; } } @@ -142,10 +142,10 @@ void ImageControl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan pBorderWindow->SetFillColor(); pBorderWindow->SetLineColor(bFlat ? COL_WHITE : COL_BLACK); pBorderWindow->DrawRect(aRect); - ++aRect.Left(); - --aRect.Right(); - ++aRect.Top(); - --aRect.Bottom(); + aRect.AdjustLeft( 1 ); + aRect.AdjustRight( -1 ); + aRect.AdjustTop( 1 ); + aRect.AdjustBottom( -1 ); pBorderWindow->SetLineColor(bFlat ? COL_BLACK : COL_WHITE); pBorderWindow->DrawRect(aRect); pBorderWindow->SetLineColor(oldLineCol); diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index a6ca96f0a79a..f13df3bcd46f 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -625,7 +625,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) Size aCurSize( PixelToLogic( GetSizePixel() ) ); // set the current size to a large number // GetTextRect should shrink it to the actual size - aCurSize.Height() = 0x7fffff; + aCurSize.setHeight( 0x7fffff ); tools::Rectangle aTextRect( Point( 0, 0 ), aCurSize ); aTextRect = GetTextRect( aTextRect, rEntry.maStr, DrawTextFlags::WordBreak | DrawTextFlags::MultiLine ); aMetrics.nTextWidth = aTextRect.GetWidth(); @@ -1714,7 +1714,7 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 { mbInUserDraw = true; mnUserDrawEntry = nPos; - aRect.Left() -= mnLeft; + aRect.AdjustLeft( -(mnLeft) ); if (nPos < GetEntryList()->GetMRUCount()) nPos = GetEntryList()->FindEntry(GetEntryList()->GetEntryText(nPos)); nPos = nPos - GetEntryList()->GetMRUCount(); @@ -1758,7 +1758,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 // pb: #106948# explicit mirroring for calc if (mbMirroring) // right aligned - aPtImg.X() = mnMaxWidth + mnBorder - aImgSz.Width() - mnLeft; + aPtImg.setX( mnMaxWidth + mnBorder - aImgSz.Width() - mnLeft ); if (!IsZoom()) { @@ -1766,8 +1766,8 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 } else { - aImgSz.Width() = CalcZoom(aImgSz.Width()); - aImgSz.Height() = CalcZoom(aImgSz.Height()); + aImgSz.setWidth( CalcZoom(aImgSz.Width()) ); + aImgSz.setHeight( CalcZoom(aImgSz.Height()) ); rRenderContext.DrawImage(aPtImg, aImgSz, aImage); } @@ -1805,16 +1805,16 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 if (!bDrawTextAtImagePos && (mpEntryList->HasEntryImage(nPos) || IsUserDrawEnabled())) { long nImageWidth = std::max(mnMaxImgWidth, maUserItemSize.Width()); - aTextRect.Left() += nImageWidth + IMG_TXT_DISTANCE; + aTextRect.AdjustLeft(nImageWidth + IMG_TXT_DISTANCE ); } // pb: #106948# explicit mirroring for calc if (mbMirroring) { // right aligned - aTextRect.Left() = nMaxWidth + mnBorder - rRenderContext.GetTextWidth(aStr) - mnLeft; + aTextRect.SetLeft( nMaxWidth + mnBorder - rRenderContext.GetTextWidth(aStr) - mnLeft ); if (aImgSz.Width() > 0) - aTextRect.Left() -= (aImgSz.Width() + IMG_TXT_DISTANCE); + aTextRect.AdjustLeft( -(aImgSz.Width() + IMG_TXT_DISTANCE) ); } DrawTextFlags nDrawStyle = ImplGetTextStyle(); @@ -1834,9 +1834,9 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 rRenderContext.SetLineColor((GetBackground().GetColor() != COL_LIGHTGRAY) ? COL_LIGHTGRAY : COL_GRAY); Point aStartPos(0, nY); if (nPos == mnSeparatorPos) - aStartPos.Y() += pEntry->mnHeight - 1; + aStartPos.AdjustY(pEntry->mnHeight - 1 ); Point aEndPos(aStartPos); - aEndPos.X() = GetOutputSizePixel().Width(); + aEndPos.setX( GetOutputSizePixel().Width() ); rRenderContext.DrawLine(aStartPos, aEndPos); rRenderContext.SetLineColor(aOldLineColor); } @@ -2018,8 +2018,8 @@ Size ImplListBoxWindow::CalcSize(sal_Int32 nMaxLines) const // FIXME: ListBoxEntryFlags::MultiLine Size aSz; - aSz.Height() = nMaxLines * mnMaxHeight; - aSz.Width() = mnMaxWidth + 2*mnBorder; + aSz.setHeight( nMaxLines * mnMaxHeight ); + aSz.setWidth( mnMaxWidth + 2*mnBorder ); return aSz; } @@ -2358,9 +2358,9 @@ void ImplListBox::ImplResizeControls() Size aInnerSz( aOutSz ); if ( mbVScroll ) - aInnerSz.Width() -= nSBWidth; + aInnerSz.AdjustWidth( -nSBWidth ); if ( mbHScroll ) - aInnerSz.Height() -= nSBWidth; + aInnerSz.AdjustHeight( -nSBWidth ); // pb: #106948# explicit mirroring for calc // Scrollbar on left or right side? @@ -2768,8 +2768,8 @@ void ImplWin::DrawEntry(vcl::RenderContext& rRenderContext, bool bLayout) } else { - aImgSz.Width() = CalcZoom( aImgSz.Width() ); - aImgSz.Height() = CalcZoom( aImgSz.Height() ); + aImgSz.setWidth( CalcZoom( aImgSz.Width() ) ); + aImgSz.setHeight( CalcZoom( aImgSz.Height() ) ); rRenderContext.DrawImage( aPtImg, aImgSz, *pImage, nStyle ); } @@ -2806,7 +2806,7 @@ void ImplWin::DrawEntry(vcl::RenderContext& rRenderContext, bool bLayout) if ( bImage || IsUserDrawEnabled() ) { - aTextRect.Left() += maImage.GetSizePixel().Width() + IMG_TXT_DISTANCE; + aTextRect.AdjustLeft(maImage.GetSizePixel().Width() + IMG_TXT_DISTANCE ); } MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : nullptr; @@ -2941,10 +2941,10 @@ void ImplListBoxFloatingWindow::setPosSizePixel( long nX, long nY, long nWidth, aPos = GetParent()->GetParent()->OutputToScreenPixel( aPos ); if ( nFlags & PosSizeFlags::X ) - aPos.X() = nX; + aPos.setX( nX ); if ( nFlags & PosSizeFlags::Y ) - aPos.Y() = nY; + aPos.setY( nY ); sal_uInt16 nIndex; SetPosPixel( ImplCalcPos( this, tools::Rectangle( aPos, GetParent()->GetSizePixel() ), FloatWinPopupFlags::Down, nIndex ) ); @@ -2984,40 +2984,40 @@ Size ImplListBoxFloatingWindow::CalcFloatSize() long nMaxHeight = aSz.Height() + nTop + nBottom; if ( mnDDLineCount ) - aFloatSz.Height() = nMaxHeight; + aFloatSz.setHeight( nMaxHeight ); if( mbAutoWidth ) { // AutoSize first only for width... - aFloatSz.Width() = aSz.Width() + nLeft + nRight; - aFloatSz.Width() += nRight; // adding some space looks better... + aFloatSz.setWidth( aSz.Width() + nLeft + nRight ); + aFloatSz.AdjustWidth(nRight ); // adding some space looks better... if ( ( aFloatSz.Height() < nMaxHeight ) || ( mnDDLineCount && ( mnDDLineCount < mpImplLB->GetEntryList()->GetEntryCount() ) ) ) { // then we also need the vertical Scrollbar long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); - aFloatSz.Width() += nSBWidth; + aFloatSz.AdjustWidth(nSBWidth ); } long nDesktopWidth = GetDesktopRectPixel().getWidth(); if (aFloatSz.Width() > nDesktopWidth) // Don't exceed the desktop width. - aFloatSz.Width() = nDesktopWidth; + aFloatSz.setWidth( nDesktopWidth ); } if ( aFloatSz.Height() > nMaxHeight ) - aFloatSz.Height() = nMaxHeight; + aFloatSz.setHeight( nMaxHeight ); // Minimal height, in case height is not set to Float height. // The parent of FloatWin must be DropDown-Combo/Listbox. Size aParentSz = GetParent()->GetSizePixel(); if( (!mnDDLineCount || !nLines) && ( aFloatSz.Height() < aParentSz.Height() ) ) - aFloatSz.Height() = aParentSz.Height(); + aFloatSz.setHeight( aParentSz.Height() ); // do not get narrower than the parent... if( aFloatSz.Width() < aParentSz.Width() ) - aFloatSz.Width() = aParentSz.Width(); + aFloatSz.setWidth( aParentSz.Width() ); // align height to entries... long nInnerHeight = aFloatSz.Height() - nTop - nBottom; @@ -3027,7 +3027,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize() nInnerHeight /= nEntryHeight; nInnerHeight++; nInnerHeight *= nEntryHeight; - aFloatSz.Height() = nInnerHeight + nTop + nBottom; + aFloatSz.setHeight( nInnerHeight + nTop + nBottom ); } if (aFloatSz.Width() < aSz.Width()) @@ -3035,7 +3035,7 @@ Size ImplListBoxFloatingWindow::CalcFloatSize() // The max width of list box entries exceeds the window width. // Account for the scroll bar height. long nSBWidth = GetSettings().GetStyleSettings().GetScrollBarSize(); - aFloatSz.Height() += nSBWidth; + aFloatSz.AdjustHeight(nSBWidth ); } return aFloatSz; @@ -3063,10 +3063,10 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking ) GetParent()->IsNativeWidgetEnabled() ) { const sal_Int32 nLeft = 4, nTop = 4, nRight = 4, nBottom = 4; - aPos.X() += nLeft; - aPos.Y() += nTop; - aSz.Width() -= nLeft + nRight; - aSz.Height() -= nTop + nBottom; + aPos.AdjustX(nLeft ); + aPos.AdjustY(nTop ); + aSz.AdjustWidth( -(nLeft + nRight) ); + aSz.AdjustHeight( -(nTop + nBottom) ); } tools::Rectangle aRect( aPos, aSz ); diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx index c693223bb21a..514d86b94a3d 100644 --- a/vcl/source/control/listbox.cxx +++ b/vcl/source/control/listbox.cxx @@ -387,8 +387,8 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr else nTextStyle |= DrawTextFlags::Left; - aTextRect.Left() += nOffX; - aTextRect.Right() -= nOffX; + aTextRect.AdjustLeft(nOffX ); + aTextRect.AdjustRight( -nOffX ); if ( IsDropDownBox() ) { @@ -404,7 +404,7 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr { tools::Rectangle aClip( aPos, aSize ); if ( nTextHeight > aSize.Height() ) - aClip.Bottom() += nTextHeight-aSize.Height()+1; // So that HP Printers don't optimize this away + aClip.AdjustBottom(nTextHeight-aSize.Height()+1 ); // So that HP Printers don't optimize this away pDev->IntersectClipRegion( aClip ); } @@ -434,8 +434,8 @@ void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, Dr pDev->SetTextColor( COL_WHITE ); } - aTextRect.Top() = aPos.Y() + n*nTextHeight; - aTextRect.Bottom() = aTextRect.Top() + nTextHeight; + aTextRect.SetTop( aPos.Y() + n*nTextHeight ); + aTextRect.SetBottom( aTextRect.Top() + nTextHeight ); pDev->DrawText( aTextRect, mpImplLB->GetEntryList()->GetEntryText( nEntry ), nTextStyle ); @@ -553,9 +553,9 @@ void ListBox::setPosSizePixel( long nX, long nY, long nWidth, long nHeight, PosS { Size aPrefSz = mpFloatWin->GetPrefSize(); if ( ( nFlags & PosSizeFlags::Height ) && ( nHeight >= 2*mnDDHeight ) ) - aPrefSz.Height() = nHeight-mnDDHeight; + aPrefSz.setHeight( nHeight-mnDDHeight ); if ( nFlags & PosSizeFlags::Width ) - aPrefSz.Width() = nWidth; + aPrefSz.setWidth( nWidth ); mpFloatWin->SetPrefSize( aPrefSz ); if (IsAutoSizeEnabled()) @@ -592,7 +592,7 @@ void ListBox::Resize() aContent.Move( -aPoint.X(), -aPoint.Y() ); // Use the themes drop down size for the button - aOutSz.Width() = aContent.Left(); + aOutSz.setWidth( aContent.Left() ); mpBtn->setPosSizePixel( aContent.Left(), nTop, aContent.Right(), (nBottom-nTop) ); // Adjust the size of the edit field @@ -611,8 +611,8 @@ void ListBox::Resize() // completely wrong. Size aSz( GetOutputSizePixel() ); long nDiff = aContent.Top() - (aSz.Height() - aContent.GetHeight())/2; - aContent.Top() -= nDiff; - aContent.Bottom() -= nDiff; + aContent.AdjustTop( -nDiff ); + aContent.AdjustBottom( -nDiff ); } mpImplWin->SetPosSizePixel( aContent.TopLeft(), aContent.GetSize() ); } @@ -1169,8 +1169,8 @@ Size ListBox::CalcMinimumSize() const if (IsDropDownBox()) { - aSz.Height() += 4; // add a space between entry and border - aSz.Width() += 4; // add a little breathing space + aSz.AdjustHeight(4 ); // add a space between entry and border + aSz.AdjustWidth(4 ); // add a little breathing space bAddScrollWidth = true; } else @@ -1189,10 +1189,10 @@ Size ListBox::CalcMinimumSize() const aControlValue, aBound, aContent) ) { // use the themes drop down size - aSz.Width() += aTestSize.Width() - aContent.GetWidth(); + aSz.AdjustWidth(aTestSize.Width() - aContent.GetWidth() ); } else - aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() ); } aSz = CalcWindowSize( aSz ); @@ -1206,7 +1206,7 @@ Size ListBox::CalcMinimumSize() const aControlValue, aBound, aContent) ) { if( aBound.GetHeight() > aSz.Height() ) - aSz.Height() = aBound.GetHeight(); + aSz.setHeight( aBound.GetHeight() ); } } @@ -1224,19 +1224,19 @@ Size ListBox::CalcSubEditSize() const aSz = mpImplLB->CalcSize (mnLineCount ? mnLineCount : mpImplLB->GetEntryList()->GetEntryCount()); else { - aSz.Height() = mpImplLB->CalcSize( 1 ).Height(); + aSz.setHeight( mpImplLB->CalcSize( 1 ).Height() ); // Size to maxmimum entry width - aSz.Width() = mpImplLB->GetMaxEntryWidth(); + aSz.setWidth( mpImplLB->GetMaxEntryWidth() ); if (m_nMaxWidthChars != -1) { long nMaxWidth = m_nMaxWidthChars * approximate_char_width(); - aSz.Width() = std::min(aSz.Width(), nMaxWidth); + aSz.setWidth( std::min(aSz.Width(), nMaxWidth) ); } // Do not create ultrathin ListBoxes, it doesn't look good if( aSz.Width() < GetSettings().GetStyleSettings().GetScrollBarSize() ) - aSz.Width() = GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.setWidth( GetSettings().GetStyleSettings().GetScrollBarSize() ); } return aSz; @@ -1257,20 +1257,20 @@ Size ListBox::CalcAdjustedSize( const Size& rPrefSize ) const Size aSz = rPrefSize; sal_Int32 nLeft, nTop, nRight, nBottom; static_cast<vcl::Window*>(const_cast<ListBox *>(this))->GetBorder( nLeft, nTop, nRight, nBottom ); - aSz.Height() -= nTop+nBottom; + aSz.AdjustHeight( -(nTop+nBottom) ); if ( !IsDropDownBox() ) { long nEntryHeight = CalcBlockSize( 1, 1 ).Height(); long nLines = aSz.Height() / nEntryHeight; if ( nLines < 1 ) nLines = 1; - aSz.Height() = nLines * nEntryHeight; + aSz.setHeight( nLines * nEntryHeight ); } else { - aSz.Height() = mnDDHeight; + aSz.setHeight( mnDDHeight ); } - aSz.Height() += nTop+nBottom; + aSz.AdjustHeight(nTop+nBottom ); aSz = CalcWindowSize( aSz ); return aSz; @@ -1288,28 +1288,28 @@ Size ListBox::CalcBlockSize( sal_uInt16 nColumns, sal_uInt16 nLines ) const if ( nLines ) { if ( !IsDropDownBox() ) - aSz.Height() = mpImplLB->CalcSize( nLines ).Height(); + aSz.setHeight( mpImplLB->CalcSize( nLines ).Height() ); else - aSz.Height() = mnDDHeight; + aSz.setHeight( mnDDHeight ); } else - aSz.Height() = aMinSz.Height(); + aSz.setHeight( aMinSz.Height() ); // Width if ( nColumns ) - aSz.Width() = nColumns * GetTextWidth( OUString('X') ); + aSz.setWidth( nColumns * GetTextWidth( OUString('X') ) ); else - aSz.Width() = aMinSz.Width(); + aSz.setWidth( aMinSz.Width() ); if ( IsDropDownBox() ) - aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() ); if ( !IsDropDownBox() ) { if ( aSz.Width() < aMinSz.Width() ) - aSz.Height() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustHeight(GetSettings().GetStyleSettings().GetScrollBarSize() ); if ( aSz.Height() < aMinSz.Height() ) - aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() ); } aSz = CalcWindowSize( aSz ); diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx index 705b945fd18b..97c16db80492 100644 --- a/vcl/source/control/listctrl.cxx +++ b/vcl/source/control/listctrl.cxx @@ -84,12 +84,12 @@ void ListControl::RecalcAll() item->SetPosPixel(aPoint); Size aSize = item->GetSizePixel(); if(mbHasScrollBar) - aSize.Width() = aCtrlSize.Width() - nSrcBarSize; + aSize.setWidth( aCtrlSize.Width() - nSrcBarSize ); else - aSize.Width() = aCtrlSize.Width(); + aSize.setWidth( aCtrlSize.Width() ); item->SetSizePixel(aSize); - aPoint.Y() += item->GetSizePixel().Height(); + aPoint.AdjustY(item->GetSizePixel().Height() ); } } @@ -114,7 +114,7 @@ void ListControl::DoScroll(long nDelta) { Point aNewPoint = mpScrollBar->GetPosPixel(); tools::Rectangle aRect(Point(), GetOutputSize()); - aRect.Right() -= mpScrollBar->GetSizePixel().Width(); + aRect.AdjustRight( -(mpScrollBar->GetSizePixel().Width()) ); Scroll( 0, -nDelta, aRect ); mpScrollBar->SetPosPixel(aNewPoint); } diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index 95fd6fb78871..1bcbee39d9db 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -109,13 +109,13 @@ void MoreButton::Click() Point aPos( pParent->GetPosPixel() ); tools::Rectangle aDeskRect( pParent->ImplGetFrameWindow()->GetDesktopRectPixel() ); - aSize.Height() += nDeltaPixel; + aSize.AdjustHeight(nDeltaPixel ); if ( (aPos.Y()+aSize.Height()) > aDeskRect.Bottom() ) { - aPos.Y() = aDeskRect.Bottom()-aSize.Height(); + aPos.setY( aDeskRect.Bottom()-aSize.Height() ); if ( aPos.Y() < aDeskRect.Top() ) - aPos.Y() = aDeskRect.Top(); + aPos.setY( aDeskRect.Top() ); pParent->SetPosSizePixel( aPos, aSize ); } @@ -125,7 +125,7 @@ void MoreButton::Click() else { // Adapt Dialogbox - aSize.Height() -= nDeltaPixel; + aSize.AdjustHeight( -nDeltaPixel ); pParent->SetSizePixel( aSize ); // Hide window(s) again diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index ee3e05ab3852..54931df82557 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -130,7 +130,7 @@ void NotebookBar::Resize() if (pWindow) { Size aSize = pWindow->GetSizePixel(); - aSize.Width() = GetSizePixel().Width(); + aSize.setWidth( GetSizePixel().Width() ); pWindow->SetSizePixel(aSize); } } diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx index 519353a6a777..ac21e7c98ca3 100644 --- a/vcl/source/control/prgsbar.cxx +++ b/vcl/source/control/prgsbar.cxx @@ -125,7 +125,7 @@ void ProgressBar::ImplDrawProgress(vcl::RenderContext& rRenderContext, sal_uInt1 Size aSize(GetOutputSizePixel()); mnPrgsHeight = aSize.Height() - (PROGRESSBAR_WIN_OFFSET * 2); mnPrgsWidth = (mnPrgsHeight * 2) / 3; - maPos.Y() = PROGRESSBAR_WIN_OFFSET; + maPos.setY( PROGRESSBAR_WIN_OFFSET ); long nMaxWidth = (aSize.Width() - (PROGRESSBAR_WIN_OFFSET * 2) + PROGRESSBAR_OFFSET); sal_uInt16 nMaxCount = static_cast<sal_uInt16>(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET)); if (nMaxCount <= 1) @@ -141,7 +141,7 @@ void ProgressBar::ImplDrawProgress(vcl::RenderContext& rRenderContext, sal_uInt1 } mnPercentCount = 10000 / nMaxCount; nMaxWidth = ((10000 / (10000 / nMaxCount)) * (mnPrgsWidth + PROGRESSBAR_OFFSET)) - PROGRESSBAR_OFFSET; - maPos.X() = (aSize.Width() - nMaxWidth) / 2; + maPos.setX( (aSize.Width() - nMaxWidth) / 2 ); } ::DrawProgress(this, rRenderContext, maPos, PROGRESSBAR_OFFSET, mnPrgsWidth, mnPrgsHeight, diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 313d53b0b199..d7ba1353b531 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -128,34 +128,34 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) { if ( GetStyle() & WB_HORZ ) { - maThumbRect.Left() = maTrackRect.Left()+mnThumbPixPos; - maThumbRect.Right() = maThumbRect.Left()+mnThumbPixSize-1; + maThumbRect.SetLeft( maTrackRect.Left()+mnThumbPixPos ); + maThumbRect.SetRight( maThumbRect.Left()+mnThumbPixSize-1 ); if ( !mnThumbPixPos ) maPage1Rect.SetWidthEmpty(); else - maPage1Rect.Right() = maThumbRect.Left()-1; + maPage1Rect.SetRight( maThumbRect.Left()-1 ); if ( mnThumbPixPos >= (mnThumbPixRange-mnThumbPixSize) ) maPage2Rect.SetWidthEmpty(); else { - maPage2Rect.Left() = maThumbRect.Right()+1; - maPage2Rect.Right() = maTrackRect.Right(); + maPage2Rect.SetLeft( maThumbRect.Right()+1 ); + maPage2Rect.SetRight( maTrackRect.Right() ); } } else { - maThumbRect.Top() = maTrackRect.Top()+mnThumbPixPos; - maThumbRect.Bottom() = maThumbRect.Top()+mnThumbPixSize-1; + maThumbRect.SetTop( maTrackRect.Top()+mnThumbPixPos ); + maThumbRect.SetBottom( maThumbRect.Top()+mnThumbPixSize-1 ); if ( !mnThumbPixPos ) maPage1Rect.SetHeightEmpty(); else - maPage1Rect.Bottom() = maThumbRect.Top()-1; + maPage1Rect.SetBottom( maThumbRect.Top()-1 ); if ( mnThumbPixPos >= (mnThumbPixRange-mnThumbPixSize) ) maPage2Rect.SetHeightEmpty(); else { - maPage2Rect.Top() = maThumbRect.Bottom()+1; - maPage2Rect.Bottom() = maTrackRect.Bottom(); + maPage2Rect.SetTop( maThumbRect.Bottom()+1 ); + maPage2Rect.SetBottom( maTrackRect.Bottom() ); } } } @@ -166,10 +166,10 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) const long nSpace = maTrackRect.Right() - maTrackRect.Left(); if ( nSpace > 0 ) { - maPage1Rect.Left() = maTrackRect.Left(); - maPage1Rect.Right() = maTrackRect.Left() + (nSpace/2); - maPage2Rect.Left() = maPage1Rect.Right() + 1; - maPage2Rect.Right() = maTrackRect.Right(); + maPage1Rect.SetLeft( maTrackRect.Left() ); + maPage1Rect.SetRight( maTrackRect.Left() + (nSpace/2) ); + maPage2Rect.SetLeft( maPage1Rect.Right() + 1 ); + maPage2Rect.SetRight( maTrackRect.Right() ); } } else @@ -177,10 +177,10 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) const long nSpace = maTrackRect.Bottom() - maTrackRect.Top(); if ( nSpace > 0 ) { - maPage1Rect.Top() = maTrackRect.Top(); - maPage1Rect.Bottom() = maTrackRect.Top() + (nSpace/2); - maPage2Rect.Top() = maPage1Rect.Bottom() + 1; - maPage2Rect.Bottom() = maTrackRect.Bottom(); + maPage1Rect.SetTop( maTrackRect.Top() ); + maPage1Rect.SetBottom( maTrackRect.Top() + (nSpace/2) ); + maPage2Rect.SetTop( maPage1Rect.Bottom() + 1 ); + maPage2Rect.SetBottom( maTrackRect.Bottom() ); } } } @@ -255,8 +255,8 @@ void ScrollBar::ImplCalc( bool bUpdate ) else { Size aBtnSize( aSize.Height(), aSize.Height() ); - maBtn2Rect.Top() = maBtn1Rect.Top(); - maBtn2Rect.Left() = aSize.Width()-aSize.Height(); + maBtn2Rect.SetTop( maBtn1Rect.Top() ); + maBtn2Rect.SetLeft( aSize.Width()-aSize.Height() ); maBtn1Rect.SetSize( aBtnSize ); maBtn2Rect.SetSize( aBtnSize ); } @@ -271,7 +271,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) mnThumbPixRange = maTrackRect.Right() - maTrackRect.Left(); if( mnThumbPixRange > 0 ) { - maPage1Rect.Left() = maTrackRect.Left(); + maPage1Rect.SetLeft( maTrackRect.Left() ); maPage1Rect.Bottom() = maPage2Rect.Bottom() = maThumbRect.Bottom() = maTrackRect.Bottom(); @@ -296,8 +296,8 @@ void ScrollBar::ImplCalc( bool bUpdate ) else { const Size aBtnSize( aSize.Width(), aSize.Width() ); - maBtn2Rect.Left() = maBtn1Rect.Left(); - maBtn2Rect.Top() = aSize.Height()-aSize.Width(); + maBtn2Rect.SetLeft( maBtn1Rect.Left() ); + maBtn2Rect.SetTop( aSize.Height()-aSize.Width() ); maBtn1Rect.SetSize( aBtnSize ); maBtn2Rect.SetSize( aBtnSize ); } @@ -312,7 +312,7 @@ void ScrollBar::ImplCalc( bool bUpdate ) mnThumbPixRange = maTrackRect.Bottom() - maTrackRect.Top(); if( mnThumbPixRange > 0 ) { - maPage1Rect.Top() = maTrackRect.Top(); + maPage1Rect.SetTop( maTrackRect.Top() ); maPage1Rect.Right() = maPage2Rect.Right() = maThumbRect.Right() = maTrackRect.Right(); @@ -1121,13 +1121,13 @@ void ScrollBar::ImplInvert() tools::Rectangle aRect( maThumbRect ); if( aRect.getWidth() > 4 ) { - aRect.Left() += 2; - aRect.Right() -= 2; + aRect.AdjustLeft(2 ); + aRect.AdjustRight( -2 ); } if( aRect.getHeight() > 4 ) { - aRect.Top() += 2; - aRect.Bottom() -= 2; + aRect.AdjustTop(2 ); + aRect.AdjustBottom( -2 ); } Invert( aRect ); @@ -1402,11 +1402,11 @@ Size ScrollBar::GetOptimalSize() const if (GetStyle() & WB_HORZ) { - aRet.Width() = maBtn1Rect.GetWidth() + nMinThumbSize + maBtn2Rect.GetWidth(); + aRet.setWidth( maBtn1Rect.GetWidth() + nMinThumbSize + maBtn2Rect.GetWidth() ); } else { - aRet.Height() = maBtn1Rect.GetHeight() + nMinThumbSize + maBtn2Rect.GetHeight(); + aRet.setHeight( maBtn1Rect.GetHeight() + nMinThumbSize + maBtn2Rect.GetHeight() ); } return aRet; diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index 9bcc748fcd7a..6682ceb99d66 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -116,23 +116,23 @@ void Slider::ImplUpdateRects( bool bUpdate ) { if ( GetStyle() & WB_HORZ ) { - maThumbRect.Left() = mnThumbPixPos-SLIDER_THUMB_HALFSIZE; - maThumbRect.Right() = maThumbRect.Left()+SLIDER_THUMB_SIZE-1; + maThumbRect.SetLeft( mnThumbPixPos-SLIDER_THUMB_HALFSIZE ); + maThumbRect.SetRight( maThumbRect.Left()+SLIDER_THUMB_SIZE-1 ); if ( mnChannelPixOffset < maThumbRect.Left() ) { - maChannel1Rect.Left() = mnChannelPixOffset; - maChannel1Rect.Right() = maThumbRect.Left()-1; - maChannel1Rect.Top() = mnChannelPixTop; - maChannel1Rect.Bottom() = mnChannelPixBottom; + maChannel1Rect.SetLeft( mnChannelPixOffset ); + maChannel1Rect.SetRight( maThumbRect.Left()-1 ); + maChannel1Rect.SetTop( mnChannelPixTop ); + maChannel1Rect.SetBottom( mnChannelPixBottom ); } else maChannel1Rect.SetEmpty(); if ( mnChannelPixOffset+mnChannelPixRange-1 > maThumbRect.Right() ) { - maChannel2Rect.Left() = maThumbRect.Right()+1; - maChannel2Rect.Right() = mnChannelPixOffset+mnChannelPixRange-1; - maChannel2Rect.Top() = mnChannelPixTop; - maChannel2Rect.Bottom() = mnChannelPixBottom; + maChannel2Rect.SetLeft( maThumbRect.Right()+1 ); + maChannel2Rect.SetRight( mnChannelPixOffset+mnChannelPixRange-1 ); + maChannel2Rect.SetTop( mnChannelPixTop ); + maChannel2Rect.SetBottom( mnChannelPixBottom ); } else maChannel2Rect.SetEmpty(); @@ -143,30 +143,30 @@ void Slider::ImplUpdateRects( bool bUpdate ) aControlRegion, ControlState::NONE, ImplControlValue(), aThumbBounds, aThumbContent ) ) { - maThumbRect.Left() = mnThumbPixPos - aThumbBounds.GetWidth()/2; - maThumbRect.Right() = maThumbRect.Left() + aThumbBounds.GetWidth() - 1; + maThumbRect.SetLeft( mnThumbPixPos - aThumbBounds.GetWidth()/2 ); + maThumbRect.SetRight( maThumbRect.Left() + aThumbBounds.GetWidth() - 1 ); bInvalidateAll = true; } } else { - maThumbRect.Top() = mnThumbPixPos-SLIDER_THUMB_HALFSIZE; - maThumbRect.Bottom() = maThumbRect.Top()+SLIDER_THUMB_SIZE-1; + maThumbRect.SetTop( mnThumbPixPos-SLIDER_THUMB_HALFSIZE ); + maThumbRect.SetBottom( maThumbRect.Top()+SLIDER_THUMB_SIZE-1 ); if ( mnChannelPixOffset < maThumbRect.Top() ) { - maChannel1Rect.Top() = mnChannelPixOffset; - maChannel1Rect.Bottom() = maThumbRect.Top()-1; - maChannel1Rect.Left() = mnChannelPixTop; - maChannel1Rect.Right() = mnChannelPixBottom; + maChannel1Rect.SetTop( mnChannelPixOffset ); + maChannel1Rect.SetBottom( maThumbRect.Top()-1 ); + maChannel1Rect.SetLeft( mnChannelPixTop ); + maChannel1Rect.SetRight( mnChannelPixBottom ); } else maChannel1Rect.SetEmpty(); if ( mnChannelPixOffset+mnChannelPixRange-1 > maThumbRect.Bottom() ) { - maChannel2Rect.Top() = maThumbRect.Bottom()+1; - maChannel2Rect.Bottom() = mnChannelPixOffset+mnChannelPixRange-1; - maChannel2Rect.Left() = mnChannelPixTop; - maChannel2Rect.Right() = mnChannelPixBottom; + maChannel2Rect.SetTop( maThumbRect.Bottom()+1 ); + maChannel2Rect.SetBottom( mnChannelPixOffset+mnChannelPixRange-1 ); + maChannel2Rect.SetLeft( mnChannelPixTop ); + maChannel2Rect.SetRight( mnChannelPixBottom ); } else maChannel2Rect.SetEmpty(); @@ -177,8 +177,8 @@ void Slider::ImplUpdateRects( bool bUpdate ) aControlRegion, ControlState::NONE, ImplControlValue(), aThumbBounds, aThumbContent ) ) { - maThumbRect.Top() = mnThumbPixPos - aThumbBounds.GetHeight()/2; - maThumbRect.Bottom() = maThumbRect.Top() + aThumbBounds.GetHeight() - 1; + maThumbRect.SetTop( mnThumbPixPos - aThumbBounds.GetHeight()/2 ); + maThumbRect.SetBottom( maThumbRect.Top() + aThumbBounds.GetHeight() - 1 ); bInvalidateAll = true; } } @@ -266,15 +266,15 @@ void Slider::ImplCalc( bool bUpdate ) { nCalcWidth = aSize.Width(); nCalcHeight = aSize.Height(); - maThumbRect.Top() = 0; - maThumbRect.Bottom()= aSize.Height()-1; + maThumbRect.SetTop( 0 ); + maThumbRect.SetBottom( aSize.Height()-1 ); } else { nCalcWidth = aSize.Height(); nCalcHeight = aSize.Width(); - maThumbRect.Left() = 0; - maThumbRect.Right() = aSize.Width()-1; + maThumbRect.SetLeft( 0 ); + maThumbRect.SetRight( aSize.Width()-1 ); } if ( nCalcWidth >= SLIDER_THUMB_SIZE ) @@ -374,12 +374,12 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) if (nRectSize > 1) { - aRect.Left()++; - aRect.Top()++; + aRect.AdjustLeft( 1 ); + aRect.AdjustTop( 1 ); if (GetStyle() & WB_HORZ) - aRect.Bottom()--; + aRect.AdjustBottom( -1 ); else - aRect.Right()--; + aRect.AdjustRight( -1 ); rRenderContext.SetLineColor(); if (mnStateFlags & SLIDER_STATE_CHANNEL1_DOWN) rRenderContext.SetFillColor(rStyleSettings.GetShadowColor()); @@ -415,12 +415,12 @@ void Slider::ImplDraw(vcl::RenderContext& rRenderContext) else rRenderContext.DrawLine(aRect.TopLeft(), Point(aRect.Left(), aRect.Bottom() - 1)); - aRect.Right()--; - aRect.Bottom()--; + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); if (GetStyle() & WB_HORZ) - aRect.Top()++; + aRect.AdjustTop( 1 ); else - aRect.Left()++; + aRect.AdjustLeft( 1 ); rRenderContext.SetLineColor(); if (mnStateFlags & SLIDER_STATE_CHANNEL2_DOWN) rRenderContext.SetFillColor(rStyleSettings.GetShadowColor()); @@ -454,13 +454,13 @@ bool Slider::ImplIsPageUp( const Point& rPos ) tools::Rectangle aRect = maChannel1Rect; if ( GetStyle() & WB_HORZ ) { - aRect.Top() = 0; - aRect.Bottom() = aSize.Height()-1; + aRect.SetTop( 0 ); + aRect.SetBottom( aSize.Height()-1 ); } else { - aRect.Left() = 0; - aRect.Right() = aSize.Width()-1; + aRect.SetLeft( 0 ); + aRect.SetRight( aSize.Width()-1 ); } return aRect.IsInside( rPos ); } @@ -471,13 +471,13 @@ bool Slider::ImplIsPageDown( const Point& rPos ) tools::Rectangle aRect = maChannel2Rect; if ( GetStyle() & WB_HORZ ) { - aRect.Top() = 0; - aRect.Bottom() = aSize.Height()-1; + aRect.SetTop( 0 ); + aRect.SetBottom( aSize.Height()-1 ); } else { - aRect.Left() = 0; - aRect.Right() = aSize.Width()-1; + aRect.SetLeft( 0 ); + aRect.SetRight( aSize.Width()-1 ); } return aRect.IsInside( rPos ); } @@ -952,13 +952,13 @@ Size Slider::CalcWindowSizePixel() Size aSize; if ( GetStyle() & WB_HORZ ) { - aSize.Width() = nWidth; - aSize.Height() = nHeight; + aSize.setWidth( nWidth ); + aSize.setHeight( nHeight ); } else { - aSize.Height() = nWidth; - aSize.Width() = nHeight; + aSize.setHeight( nWidth ); + aSize.setWidth( nHeight ); } return aSize; } diff --git a/vcl/source/control/spinbtn.cxx b/vcl/source/control/spinbtn.cxx index 0904a6ba7a94..b5c388ce54c6 100644 --- a/vcl/source/control/spinbtn.cxx +++ b/vcl/source/control/spinbtn.cxx @@ -419,10 +419,10 @@ void SpinButton::ImplCalcFocusRect( bool _bUpper ) { maFocusRect = _bUpper ? maUpperRect : maLowerRect; // inflate by some pixels - maFocusRect.Left() += 2; - maFocusRect.Top() += 2; - maFocusRect.Right() -= 2; - maFocusRect.Bottom() -= 2; + maFocusRect.AdjustLeft(2 ); + maFocusRect.AdjustTop(2 ); + maFocusRect.AdjustRight( -2 ); + maFocusRect.AdjustBottom( -2 ); mbUpperIsFocused = _bUpper; } diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index c5ccad010628..13eecee94abe 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -237,22 +237,22 @@ void ImplDrawUpDownButtons(vcl::RenderContext& rRenderContext, tools::Rectangle aLowRect = aDecoView.DrawButton(rLowerRect, nStyle); // make use of additional default edge - aUpRect.Left()--; - aUpRect.Top()--; - aUpRect.Right()++; - aUpRect.Bottom()++; - aLowRect.Left()--; - aLowRect.Top()--; - aLowRect.Right()++; - aLowRect.Bottom()++; + aUpRect.AdjustLeft( -1 ); + aUpRect.AdjustTop( -1 ); + aUpRect.AdjustRight( 1 ); + aUpRect.AdjustBottom( 1 ); + aLowRect.AdjustLeft( -1 ); + aLowRect.AdjustTop( -1 ); + aLowRect.AdjustRight( 1 ); + aLowRect.AdjustBottom( 1 ); // draw into the edge, so that something is visible if the rectangle is too small if (aUpRect.GetHeight() < 4) { - aUpRect.Right()++; - aUpRect.Bottom()++; - aLowRect.Right()++; - aLowRect.Bottom()++; + aUpRect.AdjustRight( 1 ); + aUpRect.AdjustBottom( 1 ); + aLowRect.AdjustRight( 1 ); + aLowRect.AdjustBottom( 1 ); } // calculate Symbol size @@ -261,18 +261,18 @@ void ImplDrawUpDownButtons(vcl::RenderContext& rRenderContext, if (std::abs( nTempSize1-nTempSize2 ) == 1) { if (nTempSize1 > nTempSize2) - aUpRect.Left()++; + aUpRect.AdjustLeft( 1 ); else - aLowRect.Left()++; + aLowRect.AdjustLeft( 1 ); } nTempSize1 = aUpRect.GetHeight(); nTempSize2 = aLowRect.GetHeight(); if (std::abs(nTempSize1 - nTempSize2) == 1) { if (nTempSize1 > nTempSize2) - aUpRect.Top()++; + aUpRect.AdjustTop( 1 ); else - aLowRect.Top()++; + aLowRect.AdjustTop( 1 ); } const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); @@ -618,9 +618,9 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, tool long nW = rStyleSettings.GetScrollBarSize(); nW = GetDrawPixel( pDev, nW ); aDropDownSize = Size( CalcZoom( nW ), aSize.Height() ); - aSize.Width() -= aDropDownSize.Width(); + aSize.AdjustWidth( -(aDropDownSize.Width()) ); rDDArea = tools::Rectangle( Point( aSize.Width(), 0 ), aDropDownSize ); - rDDArea.Top()--; + rDDArea.AdjustTop( -1 ); } else rDDArea.SetEmpty(); @@ -675,7 +675,7 @@ void SpinField::ImplCalcButtonAreas(OutputDevice* pDev, const Size& rOutSz, tool } else { - aSize.Width() -= CalcZoom( GetDrawPixel( pDev, rStyleSettings.GetSpinSize() ) ); + aSize.AdjustWidth( -(CalcZoom( GetDrawPixel( pDev, rStyleSettings.GetSpinSize() ) )) ); rSpinUpArea = tools::Rectangle( aSize.Width(), 0, rOutSz.Width()-aDropDownSize.Width()-1, nBottom1 ); rSpinDownArea = tools::Rectangle( rSpinUpArea.Left(), nTop2, rSpinUpArea.Right(), nBottom2 ); @@ -728,10 +728,10 @@ void SpinField::Resize() if (maUpperRect.IsEmpty()) { SAL_WARN_IF( maDropDownRect.IsEmpty(), "vcl", "SpinField::Resize: SPIN && DROPDOWN, but all empty rects?" ); - aSize.Width() = maDropDownRect.Left(); + aSize.setWidth( maDropDownRect.Left() ); } else - aSize.Width() = maUpperRect.Left(); + aSize.setWidth( maUpperRect.Left() ); } } @@ -894,7 +894,7 @@ Size SpinField::CalcMinimumSizeForText(const OUString &rString) const Size aSz = Edit::CalcMinimumSizeForText(rString); if ( GetStyle() & WB_DROPDOWN ) - aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() ); if ( GetStyle() & WB_SPIN ) { ImplControlValue aControlValue; @@ -907,11 +907,11 @@ Size SpinField::CalcMinimumSizeForText(const OUString &rString) const aArea, ControlState::NONE, aControlValue, aEditBound, aEditContent) ) { - aSz.Width() += (aEntireContent.GetWidth() - aEditContent.GetWidth()); + aSz.AdjustWidth(aEntireContent.GetWidth() - aEditContent.GetWidth()); } else { - aSz.Width() += maUpperRect.GetWidth(); + aSz.AdjustWidth(maUpperRect.GetWidth() ); } } @@ -933,9 +933,9 @@ Size SpinField::CalcSize(sal_Int32 nChars) const Size aSz = Edit::CalcSize( nChars ); if ( GetStyle() & WB_DROPDOWN ) - aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize(); + aSz.AdjustWidth(GetSettings().GetStyleSettings().GetScrollBarSize() ); if ( GetStyle() & WB_SPIN ) - aSz.Width() += GetSettings().GetStyleSettings().GetSpinSize(); + aSz.AdjustWidth(GetSettings().GetStyleSettings().GetSpinSize() ); return aSz; } @@ -986,7 +986,7 @@ void SpinField::Draw(OutputDevice* pDev, const Point& rPos, const Size& rSize, D ImplCalcButtonAreas(pDev, aSize, aDD, aUp, aDown); aDD.Move(aPos.X(), aPos.Y()); aUp.Move(aPos.X(), aPos.Y()); - aUp.Top()++; + aUp.AdjustTop( 1 ); aDown.Move(aPos.X(), aPos.Y()); Color aButtonTextColor; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 507ebc132571..7f216b4b6555 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -223,14 +223,14 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) { aImageSize = pItem->maTabImage.GetSizePixel(); if( !pItem->maFormatText.isEmpty() ) - aImageSize.Width() += GetTextHeight()/4; + aImageSize.AdjustWidth(GetTextHeight()/4 ); } - aSize.Width() += aImageSize.Width(); + aSize.AdjustWidth(aImageSize.Width() ); if( aImageSize.Height() > aSize.Height() ) - aSize.Height() = aImageSize.Height(); + aSize.setHeight( aImageSize.Height() ); - aSize.Width() += TAB_TABOFFSET_X*2; - aSize.Height() += TAB_TABOFFSET_Y*2; + aSize.AdjustWidth(TAB_TABOFFSET_X*2 ); + aSize.AdjustHeight(TAB_TABOFFSET_Y*2 ); tools::Rectangle aCtrlRegion( Point( 0, 0 ), aSize ); tools::Rectangle aBoundingRgn, aContentRgn; @@ -247,7 +247,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) // For languages with short names (e.g. Chinese), because the space is // normally only one pixel per char if ( pItem->maFormatText.getLength() < TAB_EXTRASPACE_X ) - aSize.Width() += TAB_EXTRASPACE_X-pItem->maFormatText.getLength(); + aSize.AdjustWidth(TAB_EXTRASPACE_X-pItem->maFormatText.getLength() ); // shorten Text if needed if ( aSize.Width()+4 >= nMaxWidth ) @@ -257,22 +257,22 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) do { pItem->maFormatText = pItem->maFormatText.replaceAt( pItem->maFormatText.getLength()-aAppendStr.getLength()-1, 1, "" ); - aSize.Width() = GetCtrlTextWidth( pItem->maFormatText ); - aSize.Width() += aImageSize.Width(); - aSize.Width() += TAB_TABOFFSET_X*2; + aSize.setWidth( GetCtrlTextWidth( pItem->maFormatText ) ); + aSize.AdjustWidth(aImageSize.Width() ); + aSize.AdjustWidth(TAB_TABOFFSET_X*2 ); } while ( (aSize.Width()+4 >= nMaxWidth) && (pItem->maFormatText.getLength() > aAppendStr.getLength()) ); if ( aSize.Width()+4 >= nMaxWidth ) { pItem->maFormatText = "."; - aSize.Width() = 1; + aSize.setWidth( 1 ); } } if( pItem->maFormatText.isEmpty() ) { if( aSize.Height() < aImageSize.Height()+4 ) //leave space for focus rect - aSize.Height() = aImageSize.Height()+4; + aSize.setHeight( aImageSize.Height()+4 ); } return aSize; @@ -484,16 +484,16 @@ bool TabControl::ImplPlaceTabs( long nWidth ) n++; } - item.maRect.Left() += nIDX; - item.maRect.Right() += nIDX + nDX; - item.maRect.Top() = nLineHeightAry[n-1]; - item.maRect.Bottom() = nLineHeightAry[n-1] + nIH; + item.maRect.AdjustLeft(nIDX ); + item.maRect.AdjustRight(nIDX + nDX ); + item.maRect.SetTop( nLineHeightAry[n-1] ); + item.maRect.SetBottom( nLineHeightAry[n-1] + nIH ); nIDX += nDX; if ( nModDX ) { nIDX++; - item.maRect.Right()++; + item.maRect.AdjustRight( 1 ); nModDX--; } @@ -511,8 +511,8 @@ bool TabControl::ImplPlaceTabs( long nWidth ) } for (auto & item : mpTabCtrlData->maItemList) { - item.maRect.Left() += nRightSpace / 2; - item.maRect.Right() += nRightSpace / 2; + item.maRect.AdjustLeft(nRightSpace / 2 ); + item.maRect.AdjustRight(nRightSpace / 2 ); } } } @@ -594,21 +594,21 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) if ( !pOldItem || !pItem || (pOldItem->mnLine != pItem->mnLine) ) { - aRect.Left() = 0; - aRect.Top() = 0; - aRect.Right() = Control::GetOutputSizePixel().Width(); + aRect.SetLeft( 0 ); + aRect.SetTop( 0 ); + aRect.SetRight( Control::GetOutputSizePixel().Width() ); } else { - aRect.Left() -= 3; - aRect.Top() -= 2; - aRect.Right() += 3; + aRect.AdjustLeft( -3 ); + aRect.AdjustTop( -2 ); + aRect.AdjustRight(3 ); Invalidate( aRect ); nPos = GetPagePos( nOldId ); aRect = ImplGetTabRect( nPos ); - aRect.Left() -= 3; - aRect.Top() -= 2; - aRect.Right() += 3; + aRect.AdjustLeft( -3 ); + aRect.AdjustTop( -2 ); + aRect.AdjustRight(3 ); } Invalidate( aRect ); } @@ -664,10 +664,10 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) // see Window::DrawNativeControl() if( IsNativeControlSupported( ControlType::TabPane, ControlPart::Entire ) ) { - aRect.Left() -= TAB_OFFSET; - aRect.Top() -= TAB_OFFSET; - aRect.Right() += TAB_OFFSET; - aRect.Bottom() += TAB_OFFSET; + aRect.AdjustLeft( -(TAB_OFFSET) ); + aRect.AdjustTop( -(TAB_OFFSET) ); + aRect.AdjustRight(TAB_OFFSET ); + aRect.AdjustBottom(TAB_OFFSET ); } Invalidate( aRect ); @@ -733,16 +733,16 @@ void TabControl::ImplShowFocus() { aImageSize = rItem.maTabImage.GetSizePixel(); if( !rItem.maFormatText.isEmpty() ) - aImageSize.Width() += GetTextHeight()/4; + aImageSize.AdjustWidth(GetTextHeight()/4 ); } if( !rItem.maFormatText.isEmpty() ) { // show focus around text - aRect.Left() = aRect.Left()+aImageSize.Width()+((aTabSize.Width()-nTextWidth-aImageSize.Width())/2)-nOff-1-1; - aRect.Top() = aRect.Top()+((aTabSize.Height()-nTextHeight)/2)-1-1; - aRect.Right() = aRect.Left()+nTextWidth+2; - aRect.Bottom() = aRect.Top()+nTextHeight+2; + aRect.SetLeft( aRect.Left()+aImageSize.Width()+((aTabSize.Width()-nTextWidth-aImageSize.Width())/2)-nOff-1-1 ); + aRect.SetTop( aRect.Top()+((aTabSize.Height()-nTextHeight)/2)-1-1 ); + aRect.SetRight( aRect.Left()+nTextWidth+2 ); + aRect.SetBottom( aRect.Top()+nTextHeight+2 ); } else { @@ -752,10 +752,10 @@ void TabControl::ImplShowFocus() if( aImageSize.Height() < aRect.GetHeight() ) nYPos += (aRect.GetHeight() - aImageSize.Height())/2; - aRect.Left() = nXPos - 2; - aRect.Top() = nYPos - 2; - aRect.Right() = aRect.Left() + aImageSize.Width() + 4; - aRect.Bottom() = aRect.Top() + aImageSize.Height() + 4; + aRect.SetLeft( nXPos - 2 ); + aRect.SetTop( nYPos - 2 ); + aRect.SetRight( aRect.Left() + aImageSize.Width() + 4 ); + aRect.SetBottom( aRect.Top() + aImageSize.Height() + 4 ); } ShowFocus( aRect ); } @@ -796,10 +796,10 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p Point aRightTestPos = aRect.BottomRight(); if (aLeftTestPos.Y() == rCurRect.Bottom()) { - aLeftTestPos.X() -= 2; + aLeftTestPos.AdjustX( -2 ); if (rCurRect.IsInside(aLeftTestPos)) bLeftBorder = false; - aRightTestPos.X() += 2; + aRightTestPos.AdjustX(2 ); if (rCurRect.IsInside(aRightTestPos)) bRightBorder = false; } @@ -916,7 +916,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p { aImageSize = pItem->maTabImage.GetSizePixel(); if (!pItem->maFormatText.isEmpty()) - aImageSize.Width() += GetTextHeight() / 4; + aImageSize.AdjustWidth(GetTextHeight() / 4 ); } long nXPos = aRect.Left() + ((aTabSize.Width() - nTextWidth - aImageSize.Width()) / 2) - nOff - nOff3; long nYPos = aRect.Top() + ((aTabSize.Height() - nTextHeight) / 2) - nOff3; @@ -947,7 +947,7 @@ void TabControl::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplTabItem* p { Point aImgTL( nXPos, aRect.Top() ); if (aImageSize.Height() < aRect.GetHeight()) - aImgTL.Y() += (aRect.GetHeight() - aImageSize.Height()) / 2; + aImgTL.AdjustY((aRect.GetHeight() - aImageSize.Height()) / 2 ); rRenderContext.DrawImage(aImgTL, pItem->maTabImage, pItem->mbEnabled ? DrawImageFlags::NONE : DrawImageFlags::Disable ); } } @@ -1063,10 +1063,10 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const tools::Rect // Draw the TabPage border const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); tools::Rectangle aCurRect; - aRect.Left() -= TAB_OFFSET; - aRect.Top() -= TAB_OFFSET; - aRect.Right() += TAB_OFFSET; - aRect.Bottom() += TAB_OFFSET; + aRect.AdjustLeft( -(TAB_OFFSET) ); + aRect.AdjustTop( -(TAB_OFFSET) ); + aRect.AdjustRight(TAB_OFFSET ); + aRect.AdjustBottom(TAB_OFFSET ); // if we have an invisible tabpage or no tabpage at all the tabpage rect should be // increased to avoid round corners that might be drawn by a theme @@ -1077,8 +1077,8 @@ void TabControl::ImplPaint(vcl::RenderContext& rRenderContext, const tools::Rect if (!pCurPage || !pCurPage->IsVisible()) { bNoTabPage = true; - aRect.Left() -= 10; - aRect.Right() += 10; + aRect.AdjustLeft( -10 ); + aRect.AdjustRight(10 ); } if (rRenderContext.IsNativeControlSupported(ControlType::TabPane, ControlPart::Entire)) @@ -1274,10 +1274,10 @@ void TabControl::setAllocation(const Size &rAllocation) if ( mbSmallInvalidate ) { tools::Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); - aRect.Left() -= TAB_OFFSET+TAB_BORDER_LEFT; - aRect.Top() -= TAB_OFFSET+TAB_BORDER_TOP; - aRect.Right() += TAB_OFFSET+TAB_BORDER_RIGHT; - aRect.Bottom() += TAB_OFFSET+TAB_BORDER_BOTTOM; + aRect.AdjustLeft( -(TAB_OFFSET+TAB_BORDER_LEFT) ); + aRect.AdjustTop( -(TAB_OFFSET+TAB_BORDER_TOP) ); + aRect.AdjustRight(TAB_OFFSET+TAB_BORDER_RIGHT ); + aRect.AdjustBottom(TAB_OFFSET+TAB_BORDER_BOTTOM ); if ( bTabPage ) Invalidate( aRect, InvalidateFlags::NoChildren ); else @@ -1358,11 +1358,11 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) { tools::Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr ); return; } @@ -1389,11 +1389,11 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) { tools::Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); if ( !rStr.isEmpty() ) { if ( rHEvt.GetMode() & HelpEventMode::BALLOON ) @@ -1414,11 +1414,11 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) { tools::Rectangle aItemRect = ImplGetTabRect( GetPagePos( nItemId ) ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); Help::ShowQuickHelp( this, aItemRect, rHelpText ); return; } @@ -1552,9 +1552,9 @@ bool TabControl::PreNotify( NotifyEvent& rNEvt ) // as used by gtk // TODO: query for the correct sizes tools::Rectangle aRect(*pLastRect); - aRect.Left()-=2; - aRect.Right()+=2; - aRect.Top()-=3; + aRect.AdjustLeft( -2 ); + aRect.AdjustRight(2 ); + aRect.AdjustTop( -3 ); aClipRgn.Union( aRect ); } if( pRect ) @@ -1563,9 +1563,9 @@ bool TabControl::PreNotify( NotifyEvent& rNEvt ) // as used by gtk // TODO: query for the correct sizes tools::Rectangle aRect(*pRect); - aRect.Left()-=2; - aRect.Right()+=2; - aRect.Top()-=3; + aRect.AdjustLeft( -2 ); + aRect.AdjustRight(2 ); + aRect.AdjustTop( -3 ); aClipRgn.Union( aRect ); } if( !aClipRgn.IsEmpty() ) @@ -1603,10 +1603,10 @@ void TabControl::SetTabPageSizePixel( const Size& rSize ) ImplFreeLayoutData(); Size aNewSize( rSize ); - aNewSize.Width() += TAB_OFFSET*2; + aNewSize.AdjustWidth(TAB_OFFSET*2 ); tools::Rectangle aRect = ImplGetTabRect( TAB_PAGERECT, aNewSize.Width(), aNewSize.Height() ); - aNewSize.Height() += aRect.Top()+TAB_OFFSET; + aNewSize.AdjustHeight(aRect.Top()+TAB_OFFSET ); Window::SetOutputSizePixel( aNewSize ); } @@ -2121,9 +2121,9 @@ Size TabControl::calculateRequisition() const Size aPageSize(VclContainer::getLayoutRequisition(*pPage)); if (aPageSize.Width() > aOptimalPageSize.Width()) - aOptimalPageSize.Width() = aPageSize.Width(); + aOptimalPageSize.setWidth( aPageSize.Width() ); if (aPageSize.Height() > aOptimalPageSize.Height()) - aOptimalPageSize.Height() = aPageSize.Height(); + aOptimalPageSize.setHeight( aPageSize.Height() ); } //fdo#61940 If we were forced to activate pages in order to on-demand @@ -2150,11 +2150,11 @@ Size TabControl::calculateRequisition() const } Size aOptimalSize(aOptimalPageSize); - aOptimalSize.Height() += nTabLabelsBottom; - aOptimalSize.Width() = std::max(nTabLabelsRight, aOptimalSize.Width()); + aOptimalSize.AdjustHeight(nTabLabelsBottom ); + aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) ); - aOptimalSize.Width() += TAB_OFFSET * 2; - aOptimalSize.Height() += TAB_OFFSET * 2; + aOptimalSize.AdjustWidth(TAB_OFFSET * 2 ); + aOptimalSize.AdjustHeight(TAB_OFFSET * 2 ); return aOptimalSize; } @@ -2391,10 +2391,10 @@ bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) // set minimum tab size if( nFullWidth < nMaxWidth && !item.maText.isEmpty() && aSize.getWidth() < 100) - aSize.Width() = 100; + aSize.setWidth( 100 ); if( !item.maText.isEmpty() && aSize.getHeight() < 28 ) - aSize.Height() = 28; + aSize.setHeight( 28 ); tools::Rectangle aNewRect( Point( nX, nY ), aSize ); if ( mbSmallInvalidate && (item.maRect != aNewRect) ) @@ -2418,8 +2418,8 @@ bool NotebookbarTabControlBase::ImplPlaceTabs( long nWidth ) } for (auto & item : mpTabCtrlData->maItemList) { - item.maRect.Left() += nRightSpace / 2; - item.maRect.Right() += nRightSpace / 2; + item.maRect.AdjustLeft(nRightSpace / 2 ); + item.maRect.AdjustRight(nRightSpace / 2 ); } } @@ -2453,10 +2453,10 @@ void NotebookbarTabControlBase::ImplPaint(vcl::RenderContext& rRenderContext, co // Draw the TabPage border const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings(); tools::Rectangle aCurRect; - aRect.Left() -= TAB_OFFSET; - aRect.Top() -= TAB_OFFSET; - aRect.Right() += TAB_OFFSET; - aRect.Bottom() += TAB_OFFSET; + aRect.AdjustLeft( -(TAB_OFFSET) ); + aRect.AdjustTop( -(TAB_OFFSET) ); + aRect.AdjustRight(TAB_OFFSET ); + aRect.AdjustBottom(TAB_OFFSET ); // if we have an invisible tabpage or no tabpage at all the tabpage rect should be // increased to avoid round corners that might be drawn by a theme @@ -2467,8 +2467,8 @@ void NotebookbarTabControlBase::ImplPaint(vcl::RenderContext& rRenderContext, co if (!pCurPage || !pCurPage->IsVisible()) { bNoTabPage = true; - aRect.Left() -= 10; - aRect.Right() += 10; + aRect.AdjustLeft( -10 ); + aRect.AdjustRight(10 ); } if (rRenderContext.IsNativeControlSupported(ControlType::TabPane, ControlPart::Entire)) @@ -2650,9 +2650,9 @@ Size NotebookbarTabControlBase::calculateRequisition() const Size aPageSize(VclContainer::getLayoutRequisition(*pPage)); if (aPageSize.Width() > aOptimalPageSize.Width()) - aOptimalPageSize.Width() = aPageSize.Width(); + aOptimalPageSize.setWidth( aPageSize.Width() ); if (aPageSize.Height() > aOptimalPageSize.Height()) - aOptimalPageSize.Height() = aPageSize.Height(); + aOptimalPageSize.setHeight( aPageSize.Height() ); } //fdo#61940 If we were forced to activate pages in order to on-demand @@ -2682,11 +2682,11 @@ Size NotebookbarTabControlBase::calculateRequisition() const } Size aOptimalSize(aOptimalPageSize); - aOptimalSize.Height() += nTabLabelsBottom; - aOptimalSize.Width() = std::max(nTabLabelsRight, aOptimalSize.Width()); + aOptimalSize.AdjustHeight(nTabLabelsBottom ); + aOptimalSize.setWidth( std::max(nTabLabelsRight, aOptimalSize.Width()) ); - aOptimalSize.Width() += TAB_OFFSET * 2; - aOptimalSize.Height() += TAB_OFFSET * 2; + aOptimalSize.AdjustWidth(TAB_OFFSET * 2 ); + aOptimalSize.AdjustHeight(TAB_OFFSET * 2 ); return aOptimalSize; } 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 ); } diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 340308c83073..ebf885537f2b 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1959,8 +1959,8 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r if (nMaxMem<nNeededMem) { double fFak=sqrt(static_cast<double>(nMaxMem)/static_cast<double>(nNeededMem)); - aSizePixel.Width()=static_cast<sal_uLong>(static_cast<double>(aSizePixel.Width())*fFak); - aSizePixel.Height()=static_cast<sal_uLong>(static_cast<double>(aSizePixel.Height())*fFak); + aSizePixel.setWidth(static_cast<sal_uLong>(static_cast<double>(aSizePixel.Width())*fFak) ); + aSizePixel.setHeight(static_cast<sal_uLong>(static_cast<double>(aSizePixel.Height())*fFak) ); } aVirDev->SetMapMode(MapMode(MapUnit::MapPixel)); diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index 84bb1fe59194..f35ac1c37c81 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -130,11 +130,11 @@ bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, bool bExtendedInfo ) // Pixel width rStm.ReadUInt32( nTemp32 ); - aPixSize.Width() = nTemp32; + aPixSize.setWidth( nTemp32 ); // Pixel height rStm.ReadUInt32( nTemp32 ); - aPixSize.Height() = nTemp32; + aPixSize.setHeight( nTemp32 ); // Planes rStm.ReadUInt16( nTemp16 ); @@ -152,12 +152,12 @@ bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, bool bExtendedInfo ) rStm.SeekRel( 4 ); rStm.ReadUInt32( nTemp32 ); if ( nTemp32 ) - aLogSize.Width() = ( aPixSize.Width() * 100000 ) / nTemp32; + aLogSize.setWidth( ( aPixSize.Width() * 100000 ) / nTemp32 ); // logical height rStm.ReadUInt32( nTemp32 ); if ( nTemp32 ) - aLogSize.Height() = ( aPixSize.Height() * 100000 ) / nTemp32; + aLogSize.setHeight( ( aPixSize.Height() * 100000 ) / nTemp32 ); // further validation, check for rational values if ( ( nBitsPerPixel > 24 ) || ( nCompression > 3 ) ) @@ -196,11 +196,11 @@ bool GraphicDescriptor::ImpDetectGIF( SvStream& rStm, bool bExtendedInfo ) // Pixel width rStm.ReadUInt16( nTemp16 ); - aPixSize.Width() = nTemp16; + aPixSize.setWidth( nTemp16 ); // Pixel height rStm.ReadUInt16( nTemp16 ); - aPixSize.Height() = nTemp16; + aPixSize.setHeight( nTemp16 ); // Bits/Pixel rStm.ReadUChar( cByte ); @@ -375,8 +375,8 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) // nSamplingFactor (lower nibble: vertical, // upper nibble: horizontal) is unused - aPixSize.Height() = nNumberOfLines; - aPixSize.Width() = nSamplesPerLine; + aPixSize.setHeight( nNumberOfLines ); + aPixSize.setWidth( nSamplesPerLine ); nBitsPerPixel = ( nNumberOfImageComponents == 3 ? 24 : nNumberOfImageComponents == 1 ? 8 : 0 ); nPlanes = 1; @@ -476,8 +476,8 @@ bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, bool bExtendedInfo ) rStm.ReadUInt16( nTemp16 ); nYmax = nTemp16; - aPixSize.Width() = nXmax - nXmin + 1; - aPixSize.Height() = nYmax - nYmin + 1; + aPixSize.setWidth( nXmax - nXmin + 1 ); + aPixSize.setHeight( nYmax - nYmin + 1 ); // resolution rStm.ReadUInt16( nTemp16 ); @@ -532,11 +532,11 @@ bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, bool bExtendedInfo ) // width rStm.ReadUInt32( nTemp32 ); - aPixSize.Width() = nTemp32; + aPixSize.setWidth( nTemp32 ); // height rStm.ReadUInt32( nTemp32 ); - aPixSize.Height() = nTemp32; + aPixSize.setHeight( nTemp32 ); // Bits/Pixel rStm.ReadUChar( cByte ); @@ -584,10 +584,10 @@ bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, bool bExtendedInfo ) if ( cByte ) { if ( nXRes ) - aLogSize.Width() = (aPixSize.Width() * 100000) / nXRes; + aLogSize.setWidth( (aPixSize.Width() * 100000) / nXRes ); if ( nYRes ) - aLogSize.Height() = (aPixSize.Height() * 100000) / nYRes; + aLogSize.setHeight( (aPixSize.Height() * 100000) / nYRes ); } } } @@ -668,13 +668,13 @@ bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, bool bExtendedInfo ) if ( nTemp16 == 3 ) { rStm.ReadUInt16( nTemp16 ); - aPixSize.Width() = nTemp16; + aPixSize.setWidth( nTemp16 ); rStm.SeekRel( 2 ); } else { rStm.ReadUInt32( nTemp32 ); - aPixSize.Width() = nTemp32; + aPixSize.setWidth( nTemp32 ); } // height @@ -684,13 +684,13 @@ bool GraphicDescriptor::ImpDetectTIF( SvStream& rStm, bool bExtendedInfo ) if ( nTemp16 == 3 ) { rStm.ReadUInt16( nTemp16 ); - aPixSize.Height() = nTemp16; + aPixSize.setHeight( nTemp16 ); rStm.SeekRel( 2 ); } else { rStm.ReadUInt32( nTemp32 ); - aPixSize.Height() = nTemp32; + aPixSize.setHeight( nTemp32 ); } // Bits/Pixel @@ -870,8 +870,8 @@ bool GraphicDescriptor::ImpDetectPSD( SvStream& rStm, bool bExtendedInfo ) SAL_FALLTHROUGH; case 2 : case 1 : - aPixSize.Width() = nColumns; - aPixSize.Height() = nRows; + aPixSize.setWidth( nColumns ); + aPixSize.setHeight( nRows ); break; default: bRet = false; @@ -980,12 +980,12 @@ bool GraphicDescriptor::ImpDetectSVM( SvStream& rStm, bool bExtendedInfo ) // width nTemp32 = 0; rStm.ReadUInt32( nTemp32 ); - aLogSize.Width() = nTemp32; + aLogSize.setWidth( nTemp32 ); // height nTemp32 = 0; rStm.ReadUInt32( nTemp32 ); - aLogSize.Height() = nTemp32; + aLogSize.setHeight( nTemp32 ); // read MapUnit and determine PrefSize nTemp16 = 0; diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index a624b7156703..ed02add407cc 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -1187,8 +1187,8 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf ) if( fScaleX != 1.0 || fScaleY != 1.0 ) { aTmpMtf.Scale( fScaleX, fScaleY ); - aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ); - aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY ); + aSrcPt.setX( FRound( aSrcPt.X() * fScaleX ) ); + aSrcPt.setY( FRound( aSrcPt.Y() * fScaleY ) ); } nMoveX = aDestPt.X() - aSrcPt.X(); diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index c50c5da5084b..bd828180c525 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -1421,7 +1421,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) else aX += BigInt( aScaleX.GetNumerator()/2 ); aX /= BigInt( aScaleX.GetNumerator() ); - aOrigin.X() = static_cast<long>(aX) + aMM.GetOrigin().X(); + aOrigin.setX( static_cast<long>(aX) + aMM.GetOrigin().X() ); BigInt aY( aOrigin.Y() ); aY *= BigInt( aScaleY.GetDenominator() ); if( aOrigin.Y() >= 0 ) @@ -1435,7 +1435,7 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) else aY += BigInt( aScaleY.GetNumerator()/2 ); aY /= BigInt( aScaleY.GetNumerator() ); - aOrigin.Y() = static_cast<long>(aY) + aMM.GetOrigin().Y(); + aOrigin.setY( static_cast<long>(aY) + aMM.GetOrigin().Y() ); aSrcMapMode.SetOrigin( aOrigin ); aScaleX *= aSrcMapMode.GetScaleX(); @@ -1581,8 +1581,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF ) if( fScaleX != 1.0 || fScaleY != 1.0 ) { aTmpMtf.Scale( fScaleX, fScaleY ); - aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ); - aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY ); + aSrcPt.setX( FRound( aSrcPt.X() * fScaleX ) ); + aSrcPt.setY( FRound( aSrcPt.Y() * fScaleY ) ); } nMoveX = aDestPt.X() - aSrcPt.X(); @@ -1716,8 +1716,8 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, aTargetMapMode = aSrcMapMode; aTargetSize = rMTF.GetPrefSize(); sal_uInt16 nTargetDivisor = CalcSaveTargetMapMode(aTargetMapMode, aTargetSize); - aTargetSize.Width() /= nTargetDivisor; - aTargetSize.Height() /= nTargetDivisor; + aTargetSize.setWidth( aTargetSize.Width() / nTargetDivisor ); + aTargetSize.setHeight( aTargetSize.Height() / nTargetDivisor ); } else { diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index a8d57af26bf1..fe557ac9c78b 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -759,7 +759,7 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs) nAdvance, nXOffset); AppendGlyph(aGI); - aCurrPos.X() += nAdvance; + aCurrPos.AdjustX(nAdvance ); } } } @@ -859,10 +859,10 @@ void CommonSalLayout::ApplyDXArray(ImplLayoutArgs& rArgs) { if (m_GlyphItems[j].mnCharPos != m_GlyphItems[i].mnCharPos) break; - m_GlyphItems[j].maLinearPos.X() += nDelta; + m_GlyphItems[j].maLinearPos.AdjustX(nDelta ); // For RTL, put all DX adjustment space to the left of the glyph. if (m_GlyphItems[i].IsRTLGlyph()) - m_GlyphItems[j].maLinearPos.X() += nDiff; + m_GlyphItems[j].maLinearPos.AdjustX(nDiff ); ++j; } @@ -880,7 +880,7 @@ void CommonSalLayout::ApplyDXArray(ImplLayoutArgs& rArgs) auto pGlyph = m_GlyphItems.begin() + i - 1; while (pGlyph != m_GlyphItems.begin() && pGlyph->IsDiacritic()) { - pGlyph->maLinearPos.X() += nDiff; + pGlyph->maLinearPos.AdjustX(nDiff ); --pGlyph; } } @@ -930,8 +930,8 @@ void CommonSalLayout::ApplyDXArray(ImplLayoutArgs& rArgs) { GlyphItem aKashida(nCharPos, nKashidaIndex, aPos, nFlags, nKashidaWidth); pGlyphIter = m_GlyphItems.insert(pGlyphIter, aKashida); - aPos.X() += nKashidaWidth; - aPos.X() -= nOverlap; + aPos.AdjustX(nKashidaWidth ); + aPos.AdjustX( -nOverlap ); ++pGlyphIter; ++nInserted; } diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 7898fda187b4..6e1102a5ac49 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -581,10 +581,10 @@ void Animation::Mirror( BmpMirrorFlags nMirrorFlags ) if( bRet ) { if( nMirrorFlags & BmpMirrorFlags::Horizontal ) - pStepBmp->aPosPix.X() = maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width(); + pStepBmp->aPosPix.setX( maGlobalSize.Width() - pStepBmp->aPosPix.X() - pStepBmp->aSizePix.Width() ); if( nMirrorFlags & BmpMirrorFlags::Vertical ) - pStepBmp->aPosPix.Y() = maGlobalSize.Height() - pStepBmp->aPosPix.Y() - pStepBmp->aSizePix.Height(); + pStepBmp->aPosPix.setY( maGlobalSize.Height() - pStepBmp->aPosPix.Y() - pStepBmp->aSizePix.Height() ); } } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index cd28ea2c0a23..8ca224a1c789 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -315,8 +315,8 @@ void Bitmap::ImplAssignWithSize( const Bitmap& rBitmap ) if( ( aOldSizePix != aNewSizePix ) && aOldSizePix.Width() && aOldSizePix.Height() ) { - aNewPrefSize.Width() = FRound( maPrefSize.Width() * aNewSizePix.Width() / aOldSizePix.Width() ); - aNewPrefSize.Height() = FRound( maPrefSize.Height() * aNewSizePix.Height() / aOldSizePix.Height() ); + aNewPrefSize.setWidth( FRound( maPrefSize.Width() * aNewSizePix.Width() / aOldSizePix.Width() ) ); + aNewPrefSize.setHeight( FRound( maPrefSize.Height() * aNewSizePix.Height() / aOldSizePix.Height() ) ); } else aNewPrefSize = maPrefSize; @@ -1457,13 +1457,13 @@ vcl::Region Bitmap::CreateRegion( const Color& rColor, const tools::Rectangle& r tools::Rectangle aSubRect; // enter y values and proceed ystart - aSubRect.Top() = nYStart; - aSubRect.Bottom() = nY ? nY - 1 : 0; + aSubRect.SetTop( nYStart ); + aSubRect.SetBottom( nY ? nY - 1 : 0 ); for(size_t a(0); a < aLine.size();) { - aSubRect.Left() = aLine[a++]; - aSubRect.Right() = aLine[a++]; + aSubRect.SetLeft( aLine[a++] ); + aSubRect.SetRight( aLine[a++] ); aRegion.Union(aSubRect); } } @@ -1480,13 +1480,13 @@ vcl::Region Bitmap::CreateRegion( const Color& rColor, const tools::Rectangle& r tools::Rectangle aSubRect; // enter y values - aSubRect.Top() = nYStart; - aSubRect.Bottom() = nY ? nY - 1 : 0; + aSubRect.SetTop( nYStart ); + aSubRect.SetBottom( nY ? nY - 1 : 0 ); for(size_t a(0); a < aLine.size();) { - aSubRect.Left() = aLine[a++]; - aSubRect.Right() = aLine[a++]; + aSubRect.SetLeft( aLine[a++] ); + aSubRect.SetRight( aLine[a++] ); aRegion.Union(aSubRect); } } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index b754df4e2c6e..eb73aa2b6349 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -460,10 +460,10 @@ void GDIMetaFile::Play( OutputDevice* pOut, const Point& rPos, Size aTmpPrefSize( pOut->LogicToPixel( GetPrefSize(), aDrawMap ) ); if( !aTmpPrefSize.Width() ) - aTmpPrefSize.Width() = aDestSize.Width(); + aTmpPrefSize.setWidth( aDestSize.Width() ); if( !aTmpPrefSize.Height() ) - aTmpPrefSize.Height() = aDestSize.Height(); + aTmpPrefSize.setHeight( aDestSize.Height() ); Fraction aScaleX( aDestSize.Width(), aTmpPrefSize.Width() ); Fraction aScaleY( aDestSize.Height(), aTmpPrefSize.Height() ); @@ -690,8 +690,8 @@ void GDIMetaFile::Move( long nX, long nY, long nDPIX, long nDPIY ) { aOffset = aMapVDev->LogicToPixel( aBaseOffset, GetPrefMapMode() ); MapMode aMap( aMapVDev->GetMapMode() ); - aOffset.Width() = static_cast<long>(aOffset.Width() * static_cast<double>(aMap.GetScaleX())); - aOffset.Height() = static_cast<long>(aOffset.Height() * static_cast<double>(aMap.GetScaleY())); + aOffset.setWidth( static_cast<long>(aOffset.Width() * static_cast<double>(aMap.GetScaleX())) ); + aOffset.setHeight( static_cast<long>(aOffset.Height() * static_cast<double>(aMap.GetScaleY())) ); } else aOffset = OutputDevice::LogicToLogic( aBaseOffset, GetPrefMapMode(), aMapVDev->GetMapMode() ); @@ -718,8 +718,8 @@ void GDIMetaFile::Scale( double fScaleX, double fScaleY ) pModAct->Scale( fScaleX, fScaleY ); } - m_aPrefSize.Width() = FRound( m_aPrefSize.Width() * fScaleX ); - m_aPrefSize.Height() = FRound( m_aPrefSize.Height() * fScaleY ); + m_aPrefSize.setWidth( FRound( m_aPrefSize.Width() * fScaleX ) ); + m_aPrefSize.setHeight( FRound( m_aPrefSize.Height() * fScaleY ) ); } void GDIMetaFile::Scale( const Fraction& rScaleX, const Fraction& rScaleY ) @@ -1498,7 +1498,7 @@ tools::Rectangle GDIMetaFile::GetBoundRect( OutputDevice& i_rReference, tools::R aMapVDev->GetTextBoundRect( aRect, aStr, 0, 0, aStr.getLength() ); Point aPt( pAct->GetStartPoint() ); aRect.Move( aPt.X(), aPt.Y() ); - aRect.Right() = aRect.Left() + pAct->GetWidth(); + aRect.SetRight( aRect.Left() + pAct->GetWidth() ); ImplActionBounds( aBound, OutputDevice::LogicToLogic( aRect, aMapVDev->GetMapMode(), GetPrefMapMode() ), aClipStack, nullptr ); } break; @@ -2806,17 +2806,17 @@ bool GDIMetaFile::CreateThumbnail(BitmapEx& rBitmapEx, BmpConversion eColorConve if ( fWH <= 1.0 ) { - aSizePix.Width() = FRound( nMaximumExtent * fWH ); - aSizePix.Height() = nMaximumExtent; + aSizePix.setWidth( FRound( nMaximumExtent * fWH ) ); + aSizePix.setHeight( nMaximumExtent ); } else { - aSizePix.Width() = nMaximumExtent; - aSizePix.Height() = FRound( nMaximumExtent / fWH ); + aSizePix.setWidth( nMaximumExtent ); + aSizePix.setHeight( FRound( nMaximumExtent / fWH ) ); } - aDrawSize.Width() = FRound( ( static_cast< double >( aDrawSize.Width() ) * aSizePix.Width() ) / aOldSizePix.Width() ); - aDrawSize.Height() = FRound( ( static_cast< double >( aDrawSize.Height() ) * aSizePix.Height() ) / aOldSizePix.Height() ); + aDrawSize.setWidth( FRound( ( static_cast< double >( aDrawSize.Width() ) * aSizePix.Width() ) / aOldSizePix.Width() ) ); + aDrawSize.setHeight( FRound( ( static_cast< double >( aDrawSize.Height() ) * aSizePix.Height() ) / aOldSizePix.Height() ) ); } // draw image(s) into VDev and get resulting image diff --git a/vcl/source/gdi/gradient.cxx b/vcl/source/gdi/gradient.cxx index dc08091295e7..c9552bb875d9 100644 --- a/vcl/source/gdi/gradient.cxx +++ b/vcl/source/gdi/gradient.cxx @@ -158,10 +158,10 @@ void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rB fWidth * fabs( sin( fAngle ) ); fDX = (fDX - fWidth) * 0.5 + 0.5; fDY = (fDY - fHeight) * 0.5 + 0.5; - aRect.Left() -= static_cast<long>(fDX); - aRect.Right() += static_cast<long>(fDX); - aRect.Top() -= static_cast<long>(fDY); - aRect.Bottom() += static_cast<long>(fDY); + aRect.AdjustLeft( -static_cast<long>(fDX) ); + aRect.AdjustRight(static_cast<long>(fDX) ); + aRect.AdjustTop( -static_cast<long>(fDY) ); + aRect.AdjustBottom(static_cast<long>(fDY) ); rBoundRect = aRect; rCenter = rRect.Center(); @@ -179,10 +179,10 @@ void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rB fDX = ( fDX - fWidth ) * 0.5 + 0.5; fDY = ( fDY - fHeight ) * 0.5 + 0.5; - aRect.Left() -= static_cast<long>(fDX); - aRect.Right() += static_cast<long>(fDX); - aRect.Top() -= static_cast<long>(fDY); - aRect.Bottom() += static_cast<long>(fDY); + aRect.AdjustLeft( -static_cast<long>(fDX) ); + aRect.AdjustRight(static_cast<long>(fDX) ); + aRect.AdjustTop( -static_cast<long>(fDY) ); + aRect.AdjustBottom(static_cast<long>(fDY) ); } Size aSize( aRect.GetSize() ); @@ -190,14 +190,14 @@ void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rB if( GetStyle() == GradientStyle::Radial ) { // Calculation of radii for circle - aSize.Width() = static_cast<long>(0.5 + sqrt(static_cast<double>(aSize.Width())*static_cast<double>(aSize.Width()) + static_cast<double>(aSize.Height())*static_cast<double>(aSize.Height()))); - aSize.Height() = aSize.Width(); + aSize.setWidth( static_cast<long>(0.5 + sqrt(static_cast<double>(aSize.Width())*static_cast<double>(aSize.Width()) + static_cast<double>(aSize.Height())*static_cast<double>(aSize.Height()))) ); + aSize.setHeight( aSize.Width() ); } else if( GetStyle() == GradientStyle::Elliptical ) { // Calculation of radii for ellipse - aSize.Width() = static_cast<long>( 0.5 + static_cast<double>(aSize.Width()) * 1.4142 ); - aSize.Height() = static_cast<long>( 0.5 + static_cast<double>(aSize.Height()) * 1.4142 ); + aSize.setWidth( static_cast<long>( 0.5 + static_cast<double>(aSize.Width()) * 1.4142 ) ); + aSize.setHeight( static_cast<long>( 0.5 + static_cast<double>(aSize.Height()) * 1.4142 ) ); } // Calculate new centers @@ -208,12 +208,12 @@ void Gradient::GetBoundRect( const tools::Rectangle& rRect, tools::Rectangle& rB rCenter = Point( aRect.Left() + nZWidth, aRect.Top() + nZHeight ); // Respect borders - aSize.Width() -= nBorderX; - aSize.Height() -= nBorderY; + aSize.AdjustWidth( -nBorderX ); + aSize.AdjustHeight( -nBorderY ); // Recalculate output rectangle - aRect.Left() = rCenter.X() - ( aSize.Width() >> 1 ); - aRect.Top() = rCenter.Y() - ( aSize.Height() >> 1 ); + aRect.SetLeft( rCenter.X() - ( aSize.Width() >> 1 ) ); + aRect.SetTop( rCenter.Y() - ( aSize.Height() >> 1 ) ); aRect.SetSize( aSize ); rBoundRect = aRect; diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 69e962c8ee64..b1e5f40335ea 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -57,25 +57,25 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText, pOutDev->SetLineColor( COL_BLACK ); else { - aBorderRect.Left() += nPixel; - aBorderRect.Top() += nPixel; + aBorderRect.AdjustLeft(nPixel ); + aBorderRect.AdjustTop(nPixel ); pOutDev->SetLineColor( COL_LIGHTGRAY ); pOutDev->DrawRect( aBorderRect ); - aBorderRect.Left() -= nPixel; - aBorderRect.Top() -= nPixel; - aBorderRect.Right() -= nPixel; - aBorderRect.Bottom() -= nPixel; + aBorderRect.AdjustLeft( -nPixel ); + aBorderRect.AdjustTop( -nPixel ); + aBorderRect.AdjustRight( -nPixel ); + aBorderRect.AdjustBottom( -nPixel ); pOutDev->SetLineColor( COL_GRAY ); } pOutDev->DrawRect( aBorderRect ); - aPoint.X() += nPixelWidth + 2*nPixel; - aPoint.Y() += nPixelWidth + 2*nPixel; - aSize.Width() -= 2*nPixelWidth + 4*nPixel; - aSize.Height() -= 2*nPixelWidth + 4*nPixel; + aPoint.AdjustX(nPixelWidth + 2*nPixel ); + aPoint.AdjustY(nPixelWidth + 2*nPixel ); + aSize.AdjustWidth( -(2*nPixelWidth + 4*nPixel) ); + aSize.AdjustHeight( -(2*nPixelWidth + 4*nPixel) ); if( aSize.Width() > 0 && aSize.Height() > 0 && ( pBitmapEx && !!*pBitmapEx ) ) @@ -85,8 +85,8 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText, if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > aBitmapSize.Width() ) { pOutDev->DrawBitmapEx( aPoint, *pBitmapEx ); - aPoint.X() += aBitmapSize.Width() + 2*nPixel; - aSize.Width() -= aBitmapSize.Width() + 2*nPixel; + aPoint.AdjustX(aBitmapSize.Width() + 2*nPixel ); + aSize.AdjustWidth( -(aBitmapSize.Width() + 2*nPixel) ); } } @@ -101,7 +101,7 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText, if ( !nStep ) nStep = aSz.Height() - nThreshold; - for(;; aSz.Height() -= nStep ) + for(;; aSz.AdjustHeight( -nStep ) ) { pFont->SetFontSize( aSz ); pOutDev->SetFont( *pFont ); @@ -146,7 +146,7 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText, nTextWidth = pOutDev->GetTextWidth( *pText, nStart, --n ); pOutDev->DrawText( aPoint, *pText, nStart, n ); - aPoint.Y() += nTextHeight; + aPoint.AdjustY(nTextHeight ); nStart = sal::static_int_cast<sal_uInt16>(nStart + nLen); nLen = nNext-nLen; while( nStart < pText->getLength() && (*pText)[nStart] == ' ' ) @@ -166,10 +166,10 @@ void ImplDrawDefault( OutputDevice* pOutDev, const OUString* pText, // If the default graphic does not have content, we draw a red rectangle if( !bFilled ) { - aBorderRect.Left()++; - aBorderRect.Top()++; - aBorderRect.Right()--; - aBorderRect.Bottom()--; + aBorderRect.AdjustLeft( 1 ); + aBorderRect.AdjustTop( 1 ); + aBorderRect.AdjustRight( -1 ); + aBorderRect.AdjustBottom( -1 ); pOutDev->SetLineColor( COL_LIGHTRED ); pOutDev->DrawLine( aBorderRect.TopLeft(), aBorderRect.BottomRight() ); diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 99708ce57316..958ce0803444 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -50,27 +50,27 @@ ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut, // Mirrored horizontally? if( mbHMirr ) { - maDispPt.X() = maPt.X() + maSz.Width() + 1; - maDispSz.Width() = -maSz.Width(); - maSzPix.Width() = -maSzPix.Width(); + maDispPt.setX( maPt.X() + maSz.Width() + 1 ); + maDispSz.setWidth( -maSz.Width() ); + maSzPix.setWidth( -maSzPix.Width() ); } else { - maDispPt.X() = maPt.X(); - maDispSz.Width() = maSz.Width(); + maDispPt.setX( maPt.X() ); + maDispSz.setWidth( maSz.Width() ); } // Mirrored vertically? if( mbVMirr ) { - maDispPt.Y() = maPt.Y() + maSz.Height() + 1; - maDispSz.Height() = -maSz.Height(); - maSzPix.Height() = -maSzPix.Height(); + maDispPt.setY( maPt.Y() + maSz.Height() + 1 ); + maDispSz.setHeight( -maSz.Height() ); + maSzPix.setHeight( -maSzPix.Height() ); } else { - maDispPt.Y() = maPt.Y(); - maDispSz.Height() = maSz.Height(); + maDispPt.setY( maPt.Y() ); + maDispSz.setHeight( maSz.Height() ); } // save background @@ -137,22 +137,22 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size else fFactY = 1.0; - rPosPix.X() = FRound( rAnm.aPosPix.X() * fFactX ); - rPosPix.Y() = FRound( rAnm.aPosPix.Y() * fFactY ); + rPosPix.setX( FRound( rAnm.aPosPix.X() * fFactX ) ); + rPosPix.setY( FRound( rAnm.aPosPix.Y() * fFactY ) ); - aPt2.X() = FRound( aPt2.X() * fFactX ); - aPt2.Y() = FRound( aPt2.Y() * fFactY ); + aPt2.setX( FRound( aPt2.X() * fFactX ) ); + aPt2.setY( FRound( aPt2.Y() * fFactY ) ); - rSizePix.Width() = aPt2.X() - rPosPix.X() + 1; - rSizePix.Height() = aPt2.Y() - rPosPix.Y() + 1; + rSizePix.setWidth( aPt2.X() - rPosPix.X() + 1 ); + rSizePix.setHeight( aPt2.Y() - rPosPix.Y() + 1 ); // Mirrored horizontally? if( mbHMirr ) - rPosPix.X() = maSzPix.Width() - 1 - aPt2.X(); + rPosPix.setX( maSzPix.Width() - 1 - aPt2.X() ); // Mirrored vertically? if( mbVMirr ) - rPosPix.Y() = maSzPix.Height() - 1 - aPt2.Y(); + rPosPix.setY( maSzPix.Height() - 1 - aPt2.Y() ); } void ImplAnimView::drawToPos( sal_uLong nPos ) @@ -219,25 +219,25 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev ) // Mirrored horizontally? if( mbHMirr ) { - aBmpPosPix.X() = aPosPix.X() + aSizePix.Width() - 1; - aBmpSizePix.Width() = -aSizePix.Width(); + aBmpPosPix.setX( aPosPix.X() + aSizePix.Width() - 1 ); + aBmpSizePix.setWidth( -aSizePix.Width() ); } else { - aBmpPosPix.X() = aPosPix.X(); - aBmpSizePix.Width() = aSizePix.Width(); + aBmpPosPix.setX( aPosPix.X() ); + aBmpSizePix.setWidth( aSizePix.Width() ); } // Mirrored vertically? if( mbVMirr ) { - aBmpPosPix.Y() = aPosPix.Y() + aSizePix.Height() - 1; - aBmpSizePix.Height() = -aSizePix.Height(); + aBmpPosPix.setY( aPosPix.Y() + aSizePix.Height() - 1 ); + aBmpSizePix.setHeight( -aSizePix.Height() ); } else { - aBmpPosPix.Y() = aPosPix.Y(); - aBmpSizePix.Height() = aSizePix.Height(); + aBmpPosPix.setY( aPosPix.Y() ); + aBmpSizePix.setHeight( aSizePix.Height() ); } // get output device diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index d9ab48c1e937..94680d99255d 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -350,79 +350,79 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag ) } else if( cMove == 2 && cNextMove == 3 ) { - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); } else if( cMove == 3 && cNextMove == 0 ) { - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); } else if( cMove == 0 && cNextMove == 1 ) { - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); } else if( cMove == 1 && cNextMove == 2 ) { - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); } else bDone = false; } else if( cMove == 7 && cNextMove == 0 ) { - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); } else if( cMove == 4 && cNextMove == 1 ) { - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); } else bDone = false; if( !bDone ) { - aArr[ nPolyPos ].X() = nLastX + rMoveInner.nDX; - aArr[ nPolyPos++ ].Y() = nLastY + rMoveInner.nDY; + aArr[ nPolyPos ].setX( nLastX + rMoveInner.nDX ); + aArr[ nPolyPos++ ].setY( nLastY + rMoveInner.nDY ); } } - aArr[ nPolyPos ].X() = nFirstX + 1; - aArr[ nPolyPos++ ].Y() = nFirstY + 1; + aArr[ nPolyPos ].setX( nFirstX + 1 ); + aArr[ nPolyPos++ ].setY( nFirstY + 1 ); aArr.ImplSetRealSize( nPolyPos ); } else if( nFlag & VECT_POLY_INLINE_OUTER ) @@ -457,79 +457,79 @@ void ImplChain::ImplEndAdd( sal_uLong nFlag ) } else if( cMove == 0 && cNextMove == 3 ) { - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); } else if( cMove == 3 && cNextMove == 2 ) { - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); } else if( cMove == 2 && cNextMove == 1 ) { - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); } else if( cMove == 1 && cNextMove == 0 ) { - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); - aArr[ nPolyPos ].X() = nLastX - 1; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX - 1 ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); } else bDone = false; } else if( cMove == 7 && cNextMove == 3 ) { - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY - 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY - 1 ); - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); } else if( cMove == 6 && cNextMove == 2 ) { - aArr[ nPolyPos ].X() = nLastX + 1; - aArr[ nPolyPos++ ].Y() = nLastY; + aArr[ nPolyPos ].setX( nLastX + 1 ); + aArr[ nPolyPos++ ].setY( nLastY ); - aArr[ nPolyPos ].X() = nLastX; - aArr[ nPolyPos++ ].Y() = nLastY + 1; + aArr[ nPolyPos ].setX( nLastX ); + aArr[ nPolyPos++ ].setY( nLastY + 1 ); } else bDone = false; if( !bDone ) { - aArr[ nPolyPos ].X() = nLastX + rMoveOuter.nDX; - aArr[ nPolyPos++ ].Y() = nLastY + rMoveOuter.nDY; + aArr[ nPolyPos ].setX( nLastX + rMoveOuter.nDX ); + aArr[ nPolyPos++ ].setY( nLastY + rMoveOuter.nDY ); } } - aArr[ nPolyPos ].X() = nFirstX - 1; - aArr[ nPolyPos++ ].Y() = nFirstY - 1; + aArr[ nPolyPos ].setX( nFirstX - 1 ); + aArr[ nPolyPos++ ].setY( nFirstY - 1 ); aArr.ImplSetRealSize( nPolyPos ); } else @@ -567,8 +567,8 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr ) // pass 1 aNewArr1.ImplSetSize( nCount ); pLast = &( aNewArr1[ 0 ] ); - pLast->X() = BACK_MAP( rArr[ 0 ].X() ); - pLast->Y() = BACK_MAP( rArr[ 0 ].Y() ); + pLast->setX( BACK_MAP( rArr[ 0 ].X() ) ); + pLast->setY( BACK_MAP( rArr[ 0 ].Y() ) ); for( n = nNewPos = 1; n < nCount; ) { @@ -579,8 +579,8 @@ void ImplChain::ImplPostProcess( const ImplPointArray& rArr ) if( nX != pLast->X() || nY != pLast->Y() ) { pLast = pLeast = &( aNewArr1[ nNewPos++ ] ); - pLeast->X() = nX; - pLeast->Y() = nY; + pLeast->setX( nX ); + pLeast->setY( nY ); } } diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 9856b1d22df5..3595d90f1554 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -109,8 +109,8 @@ meta_action_name(MetaActionType nMetaAction) inline void ImplScalePoint( Point& rPt, double fScaleX, double fScaleY ) { - rPt.X() = FRound( fScaleX * rPt.X() ); - rPt.Y() = FRound( fScaleY * rPt.Y() ); + rPt.setX( FRound( fScaleX * rPt.X() ) ); + rPt.setY( FRound( fScaleY * rPt.Y() ) ); } inline void ImplScaleRect( tools::Rectangle& rRect, double fScaleX, double fScaleY ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index dd8aebb49a24..89b87d44815e 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1411,10 +1411,10 @@ void PDFWriterImpl::PDFPage::convertRect( tools::Rectangle& rRect ) const m_pWriter->m_aMapMode, m_pWriter->getReferenceDevice(), rRect.GetSize() ); - rRect.Left() = aLL.X(); - rRect.Right() = aLL.X() + aSize.Width(); - rRect.Top() = pointToPixel(getHeight()) - aLL.Y(); - rRect.Bottom() = rRect.Top() + aSize.Height(); + rRect.SetLeft( aLL.X() ); + rRect.SetRight( aLL.X() + aSize.Width() ); + rRect.SetTop( pointToPixel(getHeight()) - aLL.Y() ); + rRect.SetBottom( rRect.Top() + aSize.Height() ); } void PDFWriterImpl::PDFPage::appendPolygon( const tools::Polygon& rPoly, OStringBuffer& rBuffer, bool bClose ) const @@ -2772,9 +2772,9 @@ bool PDFWriterImpl::emitTilings() sal_Int32 nW = static_cast<sal_Int32>(tiling.m_aRectangle.GetWidth()); sal_Int32 nH = static_cast<sal_Int32>(tiling.m_aRectangle.GetHeight()); if( tiling.m_aCellSize.Width() == 0 ) - tiling.m_aCellSize.Width() = nW; + tiling.m_aCellSize.setWidth( nW ); if( tiling.m_aCellSize.Height() == 0 ) - tiling.m_aCellSize.Height() = nH; + tiling.m_aCellSize.setHeight( nH ); bool bDeflate = compressStream( tiling.m_pTilingStream ); tiling.m_pTilingStream->Seek( STREAM_SEEK_TO_END ); @@ -4191,8 +4191,8 @@ Font PDFWriterImpl::drawFieldBorder( PDFWidget& rIntern, tools::Rectangle aRect = rIntern.m_aRect; setFillColor( rSettings.GetLightBorderColor() ); drawRectangle( aRect ); - aRect.Left() += nDelta; aRect.Top() += nDelta; - aRect.Right() -= nDelta; aRect.Bottom() -= nDelta; + aRect.AdjustLeft(nDelta ); aRect.AdjustTop(nDelta ); + aRect.AdjustRight( -nDelta ); aRect.AdjustBottom( -nDelta ); setFillColor( rSettings.GetFieldColor() ); drawRectangle( aRect ); setFillColor( rSettings.GetLightColor() ); @@ -4215,10 +4215,10 @@ Font PDFWriterImpl::drawFieldBorder( PDFWidget& rIntern, sal_Int32 nDelta = aFont.GetFontHeight()/4; if( nDelta < 1 ) nDelta = 1; - rIntern.m_aRect.Left() += nDelta; - rIntern.m_aRect.Top() += nDelta; - rIntern.m_aRect.Right() -= nDelta; - rIntern.m_aRect.Bottom()-= nDelta; + rIntern.m_aRect.AdjustLeft(nDelta ); + rIntern.m_aRect.AdjustTop(nDelta ); + rIntern.m_aRect.AdjustRight( -nDelta ); + rIntern.m_aRect.AdjustBottom( -nDelta ); } } return aFont; @@ -4335,30 +4335,30 @@ void PDFWriterImpl::createDefaultCheckBoxAppearance( PDFWidget& rBox, const PDFW setFont( aFont ); Size aFontSize = aFont.GetFontSize(); if( aFontSize.Height() > rBox.m_aRect.GetHeight() ) - aFontSize.Height() = rBox.m_aRect.GetHeight(); + aFontSize.setHeight( rBox.m_aRect.GetHeight() ); sal_Int32 nDelta = aFontSize.Height()/10; if( nDelta < 1 ) nDelta = 1; tools::Rectangle aCheckRect, aTextRect; { - aCheckRect.Left() = rBox.m_aRect.Left() + nDelta; - aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2; - aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height(); - aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height(); + aCheckRect.SetLeft( rBox.m_aRect.Left() + nDelta ); + aCheckRect.SetTop( rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2 ); + aCheckRect.SetRight( aCheckRect.Left() + aFontSize.Height() ); + aCheckRect.SetBottom( aCheckRect.Top() + aFontSize.Height() ); // #i74206# handle small controls without text area while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta ) { - aCheckRect.Right() -= nDelta; - aCheckRect.Top() += nDelta/2; - aCheckRect.Bottom() -= nDelta - (nDelta/2); + aCheckRect.AdjustRight( -nDelta ); + aCheckRect.AdjustTop(nDelta/2 ); + aCheckRect.AdjustBottom( -(nDelta - (nDelta/2)) ); } - aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta; - aTextRect.Top() = rBox.m_aRect.Top(); - aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta; - aTextRect.Bottom() = rBox.m_aRect.Bottom(); + aTextRect.SetLeft( rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta ); + aTextRect.SetTop( rBox.m_aRect.Top() ); + aTextRect.SetRight( aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta ); + aTextRect.SetBottom( rBox.m_aRect.Bottom() ); } setLineColor( Color( COL_BLACK ) ); setFillColor( Color( COL_TRANSPARENT ) ); @@ -4439,30 +4439,30 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P setFont( aFont ); Size aFontSize = aFont.GetFontSize(); if( aFontSize.Height() > rBox.m_aRect.GetHeight() ) - aFontSize.Height() = rBox.m_aRect.GetHeight(); + aFontSize.setHeight( rBox.m_aRect.GetHeight() ); sal_Int32 nDelta = aFontSize.Height()/10; if( nDelta < 1 ) nDelta = 1; tools::Rectangle aCheckRect, aTextRect; { - aCheckRect.Left() = rBox.m_aRect.Left() + nDelta; - aCheckRect.Top() = rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2; - aCheckRect.Right() = aCheckRect.Left() + aFontSize.Height(); - aCheckRect.Bottom() = aCheckRect.Top() + aFontSize.Height(); + aCheckRect.SetLeft( rBox.m_aRect.Left() + nDelta ); + aCheckRect.SetTop( rBox.m_aRect.Top() + (rBox.m_aRect.GetHeight()-aFontSize.Height())/2 ); + aCheckRect.SetRight( aCheckRect.Left() + aFontSize.Height() ); + aCheckRect.SetBottom( aCheckRect.Top() + aFontSize.Height() ); // #i74206# handle small controls without text area while( aCheckRect.GetWidth() > rBox.m_aRect.GetWidth() && aCheckRect.GetWidth() > nDelta ) { - aCheckRect.Right() -= nDelta; - aCheckRect.Top() += nDelta/2; - aCheckRect.Bottom() -= nDelta - (nDelta/2); + aCheckRect.AdjustRight( -nDelta ); + aCheckRect.AdjustTop(nDelta/2 ); + aCheckRect.AdjustBottom( -(nDelta - (nDelta/2)) ); } - aTextRect.Left() = rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta; - aTextRect.Top() = rBox.m_aRect.Top(); - aTextRect.Right() = aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta; - aTextRect.Bottom() = rBox.m_aRect.Bottom(); + aTextRect.SetLeft( rBox.m_aRect.Left() + aCheckRect.GetWidth()+5*nDelta ); + aTextRect.SetTop( rBox.m_aRect.Top() ); + aTextRect.SetRight( aTextRect.Left() + rBox.m_aRect.GetWidth() - aCheckRect.GetWidth()-6*nDelta ); + aTextRect.SetBottom( rBox.m_aRect.Bottom() ); } setLineColor( Color( COL_BLACK ) ); setFillColor( Color( COL_TRANSPARENT ) ); @@ -4507,10 +4507,10 @@ void PDFWriterImpl::createDefaultRadioButtonAppearance( PDFWidget& rBox, const P writeBuffer( aDA.getStr(), aDA.getLength() ); setFillColor( replaceColor( rWidget.TextColor, rSettings.GetRadioCheckTextColor() ) ); setLineColor( Color( COL_TRANSPARENT ) ); - aCheckRect.Left() += 3*nDelta; - aCheckRect.Top() += 3*nDelta; - aCheckRect.Bottom() -= 3*nDelta; - aCheckRect.Right() -= 3*nDelta; + aCheckRect.AdjustLeft(3*nDelta ); + aCheckRect.AdjustTop(3*nDelta ); + aCheckRect.AdjustBottom( -(3*nDelta) ); + aCheckRect.AdjustRight( -(3*nDelta) ); drawEllipse( aCheckRect ); writeBuffer( "\nEMC\n", 5 ); endRedirect(); @@ -6405,8 +6405,8 @@ void PDFWriterImpl::drawVerticalGlyphs( if (rGlyphs[i].m_bVertical) { fDeltaAngle = M_PI/2.0; - aDeltaPos.X() = m_pReferenceDevice->GetFontMetric().GetAscent(); - aDeltaPos.Y() = static_cast<int>(static_cast<double>(m_pReferenceDevice->GetFontMetric().GetDescent()) * fXScale); + aDeltaPos.setX( m_pReferenceDevice->GetFontMetric().GetAscent() ); + aDeltaPos.setY( static_cast<int>(static_cast<double>(m_pReferenceDevice->GetFontMetric().GetDescent()) * fXScale) ); fYScale = fXScale; fTempXScale = 1.0; fSkewA = -fSkewB; @@ -6750,8 +6750,8 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool if (i > 0) { Point aPos = pGlyphs[i]->maLinearPos; - aPos.X() /= rLayout.GetUnitsPerPixel(); - aPos.Y() /= rLayout.GetUnitsPerPixel(); + aPos.setX( aPos.X() / ( rLayout.GetUnitsPerPixel()) ); + aPos.setY( aPos.Y() / ( rLayout.GetUnitsPerPixel()) ); aGNGlyphPos = rLayout.GetDrawPosition(aPos); } aGlyphs.emplace_back( aGNGlyphPos, @@ -6801,9 +6801,9 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool Point aAlignOffset; if ( eAlign == ALIGN_BOTTOM ) - aAlignOffset.Y() -= aRefDevFontMetric.GetDescent(); + aAlignOffset.AdjustY( -(aRefDevFontMetric.GetDescent()) ); else if ( eAlign == ALIGN_TOP ) - aAlignOffset.Y() += aRefDevFontMetric.GetAscent(); + aAlignOffset.AdjustY(aRefDevFontMetric.GetAscent() ); if( aAlignOffset.X() || aAlignOffset.Y() ) aAlignOffset = aRotScale.transform( aAlignOffset ); @@ -6925,18 +6925,18 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool Point aOffset = Point(0,0); if ( nEmphMark & FontEmphasisMark::PosBelow ) - aOffset.Y() += m_pReferenceDevice->mpFontInstance->mxFontMetric->GetDescent() + nEmphYOff; + aOffset.AdjustY(m_pReferenceDevice->mpFontInstance->mxFontMetric->GetDescent() + nEmphYOff ); else - aOffset.Y() -= m_pReferenceDevice->mpFontInstance->mxFontMetric->GetAscent() + nEmphYOff; + aOffset.AdjustY( -(m_pReferenceDevice->mpFontInstance->mxFontMetric->GetAscent() + nEmphYOff) ); long nEmphWidth2 = nEmphWidth / 2; long nEmphHeight2 = nEmphHeight / 2; aOffset += Point( nEmphWidth2, nEmphHeight2 ); if ( eAlign == ALIGN_BOTTOM ) - aOffset.Y() -= m_pReferenceDevice->mpFontInstance->mxFontMetric->GetDescent(); + aOffset.AdjustY( -(m_pReferenceDevice->mpFontInstance->mxFontMetric->GetDescent()) ); else if ( eAlign == ALIGN_TOP ) - aOffset.Y() += m_pReferenceDevice->mpFontInstance->mxFontMetric->GetAscent(); + aOffset.AdjustY(m_pReferenceDevice->mpFontInstance->mxFontMetric->GetAscent() ); Point aPos; const GlyphItem* pGlyph; @@ -6946,7 +6946,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool if (pGlyph->IsSpacing()) { Point aAdjOffset = aOffset; - aAdjOffset.X() += (pGlyph->mnNewWidth - nEmphWidth) / 2; + aAdjOffset.AdjustX((pGlyph->mnNewWidth - nEmphWidth) / 2 ); aAdjOffset = aRotScale.transform( aAdjOffset ); aAdjOffset -= Point( nEmphWidth2, nEmphHeight2 ); @@ -7115,25 +7115,25 @@ void PDFWriterImpl::drawText( const tools::Rectangle& rRect, const OUString& rOr // vertical alignment if ( nStyle & DrawTextFlags::Bottom ) - aPos.Y() += nHeight-(nFormatLines*nTextHeight); + aPos.AdjustY(nHeight-(nFormatLines*nTextHeight) ); else if ( nStyle & DrawTextFlags::VCenter ) - aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2; + aPos.AdjustY((nHeight-(nFormatLines*nTextHeight))/2 ); // draw all lines excluding the last for ( i = 0; i < nFormatLines; i++ ) { pLineInfo = aMultiLineInfo.GetLine( i ); if ( nStyle & DrawTextFlags::Right ) - aPos.X() += nWidth-pLineInfo->GetWidth(); + aPos.AdjustX(nWidth-pLineInfo->GetWidth() ); else if ( nStyle & DrawTextFlags::Center ) - aPos.X() += (nWidth-pLineInfo->GetWidth())/2; + aPos.AdjustX((nWidth-pLineInfo->GetWidth())/2 ); sal_Int32 nIndex = pLineInfo->GetIndex(); sal_Int32 nLineLen = pLineInfo->GetLen(); drawText( aPos, aStr, nIndex, nLineLen ); // mnemonics should not appear in documents, // if the need arises, put them in here - aPos.Y() += nTextHeight; - aPos.X() = rRect.Left(); + aPos.AdjustY(nTextHeight ); + aPos.setX( rRect.Left() ); } // output last line left adjusted since it was shortened @@ -7159,14 +7159,14 @@ void PDFWriterImpl::drawText( const tools::Rectangle& rRect, const OUString& rOr // vertical alignment if ( nStyle & DrawTextFlags::Right ) - aPos.X() += nWidth-nTextWidth; + aPos.AdjustX(nWidth-nTextWidth ); else if ( nStyle & DrawTextFlags::Center ) - aPos.X() += (nWidth-nTextWidth)/2; + aPos.AdjustX((nWidth-nTextWidth)/2 ); if ( nStyle & DrawTextFlags::Bottom ) - aPos.Y() += nHeight-nTextHeight; + aPos.AdjustY(nHeight-nTextHeight ); else if ( nStyle & DrawTextFlags::VCenter ) - aPos.Y() += (nHeight-nTextHeight)/2; + aPos.AdjustY((nHeight-nTextHeight)/2 ); // mnemonics should be inserted here if the need arises @@ -7572,10 +7572,10 @@ void PDFWriterImpl::drawStrikeoutChar( const Point& rPos, long nWidth, FontStrik push( PushFlags::CLIPREGION ); FontMetric aRefDevFontMetric = m_pReferenceDevice->GetFontMetric(); tools::Rectangle aRect; - aRect.Left() = rPos.X(); - aRect.Right() = aRect.Left()+nWidth; - aRect.Bottom() = rPos.Y()+aRefDevFontMetric.GetDescent(); - aRect.Top() = rPos.Y()-aRefDevFontMetric.GetAscent(); + aRect.SetLeft( rPos.X() ); + aRect.SetRight( aRect.Left()+nWidth ); + aRect.SetBottom( rPos.Y()+aRefDevFontMetric.GetDescent() ); + aRect.SetTop( rPos.Y()-aRefDevFontMetric.GetAscent() ); LogicalFontInstance* pFontInstance = m_pReferenceDevice->mpFontInstance; if (pFontInstance->mnOrientation) @@ -7629,9 +7629,9 @@ void PDFWriterImpl::drawTextLine( const Point& rPos, long nWidth, FontStrikeout Point aPos( rPos ); TextAlign eAlign = m_aCurrentPDFState.m_aFont.GetAlignment(); if( eAlign == ALIGN_TOP ) - aPos.Y() += HCONV( pFontInstance->mxFontMetric->GetAscent() ); + aPos.AdjustY(HCONV( pFontInstance->mxFontMetric->GetAscent() )); else if( eAlign == ALIGN_BOTTOM ) - aPos.Y() -= HCONV( pFontInstance->mxFontMetric->GetDescent() ); + aPos.AdjustY( -HCONV( pFontInstance->mxFontMetric->GetDescent() ) ); OStringBuffer aLine( 512 ); // save GS @@ -7855,7 +7855,7 @@ void PDFWriterImpl::beginRedirect( SvStream* pStream, const tools::Rectangle& rT rTargetRect ); Point aDelta = m_aOutputStreams.front().m_aTargetRect.BottomLeft(); long nPageHeight = pointToPixel(m_aPages[m_nCurrentPage].getHeight()); - aDelta.Y() = -(nPageHeight - m_aOutputStreams.front().m_aTargetRect.Bottom()); + aDelta.setY( -(nPageHeight - m_aOutputStreams.front().m_aTargetRect.Bottom()) ); m_aMapMode.SetOrigin( m_aMapMode.GetOrigin() + aDelta ); } @@ -8451,10 +8451,10 @@ void PDFWriterImpl::drawPolyLine( const tools::Polygon& rPoly, const PDFWriter:: if( rInfo.m_fLineWidth > 0.0 ) { sal_Int32 nLW = sal_Int32(rInfo.m_fLineWidth); - aBoundRect.Top() -= nLW; - aBoundRect.Left() -= nLW; - aBoundRect.Right() += nLW; - aBoundRect.Bottom() += nLW; + aBoundRect.AdjustTop( -nLW ); + aBoundRect.AdjustLeft( -nLW ); + aBoundRect.AdjustRight(nLW ); + aBoundRect.AdjustBottom(nLW ); } endTransparencyGroup( aBoundRect, static_cast<sal_uInt16>(100.0*rInfo.m_fTransparency) ); } @@ -8777,8 +8777,8 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject ) // See: OutputDevice::ImplDrawLinearGradient for reference tools::Rectangle aRect; aRect.Left() = aRect.Top() = 0; - aRect.Right() = aSize.Width(); - aRect.Bottom() = aSize.Height(); + aRect.SetRight( aSize.Width() ); + aRect.SetBottom( aSize.Height() ); tools::Rectangle aBoundRect; Point aCenter; @@ -8792,10 +8792,10 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit const & rObject ) fBorder /= 2.0; } - aBoundRect.Bottom() -= fBorder; + aBoundRect.AdjustBottom( -fBorder ); if (!bLinear) { - aBoundRect.Top() += fBorder; + aBoundRect.AdjustTop(fBorder ); } switch (rObject.m_aGradient.GetStyle()) @@ -9927,8 +9927,8 @@ sal_Int32 PDFWriterImpl::createGradient( const Gradient& rGradient, const Size& // check if we already have this gradient // rounding to point will generally lose some pixels // round up to point boundary - aPtSize.Width()++; - aPtSize.Height()++; + aPtSize.AdjustWidth( 1 ); + aPtSize.AdjustHeight( 1 ); std::list< GradientEmit >::const_iterator it = std::find_if(m_aGradients.begin(), m_aGradients.end(), [&](const GradientEmit& arg) { return ((rGradient == arg.m_aGradient) && (aPtSize == arg.m_aSize) ); }); @@ -10051,32 +10051,32 @@ void PDFWriterImpl::drawWallpaper( const tools::Rectangle& rRect, const Wallpape case WallpaperStyle::TopLeft: break; case WallpaperStyle::Top: - aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2; + aBmpPos.AdjustX((aRect.GetWidth()-aBmpSize.Width())/2 ); break; case WallpaperStyle::Left: - aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2; + aBmpPos.AdjustY((aRect.GetHeight()-aBmpSize.Height())/2 ); break; case WallpaperStyle::TopRight: - aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width(); + aBmpPos.AdjustX(aRect.GetWidth()-aBmpSize.Width() ); break; case WallpaperStyle::Center: - aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2; - aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2; + aBmpPos.AdjustX((aRect.GetWidth()-aBmpSize.Width())/2 ); + aBmpPos.AdjustY((aRect.GetHeight()-aBmpSize.Height())/2 ); break; case WallpaperStyle::Right: - aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width(); - aBmpPos.Y() += (aRect.GetHeight()-aBmpSize.Height())/2; + aBmpPos.AdjustX(aRect.GetWidth()-aBmpSize.Width() ); + aBmpPos.AdjustY((aRect.GetHeight()-aBmpSize.Height())/2 ); break; case WallpaperStyle::BottomLeft: - aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height(); + aBmpPos.AdjustY(aRect.GetHeight()-aBmpSize.Height() ); break; case WallpaperStyle::Bottom: - aBmpPos.X() += (aRect.GetWidth()-aBmpSize.Width())/2; - aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height(); + aBmpPos.AdjustX((aRect.GetWidth()-aBmpSize.Width())/2 ); + aBmpPos.AdjustY(aRect.GetHeight()-aBmpSize.Height() ); break; case WallpaperStyle::BottomRight: - aBmpPos.X() += aRect.GetWidth()-aBmpSize.Width(); - aBmpPos.Y() += aRect.GetHeight()-aBmpSize.Height(); + aBmpPos.AdjustX(aRect.GetWidth()-aBmpSize.Width() ); + aBmpPos.AdjustY(aRect.GetHeight()-aBmpSize.Height() ); break; default: ; } diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 928ab4d53ec9..5d35f09de169 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -83,14 +83,14 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz BmpMirrorFlags nMirrorFlags(BmpMirrorFlags::NONE); if( aSize.Width() < 0 ) { - aSize.Width() *= -1; - aPoint.X() -= aSize.Width(); + aSize.setWidth( aSize.Width() * -1 ); + aPoint.AdjustX( -(aSize.Width()) ); nMirrorFlags |= BmpMirrorFlags::Horizontal; } if( aSize.Height() < 0 ) { - aSize.Height() *= -1; - aPoint.Y() -= aSize.Height(); + aSize.setHeight( aSize.Height() * -1 ); + aPoint.AdjustY( -(aSize.Height()) ); nMirrorFlags |= BmpMirrorFlags::Vertical; } @@ -129,13 +129,13 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz if( fBmpWH < fMaxWH ) { - aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH ); - aNewBmpSize.Height() = FRound( fMaxPixelY ); + aNewBmpSize.setWidth( FRound( fMaxPixelY * fBmpWH ) ); + aNewBmpSize.setHeight( FRound( fMaxPixelY ) ); } else if( fBmpWH > 0.0 ) { - aNewBmpSize.Width() = FRound( fMaxPixelX ); - aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH); + aNewBmpSize.setWidth( FRound( fMaxPixelX ) ); + aNewBmpSize.setHeight( FRound( fMaxPixelX / fBmpWH) ); } if( aNewBmpSize.Width() && aNewBmpSize.Height() ) diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 9bb759400c97..7e6674819925 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -407,8 +407,8 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) mbpHYs = true; // convert into MapUnit::Map100thMM - maPhysSize.Width() = static_cast<sal_Int32>( (100000.0 * maOrigSize.Width()) / nXPixelPerMeter ); - maPhysSize.Height() = static_cast<sal_Int32>( (100000.0 * maOrigSize.Height()) / nYPixelPerMeter ); + maPhysSize.setWidth( static_cast<sal_Int32>( (100000.0 * maOrigSize.Width()) / nXPixelPerMeter ) ); + maPhysSize.setHeight( static_cast<sal_Int32>( (100000.0 * maOrigSize.Height()) / nYPixelPerMeter ) ); } } } @@ -454,8 +454,8 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) if( mnChunkLen < 13 ) return false; - maOrigSize.Width() = ImplReadsal_uInt32(); - maOrigSize.Height() = ImplReadsal_uInt32(); + maOrigSize.setWidth( ImplReadsal_uInt32() ); + maOrigSize.setHeight( ImplReadsal_uInt32() ); if (maOrigSize.Width() <= 0 || maOrigSize.Height() <= 0) return false; @@ -650,8 +650,8 @@ bool PNGReaderImpl::ImplReadHeader( const Size& rPreviewSizeHint ) } } - maTargetSize.Width() = (maOrigSize.Width() + mnPreviewMask) >> mnPreviewShift; - maTargetSize.Height() = (maOrigSize.Height() + mnPreviewMask) >> mnPreviewShift; + maTargetSize.setWidth( (maOrigSize.Width() + mnPreviewMask) >> mnPreviewShift ); + maTargetSize.setHeight( (maOrigSize.Height() + mnPreviewMask) >> mnPreviewShift ); //round bits up to nearest multiple of 8 and divide by 8 to get num of bytes per pixel int nBytesPerPixel = ((mnTargetDepth + 7) & ~7)/8; diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index aa13bc433a3e..66a15d0e257b 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -752,16 +752,16 @@ void Printer::DrawDeviceMask( const Bitmap& rMask, const Color& rMaskColor, // mirrored horizontically if( aDestSz.Width() < 0 ) { - aDestSz.Width() = -aDestSz.Width(); - aDestPt.X() -= ( aDestSz.Width() - 1 ); + aDestSz.setWidth( -aDestSz.Width() ); + aDestPt.AdjustX( -( aDestSz.Width() - 1 ) ); nMirrFlags |= BmpMirrorFlags::Horizontal; } // mirrored vertically if( aDestSz.Height() < 0 ) { - aDestSz.Height() = -aDestSz.Height(); - aDestPt.Y() -= ( aDestSz.Height() - 1 ); + aDestSz.setHeight( -aDestSz.Height() ); + aDestPt.AdjustY( -( aDestSz.Height() - 1 ) ); nMirrFlags |= BmpMirrorFlags::Vertical; } diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 4334eb0e7e81..2e88362cac80 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -413,10 +413,10 @@ tools::Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic if(nLineWidth) { const long nHalfLineWidth((nLineWidth + 1) / 2); - aActionBounds.Left() -= nHalfLineWidth; - aActionBounds.Top() -= nHalfLineWidth; - aActionBounds.Right() += nHalfLineWidth; - aActionBounds.Bottom() += nHalfLineWidth; + aActionBounds.AdjustLeft( -nHalfLineWidth ); + aActionBounds.AdjustTop( -nHalfLineWidth ); + aActionBounds.AdjustRight(nHalfLineWidth ); + aActionBounds.AdjustBottom(nHalfLineWidth ); } break; } @@ -466,10 +466,10 @@ tools::Rectangle ImplCalcActionBounds( const MetaAction& rAct, const OutputDevic if(nLineWidth) { const long nHalfLineWidth((nLineWidth + 1) / 2); - aActionBounds.Left() -= nHalfLineWidth; - aActionBounds.Top() -= nHalfLineWidth; - aActionBounds.Right() += nHalfLineWidth; - aActionBounds.Bottom() += nHalfLineWidth; + aActionBounds.AdjustLeft( -nHalfLineWidth ); + aActionBounds.AdjustTop( -nHalfLineWidth ); + aActionBounds.AdjustRight(nHalfLineWidth ); + aActionBounds.AdjustBottom(nHalfLineWidth ); } break; } @@ -1154,16 +1154,16 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, while( aDstPtPix.Y() <= aBoundRect.Bottom() ) { - aDstPtPix.X() = aBoundRect.Left(); + aDstPtPix.setX( aBoundRect.Left() ); aDstSzPix = bTiling ? Size( MAX_TILE_WIDTH, MAX_TILE_HEIGHT ) : aBoundRect.GetSize(); if( ( aDstPtPix.Y() + aDstSzPix.Height() - 1 ) > aBoundRect.Bottom() ) - aDstSzPix.Height() = aBoundRect.Bottom() - aDstPtPix.Y() + 1; + aDstSzPix.setHeight( aBoundRect.Bottom() - aDstPtPix.Y() + 1 ); while( aDstPtPix.X() <= aBoundRect.Right() ) { if( ( aDstPtPix.X() + aDstSzPix.Width() - 1 ) > aBoundRect.Right() ) - aDstSzPix.Width() = aBoundRect.Right() - aDstPtPix.X() + 1; + aDstSzPix.setWidth( aBoundRect.Right() - aDstPtPix.X() + 1 ); if( !tools::Rectangle( aDstPtPix, aDstSzPix ).Intersection( aBoundRect ).IsEmpty() && aPaintVDev->SetOutputSizePixel( aDstSzPix ) ) @@ -1247,11 +1247,11 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, } // overlapping bands to avoid missing lines (e.g. PostScript) - aDstPtPix.X() += aDstSzPix.Width(); + aDstPtPix.AdjustX(aDstSzPix.Width() ); } // overlapping bands to avoid missing lines (e.g. PostScript) - aDstPtPix.Y() += aDstSzPix.Height(); + aDstPtPix.AdjustY(aDstSzPix.Height() ); } rOutMtf.AddAction( new MetaPopAction() ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 22edd1734de9..938dca6dd7dc 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -443,8 +443,8 @@ bool Printer::PreparePrintJob(std::shared_ptr<PrinterController> xController, css::awt::Size aSizeVal; if( pPgSizeVal && (pPgSizeVal->Value >>= aSizeVal) ) { - aMPS.aPaperSize.Width() = aSizeVal.Width; - aMPS.aPaperSize.Height() = aSizeVal.Height; + aMPS.aPaperSize.setWidth( aSizeVal.Width ); + aMPS.aPaperSize.setHeight( aSizeVal.Height ); } xController->setMultipage( aMPS ); @@ -905,8 +905,8 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons if( aIsSize.Width && aIsSize.Height ) { - aPageSize.aSize.Width() = aIsSize.Width; - aPageSize.aSize.Height() = aIsSize.Height; + aPageSize.aSize.setWidth( aIsSize.Width ); + aPageSize.aSize.setHeight( aIsSize.Height ); Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, true/*bNoNUP*/ ) ); if( aRealPaperSize != aCurSize ) @@ -1111,10 +1111,10 @@ PrinterController::PageSize PrinterController::getFilteredPageFile( int i_nFilte // multi page area: page size minus margins + one time spacing right and down // the added spacing is so each subpage can be calculated including its spacing Size aMPArea( aPaperSize ); - aMPArea.Width() -= rMPS.nLeftMargin + rMPS.nRightMargin; - aMPArea.Width() += rMPS.nHorizontalSpacing; - aMPArea.Height() -= rMPS.nTopMargin + rMPS.nBottomMargin; - aMPArea.Height() += rMPS.nVerticalSpacing; + aMPArea.AdjustWidth( -(rMPS.nLeftMargin + rMPS.nRightMargin) ); + aMPArea.AdjustWidth(rMPS.nHorizontalSpacing ); + aMPArea.AdjustHeight( -(rMPS.nTopMargin + rMPS.nBottomMargin) ); + aMPArea.AdjustHeight(rMPS.nVerticalSpacing ); // determine offsets long nAdvX = aMPArea.Width() / rMPS.nColumns; diff --git a/vcl/source/gdi/region.cxx b/vcl/source/gdi/region.cxx index 62a699f17196..bcc8a0c96e9a 100644 --- a/vcl/source/gdi/region.cxx +++ b/vcl/source/gdi/region.cxx @@ -1739,10 +1739,10 @@ static inline bool ImplPolygonRectTest( const tools::Polygon& rPoly, tools::Rect nY2--; } - pRectOut->Left() = nX1; - pRectOut->Right() = nX2; - pRectOut->Top() = nY1; - pRectOut->Bottom() = nY2; + pRectOut->SetLeft( nX1 ); + pRectOut->SetRight( nX2 ); + pRectOut->SetTop( nY1 ); + pRectOut->SetBottom( nY2 ); } } } diff --git a/vcl/source/gdi/regionband.cxx b/vcl/source/gdi/regionband.cxx index 4f89231dd1ad..c93fc4c73d26 100644 --- a/vcl/source/gdi/regionband.cxx +++ b/vcl/source/gdi/regionband.cxx @@ -1233,13 +1233,13 @@ void RegionBand::GetRegionRectangles(RectangleVector& rTarget) const { ImplRegionBandSep* pCurrRectBandSep = pCurrRectBand->mpFirstSep; - aRectangle.Top() = pCurrRectBand->mnYTop; - aRectangle.Bottom() = pCurrRectBand->mnYBottom; + aRectangle.SetTop( pCurrRectBand->mnYTop ); + aRectangle.SetBottom( pCurrRectBand->mnYBottom ); while(pCurrRectBandSep) { - aRectangle.Left() = pCurrRectBandSep->mnXLeft; - aRectangle.Right() = pCurrRectBandSep->mnXRight; + aRectangle.SetLeft( pCurrRectBandSep->mnXLeft ); + aRectangle.SetRight( pCurrRectBandSep->mnXRight ); rTarget.push_back(aRectangle); pCurrRectBandSep = pCurrRectBandSep->mpNextSep; } diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index c9459ad5b681..4404f3fcdeb0 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -773,7 +773,7 @@ void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) if( nNewWidth < nMaxGlyphWidth) nNewWidth = nMaxGlyphWidth; nNewWidth -= pGlyphIterRight->mnOrigWidth; - pGlyphIterRight->maLinearPos.X() = maBasePoint.X() + nNewWidth; + pGlyphIterRight->maLinearPos.setX( maBasePoint.X() + nNewWidth ); // justify glyph widths and positions int nDiffWidth = nNewWidth - nOldWidth; @@ -784,7 +784,7 @@ void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) for( pGlyphIter = m_GlyphItems.begin(); pGlyphIter != pGlyphIterRight; ++pGlyphIter ) { // move glyph to justified position - pGlyphIter->maLinearPos.X() += nDeltaSum; + pGlyphIter->maLinearPos.AdjustX(nDeltaSum ); // do not stretch non-stretchable glyphs if( pGlyphIter->IsDiacritic() || (nStretchable <= 0) ) @@ -807,7 +807,7 @@ void GenericSalLayout::Justify( DeviceCoordinate nNewWidth ) { int nX = pGlyphIter->maLinearPos.X() - maBasePoint.X(); nX = static_cast<int>(nX * fSqueeze); - pGlyphIter->maLinearPos.X() = nX + maBasePoint.X(); + pGlyphIter->maLinearPos.setX( nX + maBasePoint.X() ); } } // adjust glyph widths to new positions @@ -853,7 +853,7 @@ void GenericSalLayout::ApplyAsianKerning(const OUString& rStr) // adjust the glyph positions to the new glyph widths if( pGlyphIter+1 != pGlyphIterEnd ) - pGlyphIter->maLinearPos.X() += nOffset; + pGlyphIter->maLinearPos.AdjustX(nOffset ); } } @@ -967,8 +967,8 @@ int GenericSalLayout::GetNextGlyphs(int nLen, const GlyphItem** pGlyphs, break; } - aRelativePos.X() /= mnUnitsPerPixel; - aRelativePos.Y() /= mnUnitsPerPixel; + aRelativePos.setX( aRelativePos.X() / ( mnUnitsPerPixel) ); + aRelativePos.setY( aRelativePos.Y() / ( mnUnitsPerPixel) ); rPos = GetDrawPosition( aRelativePos ); return nCount; @@ -994,7 +994,7 @@ void GenericSalLayout::MoveGlyph( int nStart, long nNewXPos ) { for( std::vector<GlyphItem>::iterator pGlyphIterEnd = m_GlyphItems.end(); pGlyphIter != pGlyphIterEnd; ++pGlyphIter ) { - pGlyphIter->maLinearPos.X() += nXDelta; + pGlyphIter->maLinearPos.AdjustX(nXDelta ); } } } diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 3b1447f5df5c..c4e77c0489a2 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -526,9 +526,9 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) rIStm.ReadInt16( nVersion ); // Version sal_Int32 nTmp32(0); rIStm.ReadInt32( nTmp32 ); - aPrefSz.Width() = nTmp32; // PrefSize.Width() + aPrefSz.setWidth( nTmp32 ); // PrefSize.Width() rIStm.ReadInt32( nTmp32 ); - aPrefSz.Height() = nTmp32; // PrefSize.Height() + aPrefSz.setHeight( nTmp32 ); // PrefSize.Height() // check header-magic and version if( rIStm.GetError() @@ -2383,8 +2383,8 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile const & r if( fScaleX != 1.0 || fScaleY != 1.0 ) { aMtf.Scale( fScaleX, fScaleY ); - aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ); - aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY ); + aSrcPt.setX( FRound( aSrcPt.X() * fScaleX ) ); + aSrcPt.setY( FRound( aSrcPt.Y() * fScaleY ) ); } nMoveX = rPos.X() - aSrcPt.X(); diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index 6b6ed327b3b1..bcc431e15d11 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -468,8 +468,8 @@ uno::Sequence< sal_Int8 > SAL_CALL VclCanvasBitmap::getData( rendering::IntegerB tools::Rectangle aRequestedBytes( aRequestedArea ); // adapt to byte boundaries - aRequestedBytes.Left() = aRequestedArea.Left()*m_nBitsPerOutputPixel/8; - aRequestedBytes.Right() = (aRequestedArea.Right()*m_nBitsPerOutputPixel + 7)/8; + aRequestedBytes.SetLeft( aRequestedArea.Left()*m_nBitsPerOutputPixel/8 ); + aRequestedBytes.SetRight( (aRequestedArea.Right()*m_nBitsPerOutputPixel + 7)/8 ); // copy stuff to output sequence aRet.realloc(aRequestedBytes.getWidth()*aRequestedBytes.getHeight()); diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 53a6e6551ae7..353cc4fb7e92 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -221,13 +221,13 @@ Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz, if( fBmpWH < fMaxWH ) { - aNewBmpSize.Width() = FRound( fMaxPixelY * fBmpWH ); - aNewBmpSize.Height() = FRound( fMaxPixelY ); + aNewBmpSize.setWidth( FRound( fMaxPixelY * fBmpWH ) ); + aNewBmpSize.setHeight( FRound( fMaxPixelY ) ); } else if( fBmpWH > 0.0 ) { - aNewBmpSize.Width() = FRound( fMaxPixelX ); - aNewBmpSize.Height() = FRound( fMaxPixelX / fBmpWH); + aNewBmpSize.setWidth( FRound( fMaxPixelX ) ); + aNewBmpSize.setHeight( FRound( fMaxPixelX / fBmpWH) ); } if( aNewBmpSize.Width() && aNewBmpSize.Height() ) @@ -643,14 +643,14 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r if (bHMirr) { - aOutSz.Width() = -aOutSz.Width(); - aOutPt.X() -= aOutSz.Width() - 1; + aOutSz.setWidth( -aOutSz.Width() ); + aOutPt.AdjustX( -(aOutSz.Width() - 1) ); } if (bVMirr) { - aOutSz.Height() = -aOutSz.Height(); - aOutPt.Y() -= aOutSz.Height() - 1; + aOutSz.setHeight( -aOutSz.Height() ); + aOutPt.AdjustY( -(aOutSz.Height() - 1) ); } if (!aDstRect.Intersection(tools::Rectangle(aOutPt, aOutSz)).IsEmpty()) diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 63841a7cacf3..f9a74da0988a 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -110,21 +110,21 @@ Size OutputDevice::GetDevFontSize( const vcl::Font& rFont, int nSizeIndex ) cons Size aSize( 0, mpDeviceFontSizeList->Get( nSizeIndex ) ); if ( mbMap ) { - aSize.Height() *= 10; + aSize.setHeight( aSize.Height() * 10 ); MapMode aMap( MapUnit::Map10thInch, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) ); aSize = PixelToLogic( aSize, aMap ); - aSize.Height() += 5; - aSize.Height() /= 10; + aSize.AdjustHeight(5 ); + aSize.setHeight( aSize.Height() / 10 ); long nRound = aSize.Height() % 5; if ( nRound >= 3 ) - aSize.Height() += (5-nRound); + aSize.AdjustHeight(5-nRound); else - aSize.Height() -= nRound; - aSize.Height() *= 10; + aSize.AdjustHeight( -nRound ); + aSize.setHeight( aSize.Height() * 10 ); aSize = LogicToPixel( aSize, aMap ); aSize = PixelToLogic( aSize ); - aSize.Height() += 5; - aSize.Height() /= 10; + aSize.AdjustHeight(5 ); + aSize.setHeight( aSize.Height() / 10 ); } return aSize; } @@ -882,14 +882,14 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan { // use default pixel height only when logical height is zero if ( aFont.GetFontHeight() ) - aSize.Height() = 1; + aSize.setHeight( 1 ); else - aSize.Height() = (12*pOutDev->mnDPIY)/72; + aSize.setHeight( (12*pOutDev->mnDPIY)/72 ); } // use default width only when logical width is zero if( (0 == aSize.Width()) && (0 != aFont.GetFontSize().Width()) ) - aSize.Width() = 1; + aSize.setWidth( 1 ); // get the name of the first available font float fExactHeight = static_cast<float>(aSize.Height()); @@ -1033,15 +1033,15 @@ bool OutputDevice::ImplNewFont() const { // use default pixel height only when logical height is zero if ( maFont.GetFontSize().Height() ) - aSize.Height() = 1; + aSize.setHeight( 1 ); else - aSize.Height() = (12*mnDPIY)/72; + aSize.setHeight( (12*mnDPIY)/72 ); fExactHeight = static_cast<float>(aSize.Height()); } // select the default width only when logical width is zero if( (0 == aSize.Width()) && (0 != maFont.GetFontSize().Width()) ) - aSize.Width() = 1; + aSize.setWidth( 1 ); // get font entry LogicalFontInstance* pOldFontInstance = mpFontInstance; @@ -1255,9 +1255,9 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout ) Point aOffset = Point(0,0); if ( nEmphasisMark & FontEmphasisMark::PosBelow ) - aOffset.Y() += mpFontInstance->mxFontMetric->GetDescent() + nEmphasisYOff; + aOffset.AdjustY(mpFontInstance->mxFontMetric->GetDescent() + nEmphasisYOff ); else - aOffset.Y() -= mpFontInstance->mxFontMetric->GetAscent() + nEmphasisYOff; + aOffset.AdjustY( -(mpFontInstance->mxFontMetric->GetAscent() + nEmphasisYOff) ); long nEmphasisWidth2 = nEmphasisWidth / 2; long nEmphasisHeight2 = nEmphasisHeight / 2; @@ -1275,7 +1275,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout ) if (!pGlyph->IsSpacing()) { Point aAdjPoint = aOffset; - aAdjPoint.X() += aRectangle.Left() + (aRectangle.GetWidth() - nEmphasisWidth) / 2; + aAdjPoint.AdjustX(aRectangle.Left() + (aRectangle.GetWidth() - nEmphasisWidth) / 2 ); if ( mpFontInstance->mnOrientation ) { Point aOriginPt(0, 0); diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index c71b420d92ed..4fac49ed8d6c 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -132,10 +132,10 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, { // because we draw with no border line, we have to expand gradient // rect to avoid missing lines on the right and bottom edge - aRect.Left()--; - aRect.Top()--; - aRect.Right()++; - aRect.Bottom()++; + aRect.AdjustLeft( -1 ); + aRect.AdjustTop( -1 ); + aRect.AdjustRight( 1 ); + aRect.AdjustBottom( 1 ); } // if the clipping polypolygon is a rectangle, then it's the same size as the bounding of the @@ -229,10 +229,10 @@ void OutputDevice::DrawGradientToMetafile ( const tools::PolyPolygon& rPolyPoly, { // because we draw with no border line, we have to expand gradient // rect to avoid missing lines on the right and bottom edge - aRect.Left()--; - aRect.Top()--; - aRect.Right()++; - aRect.Bottom()++; + aRect.AdjustLeft( -1 ); + aRect.AdjustTop( -1 ); + aRect.AdjustRight( 1 ); + aRect.AdjustBottom( 1 ); } // if the clipping polypolygon is a rectangle, then it's the same size as the bounding of the @@ -280,10 +280,10 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, fBorder /= 2.0; } tools::Rectangle aMirrorRect = aRect; // used in style axial - aMirrorRect.Top() = ( aRect.Top() + aRect.Bottom() ) / 2; + aMirrorRect.SetTop( ( aRect.Top() + aRect.Bottom() ) / 2 ); if ( !bLinear ) { - aRect.Bottom() = aMirrorRect.Top(); + aRect.SetBottom( aMirrorRect.Top() ); } // colour-intensities of start- and finish; change if needed @@ -334,8 +334,8 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); - aBorderRect.Bottom() = static_cast<long>( aBorderRect.Top() + fBorder ); - aRect.Top() = aBorderRect.Bottom(); + aBorderRect.SetBottom( static_cast<long>( aBorderRect.Top() + fBorder ) ); + aRect.SetTop( aBorderRect.Bottom() ); aPoly[0] = aBorderRect.TopLeft(); aPoly[1] = aBorderRect.TopRight(); aPoly[2] = aBorderRect.BottomRight(); @@ -347,8 +347,8 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, if ( !bLinear) { aBorderRect = aMirrorRect; - aBorderRect.Top() = static_cast<long>( aBorderRect.Bottom() - fBorder ); - aMirrorRect.Bottom() = aBorderRect.Top(); + aBorderRect.SetTop( static_cast<long>( aBorderRect.Bottom() - fBorder ) ); + aMirrorRect.SetBottom( aBorderRect.Top() ); aPoly[0] = aBorderRect.TopLeft(); aPoly[1] = aBorderRect.TopRight(); aPoly[2] = aBorderRect.BottomRight(); @@ -397,8 +397,8 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); // Polygon for this color step - aRect.Top() = static_cast<long>( fGradientLine + static_cast<double>(i) * fScanInc ); - aRect.Bottom() = static_cast<long>( fGradientLine + ( static_cast<double>(i) + 1.0 ) * fScanInc ); + aRect.SetTop( static_cast<long>( fGradientLine + static_cast<double>(i) * fScanInc ) ); + aRect.SetBottom( static_cast<long>( fGradientLine + ( static_cast<double>(i) + 1.0 ) * fScanInc ) ); aPoly[0] = aRect.TopLeft(); aPoly[1] = aRect.TopRight(); aPoly[2] = aRect.BottomRight(); @@ -409,8 +409,8 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, if ( !bLinear ) { - aMirrorRect.Bottom() = static_cast<long>( fMirrorGradientLine - static_cast<double>(i) * fScanInc ); - aMirrorRect.Top() = static_cast<long>( fMirrorGradientLine - (static_cast<double>(i) + 1.0)* fScanInc ); + aMirrorRect.SetBottom( static_cast<long>( fMirrorGradientLine - static_cast<double>(i) * fScanInc ) ); + aMirrorRect.SetTop( static_cast<long>( fMirrorGradientLine - (static_cast<double>(i) + 1.0)* fScanInc ) ); aPoly[0] = aMirrorRect.TopLeft(); aPoly[1] = aMirrorRect.TopRight(); aPoly[2] = aMirrorRect.BottomRight(); @@ -430,8 +430,8 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect, mpGraphics->SetFillColor( MAKE_SALCOLOR( nRed, nGreen, nBlue ) ); - aRect.Top() = static_cast<long>( fGradientLine + static_cast<double>(nSteps) * fScanInc ); - aRect.Bottom() = static_cast<long>( fMirrorGradientLine - static_cast<double>(nSteps) * fScanInc ); + aRect.SetTop( static_cast<long>( fGradientLine + static_cast<double>(nSteps) * fScanInc ) ); + aRect.SetBottom( static_cast<long>( fMirrorGradientLine - static_cast<double>(nSteps) * fScanInc ) ); aPoly[0] = aRect.TopLeft(); aPoly[1] = aRect.TopRight(); aPoly[2] = aRect.BottomRight(); @@ -529,10 +529,10 @@ void OutputDevice::DrawComplexGradient( const tools::Rectangle& rRect, // extend rect, to avoid missing bounding line tools::Rectangle aExtRect( rRect ); - aExtRect.Left() -= 1; - aExtRect.Top() -= 1; - aExtRect.Right() += 1; - aExtRect.Bottom() += 1; + aExtRect.AdjustLeft( -1 ); + aExtRect.AdjustTop( -1 ); + aExtRect.AdjustRight(1 ); + aExtRect.AdjustBottom(1 ); ImplDrawPolygon( aPoly = aExtRect, pClixPolyPoly ); } @@ -541,10 +541,10 @@ void OutputDevice::DrawComplexGradient( const tools::Rectangle& rRect, for( long i = 1; i < nSteps; i++ ) { // calculate new Polygon - aRect.Left() = static_cast<long>( fScanLeft += fScanIncX ); - aRect.Top() = static_cast<long>( fScanTop += fScanIncY ); - aRect.Right() = static_cast<long>( fScanRight -= fScanIncX ); - aRect.Bottom() = static_cast<long>( fScanBottom -= fScanIncY ); + aRect.SetLeft( static_cast<long>( fScanLeft += fScanIncX ) ); + aRect.SetTop( static_cast<long>( fScanTop += fScanIncY ) ); + aRect.SetRight( static_cast<long>( fScanRight -= fScanIncX ) ); + aRect.SetBottom( static_cast<long>( fScanBottom -= fScanIncY ) ); if( ( aRect.GetWidth() < 2 ) || ( aRect.GetHeight() < 2 ) ) break; @@ -632,10 +632,10 @@ void OutputDevice::DrawLinearGradientToMetafile( const tools::Rectangle& rRect, fBorder /= 2.0; } tools::Rectangle aMirrorRect = aRect; // used in style axial - aMirrorRect.Top() = ( aRect.Top() + aRect.Bottom() ) / 2; + aMirrorRect.SetTop( ( aRect.Top() + aRect.Bottom() ) / 2 ); if ( !bLinear ) { - aRect.Bottom() = aMirrorRect.Top(); + aRect.SetBottom( aMirrorRect.Top() ); } // colour-intensities of start- and finish; change if needed @@ -686,8 +686,8 @@ void OutputDevice::DrawLinearGradientToMetafile( const tools::Rectangle& rRect, mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), true ) ); - aBorderRect.Bottom() = static_cast<long>( aBorderRect.Top() + fBorder ); - aRect.Top() = aBorderRect.Bottom(); + aBorderRect.SetBottom( static_cast<long>( aBorderRect.Top() + fBorder ) ); + aRect.SetTop( aBorderRect.Bottom() ); aPoly[0] = aBorderRect.TopLeft(); aPoly[1] = aBorderRect.TopRight(); aPoly[2] = aBorderRect.BottomRight(); @@ -699,8 +699,8 @@ void OutputDevice::DrawLinearGradientToMetafile( const tools::Rectangle& rRect, if ( !bLinear) { aBorderRect = aMirrorRect; - aBorderRect.Top() = static_cast<long>( aBorderRect.Bottom() - fBorder ); - aMirrorRect.Bottom() = aBorderRect.Top(); + aBorderRect.SetTop( static_cast<long>( aBorderRect.Bottom() - fBorder ) ); + aMirrorRect.SetBottom( aBorderRect.Top() ); aPoly[0] = aBorderRect.TopLeft(); aPoly[1] = aBorderRect.TopRight(); aPoly[2] = aBorderRect.BottomRight(); @@ -748,8 +748,8 @@ void OutputDevice::DrawLinearGradientToMetafile( const tools::Rectangle& rRect, mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), true ) ); // Polygon for this color step - aRect.Top() = static_cast<long>( fGradientLine + static_cast<double>(i) * fScanInc ); - aRect.Bottom() = static_cast<long>( fGradientLine + ( static_cast<double>(i) + 1.0 ) * fScanInc ); + aRect.SetTop( static_cast<long>( fGradientLine + static_cast<double>(i) * fScanInc ) ); + aRect.SetBottom( static_cast<long>( fGradientLine + ( static_cast<double>(i) + 1.0 ) * fScanInc ) ); aPoly[0] = aRect.TopLeft(); aPoly[1] = aRect.TopRight(); aPoly[2] = aRect.BottomRight(); @@ -760,8 +760,8 @@ void OutputDevice::DrawLinearGradientToMetafile( const tools::Rectangle& rRect, if ( !bLinear ) { - aMirrorRect.Bottom() = static_cast<long>( fMirrorGradientLine - static_cast<double>(i) * fScanInc ); - aMirrorRect.Top() = static_cast<long>( fMirrorGradientLine - (static_cast<double>(i) + 1.0)* fScanInc ); + aMirrorRect.SetBottom( static_cast<long>( fMirrorGradientLine - static_cast<double>(i) * fScanInc ) ); + aMirrorRect.SetTop( static_cast<long>( fMirrorGradientLine - (static_cast<double>(i) + 1.0)* fScanInc ) ); aPoly[0] = aMirrorRect.TopLeft(); aPoly[1] = aMirrorRect.TopRight(); aPoly[2] = aMirrorRect.BottomRight(); @@ -781,8 +781,8 @@ void OutputDevice::DrawLinearGradientToMetafile( const tools::Rectangle& rRect, mpMetaFile->AddAction( new MetaFillColorAction( Color( nRed, nGreen, nBlue ), true ) ); - aRect.Top() = static_cast<long>( fGradientLine + static_cast<double>(nSteps) * fScanInc ); - aRect.Bottom() = static_cast<long>( fMirrorGradientLine - static_cast<double>(nSteps) * fScanInc ); + aRect.SetTop( static_cast<long>( fGradientLine + static_cast<double>(nSteps) * fScanInc ) ); + aRect.SetBottom( static_cast<long>( fMirrorGradientLine - static_cast<double>(nSteps) * fScanInc ) ); aPoly[0] = aRect.TopLeft(); aPoly[1] = aRect.TopRight(); aPoly[2] = aRect.BottomRight(); @@ -870,10 +870,10 @@ void OutputDevice::DrawComplexGradientToMetafile( const tools::Rectangle& rRect, for( long i = 1; i < nSteps; i++ ) { // calculate new Polygon - aRect.Left() = static_cast<long>( fScanLeft += fScanIncX ); - aRect.Top() = static_cast<long>( fScanTop += fScanIncY ); - aRect.Right() = static_cast<long>( fScanRight -= fScanIncX ); - aRect.Bottom() = static_cast<long>( fScanBottom -= fScanIncY ); + aRect.SetLeft( static_cast<long>( fScanLeft += fScanIncX ) ); + aRect.SetTop( static_cast<long>( fScanTop += fScanIncY ) ); + aRect.SetRight( static_cast<long>( fScanRight -= fScanIncX ) ); + aRect.SetBottom( static_cast<long>( fScanBottom -= fScanIncY ) ); if( ( aRect.GetWidth() < 2 ) || ( aRect.GetHeight() < 2 ) ) break; @@ -1035,10 +1035,10 @@ void OutputDevice::AddGradientActions( const tools::Rectangle& rRect, const Grad // because we draw with no border line, we have to expand gradient // rect to avoid missing lines on the right and bottom edge - aRect.Left()--; - aRect.Top()--; - aRect.Right()++; - aRect.Bottom()++; + aRect.AdjustLeft( -1 ); + aRect.AdjustTop( -1 ); + aRect.AdjustRight( 1 ); + aRect.AdjustBottom( 1 ); // calculate step count if necessary if ( !aGradient.GetSteps() ) diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index 125672e023b2..1a70ec978494 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -175,13 +175,13 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& Size aInc; // Single hatch - aRect.Left() -= nLogPixelWidth; aRect.Top() -= nLogPixelWidth; aRect.Right() += nLogPixelWidth; aRect.Bottom() += nLogPixelWidth; + aRect.AdjustLeft( -nLogPixelWidth ); aRect.AdjustTop( -nLogPixelWidth ); aRect.AdjustRight(nLogPixelWidth ); aRect.AdjustBottom(nLogPixelWidth ); CalcHatchValues( aRect, nWidth, rHatch.GetAngle(), aPt1, aPt2, aInc, aEndPt1 ); do { DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); - aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height(); - aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height(); + aPt1.AdjustX(aInc.Width() ); aPt1.AdjustY(aInc.Height() ); + aPt2.AdjustX(aInc.Width() ); aPt2.AdjustY(aInc.Height() ); } while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) ); @@ -192,8 +192,8 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& do { DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); - aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height(); - aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height(); + aPt1.AdjustX(aInc.Width() ); aPt1.AdjustY(aInc.Height() ); + aPt2.AdjustX(aInc.Width() ); aPt2.AdjustY(aInc.Height() ); } while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) ); @@ -204,8 +204,8 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& do { DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); - aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height(); - aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height(); + aPt1.AdjustX(aInc.Width() ); aPt1.AdjustY(aInc.Height() ); + aPt2.AdjustX(aInc.Width() ); aPt2.AdjustY(aInc.Height() ); } while( ( aPt1.X() <= aEndPt1.X() ) && ( aPt1.Y() <= aEndPt1.Y() ) ); } @@ -238,8 +238,8 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, long nDist, s else nOffset = ( nDist - ( ( aRef.Y() - rRect.Top() ) % nDist ) ); - rPt1.Y() -= nOffset; - rPt2.Y() -= nOffset; + rPt1.AdjustY( -nOffset ); + rPt2.AdjustY( -nOffset ); } else if( 900 == nAngle ) { @@ -253,8 +253,8 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, long nDist, s else nOffset = nDist - ( ( aRef.X() - rRect.Left() ) % nDist ); - rPt1.X() -= nOffset; - rPt2.X() -= nOffset; + rPt1.AdjustX( -nOffset ); + rPt2.AdjustX( -nOffset ); } else if( nAngle >= -450 && nAngle <= 450 ) { @@ -285,8 +285,8 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, long nDist, s else nOffset = nDist - ( ( nPY - rPt1.Y() ) % nDist ); - rPt1.Y() -= nOffset; - rPt2.Y() -= nOffset; + rPt1.AdjustY( -nOffset ); + rPt2.AdjustY( -nOffset ); } else { @@ -317,8 +317,8 @@ void OutputDevice::CalcHatchValues( const tools::Rectangle& rRect, long nDist, s else nOffset = nDist - ( ( nPX - rPt1.X() ) % nDist ); - rPt1.X() -= nOffset; - rPt2.X() -= nOffset; + rPt1.AdjustX( -nOffset ); + rPt2.AdjustX( -nOffset ); } } diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index 9df906196581..bae0162fd387 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -540,12 +540,12 @@ tools::Polygon OutputDevice::ImplLogicToDevicePixel( const tools::Polygon& rLogi { const Point* pPt = &(pPointAry[i]); Point aPt; - aPt.X() = ImplLogicToPixel( pPt->X()+maMapRes.mnMapOfsX, mnDPIX, + aPt.setX( ImplLogicToPixel( pPt->X()+maMapRes.mnMapOfsX, mnDPIX, maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX, - maThresRes.mnThresLogToPixX )+mnOutOffX+mnOutOffOrigX; - aPt.Y() = ImplLogicToPixel( pPt->Y()+maMapRes.mnMapOfsY, mnDPIY, + maThresRes.mnThresLogToPixX )+mnOutOffX+mnOutOffOrigX ); + aPt.setY( ImplLogicToPixel( pPt->Y()+maMapRes.mnMapOfsY, mnDPIY, maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY, - maThresRes.mnThresLogToPixY )+mnOutOffY+mnOutOffOrigY; + maThresRes.mnThresLogToPixY )+mnOutOffY+mnOutOffOrigY ); aPoly[i] = aPt; } } @@ -554,8 +554,8 @@ tools::Polygon OutputDevice::ImplLogicToDevicePixel( const tools::Polygon& rLogi for ( i = 0; i < nPoints; i++ ) { Point aPt = pPointAry[i]; - aPt.X() += mnOutOffX; - aPt.Y() += mnOutOffY; + aPt.AdjustX(mnOutOffX ); + aPt.AdjustY(mnOutOffY ); aPoly[i] = aPt; } } @@ -1002,12 +1002,12 @@ tools::Polygon OutputDevice::LogicToPixel( const tools::Polygon& rLogicPoly ) co { const Point* pPt = &(pPointAry[i]); Point aPt; - aPt.X() = ImplLogicToPixel( pPt->X() + maMapRes.mnMapOfsX, mnDPIX, + aPt.setX( ImplLogicToPixel( pPt->X() + maMapRes.mnMapOfsX, mnDPIX, maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX, - maThresRes.mnThresLogToPixX )+mnOutOffOrigX; - aPt.Y() = ImplLogicToPixel( pPt->Y() + maMapRes.mnMapOfsY, mnDPIY, + maThresRes.mnThresLogToPixX )+mnOutOffOrigX ); + aPt.setY( ImplLogicToPixel( pPt->Y() + maMapRes.mnMapOfsY, mnDPIY, maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY, - maThresRes.mnThresLogToPixY )+mnOutOffOrigY; + maThresRes.mnThresLogToPixY )+mnOutOffOrigY ); aPoly[i] = aPt; } @@ -1161,12 +1161,12 @@ tools::Polygon OutputDevice::LogicToPixel( const tools::Polygon& rLogicPoly, { const Point* pPt = &(pPointAry[i]); Point aPt; - aPt.X() = ImplLogicToPixel( pPt->X() + aMapRes.mnMapOfsX, mnDPIX, + aPt.setX( ImplLogicToPixel( pPt->X() + aMapRes.mnMapOfsX, mnDPIX, aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX, - aThresRes.mnThresLogToPixX )+mnOutOffOrigX; - aPt.Y() = ImplLogicToPixel( pPt->Y() + aMapRes.mnMapOfsY, mnDPIY, + aThresRes.mnThresLogToPixX )+mnOutOffOrigX ); + aPt.setY( ImplLogicToPixel( pPt->Y() + aMapRes.mnMapOfsY, mnDPIY, aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY, - aThresRes.mnThresLogToPixY )+mnOutOffOrigY; + aThresRes.mnThresLogToPixY )+mnOutOffOrigY ); aPoly[i] = aPt; } @@ -1247,12 +1247,12 @@ tools::Polygon OutputDevice::PixelToLogic( const tools::Polygon& rDevicePoly ) c { const Point* pPt = &(pPointAry[i]); Point aPt; - aPt.X() = ImplPixelToLogic( pPt->X(), mnDPIX, + aPt.setX( ImplPixelToLogic( pPt->X(), mnDPIX, maMapRes.mnMapScNumX, maMapRes.mnMapScDenomX, - maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX - mnOutOffLogicX; - aPt.Y() = ImplPixelToLogic( pPt->Y(), mnDPIY, + maThresRes.mnThresPixToLogX ) - maMapRes.mnMapOfsX - mnOutOffLogicX ); + aPt.setY( ImplPixelToLogic( pPt->Y(), mnDPIY, maMapRes.mnMapScNumY, maMapRes.mnMapScDenomY, - maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY - mnOutOffLogicY; + maThresRes.mnThresPixToLogY ) - maMapRes.mnMapOfsY - mnOutOffLogicY ); aPoly[i] = aPt; } @@ -1410,12 +1410,12 @@ tools::Polygon OutputDevice::PixelToLogic( const tools::Polygon& rDevicePoly, { const Point* pPt = &(pPointAry[i]); Point aPt; - aPt.X() = ImplPixelToLogic( pPt->X(), mnDPIX, + aPt.setX( ImplPixelToLogic( pPt->X(), mnDPIX, aMapRes.mnMapScNumX, aMapRes.mnMapScDenomX, - aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX - mnOutOffLogicX; - aPt.Y() = ImplPixelToLogic( pPt->Y(), mnDPIY, + aThresRes.mnThresPixToLogX ) - aMapRes.mnMapOfsX - mnOutOffLogicX ); + aPt.setY( ImplPixelToLogic( pPt->Y(), mnDPIY, aMapRes.mnMapScNumY, aMapRes.mnMapScDenomY, - aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY - mnOutOffLogicY; + aThresRes.mnThresPixToLogY ) - aMapRes.mnMapOfsY - mnOutOffLogicY ); aPoly[i] = aPt; } diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 0565b7f1cd42..10951910fb48 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -690,7 +690,7 @@ bool OutputDevice::ImplIsAntiparallel() const void OutputDevice::ReMirror( Point &rPoint ) const { - rPoint.X() = mnOutOffX + mnOutWidth - 1 - rPoint.X() + mnOutOffX; + rPoint.setX( mnOutOffX + mnOutWidth - 1 - rPoint.X() + mnOutOffX ); } void OutputDevice::ReMirror( tools::Rectangle &rRect ) const { @@ -700,8 +700,8 @@ void OutputDevice::ReMirror( tools::Rectangle &rRect ) const //lc_x = mnOutWidth - nWidth - 1 - lc_x; // mirror //rRect.nLeft = lc_x + mnOutOffX; // re-normalize - rRect.Left() = mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX; - rRect.Right() = rRect.Left() + nWidth; + rRect.SetLeft( mnOutOffX + mnOutWidth - nWidth - 1 - rRect.Left() + mnOutOffX ); + rRect.SetRight( rRect.Left() + nWidth ); } void OutputDevice::ReMirror( vcl::Region &rRegion ) const diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index d2ada019fef7..ff2f49df9dbd 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -274,13 +274,13 @@ void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, { long w = meOutDevType == OUTDEV_VIRDEV ? mnOutWidth : mpGraphics->GetGraphicsWidth(); long x = rSalLayout.DrawBase().X(); - rSalLayout.DrawBase().X() = w - 1 - x; + rSalLayout.DrawBase().setX( w - 1 - x ); if( !IsRTLEnabled() ) { OutputDevice *pOutDevRef = this; // mirror this window back long devX = w-pOutDevRef->mnOutWidth-pOutDevRef->mnOutOffX; // re-mirrored mnOutOffX - rSalLayout.DrawBase().X() = devX + ( pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() - devX) ) ; + rSalLayout.DrawBase().setX( devX + ( pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() - devX) ) ) ; } } else if( IsRTLEnabled() ) @@ -289,11 +289,11 @@ void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, // mirror this window back long devX = pOutDevRef->mnOutOffX; // re-mirrored mnOutOffX - rSalLayout.DrawBase().X() = pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() - devX) + devX; + rSalLayout.DrawBase().setX( pOutDevRef->mnOutWidth - 1 - (rSalLayout.DrawBase().X() - devX) + devX ); } rSalLayout.DrawText( *mpGraphics ); - rSalLayout.DrawBase().X() = nOldX; + rSalLayout.DrawBase().setX( nOldX ); if( bTextLines ) ImplDrawTextLines( rSalLayout, @@ -1361,7 +1361,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplLayout(const OUString& rOrigStr, nRTLOffset = nPixelWidth; else nRTLOffset = pSalLayout->GetTextWidth() / pSalLayout->GetUnitsPerPixel(); - pSalLayout->DrawOffset().X() = 1 - nRTLOffset; + pSalLayout->DrawOffset().setX( 1 - nRTLOffset ); } return pSalLayout; @@ -1605,24 +1605,24 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta // Vertical alignment if ( nStyle & DrawTextFlags::Bottom ) - aPos.Y() += nHeight-(nFormatLines*nTextHeight); + aPos.AdjustY(nHeight-(nFormatLines*nTextHeight) ); else if ( nStyle & DrawTextFlags::VCenter ) - aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2; + aPos.AdjustY((nHeight-(nFormatLines*nTextHeight))/2 ); // Font alignment if ( eAlign == ALIGN_BOTTOM ) - aPos.Y() += nTextHeight; + aPos.AdjustY(nTextHeight ); else if ( eAlign == ALIGN_BASELINE ) - aPos.Y() += rTargetDevice.GetFontMetric().GetAscent(); + aPos.AdjustY(rTargetDevice.GetFontMetric().GetAscent() ); // Output all lines except for the last one for ( i = 0; i < nFormatLines; i++ ) { pLineInfo = aMultiLineInfo.GetLine( i ); if ( nStyle & DrawTextFlags::Right ) - aPos.X() += nWidth-pLineInfo->GetWidth(); + aPos.AdjustX(nWidth-pLineInfo->GetWidth() ); else if ( nStyle & DrawTextFlags::Center ) - aPos.X() += (nWidth-pLineInfo->GetWidth())/2; + aPos.AdjustX((nWidth-pLineInfo->GetWidth())/2 ); sal_Int32 nIndex = pLineInfo->GetIndex(); sal_Int32 nLineLen = pLineInfo->GetLen(); _rLayout.DrawText( aPos, aStr, nIndex, nLineLen, pVector, pDisplayText ); @@ -1647,8 +1647,8 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta rTargetDevice.ImplDrawMnemonicLine( nMnemonicX, nMnemonicY, nMnemonicWidth ); } } - aPos.Y() += nTextHeight; - aPos.X() = rRect.Left(); + aPos.AdjustY(nTextHeight ); + aPos.setX( rRect.Left() ); } // If there still is a last line, we output it left-aligned as the line would be clipped @@ -1683,20 +1683,20 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta // horizontal text alignment if ( nStyle & DrawTextFlags::Right ) - aPos.X() += nWidth-nTextWidth; + aPos.AdjustX(nWidth-nTextWidth ); else if ( nStyle & DrawTextFlags::Center ) - aPos.X() += (nWidth-nTextWidth)/2; + aPos.AdjustX((nWidth-nTextWidth)/2 ); // vertical font alignment if ( eAlign == ALIGN_BOTTOM ) - aPos.Y() += nTextHeight; + aPos.AdjustY(nTextHeight ); else if ( eAlign == ALIGN_BASELINE ) - aPos.Y() += rTargetDevice.GetFontMetric().GetAscent(); + aPos.AdjustY(rTargetDevice.GetFontMetric().GetAscent() ); if ( nStyle & DrawTextFlags::Bottom ) - aPos.Y() += nHeight-nTextHeight; + aPos.AdjustY(nHeight-nTextHeight ); else if ( nStyle & DrawTextFlags::VCenter ) - aPos.Y() += (nHeight-nTextHeight)/2; + aPos.AdjustY((nHeight-nTextHeight)/2 ); long nMnemonicX = 0; long nMnemonicY = 0; @@ -1913,30 +1913,30 @@ tools::Rectangle OutputDevice::GetTextRect( const tools::Rectangle& rRect, } if ( nStyle & DrawTextFlags::Right ) - aRect.Left() = aRect.Right()-nMaxWidth+1; + aRect.SetLeft( aRect.Right()-nMaxWidth+1 ); else if ( nStyle & DrawTextFlags::Center ) { - aRect.Left() += (nWidth-nMaxWidth)/2; - aRect.Right() = aRect.Left()+nMaxWidth-1; + aRect.AdjustLeft((nWidth-nMaxWidth)/2 ); + aRect.SetRight( aRect.Left()+nMaxWidth-1 ); } else - aRect.Right() = aRect.Left()+nMaxWidth-1; + aRect.SetRight( aRect.Left()+nMaxWidth-1 ); if ( nStyle & DrawTextFlags::Bottom ) - aRect.Top() = aRect.Bottom()-(nTextHeight*nLines)+1; + aRect.SetTop( aRect.Bottom()-(nTextHeight*nLines)+1 ); else if ( nStyle & DrawTextFlags::VCenter ) { - aRect.Top() += (aRect.GetHeight()-(nTextHeight*nLines))/2; - aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1; + aRect.AdjustTop((aRect.GetHeight()-(nTextHeight*nLines))/2 ); + aRect.SetBottom( aRect.Top()+(nTextHeight*nLines)-1 ); } else - aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1; + aRect.SetBottom( aRect.Top()+(nTextHeight*nLines)-1 ); // #99188# get rid of rounding problems when using this rect later if (nStyle & DrawTextFlags::Right) - aRect.Left()--; + aRect.AdjustLeft( -1 ); else - aRect.Right()++; + aRect.AdjustRight( 1 ); return aRect; } diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 862d979e020f..2ee5a8b91017 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -645,10 +645,10 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY, pLayout->DrawBase() = Point( nBaseX+mnTextOffX, nBaseY+mnTextOffY ); tools::Rectangle aPixelRect; - aPixelRect.Left() = nBaseX+mnTextOffX; - aPixelRect.Right() = aPixelRect.Left()+nWidth; - aPixelRect.Bottom() = nBaseY+mpFontInstance->mxFontMetric->GetDescent(); - aPixelRect.Top() = nBaseY-mpFontInstance->mxFontMetric->GetAscent(); + aPixelRect.SetLeft( nBaseX+mnTextOffX ); + aPixelRect.SetRight( aPixelRect.Left()+nWidth ); + aPixelRect.SetBottom( nBaseY+mpFontInstance->mxFontMetric->GetDescent() ); + aPixelRect.SetTop( nBaseY-mpFontInstance->mxFontMetric->GetAscent() ); if (mpFontInstance->mnOrientation) { diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 47f9967fe13f..506159a50812 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -137,16 +137,16 @@ void OutputDevice::ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask // mirrored horizontically if( aDestSz.Width() < 0 ) { - aDestSz.Width() = -aDestSz.Width(); - aDestPt.X() -= ( aDestSz.Width() - 1 ); + aDestSz.setWidth( -aDestSz.Width() ); + aDestPt.AdjustX( -( aDestSz.Width() - 1 ) ); nMirrFlags |= BmpMirrorFlags::Horizontal; } // mirrored vertically if( aDestSz.Height() < 0 ) { - aDestSz.Height() = -aDestSz.Height(); - aDestPt.Y() -= ( aDestSz.Height() - 1 ); + aDestSz.setHeight( -aDestSz.Height() ); + aDestPt.AdjustY( -( aDestSz.Height() - 1 ) ); nMirrFlags |= BmpMirrorFlags::Vertical; } diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx index a5351e33811a..567c5eec24cb 100644 --- a/vcl/source/outdev/wallpaper.cxx +++ b/vcl/source/outdev/wallpaper.cxx @@ -205,39 +205,39 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY, break; case WallpaperStyle::Top: - aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1; + aPos.AdjustX(( aSize.Width() - nBmpWidth ) >> 1 ); break; case WallpaperStyle::TopRight: - aPos.X() += ( aSize.Width() - nBmpWidth ); + aPos.AdjustX( aSize.Width() - nBmpWidth); break; case WallpaperStyle::Left: - aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1; + aPos.AdjustY(( aSize.Height() - nBmpHeight ) >> 1 ); break; case WallpaperStyle::Center: - aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1; - aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1; + aPos.AdjustX(( aSize.Width() - nBmpWidth ) >> 1 ); + aPos.AdjustY(( aSize.Height() - nBmpHeight ) >> 1 ); break; case WallpaperStyle::Right: - aPos.X() += ( aSize.Width() - nBmpWidth ); - aPos.Y() += ( aSize.Height() - nBmpHeight ) >> 1; + aPos.AdjustX(aSize.Width() - nBmpWidth); + aPos.AdjustY(( aSize.Height() - nBmpHeight ) >> 1 ); break; case WallpaperStyle::BottomLeft: - aPos.Y() += ( aSize.Height() - nBmpHeight ); + aPos.AdjustY( aSize.Height() - nBmpHeight ); break; case WallpaperStyle::Bottom: - aPos.X() += ( aSize.Width() - nBmpWidth ) >> 1; - aPos.Y() += ( aSize.Height() - nBmpHeight ); + aPos.AdjustX(( aSize.Width() - nBmpWidth ) >> 1 ); + aPos.AdjustY( aSize.Height() - nBmpHeight ); break; case WallpaperStyle::BottomRight: - aPos.X() += ( aSize.Width() - nBmpWidth ); - aPos.Y() += ( aSize.Height() - nBmpHeight ); + aPos.AdjustX( aSize.Width() - nBmpWidth ); + aPos.AdjustY( aSize.Height() - nBmpHeight ); break; default: diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index 980e77da3043..282ff6ef47d1 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -49,18 +49,18 @@ void Window::ImplCalcSymbolRect( tools::Rectangle& rRect ) { // Add border, not shown in the non-default representation, // as we want to use it for small buttons - rRect.Left()--; - rRect.Top()--; - rRect.Right()++; - rRect.Bottom()++; + rRect.AdjustLeft( -1 ); + rRect.AdjustTop( -1 ); + rRect.AdjustRight( 1 ); + rRect.AdjustBottom( 1 ); // we leave 5% room between the symbol and the button border long nExtraWidth = ((rRect.GetWidth()*50)+500)/1000; long nExtraHeight = ((rRect.GetHeight()*50)+500)/1000; - rRect.Left() += nExtraWidth; - rRect.Right() -= nExtraWidth; - rRect.Top() += nExtraHeight; - rRect.Bottom() -= nExtraHeight; + rRect.AdjustLeft(nExtraWidth ); + rRect.AdjustRight( -nExtraWidth ); + rRect.AdjustTop(nExtraHeight ); + rRect.AdjustBottom( -nExtraHeight ); } } /* namespace vcl */ @@ -97,10 +97,10 @@ static void ImplDrawBrdWinSymbolButton( vcl::RenderContext* pDev, true ); } aTempRect = rRect; - aTempRect.Left()+=3; - aTempRect.Right()-=4; - aTempRect.Top()+=3; - aTempRect.Bottom()-=4; + aTempRect.AdjustLeft(3 ); + aTempRect.AdjustRight( -4 ); + aTempRect.AdjustTop(3 ); + aTempRect.AdjustBottom( -4 ); } else { @@ -523,9 +523,9 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei { Point aPos( mpBorderWindow->GetPosPixel() ); if( mnWidth < aBounds.GetWidth() ) - aPos.X() -= (aBounds.GetWidth() - mnWidth) / 2; + aPos.AdjustX( -((aBounds.GetWidth() - mnWidth) / 2) ); if( mnHeight < aBounds.GetHeight() ) - aPos.Y() -= (aBounds.GetHeight() - mnHeight) / 2; + aPos.AdjustY( -((aBounds.GetHeight() - mnHeight) / 2) ); mpBorderWindow->SetPosSizePixel( aPos, aBounds.GetSize() ); } } @@ -1124,16 +1124,16 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) } else { - aMousePos.X() -= maFrameData.maMouseOff.X(); - aMousePos.Y() -= maFrameData.maMouseOff.Y(); + aMousePos.AdjustX( -(maFrameData.maMouseOff.X()) ); + aMousePos.AdjustY( -(maFrameData.maMouseOff.Y()) ); if ( maFrameData.mnHitTest & BorderWindowHitTest::Title ) { maFrameData.mpBorderWindow->SetPointer( Pointer( PointerStyle::Move ) ); Point aPos = pBorderWindow->GetPosPixel(); - aPos.X() += aMousePos.X(); - aPos.Y() += aMousePos.Y(); + aPos.AdjustX(aMousePos.X() ); + aPos.AdjustY(aMousePos.Y() ); if ( maFrameData.mbDragFull ) { pBorderWindow->SetPosPixel( aPos ); @@ -1173,35 +1173,35 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) nMinWidth = nMinWidth2; if ( maFrameData.mnHitTest & (BorderWindowHitTest::Left | BorderWindowHitTest::TopLeft | BorderWindowHitTest::BottomLeft) ) { - aNewRect.Left() += aMousePos.X(); + aNewRect.AdjustLeft(aMousePos.X() ); if ( aNewRect.GetWidth() < nMinWidth ) - aNewRect.Left() = aNewRect.Right()-nMinWidth+1; + aNewRect.SetLeft( aNewRect.Right()-nMinWidth+1 ); else if ( aNewRect.GetWidth() > nMaxWidth ) - aNewRect.Left() = aNewRect.Right()-nMaxWidth+1; + aNewRect.SetLeft( aNewRect.Right()-nMaxWidth+1 ); } else if ( maFrameData.mnHitTest & (BorderWindowHitTest::Right | BorderWindowHitTest::TopRight | BorderWindowHitTest::BottomRight) ) { - aNewRect.Right() += aMousePos.X(); + aNewRect.AdjustRight(aMousePos.X() ); if ( aNewRect.GetWidth() < nMinWidth ) - aNewRect.Right() = aNewRect.Left()+nMinWidth+1; + aNewRect.SetRight( aNewRect.Left()+nMinWidth+1 ); else if ( aNewRect.GetWidth() > nMaxWidth ) - aNewRect.Right() = aNewRect.Left()+nMaxWidth+1; + aNewRect.SetRight( aNewRect.Left()+nMaxWidth+1 ); } if ( maFrameData.mnHitTest & (BorderWindowHitTest::Top | BorderWindowHitTest::TopLeft | BorderWindowHitTest::TopRight) ) { - aNewRect.Top() += aMousePos.Y(); + aNewRect.AdjustTop(aMousePos.Y() ); if ( aNewRect.GetHeight() < nMinHeight ) - aNewRect.Top() = aNewRect.Bottom()-nMinHeight+1; + aNewRect.SetTop( aNewRect.Bottom()-nMinHeight+1 ); else if ( aNewRect.GetHeight() > nMaxHeight ) - aNewRect.Top() = aNewRect.Bottom()-nMaxHeight+1; + aNewRect.SetTop( aNewRect.Bottom()-nMaxHeight+1 ); } else if ( maFrameData.mnHitTest & (BorderWindowHitTest::Bottom | BorderWindowHitTest::BottomLeft | BorderWindowHitTest::BottomRight) ) { - aNewRect.Bottom() += aMousePos.Y(); + aNewRect.AdjustBottom(aMousePos.Y() ); if ( aNewRect.GetHeight() < nMinHeight ) - aNewRect.Bottom() = aNewRect.Top()+nMinHeight+1; + aNewRect.SetBottom( aNewRect.Top()+nMinHeight+1 ); else if ( aNewRect.GetHeight() > nMaxHeight ) - aNewRect.Bottom() = aNewRect.Top()+nMaxHeight+1; + aNewRect.SetBottom( aNewRect.Top()+nMaxHeight+1 ); } // call Resizing-Handler for SystemWindows @@ -1209,27 +1209,27 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) { // adjust size for Resizing-call aSize = aNewRect.GetSize(); - aSize.Width() -= nBorderWidth; - aSize.Height() -= nBorderHeight; + aSize.AdjustWidth( -nBorderWidth ); + aSize.AdjustHeight( -nBorderHeight ); static_cast<SystemWindow*>(pBorderWindow->ImplGetClientWindow())->Resizing( aSize ); - aSize.Width() += nBorderWidth; - aSize.Height() += nBorderHeight; + aSize.AdjustWidth(nBorderWidth ); + aSize.AdjustHeight(nBorderHeight ); if ( aSize.Width() < nMinWidth ) - aSize.Width() = nMinWidth; + aSize.setWidth( nMinWidth ); if ( aSize.Height() < nMinHeight ) - aSize.Height() = nMinHeight; + aSize.setHeight( nMinHeight ); if ( aSize.Width() > nMaxWidth ) - aSize.Width() = nMaxWidth; + aSize.setWidth( nMaxWidth ); if ( aSize.Height() > nMaxHeight ) - aSize.Height() = nMaxHeight; + aSize.setHeight( nMaxHeight ); if ( maFrameData.mnHitTest & (BorderWindowHitTest::Left | BorderWindowHitTest::TopLeft | BorderWindowHitTest::BottomLeft) ) - aNewRect.Left() = aNewRect.Right()-aSize.Width()+1; + aNewRect.SetLeft( aNewRect.Right()-aSize.Width()+1 ); else - aNewRect.Right() = aNewRect.Left()+aSize.Width()-1; + aNewRect.SetRight( aNewRect.Left()+aSize.Width()-1 ); if ( maFrameData.mnHitTest & (BorderWindowHitTest::Top | BorderWindowHitTest::TopLeft | BorderWindowHitTest::TopRight) ) - aNewRect.Top() = aNewRect.Bottom()-aSize.Height()+1; + aNewRect.SetTop( aNewRect.Bottom()-aSize.Height()+1 ); else - aNewRect.Bottom() = aNewRect.Top()+aSize.Height()-1; + aNewRect.SetBottom( aNewRect.Top()+aSize.Height()-1 ); } if ( maFrameData.mbDragFull ) @@ -1245,9 +1245,9 @@ bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) pBorderWindow->ImplUpdateAll(); pBorderWindow->ImplGetFrameWindow()->ImplUpdateAll(); if ( maFrameData.mnHitTest & (BorderWindowHitTest::Right | BorderWindowHitTest::TopRight | BorderWindowHitTest::BottomRight) ) - maFrameData.maMouseOff.X() += aNewRect.GetWidth()-nOldWidth; + maFrameData.maMouseOff.AdjustX(aNewRect.GetWidth()-nOldWidth ); if ( maFrameData.mnHitTest & (BorderWindowHitTest::Bottom | BorderWindowHitTest::BottomLeft | BorderWindowHitTest::BottomRight) ) - maFrameData.maMouseOff.Y() += aNewRect.GetHeight()-nOldHeight; + maFrameData.maMouseOff.AdjustY(aNewRect.GetHeight()-nOldHeight ); } else { @@ -1317,10 +1317,10 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh // highlighted buttons in the title pBorderWindow->SetBackground( rStyleSettings.GetFaceColor() ); - pData->maTitleRect.Left() = pData->mnLeftBorder; - pData->maTitleRect.Right() = nWidth-pData->mnRightBorder-1; - pData->maTitleRect.Top() = pData->mnTopBorder; - pData->maTitleRect.Bottom() = pData->maTitleRect.Top()+pData->mnTitleHeight-1; + pData->maTitleRect.SetLeft( pData->mnLeftBorder ); + pData->maTitleRect.SetRight( nWidth-pData->mnRightBorder-1 ); + pData->maTitleRect.SetTop( pData->mnTopBorder ); + pData->maTitleRect.SetBottom( pData->maTitleRect.Top()+pData->mnTitleHeight-1 ); if ( pData->mnTitleType & (BorderWindowTitleType::Normal | BorderWindowTitleType::Small) ) { @@ -1331,10 +1331,10 @@ void ImplStdBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHeigh auto addSquareOnRight = [&nRight, nItemTop, nItemBottom]( tools::Rectangle & rect, long gap) { - rect.Top() = nItemTop; - rect.Bottom() = nItemBottom; - rect.Right() = nRight; - rect.Left() = rect.Right() - rect.GetHeight() + 1; + rect.SetTop( nItemTop ); + rect.SetBottom( nItemBottom ); + rect.SetRight( nRight ); + rect.SetLeft( rect.Right() - rect.GetHeight() + 1 ); nRight -= rect.GetWidth() + gap; }; @@ -1438,10 +1438,10 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con rRenderContext.SetLineColor(aFrameColor); rRenderContext.SetFillColor(); rRenderContext.DrawRect(aInRect); - ++aInRect.Left(); - --aInRect.Right(); - ++aInRect.Top(); - --aInRect.Bottom(); + aInRect.AdjustLeft( 1 ); + aInRect.AdjustRight( -1 ); + aInRect.AdjustTop( 1 ); + aInRect.AdjustBottom( -1 ); // restore if (!(pData->mnTitleType & (BorderWindowTitleType::Normal | BorderWindowTitleType::Small))) @@ -1484,21 +1484,21 @@ void ImplStdBorderWindowView::DrawWindow(vcl::RenderContext& rRenderContext, con if (pData->mnTitleType != BorderWindowTitleType::Tearoff) { - aInRect.Left() += 2; - aInRect.Right() -= 2; + aInRect.AdjustLeft(2 ); + aInRect.AdjustRight( -2 ); if (!pData->maHelpRect.IsEmpty()) - aInRect.Right() = pData->maHelpRect.Left() - 2; + aInRect.SetRight( pData->maHelpRect.Left() - 2 ); else if (!pData->maRollRect.IsEmpty()) - aInRect.Right() = pData->maRollRect.Left() - 2; + aInRect.SetRight( pData->maRollRect.Left() - 2 ); else if (!pData->maHideRect.IsEmpty()) - aInRect.Right() = pData->maHideRect.Left() - 2; + aInRect.SetRight( pData->maHideRect.Left() - 2 ); else if (!pData->maDockRect.IsEmpty()) - aInRect.Right() = pData->maDockRect.Left() - 2; + aInRect.SetRight( pData->maDockRect.Left() - 2 ); else if (!pData->maMenuRect.IsEmpty()) - aInRect.Right() = pData->maMenuRect.Left() - 2; + aInRect.SetRight( pData->maMenuRect.Left() - 2 ); else if (!pData->maCloseRect.IsEmpty()) - aInRect.Right() = pData->maCloseRect.Left() - 2; + aInRect.SetRight( pData->maCloseRect.Left() - 2 ); if (pOffset) aInRect.Move(pOffset->X(), pOffset->Y()); @@ -1869,8 +1869,8 @@ void ImplBorderWindow::UpdateView( bool bNewView, const Size& rNewOutSize ) { Size aSize = aOutputSize; mpBorderView->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder ); - aSize.Width() += nLeftBorder+nRightBorder; - aSize.Height() += nTopBorder+nBottomBorder; + aSize.AdjustWidth(nLeftBorder+nRightBorder ); + aSize.AdjustHeight(nTopBorder+nBottomBorder ); mpBorderView->Init( this, aSize.Width(), aSize.Height() ); } @@ -1883,8 +1883,8 @@ void ImplBorderWindow::UpdateView( bool bNewView, const Size& rNewOutSize ) GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder ); if ( aOldSize.Width() || aOldSize.Height() ) { - aOutputSize.Width() += nLeftBorder+nRightBorder; - aOutputSize.Height() += nTopBorder+nBottomBorder; + aOutputSize.AdjustWidth(nLeftBorder+nRightBorder ); + aOutputSize.AdjustHeight(nTopBorder+nBottomBorder ); if ( aOutputSize == GetSizePixel() ) InvalidateBorder(); else @@ -1906,10 +1906,10 @@ void ImplBorderWindow::InvalidateBorder() { tools::Rectangle aWinRect( Point( 0, 0 ), GetOutputSizePixel() ); vcl::Region aRegion( aWinRect ); - aWinRect.Left() += nLeftBorder; - aWinRect.Top() += nTopBorder; - aWinRect.Right() -= nRightBorder; - aWinRect.Bottom() -= nBottomBorder; + aWinRect.AdjustLeft(nLeftBorder ); + aWinRect.AdjustTop(nTopBorder ); + aWinRect.AdjustRight( -nRightBorder ); + aWinRect.AdjustBottom( -nBottomBorder ); // no output area anymore, now invalidate all if ( (aWinRect.Right() < aWinRect.Left()) || (aWinRect.Bottom() < aWinRect.Top()) ) diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index 9bbffc417bb8..38f90362ec41 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -122,13 +122,13 @@ long ButtonDialog::ImplGetButtonSize() nTxtWidth += IMPL_EXTRA_BUTTON_WIDTH; if ( nTxtWidth > maCtrlSize.Width() ) - maCtrlSize.Width() = nTxtWidth; + maCtrlSize.setWidth( nTxtWidth ); long nTxtHeight = it->mpPushButton->GetTextHeight(); nTxtHeight += IMPL_EXTRA_BUTTON_HEIGHT; if ( nTxtHeight > maCtrlSize.Height() ) - maCtrlSize.Height() = nTxtHeight; + maCtrlSize.setHeight( nTxtHeight ); nSepSize += it->mnSepSize; @@ -163,7 +163,7 @@ void ButtonDialog::ImplPosControls() if ( GetStyle() & WB_HORZ ) { if ( mnButtonSize+(IMPL_DIALOG_OFFSET*2) > aDlgSize.Width() ) - aDlgSize.Width() = mnButtonSize+(IMPL_DIALOG_OFFSET*2); + aDlgSize.setWidth( mnButtonSize+(IMPL_DIALOG_OFFSET*2) ); if ( GetStyle() & WB_LEFT ) nX = IMPL_DIALOG_OFFSET; else if ( GetStyle() & WB_RIGHT ) @@ -171,13 +171,13 @@ void ButtonDialog::ImplPosControls() else nX = (aDlgSize.Width()-mnButtonSize)/2; - aDlgSize.Height() += IMPL_DIALOG_OFFSET+maCtrlSize.Height(); + aDlgSize.AdjustHeight(IMPL_DIALOG_OFFSET+maCtrlSize.Height() ); nY = aDlgSize.Height()-maCtrlSize.Height()-IMPL_DIALOG_OFFSET; } else { if ( mnButtonSize+(IMPL_DIALOG_OFFSET*2) > aDlgSize.Height() ) - aDlgSize.Height() = mnButtonSize+(IMPL_DIALOG_OFFSET*2); + aDlgSize.setHeight( mnButtonSize+(IMPL_DIALOG_OFFSET*2) ); if ( GetStyle() & WB_BOTTOM ) nY = aDlgSize.Height()-mnButtonSize-IMPL_DIALOG_OFFSET; else if ( GetStyle() & WB_VCENTER ) @@ -185,7 +185,7 @@ void ButtonDialog::ImplPosControls() else nY = IMPL_DIALOG_OFFSET; - aDlgSize.Width() += IMPL_DIALOG_OFFSET+maCtrlSize.Width(); + aDlgSize.AdjustWidth(IMPL_DIALOG_OFFSET+maCtrlSize.Width() ); nX = aDlgSize.Width()-maCtrlSize.Width()-IMPL_DIALOG_OFFSET; } diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index bfdfe67464e8..2da864f9bcd2 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -67,16 +67,16 @@ static void ImplCursorInvert( ImplCursorData const * pData ) tools::Polygon aPoly( aRect ); if( aPoly.GetSize() == 5 ) { - aPoly[1].X() += 1; // include the right border - aPoly[2].X() += 1; + aPoly[1].AdjustX(1 ); // include the right border + aPoly[2].AdjustX(1 ); if ( pData->mnPixSlant ) { Point aPoint = aPoly.GetPoint( 0 ); - aPoint.X() += pData->mnPixSlant; + aPoint.AdjustX(pData->mnPixSlant ); aPoly.SetPoint( aPoint, 0 ); aPoly.SetPoint( aPoint, 4 ); aPoint = aPoly.GetPoint( 1 ); - aPoint.X() += pData->mnPixSlant; + aPoint.AdjustX(pData->mnPixSlant ); aPoly.SetPoint( aPoint, 1 ); } @@ -91,9 +91,9 @@ static void ImplCursorInvert( ImplCursorData const * pData ) pAry[0] = aPoly.GetPoint( 0 ); pAry[1] = aPoly.GetPoint( 1 ); pAry[2] = pAry[1]; - pAry[2].X() += delta; + pAry[2].AdjustX(delta ); pAry[3] = pAry[1]; - pAry[3].Y() += delta; + pAry[3].AdjustY(delta ); pAry[4] = aPoly.GetPoint( 2 ); pAry[5] = aPoly.GetPoint( 3 ); pAry[6] = aPoly.GetPoint( 4 ); @@ -106,9 +106,9 @@ static void ImplCursorInvert( ImplCursorData const * pData ) pAry[2] = aPoly.GetPoint( 2 ); pAry[3] = aPoly.GetPoint( 3 ); pAry[4] = pAry[0]; - pAry[4].Y() += delta; + pAry[4].AdjustY(delta ); pAry[5] = pAry[0]; - pAry[5].X() -= delta; + pAry[5].AdjustX( -delta ); pAry[6] = aPoly.GetPoint( 4 ); } aPoly = tools::Polygon( 7, pAry); @@ -148,7 +148,7 @@ void vcl::Cursor::ImplDraw() // use width (as set in Settings) if size is 0, if ( !mpData->maPixSize.Width() ) - mpData->maPixSize.Width() = pWindow->GetSettings().GetStyleSettings().GetCursorSize(); + mpData->maPixSize.setWidth( pWindow->GetSettings().GetStyleSettings().GetCursorSize() ); // calculate output area and display ImplCursorInvert( mpData.get() ); @@ -233,7 +233,7 @@ void vcl::Cursor::LOKNotify( vcl::Window* pWindow, const OUString& rAction ) const long nY = pWindow->GetOutOffYPixel() + pWindow->LogicToPixel(GetPos()).Y(); Size aSize = pWindow->LogicToPixel(GetSize()); if (!aSize.Width()) - aSize.Width() = pWindow->GetSettings().GetStyleSettings().GetCursorSize(); + aSize.setWidth( pWindow->GetSettings().GetStyleSettings().GetCursorSize() ); const tools::Rectangle aRect(Point(nX, nY), aSize); aItems.emplace_back("rectangle", aRect.toString()); @@ -395,7 +395,7 @@ void vcl::Cursor::SetWidth( long nNewWidth ) { if ( maSize.Width() != nNewWidth ) { - maSize.Width() = nNewWidth; + maSize.setWidth( nNewWidth ); ImplNew(); } } diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index b2c494390d09..8b30b88a754d 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -76,7 +76,7 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) ); for ( long i=1; i <= n2; ++i ) { - ++nRect.Top(); + nRect.AdjustTop( 1 ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ), Point( aCenter.X()+i, nRect.Top() ) ); } @@ -88,7 +88,7 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) ); for ( long i=1; i <= n2; ++i ) { - --nRect.Bottom(); + nRect.AdjustBottom( -1 ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ), Point( aCenter.X()+i, nRect.Bottom() ) ); } @@ -100,7 +100,7 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) ); for ( long i=1; i <= n2; ++i ) { - ++nRect.Left(); + nRect.AdjustLeft( 1 ); pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-i ), Point( nRect.Left(), aCenter.Y()+i ) ); } @@ -112,7 +112,7 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) ); for ( long i=1; i <= n2; ++i ) { - --nRect.Right(); + nRect.AdjustRight( -1 ); pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-i ), Point( nRect.Right(), aCenter.Y()+i ) ); } @@ -121,22 +121,22 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp break; case SymbolType::SPIN_UP: - nRect.Top() += n4; + nRect.AdjustTop(n4 ); pDev->DrawPixel( Point( aCenter.X(), nRect.Top() ) ); for ( long i=1; i <= n2; ++i ) { - ++nRect.Top(); + nRect.AdjustTop( 1 ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ), Point( aCenter.X()+i, nRect.Top() ) ); } break; case SymbolType::SPIN_DOWN: - nRect.Bottom() -= n4; + nRect.AdjustBottom( -n4 ); pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom() ) ); for ( long i=1; i <= n2; ++i ) { - --nRect.Bottom(); + nRect.AdjustBottom( -1 ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ), Point( aCenter.X()+i, nRect.Bottom() ) ); } @@ -145,17 +145,17 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp case SymbolType::SPIN_LEFT: case SymbolType::FIRST: case SymbolType::PREV: - nRect.Left() += n4; + nRect.AdjustLeft(n4 ); if ( eType==SymbolType::FIRST ) { pDev->DrawLine( Point( nRect.Left(), nRect.Top() ), Point( nRect.Left(), nRect.Bottom() ) ); - ++nRect.Left(); + nRect.AdjustLeft( 1 ); } pDev->DrawPixel( Point( nRect.Left(), aCenter.Y() ) ); for ( long i=1; i <= n2; ++i ) { - ++nRect.Left(); + nRect.AdjustLeft( 1 ); pDev->DrawLine( Point( nRect.Left(), aCenter.Y()-i ), Point( nRect.Left(), aCenter.Y()+i ) ); } @@ -165,17 +165,17 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp case SymbolType::LAST: case SymbolType::NEXT: case SymbolType::PLAY: - nRect.Right() -= n4; + nRect.AdjustRight( -n4 ); if ( eType==SymbolType::LAST ) { pDev->DrawLine( Point( nRect.Right(), nRect.Top() ), Point( nRect.Right(), nRect.Bottom() ) ); - --nRect.Right(); + nRect.AdjustRight( -1 ); } pDev->DrawPixel( Point( nRect.Right(), aCenter.Y() ) ); for ( long i=1; i <= n2; ++i ) { - --nRect.Right(); + nRect.AdjustRight( -1 ); pDev->DrawLine( Point( nRect.Right(), aCenter.Y()-i ), Point( nRect.Right(), aCenter.Y()+i ) ); } @@ -186,7 +186,7 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp pDev->DrawPixel( Point( aCenter.X(), nRect.Top()+n2 ) ); for ( long i=1; i < n2; ++i ) { - ++nRect.Top(); + nRect.AdjustTop( 1 ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Top() ), Point( aCenter.X()+i, nRect.Top() ) ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Top()+n2 ), @@ -199,7 +199,7 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp pDev->DrawPixel( Point( aCenter.X(), nRect.Bottom()-n2 ) ); for ( long i=1; i < n2; ++i ) { - --nRect.Bottom(); + nRect.AdjustBottom( -1 ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom() ), Point( aCenter.X()+i, nRect.Bottom() ) ); pDev->DrawLine( Point( aCenter.X()-i, nRect.Bottom()-n2 ), @@ -277,8 +277,8 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp case SymbolType::CHECKMARK: { long n3 = nSide/3; - nRect.Top() -= n3/2; - nRect.Bottom() -= n3/2; + nRect.AdjustTop( -(n3/2) ); + nRect.AdjustBottom( -(n3/2) ); // #106953# never mirror checkmarks if ( pDev->HasMirroredGraphics() && pDev->IsRTLEnabled() ) { @@ -288,8 +288,8 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp Point( nRect.Right()-n3, nRect.Bottom() ) ); pDev->DrawLine( Point( nRect.Right()-n3, nRect.Bottom() ), Point( nRect.Left(), nRect.Top()+n3 ) ); - ++nRect.Top(); - ++nRect.Bottom(); + nRect.AdjustTop( 1 ); + nRect.AdjustBottom( 1 ); pDev->DrawLine( Point( nRect.Right(), nRect.Bottom()-n3 ), Point( nRect.Right()-n3, nRect.Bottom() ) ); pDev->DrawLine( Point( nRect.Right()-n3, nRect.Bottom() ), @@ -301,8 +301,8 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp Point( nRect.Left()+n3, nRect.Bottom() ) ); pDev->DrawLine( Point( nRect.Left()+n3, nRect.Bottom() ), Point( nRect.Right(), nRect.Top()+n3 ) ); - ++nRect.Top(); - ++nRect.Bottom(); + nRect.AdjustTop( 1 ); + nRect.AdjustBottom( 1 ); pDev->DrawLine( Point( nRect.Left(), nRect.Bottom()-n3 ), Point( nRect.Left()+n3, nRect.Bottom() ) ); pDev->DrawLine( Point( nRect.Left()+n3, nRect.Bottom() ), @@ -312,8 +312,8 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp break; case SymbolType::FLOAT: - nRect.Right() -= n4; - nRect.Top() += n4+1; + nRect.AdjustRight( -n4 ); + nRect.AdjustTop(n4+1 ); pDev->DrawRect( tools::Rectangle( nRect.Left(), nRect.Top(), nRect.Right(), nRect.Top()+n8 ) ); pDev->DrawLine( Point( nRect.Left(), nRect.Top()+n8 ), @@ -322,10 +322,10 @@ void ImplDrawSymbol( OutputDevice* pDev, tools::Rectangle nRect, const SymbolTyp Point( nRect.Right(), nRect.Bottom() ) ); pDev->DrawLine( Point( nRect.Right(), nRect.Top()+n8 ), Point( nRect.Right(), nRect.Bottom() ) ); - nRect.Right() += n4; - nRect.Top() -= n4+1; - nRect.Left() += n4; - nRect.Bottom() -= n4+1; + nRect.AdjustRight(n4 ); + nRect.AdjustTop( -(n4+1) ); + nRect.AdjustLeft(n4 ); + nRect.AdjustBottom( -(n4+1) ); pDev->DrawRect( tools::Rectangle( nRect.Left(), nRect.Top(), nRect.Right(), nRect.Top()+n8 ) ); pDev->DrawLine( Point( nRect.Left(), nRect.Top()+n8 ), @@ -407,10 +407,10 @@ void ImplDrawDPILineRect( OutputDevice *const pDev, tools::Rectangle& rRect, } } - rRect.Left() += nLineWidth; - rRect.Top() += nLineHeight; - rRect.Right() -= nLineWidth; - rRect.Bottom() -= nLineHeight; + rRect.AdjustLeft(nLineWidth ); + rRect.AdjustTop(nLineHeight ); + rRect.AdjustRight( -nLineWidth ); + rRect.AdjustBottom( -nLineHeight ); } void ImplDraw2ColorFrame( OutputDevice *const pDev, tools::Rectangle& rRect, @@ -424,10 +424,10 @@ void ImplDraw2ColorFrame( OutputDevice *const pDev, tools::Rectangle& rRect, pDev->DrawLine( rRect.TopRight(), rRect.BottomRight() ); // reduce drawing area - ++rRect.Left(); - ++rRect.Top(); - --rRect.Right(); - --rRect.Bottom(); + rRect.AdjustLeft( 1 ); + rRect.AdjustTop( 1 ); + rRect.AdjustRight( -1 ); + rRect.AdjustBottom( -1 ); } void ImplDrawButton( OutputDevice *const pDev, tools::Rectangle aFillRect, @@ -453,9 +453,9 @@ void ImplDrawButton( OutputDevice *const pDev, tools::Rectangle aFillRect, { aBrdSize = pDev->LogicToPixel( Size( 20, 20 ), MapMode(MapUnit::Map100thMM) ); if ( !aBrdSize.Width() ) - aBrdSize.Width() = 1; + aBrdSize.setWidth( 1 ); if ( !aBrdSize.Height() ) - aBrdSize.Height() = 1; + aBrdSize.setHeight( 1 ); } pDev->SetLineColor(); @@ -464,8 +464,8 @@ void ImplDrawButton( OutputDevice *const pDev, tools::Rectangle aFillRect, if ( nStyle & (DrawButtonFlags::Pressed | DrawButtonFlags::Checked) ) { // shrink fill rect - aFillRect.Left() += aBrdSize.Width(); - aFillRect.Top() += aBrdSize.Height(); + aFillRect.AdjustLeft(aBrdSize.Width() ); + aFillRect.AdjustTop(aBrdSize.Height() ); // draw top and left borders (aOrigFillRect-aFillRect) pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aOrigFillRect.Top(), aOrigFillRect.Right(), aFillRect.Top()-1 ) ); @@ -475,8 +475,8 @@ void ImplDrawButton( OutputDevice *const pDev, tools::Rectangle aFillRect, else { // shrink fill rect - aFillRect.Right() -= aBrdSize.Width(); - aFillRect.Bottom() -= aBrdSize.Height(); + aFillRect.AdjustRight( -(aBrdSize.Width()) ); + aFillRect.AdjustBottom( -(aBrdSize.Height()) ); // draw bottom and right borders (aOrigFillRect-aFillRect) pDev->DrawRect( tools::Rectangle( aOrigFillRect.Left(), aFillRect.Bottom()+1, aOrigFillRect.Right(), aOrigFillRect.Bottom() ) ); @@ -507,7 +507,7 @@ void ImplDrawButton( OutputDevice *const pDev, tools::Rectangle aFillRect, pDev->SetLineColor( rStyleSettings.GetLightBorderColor() ); pDev->DrawLine( Point( aFillRect.Left(), aFillRect.Top() ), Point( aFillRect.Left(), aFillRect.Bottom() ) ); - ++aFillRect.Left(); + aFillRect.AdjustLeft( 1 ); } Color aColor1; @@ -652,27 +652,27 @@ void ImplDrawFrame( OutputDevice *const pDev, tools::Rectangle& rRect, { case DrawFrameStyle::In: case DrawFrameStyle::Out: - ++rRect.Left(); - ++rRect.Top(); - --rRect.Right(); - --rRect.Bottom(); + rRect.AdjustLeft( 1 ); + rRect.AdjustTop( 1 ); + rRect.AdjustRight( -1 ); + rRect.AdjustBottom( -1 ); break; case DrawFrameStyle::Group: case DrawFrameStyle::DoubleIn: case DrawFrameStyle::DoubleOut: - rRect.Left() += 2; - rRect.Top() += 2; - rRect.Right() -= 2; - rRect.Bottom() -= 2; + rRect.AdjustLeft(2 ); + rRect.AdjustTop(2 ); + rRect.AdjustRight( -2 ); + rRect.AdjustBottom( -2 ); break; case DrawFrameStyle::NWF: // enough space for the native rendering - rRect.Left() += 4; - rRect.Top() += 4; - rRect.Right() -= 4; - rRect.Bottom() -= 4; + rRect.AdjustLeft(4 ); + rRect.AdjustTop(4 ); + rRect.AdjustRight( -4 ); + rRect.AdjustBottom( -4 ); break; default: break; } @@ -691,10 +691,10 @@ void ImplDrawFrame( OutputDevice *const pDev, tools::Rectangle& rRect, rRect.Right()-1, rRect.Bottom()-1 ) ); // adjust target rectangle - rRect.Left() += 2; - rRect.Top() += 2; - rRect.Right() -= 2; - rRect.Bottom() -= 2; + rRect.AdjustLeft(2 ); + rRect.AdjustTop(2 ); + rRect.AdjustRight( -2 ); + rRect.AdjustBottom( -2 ); break; case DrawFrameStyle::In: @@ -759,10 +759,10 @@ void ImplDrawFrame( OutputDevice *const pDev, tools::Rectangle& rRect, case DrawFrameStyle::NWF: // no rendering, just enough space for the native rendering - rRect.Left() += 4; - rRect.Top() += 4; - rRect.Right() -= 4; - rRect.Bottom() -= 4; + rRect.AdjustLeft(4 ); + rRect.AdjustTop(4 ); + rRect.AdjustRight( -4 ); + rRect.AdjustBottom( -4 ); break; default: break; } @@ -936,51 +936,51 @@ tools::Rectangle DecorationView::DrawButton( const tools::Rectangle& rRect, Draw mpOutDev->SetFillColor( aOldFillColor ); // keep border free, although it is used at default representation - ++aRect.Left(); - ++aRect.Top(); - --aRect.Right(); - --aRect.Bottom(); + aRect.AdjustLeft( 1 ); + aRect.AdjustTop( 1 ); + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); if ( nStyle & DrawButtonFlags::NoLightBorder ) { - ++aRect.Left(); - ++aRect.Top(); + aRect.AdjustLeft( 1 ); + aRect.AdjustTop( 1 ); } else if ( nStyle & DrawButtonFlags::NoLeftLightBorder ) { - ++aRect.Left(); + aRect.AdjustLeft( 1 ); } if ( nStyle & DrawButtonFlags::Pressed ) { if ( (aRect.GetHeight() > 10) && (aRect.GetWidth() > 10) ) { - aRect.Left() += 4; - aRect.Top() += 4; - aRect.Right() -= 1; - aRect.Bottom() -= 1; + aRect.AdjustLeft(4 ); + aRect.AdjustTop(4 ); + aRect.AdjustRight( -1 ); + aRect.AdjustBottom( -1 ); } else { - aRect.Left() += 3; - aRect.Top() += 3; - aRect.Right() -= 2; - aRect.Bottom() -= 2; + aRect.AdjustLeft(3 ); + aRect.AdjustTop(3 ); + aRect.AdjustRight( -2 ); + aRect.AdjustBottom( -2 ); } } else if ( nStyle & DrawButtonFlags::Checked ) { - aRect.Left() += 3; - aRect.Top() += 3; - aRect.Right() -= 2; - aRect.Bottom() -= 2; + aRect.AdjustLeft(3 ); + aRect.AdjustTop(3 ); + aRect.AdjustRight( -2 ); + aRect.AdjustBottom( -2 ); } else { - aRect.Left() += 2; - aRect.Top() += 2; - aRect.Right() -= 3; - aRect.Bottom() -= 3; + aRect.AdjustLeft(2 ); + aRect.AdjustTop(2 ); + aRect.AdjustRight( -3 ); + aRect.AdjustBottom( -3 ); } if ( bOldMap ) @@ -1019,13 +1019,13 @@ void DecorationView::DrawSeparator( const Point& rStart, const Point& rStop, boo mpOutDev->SetLineColor( rStyleSettings.GetLightColor() ); if( bVertical ) { - aStart.X()++; - aStop.X()++; + aStart.AdjustX( 1 ); + aStop.AdjustX( 1 ); } else { - aStart.Y()++; - aStop.Y()++; + aStart.AdjustY( 1 ); + aStop.AdjustY( 1 ); } mpOutDev->DrawLine( aStart, aStop ); } diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index bbed7a062486..4d01b3625e0c 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -231,17 +231,17 @@ void DockingAreaWindow::Paint(vcl::RenderContext& rRenderContext, const tools::R tools::Rectangle aTBRect; if (IsHorizontal()) { - aTBRect.Left() = 0; - aTBRect.Right() = aOutSz.Width() - 1; - aTBRect.Top() = range.first; - aTBRect.Bottom() = range.first + range.second - 1; + aTBRect.SetLeft( 0 ); + aTBRect.SetRight( aOutSz.Width() - 1 ); + aTBRect.SetTop( range.first ); + aTBRect.SetBottom( range.first + range.second - 1 ); } else { - aTBRect.Left() = range.first; - aTBRect.Right() = range.first + range.second - 1; - aTBRect.Top() = 0; - aTBRect.Bottom() = aOutSz.Height() - 1; + aTBRect.SetLeft( range.first ); + aTBRect.SetRight( range.first + range.second - 1 ); + aTBRect.SetTop( 0 ); + aTBRect.SetBottom( aOutSz.Height() - 1 ); } rRenderContext.DrawNativeControl(ControlType::Toolbar, IsHorizontal() ? ControlPart::DrawBackgroundHorz : ControlPart::DrawBackgroundVert, aTBRect, nState, aControlValue, OUString()); diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 36fee5fe60cf..eb27e3e18c05 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -172,9 +172,9 @@ IMPL_LINK_NOARG(ImplDockFloatWin2, DockingHdl, void*, void) sal_Int32 nLeft, nTop, nRight, nBottom; GetBorder( nLeft, nTop, nRight, nBottom ); // limit borderrect to the caption part only and without the resizing borders - aBorderRect.Bottom() = aBorderRect.Top() + nTop; - aBorderRect.Left() += nLeft; - aBorderRect.Right() -= nRight; + aBorderRect.SetBottom( aBorderRect.Top() + nTop ); + aBorderRect.AdjustLeft(nLeft ); + aBorderRect.AdjustRight( -nRight ); PointerState aBorderState = pBorder->GetPointerState(); bRealMove = aBorderRect.IsInside( aBorderState.maPos ); @@ -515,8 +515,8 @@ void ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos ) if ( mbLastFloatMode ) { - maMouseOff.X() += mnDockLeft; - maMouseOff.Y() += mnDockTop; + maMouseOff.AdjustX(mnDockLeft ); + maMouseOff.AdjustY(mnDockTop ); mnTrackX -= mnDockLeft; mnTrackY -= mnDockTop; mnTrackWidth += mnDockLeft+mnDockRight; @@ -563,21 +563,21 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) Point aFrameMousePos = GetWindow()->ImplOutputToFrame( aMousePos ); Size aFrameSize = GetWindow()->ImplGetFrameWindow()->GetOutputSizePixel(); if ( aFrameMousePos.X() < 0 ) - aFrameMousePos.X() = 0; + aFrameMousePos.setX( 0 ); if ( aFrameMousePos.Y() < 0 ) - aFrameMousePos.Y() = 0; + aFrameMousePos.setY( 0 ); if ( aFrameMousePos.X() > aFrameSize.Width()-1 ) - aFrameMousePos.X() = aFrameSize.Width()-1; + aFrameMousePos.setX( aFrameSize.Width()-1 ); if ( aFrameMousePos.Y() > aFrameSize.Height()-1 ) - aFrameMousePos.Y() = aFrameSize.Height()-1; + aFrameMousePos.setY( aFrameSize.Height()-1 ); aMousePos = GetWindow()->ImplFrameToOutput( aFrameMousePos ); - aMousePos.X() -= maMouseOff.X(); - aMousePos.Y() -= maMouseOff.Y(); + aMousePos.AdjustX( -(maMouseOff.X()) ); + aMousePos.AdjustY( -(maMouseOff.Y()) ); Point aPos = GetWindow()->ImplOutputToFrame( aMousePos ); tools::Rectangle aTrackRect( aPos, Size( mnTrackWidth, mnTrackHeight ) ); tools::Rectangle aCompRect = aTrackRect; - aPos.X() += maMouseOff.X(); - aPos.Y() += maMouseOff.Y(); + aPos.AdjustX(maMouseOff.X() ); + aPos.AdjustY(maMouseOff.Y() ); bool bFloatMode = Docking( aPos, aTrackRect ); @@ -585,19 +585,19 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) { if ( bFloatMode ) { - aTrackRect.Left() -= mnDockLeft; - aTrackRect.Top() -= mnDockTop; - aTrackRect.Right() += mnDockRight; - aTrackRect.Bottom() += mnDockBottom; + aTrackRect.AdjustLeft( -(mnDockLeft) ); + aTrackRect.AdjustTop( -(mnDockTop) ); + aTrackRect.AdjustRight(mnDockRight ); + aTrackRect.AdjustBottom(mnDockBottom ); } else { if ( aCompRect == aTrackRect ) { - aTrackRect.Left() += mnDockLeft; - aTrackRect.Top() += mnDockTop; - aTrackRect.Right() -= mnDockRight; - aTrackRect.Bottom() -= mnDockBottom; + aTrackRect.AdjustLeft(mnDockLeft ); + aTrackRect.AdjustTop(mnDockTop ); + aTrackRect.AdjustRight( -(mnDockRight) ); + aTrackRect.AdjustBottom( -(mnDockBottom) ); } } mbLastFloatMode = bFloatMode; @@ -614,8 +614,8 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) GetWindow()->ShowTracking( aShowTrackRect, nTrackStyle ); // calculate mouse offset again, as the rectangle was changed - maMouseOff.X() = aPos.X() - aTrackRect.Left(); - maMouseOff.Y() = aPos.Y() - aTrackRect.Top(); + maMouseOff.setX( aPos.X() - aTrackRect.Left() ); + maMouseOff.setY( aPos.Y() - aTrackRect.Top() ); mnTrackX = aTrackRect.Left(); mnTrackY = aTrackRect.Top(); diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 8ddc3bed8413..d6892cc42d0f 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -250,8 +250,8 @@ void DockingWindow::ImplStartDocking( const Point& rPos ) if ( mbLastFloatMode ) { - maMouseOff.X() += mnDockLeft; - maMouseOff.Y() += mnDockTop; + maMouseOff.AdjustX(mnDockLeft ); + maMouseOff.AdjustY(mnDockTop ); mnTrackX -= mnDockLeft; mnTrackY -= mnDockTop; mnTrackWidth += mnDockLeft+mnDockRight; @@ -440,21 +440,21 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) Point aFrameMousePos = ImplOutputToFrame( aMousePos ); Size aFrameSize = mpWindowImpl->mpFrameWindow->GetOutputSizePixel(); if ( aFrameMousePos.X() < 0 ) - aFrameMousePos.X() = 0; + aFrameMousePos.setX( 0 ); if ( aFrameMousePos.Y() < 0 ) - aFrameMousePos.Y() = 0; + aFrameMousePos.setY( 0 ); if ( aFrameMousePos.X() > aFrameSize.Width()-1 ) - aFrameMousePos.X() = aFrameSize.Width()-1; + aFrameMousePos.setX( aFrameSize.Width()-1 ); if ( aFrameMousePos.Y() > aFrameSize.Height()-1 ) - aFrameMousePos.Y() = aFrameSize.Height()-1; + aFrameMousePos.setY( aFrameSize.Height()-1 ); aMousePos = ImplFrameToOutput( aFrameMousePos ); - aMousePos.X() -= maMouseOff.X(); - aMousePos.Y() -= maMouseOff.Y(); + aMousePos.AdjustX( -(maMouseOff.X()) ); + aMousePos.AdjustY( -(maMouseOff.Y()) ); Point aFramePos = ImplOutputToFrame( aMousePos ); tools::Rectangle aTrackRect( aFramePos, Size( mnTrackWidth, mnTrackHeight ) ); tools::Rectangle aCompRect = aTrackRect; - aFramePos.X() += maMouseOff.X(); - aFramePos.Y() += maMouseOff.Y(); + aFramePos.AdjustX(maMouseOff.X() ); + aFramePos.AdjustY(maMouseOff.Y() ); if ( mbDragFull ) StartDocking(); bool bFloatMode = Docking( aFramePos, aTrackRect ); @@ -462,19 +462,19 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) { if ( bFloatMode ) { - aTrackRect.Left() -= mnDockLeft; - aTrackRect.Top() -= mnDockTop; - aTrackRect.Right() += mnDockRight; - aTrackRect.Bottom() += mnDockBottom; + aTrackRect.AdjustLeft( -(mnDockLeft) ); + aTrackRect.AdjustTop( -(mnDockTop) ); + aTrackRect.AdjustRight(mnDockRight ); + aTrackRect.AdjustBottom(mnDockBottom ); } else { if ( aCompRect == aTrackRect ) { - aTrackRect.Left() += mnDockLeft; - aTrackRect.Top() += mnDockTop; - aTrackRect.Right() -= mnDockRight; - aTrackRect.Bottom() -= mnDockBottom; + aTrackRect.AdjustLeft(mnDockLeft ); + aTrackRect.AdjustTop(mnDockTop ); + aTrackRect.AdjustRight( -(mnDockRight) ); + aTrackRect.AdjustBottom( -(mnDockBottom) ); } } mbLastFloatMode = bFloatMode; @@ -503,8 +503,8 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) ShowTracking( aShowTrackRect, nTrackStyle ); // recalculate mouse offset, as the rectangle was changed - maMouseOff.X() = aFramePos.X() - aTrackRect.Left(); - maMouseOff.Y() = aFramePos.Y() - aTrackRect.Top(); + maMouseOff.setX( aFramePos.X() - aTrackRect.Left() ); + maMouseOff.setY( aFramePos.Y() - aTrackRect.Top() ); } mnTrackX = aTrackRect.Left(); @@ -982,8 +982,8 @@ void DockingWindow::setOptimalLayoutSize() Size aMax(bestmaxFrameSizeForScreenSize(GetDesktopRectPixel().GetSize())); - aSize.Width() = std::min(aMax.Width(), aSize.Width()); - aSize.Height() = std::min(aMax.Height(), aSize.Height()); + aSize.setWidth( std::min(aMax.Width(), aSize.Width()) ); + aSize.setHeight( std::min(aMax.Height(), aSize.Height()) ); SetMinOutputSizePixel(aSize); setPosSizeOnContainee(); @@ -997,8 +997,8 @@ void DockingWindow::setPosSizeOnContainee() // otherwise the floating window will handle the border as well. sal_Int32 nBorderWidth = mpWindowImpl->mnBorderWidth; - aSize.Width() -= 2 * nBorderWidth; - aSize.Height() -= 2 * nBorderWidth; + aSize.AdjustWidth( -(2 * nBorderWidth) ); + aSize.AdjustHeight( -(2 * nBorderWidth) ); Window* pBox = GetWindow(GetWindowType::FirstChild); assert(pBox); @@ -1016,8 +1016,8 @@ Size DockingWindow::GetOptimalSize() const // otherwise the floating window will handle the border as well. sal_Int32 nBorderWidth = mpWindowImpl->mnBorderWidth; - aSize.Height() += 2 * nBorderWidth; - aSize.Width() += 2 * nBorderWidth; + aSize.AdjustHeight(2 * nBorderWidth ); + aSize.AdjustWidth(2 * nBorderWidth ); return aSize; } diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 304fadb40eb9..e337c7c5c341 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -305,9 +305,9 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, { case FloatWinPopupFlags::Left: - aPos.X() = devRect.Left()-aSize.Width()+1; - aPos.Y() = devRect.Top(); - aPos.Y() -= pWindow->mpWindowImpl->mnTopBorder; + aPos.setX( devRect.Left()-aSize.Width()+1 ); + aPos.setY( devRect.Top() ); + aPos.AdjustY( -(pWindow->mpWindowImpl->mnTopBorder) ); if( bRTL ) { if( (devRectRTL.Right()+aSize.Width()) > aScreenRect.Right() ) @@ -323,15 +323,15 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, e1 = devRect.TopLeft(); e2 = devRect.BottomLeft(); // set non-zero width - e2.X()++; + e2.AdjustX( 1 ); // don't clip corners - e1.Y()++; - e2.Y()--; + e1.AdjustY( 1 ); + e2.AdjustY( -1 ); } break; case FloatWinPopupFlags::Right: aPos = devRect.TopRight(); - aPos.Y() -= pWindow->mpWindowImpl->mnTopBorder; + aPos.AdjustY( -(pWindow->mpWindowImpl->mnTopBorder) ); if( bRTL ) { if( (devRectRTL.Left() - aSize.Width()) < aScreenRect.Left() ) @@ -347,15 +347,15 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, e1 = devRect.TopRight(); e2 = devRect.BottomRight(); // set non-zero width - e2.X()++; + e2.AdjustX( 1 ); // don't clip corners - e1.Y()++; - e2.Y()--; + e1.AdjustY( 1 ); + e2.AdjustY( -1 ); } break; case FloatWinPopupFlags::Up: - aPos.X() = devRect.Left(); - aPos.Y() = devRect.Top()-aSize.Height()+1; + aPos.setX( devRect.Left() ); + aPos.setY( devRect.Top()-aSize.Height()+1 ); if ( aPos.Y() < aScreenRect.Top() ) bBreak = false; if( bBreak ) @@ -363,10 +363,10 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, e1 = devRect.TopLeft(); e2 = devRect.TopRight(); // set non-zero height - e2.Y()++; + e2.AdjustY( 1 ); // don't clip corners - e1.X()++; - e2.X()--; + e1.AdjustX( 1 ); + e2.AdjustX( -1 ); } break; case FloatWinPopupFlags::Down: @@ -378,10 +378,10 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, e1 = devRect.BottomLeft(); e2 = devRect.BottomRight(); // set non-zero height - e2.Y()++; + e2.AdjustY( 1 ); // don't clip corners - e1.X()++; - e2.X()--; + e1.AdjustX( 1 ); + e2.AdjustX( -1 ); } break; default: break; @@ -395,9 +395,9 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, { if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() ) { - aPos.Y() = devRect.Bottom()-aSize.Height()+1; + aPos.setY( devRect.Bottom()-aSize.Height()+1 ); if ( aPos.Y() < aScreenRect.Top() ) - aPos.Y() = aScreenRect.Top(); + aPos.setY( aScreenRect.Top() ); } } else @@ -405,13 +405,13 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, if( bRTL ) { if( devRectRTL.Right()-aSize.Width()+1 < aScreenRect.Left() ) - aPos.X() -= aScreenRect.Left() - devRectRTL.Right() + aSize.Width() - 1; + aPos.AdjustX( -(aScreenRect.Left() - devRectRTL.Right() + aSize.Width() - 1) ); } else if ( aPos.X()+aSize.Width() > aScreenRect.Right() ) { - aPos.X() = devRect.Right()-aSize.Width()+1; + aPos.setX( devRect.Right()-aSize.Width()+1 ); if ( aPos.X() < aScreenRect.Left() ) - aPos.X() = aScreenRect.Left(); + aPos.setX( aScreenRect.Left() ); } } } @@ -720,10 +720,10 @@ void FloatingWindow::StartPopupMode( const tools::Rectangle& rRect, FloatWinPopu // !!! rRect is expected to be in screen coordinates of the parent frame window !!! maFloatRect = FloatingWindow::ImplConvertToAbsPos(GetParent(), rRect); - maFloatRect.Left() -= 2; - maFloatRect.Top() -= 2; - maFloatRect.Right() += 2; - maFloatRect.Bottom() += 2; + maFloatRect.AdjustLeft( -2 ); + maFloatRect.AdjustTop( -2 ); + maFloatRect.AdjustRight(2 ); + maFloatRect.AdjustBottom(2 ); mnPopupModeFlags = nFlags; mbInPopupMode = true; mbPopupMode = true; diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index b36923871d10..0b0eb098f0c7 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -77,18 +77,18 @@ void VclContainer::setLayoutAllocation(vcl::Window &rChild, const Point &rAllocP break; case VclAlign::Start: if (aChildPreferredSize.Width() < rChildAlloc.Width()) - aChildSize.Width() = aChildPreferredSize.Width(); + aChildSize.setWidth( aChildPreferredSize.Width() ); break; case VclAlign::End: if (aChildPreferredSize.Width() < rChildAlloc.Width()) - aChildSize.Width() = aChildPreferredSize.Width(); - aChildPos.X() += rChildAlloc.Width(); - aChildPos.X() -= aChildSize.Width(); + aChildSize.setWidth( aChildPreferredSize.Width() ); + aChildPos.AdjustX(rChildAlloc.Width() ); + aChildPos.AdjustX( -(aChildSize.Width()) ); break; case VclAlign::Center: if (aChildPreferredSize.Width() < aChildSize.Width()) - aChildSize.Width() = aChildPreferredSize.Width(); - aChildPos.X() += (rChildAlloc.Width() - aChildSize.Width()) / 2; + aChildSize.setWidth( aChildPreferredSize.Width() ); + aChildPos.AdjustX((rChildAlloc.Width() - aChildSize.Width()) / 2 ); break; } @@ -98,18 +98,18 @@ void VclContainer::setLayoutAllocation(vcl::Window &rChild, const Point &rAllocP break; case VclAlign::Start: if (aChildPreferredSize.Height() < rChildAlloc.Height()) - aChildSize.Height() = aChildPreferredSize.Height(); + aChildSize.setHeight( aChildPreferredSize.Height() ); break; case VclAlign::End: if (aChildPreferredSize.Height() < rChildAlloc.Height()) - aChildSize.Height() = aChildPreferredSize.Height(); - aChildPos.Y() += rChildAlloc.Height(); - aChildPos.Y() -= aChildSize.Height(); + aChildSize.setHeight( aChildPreferredSize.Height() ); + aChildPos.AdjustY(rChildAlloc.Height() ); + aChildPos.AdjustY( -(aChildSize.Height()) ); break; case VclAlign::Center: if (aChildPreferredSize.Height() < aChildSize.Height()) - aChildSize.Height() = aChildPreferredSize.Height(); - aChildPos.Y() += (rChildAlloc.Height() - aChildSize.Height()) / 2; + aChildSize.setHeight( aChildPreferredSize.Height() ); + aChildPos.AdjustY((rChildAlloc.Height() - aChildSize.Height()) / 2 ); break; } @@ -150,8 +150,8 @@ void VclContainer::SetPosPixel(const Point& rAllocPos) { Point aAllocPos = rAllocPos; sal_Int32 nBorderWidth = get_border_width(); - aAllocPos.X() += nBorderWidth + get_margin_left(); - aAllocPos.Y() += nBorderWidth + get_margin_top(); + aAllocPos.AdjustX(nBorderWidth + get_margin_left() ); + aAllocPos.AdjustY(nBorderWidth + get_margin_top() ); if (aAllocPos != GetPosPixel()) Window::SetPosPixel(aAllocPos); @@ -161,8 +161,8 @@ void VclContainer::SetSizePixel(const Size& rAllocation) { Size aAllocation = rAllocation; sal_Int32 nBorderWidth = get_border_width(); - aAllocation.Width() -= nBorderWidth*2 + get_margin_left() + get_margin_right(); - aAllocation.Height() -= nBorderWidth*2 + get_margin_top() + get_margin_bottom(); + aAllocation.AdjustWidth( -(nBorderWidth*2 + get_margin_left() + get_margin_right()) ); + aAllocation.AdjustHeight( -(nBorderWidth*2 + get_margin_top() + get_margin_bottom()) ); bool bSizeChanged = aAllocation != GetSizePixel(); if (bSizeChanged) Window::SetSizePixel(aAllocation); @@ -1408,20 +1408,20 @@ void VclGrid::setAllocation(const Size& rAllocation) sal_Int32 nWidth = rEntry.nSpanWidth; for (sal_Int32 nSpanX = 0; nSpanX < nWidth; ++nSpanX) - aChildAlloc.Width() += aWidths[x+nSpanX].m_nValue; - aChildAlloc.Width() += nColSpacing*(nWidth-1); + aChildAlloc.AdjustWidth(aWidths[x+nSpanX].m_nValue ); + aChildAlloc.AdjustWidth(nColSpacing*(nWidth-1) ); sal_Int32 nHeight = rEntry.nSpanHeight; for (sal_Int32 nSpanY = 0; nSpanY < nHeight; ++nSpanY) - aChildAlloc.Height() += aHeights[y+nSpanY].m_nValue; - aChildAlloc.Height() += nRowSpacing*(nHeight-1); + aChildAlloc.AdjustHeight(aHeights[y+nSpanY].m_nValue ); + aChildAlloc.AdjustHeight(nRowSpacing*(nHeight-1) ); setLayoutAllocation(*pChild, aAllocPos, aChildAlloc); } - aAllocPos.Y() += aHeights[y].m_nValue + nRowSpacing; + aAllocPos.AdjustY(aHeights[y].m_nValue + nRowSpacing ); } - aAllocPos.X() += aWidths[x].m_nValue + nColSpacing; - aAllocPos.Y() = 0; + aAllocPos.AdjustX(aWidths[x].m_nValue + nColSpacing ); + aAllocPos.setY( 0 ); } } @@ -1500,14 +1500,14 @@ Size VclFrame::calculateRequisition() const if (pLabel && pLabel->IsVisible()) { Size aLabelSize = getLayoutRequisition(*pLabel); - aRet.Height() += aLabelSize.Height(); - aRet.Width() = std::max(aLabelSize.Width(), aRet.Width()); + aRet.AdjustHeight(aLabelSize.Height() ); + aRet.setWidth( std::max(aLabelSize.Width(), aRet.Width()) ); } const FrameStyle &rFrameStyle = GetSettings().GetStyleSettings().GetFrameStyle(); - aRet.Width() += rFrameStyle.left + rFrameStyle.right; - aRet.Height() += rFrameStyle.top + rFrameStyle.bottom; + aRet.AdjustWidth(rFrameStyle.left + rFrameStyle.right ); + aRet.AdjustHeight(rFrameStyle.top + rFrameStyle.bottom ); return aRet; } @@ -1528,11 +1528,11 @@ void VclFrame::setAllocation(const Size &rAllocation) if (pLabel && pLabel->IsVisible()) { Size aLabelSize = getLayoutRequisition(*pLabel); - aLabelSize.Height() = std::min(aLabelSize.Height(), aAllocation.Height()); - aLabelSize.Width() = std::min(aLabelSize.Width(), aAllocation.Width()); + aLabelSize.setHeight( std::min(aLabelSize.Height(), aAllocation.Height()) ); + aLabelSize.setWidth( std::min(aLabelSize.Width(), aAllocation.Width()) ); setLayoutAllocation(*pLabel, aChildPos, aLabelSize); - aAllocation.Height() -= aLabelSize.Height(); - aChildPos.Y() += aLabelSize.Height(); + aAllocation.AdjustHeight( -(aLabelSize.Height()) ); + aChildPos.AdjustY(aLabelSize.Height() ); } if (pChild && pChild->IsVisible()) @@ -1620,8 +1620,8 @@ Size VclAlignment::calculateRequisition() const if (pChild && pChild->IsVisible()) { Size aChildSize = getLayoutRequisition(*pChild); - aRet.Width() += aChildSize.Width(); - aRet.Height() += aChildSize.Height(); + aRet.AdjustWidth(aChildSize.Width() ); + aRet.AdjustHeight(aChildSize.Height() ); } return aRet; @@ -1636,8 +1636,8 @@ void VclAlignment::setAllocation(const Size &rAllocation) Point aChildPos(m_nLeftPadding, m_nTopPadding); Size aAllocation; - aAllocation.Width() = rAllocation.Width() - (m_nLeftPadding + m_nRightPadding); - aAllocation.Height() = rAllocation.Height() - (m_nTopPadding + m_nBottomPadding); + aAllocation.setWidth( rAllocation.Width() - (m_nLeftPadding + m_nRightPadding) ); + aAllocation.setHeight( rAllocation.Height() - (m_nTopPadding + m_nBottomPadding) ); setLayoutAllocation(*pChild, aChildPos, aAllocation); } @@ -1694,17 +1694,17 @@ Size VclExpander::calculateRequisition() const if (pLabel && pLabel->IsVisible()) { Size aLabelSize = getLayoutRequisition(*pLabel); - aExpanderSize.Height() = std::max(aExpanderSize.Height(), aLabelSize.Height()); - aExpanderSize.Width() += aLabelSize.Width(); + aExpanderSize.setHeight( std::max(aExpanderSize.Height(), aLabelSize.Height()) ); + aExpanderSize.AdjustWidth(aLabelSize.Width() ); } - aRet.Height() += aExpanderSize.Height(); - aRet.Width() = std::max(aExpanderSize.Width(), aRet.Width()); + aRet.AdjustHeight(aExpanderSize.Height() ); + aRet.setWidth( std::max(aExpanderSize.Width(), aRet.Width()) ); const FrameStyle &rFrameStyle = GetSettings().GetStyleSettings().GetFrameStyle(); - aRet.Width() += rFrameStyle.left + rFrameStyle.right; - aRet.Height() += rFrameStyle.top + rFrameStyle.bottom; + aRet.AdjustWidth(rFrameStyle.left + rFrameStyle.right ); + aRet.AdjustHeight(rFrameStyle.top + rFrameStyle.bottom ); return aRet; } @@ -1729,15 +1729,15 @@ void VclExpander::setAllocation(const Size &rAllocation) if (pLabel && pLabel->IsVisible()) { aLabelSize = getLayoutRequisition(*pLabel); - aExpanderSize.Height() = std::max(aExpanderSize.Height(), aLabelSize.Height()); - aExpanderSize.Width() += aLabelSize.Width(); + aExpanderSize.setHeight( std::max(aExpanderSize.Height(), aLabelSize.Height()) ); + aExpanderSize.AdjustWidth(aLabelSize.Width() ); } - aExpanderSize.Height() = std::min(aExpanderSize.Height(), aAllocation.Height()); - aExpanderSize.Width() = std::min(aExpanderSize.Width(), aAllocation.Width()); + aExpanderSize.setHeight( std::min(aExpanderSize.Height(), aAllocation.Height()) ); + aExpanderSize.setWidth( std::min(aExpanderSize.Width(), aAllocation.Width()) ); - aButtonSize.Height() = std::min(aButtonSize.Height(), aExpanderSize.Height()); - aButtonSize.Width() = std::min(aButtonSize.Width(), aExpanderSize.Width()); + aButtonSize.setHeight( std::min(aButtonSize.Height(), aExpanderSize.Height()) ); + aButtonSize.setWidth( std::min(aButtonSize.Width(), aExpanderSize.Width()) ); long nExtraExpanderHeight = aExpanderSize.Height() - aButtonSize.Height(); Point aButtonPos(aChildPos.X(), aChildPos.Y() + nExtraExpanderHeight/2); @@ -1745,17 +1745,17 @@ void VclExpander::setAllocation(const Size &rAllocation) if (pLabel && pLabel->IsVisible()) { - aLabelSize.Height() = std::min(aLabelSize.Height(), aExpanderSize.Height()); - aLabelSize.Width() = std::min(aLabelSize.Width(), - aExpanderSize.Width() - aButtonSize.Width()); + aLabelSize.setHeight( std::min(aLabelSize.Height(), aExpanderSize.Height()) ); + aLabelSize.setWidth( std::min(aLabelSize.Width(), + aExpanderSize.Width() - aButtonSize.Width()) ); long nExtraLabelHeight = aExpanderSize.Height() - aLabelSize.Height(); Point aLabelPos(aChildPos.X() + aButtonSize.Width(), aChildPos.Y() + nExtraLabelHeight/2); setLayoutAllocation(*pLabel, aLabelPos, aLabelSize); } - aAllocation.Height() -= aExpanderSize.Height(); - aChildPos.Y() += aExpanderSize.Height(); + aAllocation.AdjustHeight( -(aExpanderSize.Height()) ); + aChildPos.AdjustY(aExpanderSize.Height() ); if (pChild && pChild->IsVisible()) { @@ -1841,12 +1841,12 @@ IMPL_LINK_NOARG(VclScrolledWindow, ScrollBarHdl, ScrollBar*, void) if (m_pHScroll->IsVisible()) { - aWinPos.X() = -m_pHScroll->GetThumbPos(); + aWinPos.setX( -m_pHScroll->GetThumbPos() ); } if (m_pVScroll->IsVisible()) { - aWinPos.Y() = -m_pVScroll->GetThumbPos(); + aWinPos.setY( -m_pVScroll->GetThumbPos() ); } pChild->SetPosPixel(aWinPos); @@ -1873,10 +1873,10 @@ Size VclScrolledWindow::calculateRequisition() const aRet = getLayoutRequisition(*pChild); if (GetStyle() & WB_VSCROLL) - aRet.Width() += getLayoutRequisition(*m_pVScroll).Width(); + aRet.AdjustWidth(getLayoutRequisition(*m_pVScroll).Width() ); if (GetStyle() & WB_HSCROLL) - aRet.Height() += getLayoutRequisition(*m_pHScroll).Height(); + aRet.AdjustHeight(getLayoutRequisition(*m_pHScroll).Height() ); return aRet; } @@ -1946,9 +1946,9 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation) Point aScrollPos(rAllocation.Width() - nScrollBarWidth, 0); Size aScrollSize(nScrollBarWidth, rAllocation.Height()); setLayoutAllocation(*m_pVScroll, aScrollPos, aScrollSize); - aChildAllocation.Width() -= nScrollBarWidth; - aInnerSize.Width() -= nScrollBarWidth; - aChildAllocation.Height() = aChildReq.Height(); + aChildAllocation.AdjustWidth( -nScrollBarWidth ); + aInnerSize.AdjustWidth( -nScrollBarWidth ); + aChildAllocation.setHeight( aChildReq.Height() ); } if (m_pHScroll->IsVisible()) @@ -1957,9 +1957,9 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation) Point aScrollPos(0, rAllocation.Height() - nScrollBarHeight); Size aScrollSize(rAllocation.Width(), nScrollBarHeight); setLayoutAllocation(*m_pHScroll, aScrollPos, aScrollSize); - aChildAllocation.Height() -= nScrollBarHeight; - aInnerSize.Height() -= nScrollBarHeight; - aChildAllocation.Width() = aChildReq.Width(); + aChildAllocation.AdjustHeight( -nScrollBarHeight ); + aInnerSize.AdjustHeight( -nScrollBarHeight ); + aChildAllocation.setWidth( aChildReq.Width() ); } if (m_pVScroll->IsVisible() && m_pHScroll->IsVisible()) @@ -1987,9 +1987,9 @@ Size VclScrolledWindow::getVisibleChildSize() const { Size aRet(GetSizePixel()); if (m_pVScroll->IsVisible()) - aRet.Width() -= m_pVScroll->GetSizePixel().Width(); + aRet.AdjustWidth( -(m_pVScroll->GetSizePixel().Width()) ); if (m_pHScroll->IsVisible()) - aRet.Height() -= m_pHScroll->GetSizePixel().Height(); + aRet.AdjustHeight( -(m_pHScroll->GetSizePixel().Height()) ); return aRet; } @@ -2026,8 +2026,8 @@ void VclViewport::setAllocation(const Size &rAllocation) if (pChild && pChild->IsVisible()) { Size aReq(getLayoutRequisition(*pChild)); - aReq.Width() = std::max(aReq.Width(), rAllocation.Width()); - aReq.Height() = std::max(aReq.Height(), rAllocation.Height()); + aReq.setWidth( std::max(aReq.Width(), rAllocation.Width()) ); + aReq.setHeight( std::max(aReq.Height(), rAllocation.Height()) ); setLayoutAllocation(*pChild, Point(0, 0), aReq); } } @@ -2067,8 +2067,8 @@ Size VclEventBox::calculateRequisition() const if (!pChild->IsVisible()) continue; Size aChildSize = getLayoutRequisition(*pChild); - aRet.Width() = std::max(aRet.Width(), aChildSize.Width()); - aRet.Height() = std::max(aRet.Height(), aChildSize.Height()); + aRet.setWidth( std::max(aRet.Width(), aChildSize.Width()) ); + aRet.setHeight( std::max(aRet.Height(), aChildSize.Height()) ); } return aRet; @@ -2620,8 +2620,8 @@ Size VclVPaned::calculateRequisition() const if (!pChild->IsVisible()) continue; Size aChildSize = getLayoutRequisition(*pChild); - aRet.Width() = std::max(aRet.Width(), aChildSize.Width()); - aRet.Height() += aChildSize.Height(); + aRet.setWidth( std::max(aRet.Width(), aChildSize.Width()) ); + aRet.AdjustHeight(aChildSize.Height() ); } return aRet; @@ -2646,8 +2646,8 @@ Size getLegacyBestSizeForChildren(const vcl::Window &rWindow) Size aRet(aBounds.GetSize()); Point aTopLeft(aBounds.TopLeft()); - aRet.Width() += aTopLeft.X()*2; - aRet.Height() += aTopLeft.Y()*2; + aRet.AdjustWidth(aTopLeft.X()*2 ); + aRet.AdjustHeight(aTopLeft.Y()*2 ); return aRet; } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 58f02c0aa033..72a4198513ce 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1447,7 +1447,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) { Size aImgSz = pData->aImage.GetSizePixel(); if ( aImgSz.Height() > aMaxImgSz.Height() ) - aMaxImgSz.Height() = aImgSz.Height(); + aMaxImgSz.setHeight( aImgSz.Height() ); if ( aImgSz.Height() > nMinMenuItemHeight ) nMinMenuItemHeight = aImgSz.Height(); break; @@ -1463,8 +1463,8 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) { MenuItemData* pData = pItemList->GetDataFromPos( --n ); - pData->aSz.Height() = 0; - pData->aSz.Width() = 0; + pData->aSz.setHeight( 0 ); + pData->aSz.setWidth( 0 ); if ( ImplIsVisible( n ) ) { @@ -1474,7 +1474,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) if (!IsMenuBar()&& (pData->eType == MenuItemType::SEPARATOR)) { //Useless: SAL_WARN_IF( IsMenuBar(), "vcl", "Separator in MenuBar ?! " ); - pData->aSz.Height() = 4; + pData->aSz.setHeight( 4 ); } // Image: @@ -1482,14 +1482,14 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) { Size aImgSz = pData->aImage.GetSizePixel(); - aImgSz.Height() += 4; // add a border for native marks - aImgSz.Width() += 4; // add a border for native marks + aImgSz.AdjustHeight(4 ); // add a border for native marks + aImgSz.AdjustWidth(4 ); // add a border for native marks if ( aImgSz.Width() > aMaxImgSz.Width() ) - aMaxImgSz.Width() = aImgSz.Width(); + aMaxImgSz.setWidth( aImgSz.Width() ); if ( aImgSz.Height() > aMaxImgSz.Height() ) - aMaxImgSz.Height() = aImgSz.Height(); + aMaxImgSz.setHeight( aImgSz.Height() ); if ( aImgSz.Height() > pData->aSz.Height() ) - pData->aSz.Height() = aImgSz.Height(); + pData->aSz.setHeight( aImgSz.Height() ); } // Check Buttons: @@ -1510,13 +1510,13 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) if (IsMenuBar()) { if ( nTextHeight > pData->aSz.Height() ) - pData->aSz.Height() = nTextHeight; + pData->aSz.setHeight( nTextHeight ); - pData->aSz.Width() = nTextWidth + 4*nExtra; - aSz.Width() += pData->aSz.Width(); + pData->aSz.setWidth( nTextWidth + 4*nExtra ); + aSz.AdjustWidth(pData->aSz.Width() ); } else - pData->aSz.Height() = std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + pData->aSz.setHeight( std::max( std::max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); nWidth += nTextWidth; } @@ -1536,13 +1536,13 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) if ( nFontHeight > nWidth ) nWidth += nFontHeight; - pData->aSz.Height() = std::max( std::max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + pData->aSz.setHeight( std::max( std::max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ) ); } - pData->aSz.Height() += EXTRAITEMHEIGHT; // little bit more distance + pData->aSz.AdjustHeight(EXTRAITEMHEIGHT ); // little bit more distance if (!IsMenuBar()) - aSz.Height() += pData->aSz.Height(); + aSz.AdjustHeight(pData->aSz.Height() ); if ( nWidth > nMaxWidth ) nMaxWidth = nWidth; @@ -1565,7 +1565,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) // Vertically, one height of char + extra space for decoration nTitleHeight = aTextBoundRect.GetSize().Height() + 4 * SPACE_AROUND_TITLE ; - aSz.Height() += nTitleHeight; + aSz.AdjustHeight(nTitleHeight ); long nWidth = aTextBoundRect.GetSize().Width() + 4 * SPACE_AROUND_TITLE; pWin->Pop(); @@ -1596,16 +1596,16 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) nTextPos = static_cast<sal_uInt16>(nImgOrChkPos + nImgOrChkWidth); nTextPos = nTextPos + gfxExtra; - aSz.Width() = nTextPos + nMaxWidth + nExtra; - aSz.Width() += 4*nExtra; // a _little_ more ... + aSz.setWidth( nTextPos + nMaxWidth + nExtra ); + aSz.AdjustWidth(4*nExtra ); // a _little_ more ... - aSz.Width() += 2*ImplGetSVData()->maNWFData.mnMenuFormatBorderX; - aSz.Height() += 2*ImplGetSVData()->maNWFData.mnMenuFormatBorderY; + aSz.AdjustWidth(2*ImplGetSVData()->maNWFData.mnMenuFormatBorderX ); + aSz.AdjustHeight(2*ImplGetSVData()->maNWFData.mnMenuFormatBorderY ); } else { nTextPos = static_cast<sal_uInt16>(2*nExtra); - aSz.Height() = nFontHeight+6; + aSz.setHeight( nFontHeight+6 ); // get menubar height from native methods if supported if( pWindow->IsNativeControlSupported( ControlType::Menubar, ControlPart::Entire ) ) @@ -1626,7 +1626,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) { int nNativeHeight = aNativeBounds.GetHeight(); if( nNativeHeight > aSz.Height() ) - aSz.Height() = nNativeHeight; + aSz.setHeight( nNativeHeight ); } } @@ -1634,7 +1634,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin ) // due to NWF this is variable long nCloseButtonHeight = static_cast<MenuBarWindow*>(pWindow.get())->MinCloseButtonSize().Height(); if (aSz.Height() < nCloseButtonHeight) - aSz.Height() = nCloseButtonHeight; + aSz.setHeight( nCloseButtonHeight ); } return aSz; @@ -1709,9 +1709,9 @@ void Menu::ImplPaintMenuTitle(vcl::RenderContext& rRenderContext, const tools::R Point aTextTopLeft(aBgRect.TopLeft()); tools::Rectangle aTextBoundRect; rRenderContext.GetTextBoundRect( aTextBoundRect, aTitleText ); - aTextTopLeft.X() += (aBgRect.getWidth() - aTextBoundRect.GetSize().Width()) / 2; - aTextTopLeft.Y() += (aBgRect.GetHeight() - aTextBoundRect.GetSize().Height()) / 2 - - aTextBoundRect.TopLeft().Y(); + aTextTopLeft.AdjustX((aBgRect.getWidth() - aTextBoundRect.GetSize().Width()) / 2 ); + aTextTopLeft.AdjustY((aBgRect.GetHeight() - aTextBoundRect.GetSize().Height()) / 2 + - aTextBoundRect.TopLeft().Y() ); rRenderContext.DrawText(aTextTopLeft, aTitleText, 0, aTitleText.getLength()); // Restore @@ -1739,8 +1739,8 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, if (!IsMenuBar()) { nOuterSpaceX = ImplGetSVData()->maNWFData.mnMenuFormatBorderX; - aTopLeft.X() += nOuterSpaceX; - aTopLeft.Y() += ImplGetSVData()->maNWFData.mnMenuFormatBorderY; + aTopLeft.AdjustX(nOuterSpaceX ); + aTopLeft.AdjustY(ImplGetSVData()->maNWFData.mnMenuFormatBorderY ); } // for the computations, use size of the underlying window, not of RenderContext @@ -1787,8 +1787,8 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, } Point aPos(aTopLeft); - aPos.Y() += nBorder; - aPos.Y() += nStartY; + aPos.AdjustY(nBorder ); + aPos.AdjustY(nStartY ); if (aPos.Y() >= 0) { @@ -1823,9 +1823,9 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, nState |= ControlState::SELECTED; int nSepPad = ImplGetSVData()->maNWFData.mnMenuSeparatorBorderX; Point aMpos (aPos); - aMpos.X() += nSepPad; + aMpos.AdjustX(nSepPad ); Size aSz(pData->aSz); - aSz.Width() = aOutSz.Width() - 2*nOuterSpaceX - 2 * nSepPad; + aSz.setWidth( aOutSz.Width() - 2*nOuterSpaceX - 2 * nSepPad ); tools::Rectangle aItemRect(aMpos, aSz); MenupopupValue aVal(nTextPos - GUTTERBORDER, aItemRect); bNativeOk = rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Separator, @@ -1833,11 +1833,11 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, } if (!bNativeOk) { - aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height() - 2) / 2); - aTmpPos.X() = aPos.X() + 2 + nOuterSpaceX; + aTmpPos.setY( aPos.Y() + ((pData->aSz.Height() - 2) / 2) ); + aTmpPos.setX( aPos.X() + 2 + nOuterSpaceX ); rRenderContext.SetLineColor(rSettings.GetShadowColor()); rRenderContext.DrawLine(aTmpPos, Point(aOutSz.Width() - 3 - 2 * nOuterSpaceX, aTmpPos.Y())); - aTmpPos.Y()++; + aTmpPos.AdjustY( 1 ); rRenderContext.SetLineColor(rSettings.GetLightColor()); rRenderContext.DrawLine(aTmpPos, Point(aOutSz.Width() - 3 - 2 * nOuterSpaceX, aTmpPos.Y())); rRenderContext.SetLineColor(); @@ -1846,10 +1846,10 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, tools::Rectangle aOuterCheckRect(Point(aPos.X()+nImgOrChkPos, aPos.Y()), Size(pData->aSz.Height(), pData->aSz.Height())); - aOuterCheckRect.Left() += 1; - aOuterCheckRect.Right() -= 1; - aOuterCheckRect.Top() += 1; - aOuterCheckRect.Bottom() -= 1; + aOuterCheckRect.AdjustLeft(1 ); + aOuterCheckRect.AdjustRight( -1 ); + aOuterCheckRect.AdjustTop(1 ); + aOuterCheckRect.AdjustBottom( -1 ); // CheckMark if (!bLayout && !IsMenuBar() && pData->HasCheck()) @@ -1883,12 +1883,12 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, nState |= ControlState::SELECTED; long nCtrlHeight = (pData->nBits & MenuItemBits::RADIOCHECK) ? nCheckHeight : nRadioHeight; - aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight) / 2; - aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight) / 2; + aTmpPos.setX( aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - nCtrlHeight) / 2 ); + aTmpPos.setY( aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight) / 2 ); tools::Rectangle aCheckRect(aTmpPos, Size(nCtrlHeight, nCtrlHeight)); Size aSz(pData->aSz); - aSz.Width() = aOutSz.Width() - 2 * nOuterSpaceX; + aSz.setWidth( aOutSz.Width() - 2 * nOuterSpaceX ); tools::Rectangle aItemRect(aPos, aSz); MenupopupValue aVal(nTextPos - GUTTERBORDER, aItemRect); rRenderContext.DrawNativeControl(ControlType::MenuPopup, nPart, aCheckRect, @@ -1910,8 +1910,8 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, eSymbol = SymbolType::CHECKMARK; aSymbolSize = Size((nFontHeight * 25) / 40, nFontHeight / 2); } - aTmpPos.X() = aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - aSymbolSize.Width()) / 2; - aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - aSymbolSize.Height()) / 2; + aTmpPos.setX( aOuterCheckRect.Left() + (aOuterCheckRect.GetWidth() - aSymbolSize.Width()) / 2 ); + aTmpPos.setY( aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - aSymbolSize.Height()) / 2 ); tools::Rectangle aRect(aTmpPos, aSymbolSize); aDecoView.DrawSymbol(aRect, eSymbol, rRenderContext.GetTextColor(), nSymbolStyle); } @@ -1928,17 +1928,17 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, Image aImage = pData->aImage; aTmpPos = aOuterCheckRect.TopLeft(); - aTmpPos.X() += (aOuterCheckRect.GetWidth() - aImage.GetSizePixel().Width()) / 2; - aTmpPos.Y() += (aOuterCheckRect.GetHeight() - aImage.GetSizePixel().Height()) / 2; + aTmpPos.AdjustX((aOuterCheckRect.GetWidth() - aImage.GetSizePixel().Width()) / 2 ); + aTmpPos.AdjustY((aOuterCheckRect.GetHeight() - aImage.GetSizePixel().Height()) / 2 ); rRenderContext.DrawImage(aTmpPos, aImage, nImageStyle); } // Text: if ((pData->eType == MenuItemType::STRING ) || (pData->eType == MenuItemType::STRINGIMAGE)) { - aTmpPos.X() = aPos.X() + nTextPos; - aTmpPos.Y() = aPos.Y(); - aTmpPos.Y() += nTextOffsetY; + aTmpPos.setX( aPos.X() + nTextPos ); + aTmpPos.setY( aPos.Y() ); + aTmpPos.AdjustY(nTextOffsetY ); DrawTextFlags nStyle = nTextStyle | DrawTextFlags::Mnemonic; const Menu *pMenu = this; @@ -2009,12 +2009,12 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, if (!bLayout && !IsMenuBar() && pData->aAccelKey.GetCode() && !ImplAccelDisabled()) { OUString aAccText = pData->aAccelKey.GetName(); - aTmpPos.X() = aOutSz.Width() - rRenderContext.GetTextWidth(aAccText); - aTmpPos.X() -= 4 * nExtra; + aTmpPos.setX( aOutSz.Width() - rRenderContext.GetTextWidth(aAccText) ); + aTmpPos.AdjustX( -(4 * nExtra) ); - aTmpPos.X() -= nOuterSpaceX; - aTmpPos.Y() = aPos.Y(); - aTmpPos.Y() += nTextOffsetY; + aTmpPos.AdjustX( -nOuterSpaceX ); + aTmpPos.setY( aPos.Y() ); + aTmpPos.AdjustY(nTextOffsetY ); rRenderContext.DrawCtrlText(aTmpPos, aAccText, 0, aAccText.getLength(), nTextStyle); } @@ -2039,9 +2039,9 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, if (bHighlighted) nState |= ControlState::SELECTED; - aTmpPos.X() = aOutSz.Width() - aTmpSz.Width() - aSpacing - nOuterSpaceX; - aTmpPos.Y() = aPos.Y() + ( pData->aSz.Height() - aTmpSz.Height() ) / 2; - aTmpPos.Y() += nExtra / 2; + aTmpPos.setX( aOutSz.Width() - aTmpSz.Width() - aSpacing - nOuterSpaceX ); + aTmpPos.setY( aPos.Y() + ( pData->aSz.Height() - aTmpSz.Height() ) / 2 ); + aTmpPos.AdjustY(nExtra / 2 ); tools::Rectangle aItemRect(aTmpPos, aTmpSz); MenupopupValue aVal(nTextPos - GUTTERBORDER, aItemRect); @@ -2050,15 +2050,15 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, } if (!bNativeOk) { - aTmpPos.X() = aOutSz.Width() - nFontHeight + nExtra - nOuterSpaceX; - aTmpPos.Y() = aPos.Y(); - aTmpPos.Y() += nExtra/2; - aTmpPos.Y() += (pData->aSz.Height() / 2) - (nFontHeight / 4); + aTmpPos.setX( aOutSz.Width() - nFontHeight + nExtra - nOuterSpaceX ); + aTmpPos.setY( aPos.Y() ); + aTmpPos.AdjustY(nExtra/2 ); + aTmpPos.AdjustY((pData->aSz.Height() / 2) - (nFontHeight / 4) ); if (pData->nBits & MenuItemBits::POPUPSELECT) { rRenderContext.SetTextColor(rSettings.GetMenuTextColor()); Point aTmpPos2(aPos); - aTmpPos2.X() = aOutSz.Width() - nFontHeight - nFontHeight/4; + aTmpPos2.setX( aOutSz.Width() - nFontHeight - nFontHeight/4 ); aDecoView.DrawFrame(tools::Rectangle(aTmpPos2, Size(nFontHeight + nFontHeight / 4, pData->aSz.Height())), DrawFrameStyle::Group); @@ -2088,9 +2088,9 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize, } if (!IsMenuBar()) - aTopLeft.Y() += pData->aSz.Height(); + aTopLeft.AdjustY(pData->aSz.Height() ); else - aTopLeft.X() += pData->aSz.Width(); + aTopLeft.AdjustX(pData->aSz.Width() ); } // draw "more" (">>") indicator if some items have been hidden as they go out of visible area @@ -2927,7 +2927,7 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const tools::R pWin->EnableScrollMenu( true ); sal_uInt16 nStart = ImplGetFirstVisible(); sal_uInt16 nEntries = ImplCalcVisEntries( nMaxHeight, nStart ); - aSz.Height() = ImplCalcHeight( nEntries ); + aSz.setHeight( ImplCalcHeight( nEntries ) ); } pWin->SetFocusId( xFocusId ); diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 99e8719c79d1..56b1ad8fd6eb 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -300,7 +300,7 @@ void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst ) pData = pMenu->pItemList->GetDataFromPos( nHighlightedItem ); Point aItemTopLeft( nX, 0 ); Point aItemBottomRight( aItemTopLeft ); - aItemBottomRight.X() += pData->aSz.Width(); + aItemBottomRight.AdjustX(pData->aSz.Width() ); if (pData->bHiddenOnGUI) { @@ -330,7 +330,7 @@ void MenuBarWindow::ImplCreatePopup( bool bPreSelectFirst ) if ( GetSizePixel().Height() ) { // #107747# give menuitems the height of the menubar - aItemBottomRight.Y() += GetOutputSizePixel().Height()-1; + aItemBottomRight.AdjustY(GetOutputSizePixel().Height()-1 ); } // ImplExecute is not modal... @@ -617,7 +617,7 @@ void MenuBarWindow::HighlightItem(vcl::RenderContext& rRenderContext, sal_uInt16 size_t nCount = pMenu->pItemList->size(); Size aOutputSize = GetOutputSizePixel(); - aOutputSize.Width() -= aCloseBtn->GetSizePixel().Width(); + aOutputSize.AdjustWidth( -(aCloseBtn->GetSizePixel().Width()) ); for (size_t n = 0; n < nCount; n++) { @@ -931,7 +931,7 @@ void MenuBarWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta } // shrink the area of the buttons - aOutputSize.Width() -= aCloseBtn->GetSizePixel().Width(); + aOutputSize.AdjustWidth( -(aCloseBtn->GetSizePixel().Width()) ); rRenderContext.SetFillColor(rStyleSettings.GetMenuColor()); pMenu->ImplPaint(rRenderContext, aOutputSize, 0); diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index b019906f3b0c..972300f8536e 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -175,8 +175,8 @@ vcl::Region MenuFloatingWindow::ImplCalcClipRegion() const Size aOutSz = GetOutputSizePixel(); Point aPos; tools::Rectangle aRect( aPos, aOutSz ); - aRect.Top() += nScrollerHeight; - aRect.Bottom() -= nScrollerHeight; + aRect.AdjustTop(nScrollerHeight ); + aRect.AdjustBottom( -(nScrollerHeight) ); vcl::Region aRegion(aRect); @@ -332,19 +332,19 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer, void ) Size MySize = GetOutputSizePixel(); Point aItemTopLeft( 0, nY ); Point aItemBottomRight( aItemTopLeft ); - aItemBottomRight.X() += MySize.Width(); - aItemBottomRight.Y() += pData->aSz.Height(); + aItemBottomRight.AdjustX(MySize.Width() ); + aItemBottomRight.AdjustY(pData->aSz.Height() ); // shift the popups a little - aItemTopLeft.X() += 2; - aItemBottomRight.X() -= 2; + aItemTopLeft.AdjustX(2 ); + aItemBottomRight.AdjustX( -2 ); if ( nHighlightedItem ) - aItemTopLeft.Y() -= 2; + aItemTopLeft.AdjustY( -2 ); else { sal_Int32 nL, nT, nR, nB; GetBorder( nL, nT, nR, nB ); - aItemTopLeft.Y() -= nT; + aItemTopLeft.AdjustY( -nT ); } // pTest: crash due to Reschedule() in call of Activate() @@ -827,7 +827,7 @@ void MenuFloatingWindow::RenderHighlightItem(vcl::RenderContext& rRenderContext, if (pData->nBits & MenuItemBits::POPUPSELECT) { long nFontHeight = GetTextHeight(); - aItemRect.Right() -= nFontHeight + nFontHeight / 4; + aItemRect.AdjustRight( -(nFontHeight + nFontHeight / 4) ); } if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire)) @@ -903,7 +903,7 @@ tools::Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos ) if ( pData->nBits & MenuItemBits::POPUPSELECT ) { long nFontHeight = GetTextHeight(); - aRect.Right() -= nFontHeight + nFontHeight/4; + aRect.AdjustRight( -(nFontHeight + nFontHeight/4) ); } } break; @@ -1182,7 +1182,7 @@ void MenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const tools:: rRenderContext.SetClipRegion(); long nX = 0; Size aPxSize(GetOutputSizePixel()); - aPxSize.Width() -= nX; + aPxSize.AdjustWidth( -nX ); ImplControlValue aVal(pMenu->nTextPos - GUTTERBORDER); rRenderContext.DrawNativeControl(ControlType::MenuPopup, ControlPart::Entire, tools::Rectangle(Point(nX, 0), aPxSize), diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 44b520dfe931..ccf463a49c36 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -64,8 +64,8 @@ WindowHitTest Window::ImplHitTest( const Point& rFramePos ) if ( mpWindowImpl->mbWinRegion ) { Point aTempPos = aFramePos; - aTempPos.X() -= mnOutOffX; - aTempPos.Y() -= mnOutOffY; + aTempPos.AdjustX( -(mnOutOffX) ); + aTempPos.AdjustY( -(mnOutOffY) ); if ( !mpWindowImpl->maWinRegion.IsInside( aTempPos ) ) return WindowHitTest::NONE; } diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 428e4f31ef08..ab6ff5adad1e 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -216,9 +216,9 @@ void MessBox::ImplPosControls() aImageSize = maImage.GetSizePixel(); if ( aImageSize.Width() ) { - aImageSize.Width() += 4; - aImageSize.Height() += 4; - aTextPos.X() += aImageSize.Width()+IMPL_SEP_MSGBOX_IMAGE; + aImageSize.AdjustWidth(4 ); + aImageSize.AdjustHeight(4 ); + aTextPos.AdjustX(aImageSize.Width()+IMPL_SEP_MSGBOX_IMAGE ); mpFixedImage = VclPtr<FixedImage>::Create( this ); mpFixedImage->SetPosSizePixel( Point( IMPL_DIALOG_OFFSET-2+IMPL_MSGBOX_OFFSET_EXTRA_X, IMPL_DIALOG_OFFSET-2+IMPL_MSGBOX_OFFSET_EXTRA_Y ), @@ -228,7 +228,7 @@ void MessBox::ImplPosControls() nMaxWidth -= aImageSize.Width()+IMPL_SEP_MSGBOX_IMAGE; } else - aTextPos.X() += IMPL_MSGBOX_OFFSET_EXTRA_X; + aTextPos.AdjustX(IMPL_MSGBOX_OFFSET_EXTRA_X ); // Determine maximum line length without wordbreak aFormatRect = GetTextRect( aRect, aMessText, nTextStyle, &aTextInfo ); @@ -250,48 +250,48 @@ void MessBox::ImplPosControls() if ( nWidth > nMaxWidth ) nWidth = nMaxWidth; - aRect.Right() = nWidth; + aRect.SetRight( nWidth ); aFormatRect = GetTextRect( aRect, aMessText, nTextStyle, &aTextInfo ); if ( aTextInfo.GetMaxLineWidth() > nWidth ) { nWidth = aTextInfo.GetMaxLineWidth()+8; - aRect.Right() = nWidth; + aRect.SetRight( nWidth ); aFormatRect = GetTextRect( aRect, aMessText, nTextStyle, &aTextInfo ); } // get Style for VCLMultiLineEdit - aMEditSize.Width() = aTextInfo.GetMaxLineWidth()+1; - aMEditSize.Height() = aFormatRect.GetHeight(); - aPageSize.Width() = aImageSize.Width(); + aMEditSize.setWidth( aTextInfo.GetMaxLineWidth()+1 ); + aMEditSize.setHeight( aFormatRect.GetHeight() ); + aPageSize.setWidth( aImageSize.Width() ); if ( aMEditSize.Height() < aImageSize.Height() ) { nWinStyle |= WB_VCENTER; - aPageSize.Height() = aImageSize.Height(); - aMEditSize.Height() = aImageSize.Height(); + aPageSize.setHeight( aImageSize.Height() ); + aMEditSize.setHeight( aImageSize.Height() ); } else { nWinStyle |= WB_TOP; - aPageSize.Height() = aMEditSize.Height(); + aPageSize.setHeight( aMEditSize.Height() ); } if ( aImageSize.Width() ) - aPageSize.Width() += IMPL_SEP_MSGBOX_IMAGE; - aPageSize.Width() += (IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_X*2); - aPageSize.Width() += aMEditSize.Width()+1; - aPageSize.Height() += (IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2); + aPageSize.AdjustWidth(IMPL_SEP_MSGBOX_IMAGE ); + aPageSize.AdjustWidth((IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_X*2) ); + aPageSize.AdjustWidth(aMEditSize.Width()+1 ); + aPageSize.AdjustHeight((IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2) ); if ( aPageSize.Width() < IMPL_MINSIZE_MSGBOX_WIDTH ) - aPageSize.Width() = IMPL_MINSIZE_MSGBOX_WIDTH; + aPageSize.setWidth( IMPL_MINSIZE_MSGBOX_WIDTH ); if ( aPageSize.Width() < nTitleWidth ) - aPageSize.Width() = nTitleWidth; + aPageSize.setWidth( nTitleWidth ); if ( !maCheckBoxText.isEmpty() ) { Size aMinCheckboxSize ( aMEditSize ); if ( aPageSize.Width() < IMPL_MINSIZE_MSGBOX_WIDTH+80 ) { - aPageSize.Width() = IMPL_MINSIZE_MSGBOX_WIDTH+80; - aMinCheckboxSize.Width() += 80; + aPageSize.setWidth( IMPL_MINSIZE_MSGBOX_WIDTH+80 ); + aMinCheckboxSize.AdjustWidth(80 ); } // #104492# auto mnemonics for CJK strings may increase the length, so measure the @@ -322,10 +322,10 @@ void MessBox::ImplPosControls() mpCheckBox->SetText( maCheckBoxText ); Point aPos( aTextPos ); - aPos.Y() += aMEditSize.Height() + (IMPL_DIALOG_OFFSET)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2); + aPos.AdjustY(aMEditSize.Height() + (IMPL_DIALOG_OFFSET)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2) ); // increase messagebox - aPageSize.Height() += aSize.Height() + (IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2); + aPageSize.AdjustHeight(aSize.Height() + (IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2) ); mpCheckBox->SetPosSizePixel( aPos, aSize ); mpCheckBox->Show(); diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index bb44f1bede5c..d1256289168b 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -353,10 +353,10 @@ void RenderTools::DrawSelectionBackground(vcl::RenderContext& rRenderContext, vc tools::Rectangle aRect(rRect); if (bDrawExtBorderOnly) { - aRect.Left() -= 1; - aRect.Top() -= 1; - aRect.Right() += 1; - aRect.Bottom() += 1; + aRect.AdjustLeft( -1 ); + aRect.AdjustTop( -1 ); + aRect.AdjustRight(1 ); + aRect.AdjustBottom(1 ); } rRenderContext.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 7eff568b418f..396cc69a9b2d 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -113,17 +113,17 @@ void PrintDialog::PrintPreviewWindow::Resize() Size aNewSize( GetSizePixel() ); long nTextHeight = maHorzDim->GetTextHeight(); // leave small space for decoration - aNewSize.Width() -= nTextHeight + 2; - aNewSize.Height() -= nTextHeight + 2; + aNewSize.AdjustWidth( -(nTextHeight + 2) ); + aNewSize.AdjustHeight( -(nTextHeight + 2) ); Size aScaledSize; double fScale = 1.0; // #i106435# catch corner case of Size(0,0) Size aOrigSize( maOrigSize ); if( aOrigSize.Width() < 1 ) - aOrigSize.Width() = aNewSize.Width(); + aOrigSize.setWidth( aNewSize.Width() ); if( aOrigSize.Height() < 1 ) - aOrigSize.Height() = aNewSize.Height(); + aOrigSize.setHeight( aNewSize.Height() ); if( aOrigSize.Width() > aOrigSize.Height() ) { aScaledSize = Size( aNewSize.Width(), aNewSize.Width() * aOrigSize.Height() / aOrigSize.Width() ); @@ -136,8 +136,8 @@ void PrintDialog::PrintPreviewWindow::Resize() if( aScaledSize.Width() > aNewSize.Width() ) fScale = double(aNewSize.Width())/double(aScaledSize.Width()); } - aScaledSize.Width() = long(aScaledSize.Width()*fScale); - aScaledSize.Height() = long(aScaledSize.Height()*fScale); + aScaledSize.setWidth( long(aScaledSize.Width()*fScale) ); + aScaledSize.setHeight( long(aScaledSize.Height()*fScale) ); maPreviewSize = aScaledSize; @@ -149,8 +149,8 @@ void PrintDialog::PrintPreviewWindow::Resize() double aAspectRatio = aScaledSize.Height() / static_cast<double>(aScaledSize.Width()); - aScaledSize.Width() = PREVIEW_BITMAP_WIDTH; - aScaledSize.Height() = PREVIEW_BITMAP_WIDTH * aAspectRatio; + aScaledSize.setWidth( PREVIEW_BITMAP_WIDTH ); + aScaledSize.setHeight( PREVIEW_BITMAP_WIDTH * aAspectRatio ); maPageVDev->SetOutputSizePixel( aScaledSize, false ); @@ -272,9 +272,9 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap() const Size aLogicSize( maPageVDev->PixelToLogic( aVDevSize, MapMode( MapUnit::Map100thMM ) ) ); Size aOrigSize( maOrigSize ); if( aOrigSize.Width() < 1 ) - aOrigSize.Width() = aLogicSize.Width(); + aOrigSize.setWidth( aLogicSize.Width() ); if( aOrigSize.Height() < 1 ) - aOrigSize.Height() = aLogicSize.Height(); + aOrigSize.setHeight( aLogicSize.Height() ); double fScale = double(aLogicSize.Width())/double(aOrigSize.Width()); maPageVDev->Erase(); diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index b256c263204c..de15943f9e77 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -108,8 +108,8 @@ void ImplWheelWindow::ImplSetRegion( const Bitmap& rRegionBmp ) const tools::Rectangle aRect( aPoint, aSize ); maCenter = maLastMousePos = aPos; - aPos.X() -= aSize.Width() >> 1; - aPos.Y() -= aSize.Height() >> 1; + aPos.AdjustX( -(aSize.Width() >> 1) ); + aPos.AdjustY( -(aSize.Height() >> 1) ); SetPosSizePixel( aPos, aSize ); SetWindowRegionPixel( rRegionBmp.CreateRegion( COL_BLACK, aRect ) ); diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index 3421e679614f..9b5b1209df8d 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -94,16 +94,16 @@ void Splitter::ImplSplitMousePos( Point& rPos ) if ( mbHorzSplit ) { if ( rPos.X() > maDragRect.Right()-1 ) - rPos.X() = maDragRect.Right()-1; + rPos.setX( maDragRect.Right()-1 ); if ( rPos.X() < maDragRect.Left()+1 ) - rPos.X() = maDragRect.Left()+1; + rPos.setX( maDragRect.Left()+1 ); } else { if ( rPos.Y() > maDragRect.Bottom()-1 ) - rPos.Y() = maDragRect.Bottom()-1; + rPos.setY( maDragRect.Bottom()-1 ); if ( rPos.Y() < maDragRect.Top()+1 ) - rPos.Y() = maDragRect.Top()+1; + rPos.setY( maDragRect.Top()+1 ); } } @@ -113,13 +113,13 @@ void Splitter::ImplDrawSplitter() if ( mbHorzSplit ) { - aInvRect.Left() = maDragPos.X() - 1; - aInvRect.Right() = maDragPos.X() + 1; + aInvRect.SetLeft( maDragPos.X() - 1 ); + aInvRect.SetRight( maDragPos.X() + 1 ); } else { - aInvRect.Top() = maDragPos.Y() - 1; - aInvRect.Bottom() = maDragPos.Y() + 1; + aInvRect.SetTop( maDragPos.Y() - 1 ); + aInvRect.SetBottom( maDragPos.Y() + 1 ); } mpRefWin->InvertTracking( mpRefWin->PixelToLogic(aInvRect), ShowTrackFlags::Split ); @@ -224,9 +224,9 @@ void Splitter::MouseButtonDown( const MouseEvent& rMEvt ) StartSplit(); Point aPos = rMEvt.GetPosPixel(); if ( mbHorzSplit ) - aPos.X() = mnLastSplitPos; + aPos.setX( mnLastSplitPos ); else - aPos.Y() = mnLastSplitPos; + aPos.setY( mnLastSplitPos ); ImplSplitMousePos( aPos ); long nTemp = mnSplitPos; if ( mbHorzSplit ) @@ -382,16 +382,16 @@ void Splitter::ImplKbdTracking( vcl::KeyCode aKeyCode ) switch( nCode ) { case KEY_LEFT: - aNewPos.X()-=delta; + aNewPos.AdjustX( -delta ); break; case KEY_RIGHT: - aNewPos.X()+=delta; + aNewPos.AdjustX(delta ); break; case KEY_UP: - aNewPos.Y()-=delta; + aNewPos.AdjustY( -delta ); break; case KEY_DOWN: - aNewPos.Y()+=delta; + aNewPos.AdjustY(delta ); break; default: maxiter = 0; // leave loop @@ -515,9 +515,9 @@ void Splitter::ImplRestoreSplitter() { // restore last pos if it was a useful position (>5) if ( mbHorzSplit ) - aPos.X() = mnLastSplitPos; + aPos.setX( mnLastSplitPos ); else - aPos.Y() = mnLastSplitPos; + aPos.setY( mnLastSplitPos ); } ImplSplitMousePos( aPos ); @@ -607,9 +607,9 @@ void Splitter::KeyInput( const KeyEvent& rKEvt ) StartSplit(); Point aPos; if ( mbHorzSplit ) - aPos.X() = 0; + aPos.setX( 0 ); else - aPos.Y() = 0; + aPos.setY( 0 ); ImplSplitMousePos( aPos ); long nTemp = mnSplitPos; if ( mbHorzSplit ) diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 5e8c26c094eb..42479871c8a4 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -369,16 +369,16 @@ static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos, if ( bRows ) { if ( bDown ) - aRect.Bottom() += pSet->mnSplitSize; + aRect.AdjustBottom(pSet->mnSplitSize ); else - aRect.Top() -= pSet->mnSplitSize; + aRect.AdjustTop( -(pSet->mnSplitSize) ); } else { if ( bDown ) - aRect.Right() += pSet->mnSplitSize; + aRect.AdjustRight(pSet->mnSplitSize ); else - aRect.Left() -= pSet->mnSplitSize; + aRect.AdjustLeft( -(pSet->mnSplitSize) ); } if ( aRect.IsInside( rPos ) ) @@ -781,33 +781,33 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, bool b // invalidate old rectangle if ( bRows ) { - aRect.Left() = rItems[i].mnLeft; - aRect.Right() = rItems[i].mnLeft+rItems[i].mnOldWidth-1; - aRect.Top() = rItems[i].mnOldSplitPos; - aRect.Bottom() = aRect.Top() + rItems[i].mnOldSplitSize; + aRect.SetLeft( rItems[i].mnLeft ); + aRect.SetRight( rItems[i].mnLeft+rItems[i].mnOldWidth-1 ); + aRect.SetTop( rItems[i].mnOldSplitPos ); + aRect.SetBottom( aRect.Top() + rItems[i].mnOldSplitSize ); } else { - aRect.Top() = rItems[i].mnTop; - aRect.Bottom() = rItems[i].mnTop+rItems[i].mnOldHeight-1; - aRect.Left() = rItems[i].mnOldSplitPos; - aRect.Right() = aRect.Left() + rItems[i].mnOldSplitSize; + aRect.SetTop( rItems[i].mnTop ); + aRect.SetBottom( rItems[i].mnTop+rItems[i].mnOldHeight-1 ); + aRect.SetLeft( rItems[i].mnOldSplitPos ); + aRect.SetRight( aRect.Left() + rItems[i].mnOldSplitSize ); } pWindow->Invalidate( aRect ); // invalidate new rectangle if ( bRows ) { - aRect.Left() = rItems[i].mnLeft; - aRect.Right() = rItems[i].mnLeft+rItems[i].mnWidth-1; - aRect.Top() = rItems[i].mnSplitPos; - aRect.Bottom() = aRect.Top() + rItems[i].mnSplitSize; + aRect.SetLeft( rItems[i].mnLeft ); + aRect.SetRight( rItems[i].mnLeft+rItems[i].mnWidth-1 ); + aRect.SetTop( rItems[i].mnSplitPos ); + aRect.SetBottom( aRect.Top() + rItems[i].mnSplitSize ); } else { - aRect.Top() = rItems[i].mnTop; - aRect.Bottom() = rItems[i].mnTop+rItems[i].mnHeight-1; - aRect.Left() = rItems[i].mnSplitPos; - aRect.Right() = aRect.Left() + rItems[i].mnSplitSize; + aRect.SetTop( rItems[i].mnTop ); + aRect.SetBottom( rItems[i].mnTop+rItems[i].mnHeight-1 ); + aRect.SetLeft( rItems[i].mnSplitPos ); + aRect.SetRight( aRect.Left() + rItems[i].mnSplitSize ); } pWindow->Invalidate( aRect ); @@ -815,10 +815,10 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, bool b // are not cluttered by windows if ( rItems[i].mpSet && rItems[i].mpSet->mvItems.empty() ) { - aRect.Left() = rItems[i].mnLeft; - aRect.Top() = rItems[i].mnTop; - aRect.Right() = rItems[i].mnLeft+rItems[i].mnWidth-1; - aRect.Bottom() = rItems[i].mnTop+rItems[i].mnHeight-1; + aRect.SetLeft( rItems[i].mnLeft ); + aRect.SetTop( rItems[i].mnTop ); + aRect.SetRight( rItems[i].mnLeft+rItems[i].mnWidth-1 ); + aRect.SetBottom( rItems[i].mnTop+rItems[i].mnHeight-1 ); pWindow->Invalidate( aRect ); } } @@ -905,14 +905,14 @@ void SplitWindow::ImplDrawBack(vcl::RenderContext& rRenderContext, const tools:: rRenderContext.IntersectClipRegion(rRect); do { - aPos.X() = rRect.Left(); + aPos.setX( rRect.Left() ); do { rRenderContext.DrawBitmap(aPos, *pBitmap); - aPos.X() += aBmpSize.Width(); + aPos.AdjustX(aBmpSize.Width() ); } while (aPos.X() < rRect.Right()); - aPos.Y() += aBmpSize.Height(); + aPos.AdjustY(aBmpSize.Height() ); } while (aPos.Y() < rRect.Bottom()); rRenderContext.Pop(); @@ -1188,30 +1188,30 @@ void SplitWindow::ImplDrawSplitTracking(const Point& rPos) if (mnSplitTest & SPLIT_HORZ) { - aRect.Top() = maDragRect.Top(); - aRect.Bottom() = maDragRect.Bottom(); - aRect.Left() = rPos.X(); - aRect.Right() = aRect.Left() + mpSplitSet->mnSplitSize - 1; + aRect.SetTop( maDragRect.Top() ); + aRect.SetBottom( maDragRect.Bottom() ); + aRect.SetLeft( rPos.X() ); + aRect.SetRight( aRect.Left() + mpSplitSet->mnSplitSize - 1 ); if (!(mnWinStyle & WB_NOSPLITDRAW)) - aRect.Right()--; + aRect.AdjustRight( -1 ); if ((mnSplitTest & SPLIT_WINDOW) && (mbFadeOut)) { - aRect.Left() += SPLITWIN_SPLITSIZEEXLN; - aRect.Right() += SPLITWIN_SPLITSIZEEXLN; + aRect.AdjustLeft(SPLITWIN_SPLITSIZEEXLN ); + aRect.AdjustRight(SPLITWIN_SPLITSIZEEXLN ); } } else { - aRect.Left() = maDragRect.Left(); - aRect.Right() = maDragRect.Right(); - aRect.Top() = rPos.Y(); - aRect.Bottom() = aRect.Top() + mpSplitSet->mnSplitSize - 1; + aRect.SetLeft( maDragRect.Left() ); + aRect.SetRight( maDragRect.Right() ); + aRect.SetTop( rPos.Y() ); + aRect.SetBottom( aRect.Top() + mpSplitSet->mnSplitSize - 1 ); if (!(mnWinStyle & WB_NOSPLITDRAW)) - aRect.Bottom()--; + aRect.AdjustBottom( -1 ); if ((mnSplitTest & SPLIT_WINDOW) && (mbFadeOut)) { - aRect.Top() += SPLITWIN_SPLITSIZEEXLN; - aRect.Bottom() += SPLITWIN_SPLITSIZEEXLN; + aRect.AdjustTop(SPLITWIN_SPLITSIZEEXLN ); + aRect.AdjustBottom(SPLITWIN_SPLITSIZEEXLN ); } } ShowTracking(aRect, ShowTrackFlags::Split); @@ -1333,29 +1333,29 @@ void SplitWindow::ImplSetWindowSize( long nDelta ) switch ( meAlign ) { case WindowAlign::Top: - aSize.Height() += nDelta; + aSize.AdjustHeight(nDelta ); SetSizePixel( aSize ); break; case WindowAlign::Bottom: { - maDragRect.Top() += nDelta; + maDragRect.AdjustTop(nDelta ); Point aPos = GetPosPixel(); - aPos.Y() -= nDelta; - aSize.Height() += nDelta; + aPos.AdjustY( -nDelta ); + aSize.AdjustHeight(nDelta ); SetPosSizePixel( aPos, aSize ); break; } case WindowAlign::Left: - aSize.Width() += nDelta; + aSize.AdjustWidth(nDelta ); SetSizePixel( aSize ); break; case WindowAlign::Right: default: { - maDragRect.Left() += nDelta; + maDragRect.AdjustLeft(nDelta ); Point aPos = GetPosPixel(); - aPos.X() -= nDelta; - aSize.Width() += nDelta; + aPos.AdjustX( -nDelta ); + aSize.AdjustWidth(nDelta ); SetPosSizePixel( aPos, aSize ); break; } @@ -1407,19 +1407,19 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize ) switch ( meAlign ) { case WindowAlign::Top: - aSize.Height() += nDelta; + aSize.AdjustHeight(nDelta ); break; case WindowAlign::Bottom: - aPos.Y() -= nDelta; - aSize.Height() += nDelta; + aPos.AdjustY( -nDelta ); + aSize.AdjustHeight(nDelta ); break; case WindowAlign::Left: - aSize.Width() += nDelta; + aSize.AdjustWidth(nDelta ); break; case WindowAlign::Right: default: - aPos.X() -= nDelta; - aSize.Width() += nDelta; + aPos.AdjustX( -nDelta ); + aSize.AdjustWidth(nDelta ); break; } } @@ -1526,21 +1526,21 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos ) { if ( mnSplitTest & SPLIT_HORZ ) { - rMousePos.X() -= mnMouseOff; + rMousePos.AdjustX( -(mnMouseOff) ); if ( rMousePos.X() < maDragRect.Left() ) - rMousePos.X() = maDragRect.Left(); + rMousePos.setX( maDragRect.Left() ); else if ( rMousePos.X()+mpSplitSet->mnSplitSize+1 > maDragRect.Right() ) - rMousePos.X() = maDragRect.Right()-mpSplitSet->mnSplitSize+1; + rMousePos.setX( maDragRect.Right()-mpSplitSet->mnSplitSize+1 ); // store in screen coordinates due to FullDrag mnMSplitPos = OutputToScreenPixel( rMousePos ).X(); } else { - rMousePos.Y() -= mnMouseOff; + rMousePos.AdjustY( -(mnMouseOff) ); if ( rMousePos.Y() < maDragRect.Top() ) - rMousePos.Y() = maDragRect.Top(); + rMousePos.setY( maDragRect.Top() ); else if ( rMousePos.Y()+mpSplitSet->mnSplitSize+1 > maDragRect.Bottom() ) - rMousePos.Y() = maDragRect.Bottom()-mpSplitSet->mnSplitSize+1; + rMousePos.setY( maDragRect.Bottom()-mpSplitSet->mnSplitSize+1 ); mnMSplitPos = OutputToScreenPixel( rMousePos ).Y(); } } @@ -1568,47 +1568,47 @@ void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, bool bTest ) const switch ( meAlign ) { case WindowAlign::Top: - rRect.Left() = mnLeftBorder+nEx; - rRect.Top() = mnDY-mnBottomBorder-nSplitSize; - rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE; - rRect.Bottom() = mnDY-mnBottomBorder-1; + rRect.SetLeft( mnLeftBorder+nEx ); + rRect.SetTop( mnDY-mnBottomBorder-nSplitSize ); + rRect.SetRight( rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE ); + rRect.SetBottom( mnDY-mnBottomBorder-1 ); if ( bTest ) { - rRect.Top() -= mnTopBorder; - rRect.Bottom() += mnBottomBorder; + rRect.AdjustTop( -(mnTopBorder) ); + rRect.AdjustBottom(mnBottomBorder ); } break; case WindowAlign::Bottom: - rRect.Left() = mnLeftBorder+nEx; - rRect.Top() = mnTopBorder; - rRect.Right() = rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE; - rRect.Bottom() = mnTopBorder+nSplitSize-1; + rRect.SetLeft( mnLeftBorder+nEx ); + rRect.SetTop( mnTopBorder ); + rRect.SetRight( rRect.Left()+SPLITWIN_SPLITSIZEAUTOHIDE ); + rRect.SetBottom( mnTopBorder+nSplitSize-1 ); if ( bTest ) { - rRect.Top() -= mnTopBorder; - rRect.Bottom() += mnBottomBorder; + rRect.AdjustTop( -(mnTopBorder) ); + rRect.AdjustBottom(mnBottomBorder ); } break; case WindowAlign::Left: - rRect.Left() = mnDX-mnRightBorder-nSplitSize; - rRect.Top() = mnTopBorder+nEx; - rRect.Right() = mnDX-mnRightBorder-1; - rRect.Bottom() = rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE; + rRect.SetLeft( mnDX-mnRightBorder-nSplitSize ); + rRect.SetTop( mnTopBorder+nEx ); + rRect.SetRight( mnDX-mnRightBorder-1 ); + rRect.SetBottom( rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE ); if ( bTest ) { - rRect.Left() -= mnLeftBorder; - rRect.Right() += mnRightBorder; + rRect.AdjustLeft( -(mnLeftBorder) ); + rRect.AdjustRight(mnRightBorder ); } break; case WindowAlign::Right: - rRect.Left() = mnLeftBorder; - rRect.Top() = mnTopBorder+nEx; - rRect.Right() = mnLeftBorder+nSplitSize-1; - rRect.Bottom() = rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE; + rRect.SetLeft( mnLeftBorder ); + rRect.SetTop( mnTopBorder+nEx ); + rRect.SetRight( mnLeftBorder+nSplitSize-1 ); + rRect.SetBottom( rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE ); if ( bTest ) { - rRect.Left() -= mnLeftBorder; - rRect.Right() += mnRightBorder; + rRect.AdjustLeft( -(mnLeftBorder) ); + rRect.AdjustRight(mnRightBorder ); } break; } @@ -1801,24 +1801,24 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) bDown = false; pSplitItem = &mpSplitSet->mvItems[mnSplitPos]; - maDragRect.Left() = pSplitItem->mnLeft; - maDragRect.Top() = pSplitItem->mnTop; - maDragRect.Right() = pSplitItem->mnLeft+pSplitItem->mnWidth-1; - maDragRect.Bottom() = pSplitItem->mnTop+pSplitItem->mnHeight-1; + maDragRect.SetLeft( pSplitItem->mnLeft ); + maDragRect.SetTop( pSplitItem->mnTop ); + maDragRect.SetRight( pSplitItem->mnLeft+pSplitItem->mnWidth-1 ); + maDragRect.SetBottom( pSplitItem->mnTop+pSplitItem->mnHeight-1 ); if ( mnSplitTest & SPLIT_HORZ ) { if ( bDown ) - maDragRect.Right() += mpSplitSet->mnSplitSize; + maDragRect.AdjustRight(mpSplitSet->mnSplitSize ); else - maDragRect.Left() -= mpSplitSet->mnSplitSize; + maDragRect.AdjustLeft( -(mpSplitSet->mnSplitSize) ); } else { if ( bDown ) - maDragRect.Bottom() += mpSplitSet->mnSplitSize; + maDragRect.AdjustBottom(mpSplitSet->mnSplitSize ); else - maDragRect.Top() -= mpSplitSet->mnSplitSize; + maDragRect.AdjustTop( -(mpSplitSet->mnSplitSize) ); } if ( mnSplitPos ) @@ -1834,16 +1834,16 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) if ( mnSplitTest & SPLIT_HORZ ) { if ( bDown ) - maDragRect.Left() -= pSplitItem->mnPixSize; + maDragRect.AdjustLeft( -(pSplitItem->mnPixSize) ); else - maDragRect.Right() += pSplitItem->mnPixSize; + maDragRect.AdjustRight(pSplitItem->mnPixSize ); } else { if ( bDown ) - maDragRect.Top() -= pSplitItem->mnPixSize; + maDragRect.AdjustTop( -(pSplitItem->mnPixSize) ); else - maDragRect.Bottom() += pSplitItem->mnPixSize; + maDragRect.AdjustBottom(pSplitItem->mnPixSize ); } } nTemp--; @@ -1855,16 +1855,16 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) if ( bDown ) { if ( mbHorz ) - maDragRect.Bottom() += nCurMaxSize-mnDY-mnTopBorder; + maDragRect.AdjustBottom(nCurMaxSize-mnDY-mnTopBorder ); else - maDragRect.Right() += nCurMaxSize-mnDX-mnLeftBorder; + maDragRect.AdjustRight(nCurMaxSize-mnDX-mnLeftBorder ); } else { if ( mbHorz ) - maDragRect.Top() -= nCurMaxSize-mnDY-mnBottomBorder; + maDragRect.AdjustTop( -(nCurMaxSize-mnDY-mnBottomBorder) ); else - maDragRect.Left() -= nCurMaxSize-mnDX-mnRightBorder; + maDragRect.AdjustLeft( -(nCurMaxSize-mnDX-mnRightBorder) ); } } else @@ -1880,16 +1880,16 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) if ( mnSplitTest & SPLIT_HORZ ) { if ( bDown ) - maDragRect.Right() += pSplitItem->mnPixSize; + maDragRect.AdjustRight(pSplitItem->mnPixSize ); else - maDragRect.Left() -= pSplitItem->mnPixSize; + maDragRect.AdjustLeft( -(pSplitItem->mnPixSize) ); } else { if ( bDown ) - maDragRect.Bottom() += pSplitItem->mnPixSize; + maDragRect.AdjustBottom(pSplitItem->mnPixSize ); else - maDragRect.Top() -= pSplitItem->mnPixSize; + maDragRect.AdjustTop( -(pSplitItem->mnPixSize) ); } } nTemp++; @@ -1898,23 +1898,23 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) } else { - maDragRect.Left() = mnLeftBorder; - maDragRect.Top() = mnTopBorder; - maDragRect.Right() = mnDX-mnRightBorder-1; - maDragRect.Bottom() = mnDY-mnBottomBorder-1; + maDragRect.SetLeft( mnLeftBorder ); + maDragRect.SetTop( mnTopBorder ); + maDragRect.SetRight( mnDX-mnRightBorder-1 ); + maDragRect.SetBottom( mnDY-mnBottomBorder-1 ); if ( mbHorz ) { if ( mbBottomRight ) - maDragRect.Top() -= nCurMaxSize-mnDY-mnBottomBorder; + maDragRect.AdjustTop( -(nCurMaxSize-mnDY-mnBottomBorder) ); else - maDragRect.Bottom() += nCurMaxSize-mnDY-mnTopBorder; + maDragRect.AdjustBottom(nCurMaxSize-mnDY-mnTopBorder ); } else { if ( mbBottomRight ) - maDragRect.Left() -= nCurMaxSize-mnDX-mnRightBorder; + maDragRect.AdjustLeft( -(nCurMaxSize-mnDX-mnRightBorder) ); else - maDragRect.Right() += nCurMaxSize-mnDX-mnLeftBorder; + maDragRect.AdjustRight(nCurMaxSize-mnDX-mnLeftBorder ); } } @@ -2280,11 +2280,11 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt ) if (pHelpResId) { Point aPt = OutputToScreenPixel( aHelpRect.TopLeft() ); - aHelpRect.Left() = aPt.X(); - aHelpRect.Top() = aPt.Y(); + aHelpRect.SetLeft( aPt.X() ); + aHelpRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aHelpRect.BottomRight() ); - aHelpRect.Right() = aPt.X(); - aHelpRect.Bottom() = aPt.Y(); + aHelpRect.SetRight( aPt.X() ); + aHelpRect.SetBottom( aPt.Y() ); // get and draw text OUString aStr = VclResId(pHelpResId); diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 0439acd3b7c6..8cfcaca3071f 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -298,10 +298,10 @@ tools::Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const { if ( pItem->mbVisible ) { - aRect.Left() = pItem->mnX; - aRect.Right() = aRect.Left() + pItem->mnWidth + pItem->mnExtraWidth; - aRect.Top() = STATUSBAR_OFFSET_Y; - aRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y; + aRect.SetLeft( pItem->mnX ); + aRect.SetRight( aRect.Left() + pItem->mnWidth + pItem->mnExtraWidth ); + aRect.SetTop( STATUSBAR_OFFSET_Y ); + aRect.SetBottom( mnCalcHeight - STATUSBAR_OFFSET_Y ); } } @@ -327,12 +327,12 @@ void StatusBar::ImplDrawText(vcl::RenderContext& rRenderContext) { // prevent item box from being overwritten tools::Rectangle aTextRect; - aTextRect.Left() = STATUSBAR_OFFSET_X + 1; - aTextRect.Top() = mnTextY; + aTextRect.SetLeft( STATUSBAR_OFFSET_X + 1 ); + aTextRect.SetTop( mnTextY ); if (mbVisibleItems && (GetStyle() & WB_RIGHT)) - aTextRect.Right() = mnDX - mnItemsWidth - 1; + aTextRect.SetRight( mnDX - mnItemsWidth - 1 ); else - aTextRect.Right() = mnDX - 1; + aTextRect.SetRight( mnDX - 1 ); if (aTextRect.Right() > aTextRect.Left()) { // compute position @@ -341,7 +341,7 @@ void StatusBar::ImplDrawText(vcl::RenderContext& rRenderContext) if (nPos != -1) aStr = aStr.copy(0, nPos); - aTextRect.Bottom() = aTextRect.Top()+GetTextHeight()+1; + aTextRect.SetBottom( aTextRect.Top()+GetTextHeight()+1 ); rRenderContext.DrawText(aTextRect, aStr, DrawTextFlags::Left | DrawTextFlags::Top | DrawTextFlags::Clip | DrawTextFlags::EndEllipsis); } @@ -393,8 +393,8 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen } else { - aTextPos.X() += aTextRect.Left(); - aTextPos.Y() += aTextRect.Top(); + aTextPos.AdjustX(aTextRect.Left() ); + aTextPos.AdjustY(aTextRect.Top() ); rRenderContext.DrawText( aTextPos, pItem->maText, @@ -446,11 +446,11 @@ void StatusBar::ImplDrawItem(vcl::RenderContext& rRenderContext, bool bOffScreen { // draw separator Point aFrom(aRect.TopLeft()); - aFrom.X() -= 4; - aFrom.Y()++; + aFrom.AdjustX( -4 ); + aFrom.AdjustY( 1 ); Point aTo(aRect.BottomLeft()); - aTo.X() -= 4; - aTo.Y()--; + aTo.AdjustX( -4 ); + aTo.AdjustY( -1 ); DecorationView aDecoView(&rRenderContext); aDecoView.DrawSeparator(aFrom, aTo); @@ -527,8 +527,8 @@ void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, cons do { rRenderContext.Erase(aRect); - aRect.Left() -= nDX; - aRect.Right() -= nDX; + aRect.AdjustLeft( -nDX ); + aRect.AdjustRight( -nDX ); nPerc1--; } while (nPerc1 > nPerc2); @@ -552,8 +552,8 @@ void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, cons do { rRenderContext.DrawRect(aRect); - aRect.Left() += nDX; - aRect.Right() += nDX; + aRect.AdjustLeft(nDX ); + aRect.AdjustRight(nDX ); nPerc1++; } while (nPerc1 < nPerc2); @@ -564,8 +564,8 @@ void DrawProgress(vcl::Window* pWindow, vcl::RenderContext& rRenderContext, cons // define on/off status if (((nPercent2 / nPercentCount) & 0x01) == (nPercentCount & 0x01)) { - aRect.Left() -= nDX; - aRect.Right() -= nDX; + aRect.AdjustLeft( -nDX ); + aRect.AdjustRight( -nDX ); rRenderContext.Erase(aRect); } } @@ -599,12 +599,12 @@ void StatusBar::ImplCalcProgressRect() { // calculate text size Size aPrgsTxtSize( GetTextWidth( maPrgsTxt ), GetTextHeight() ); - maPrgsTxtPos.X() = STATUSBAR_OFFSET_X+1; + maPrgsTxtPos.setX( STATUSBAR_OFFSET_X+1 ); // calculate progress frame - maPrgsFrameRect.Left() = maPrgsTxtPos.X()+aPrgsTxtSize.Width()+STATUSBAR_OFFSET; - maPrgsFrameRect.Top() = STATUSBAR_OFFSET_Y; - maPrgsFrameRect.Bottom() = mnCalcHeight - STATUSBAR_OFFSET_Y; + maPrgsFrameRect.SetLeft( maPrgsTxtPos.X()+aPrgsTxtSize.Width()+STATUSBAR_OFFSET ); + maPrgsFrameRect.SetTop( STATUSBAR_OFFSET_Y ); + maPrgsFrameRect.SetBottom( mnCalcHeight - STATUSBAR_OFFSET_Y ); // calculate size of progress rects mnPrgsSize = maPrgsFrameRect.Bottom()-maPrgsFrameRect.Top()-(STATUSBAR_PRGS_OFFSET*2); @@ -619,7 +619,7 @@ void StatusBar::ImplCalcProgressRect() if ( nMaxPercent <= STATUSBAR_PRGS_MIN ) break; } - maPrgsFrameRect.Right() = maPrgsFrameRect.Left() + ImplCalcProgressWidth( nMaxPercent, mnPrgsSize ); + maPrgsFrameRect.SetRight( maPrgsFrameRect.Left() + ImplCalcProgressWidth( nMaxPercent, mnPrgsSize ) ); // save the divisor for later mnPercentCount = 10000 / nMaxPercent; @@ -637,14 +637,14 @@ void StatusBar::ImplCalcProgressRect() if( nProgressHeight > maPrgsFrameRect.GetHeight() ) { long nDelta = nProgressHeight - maPrgsFrameRect.GetHeight(); - maPrgsFrameRect.Top() -= (nDelta - nDelta/2); - maPrgsFrameRect.Bottom() += nDelta/2; + maPrgsFrameRect.AdjustTop( -(nDelta - nDelta/2) ); + maPrgsFrameRect.AdjustBottom(nDelta/2 ); } - maPrgsTxtPos.Y() = maPrgsFrameRect.Top() + (nProgressHeight - GetTextHeight())/2; + maPrgsTxtPos.setY( maPrgsFrameRect.Top() + (nProgressHeight - GetTextHeight())/2 ); } } if( ! bNativeOK ) - maPrgsTxtPos.Y() = mnTextY; + maPrgsTxtPos.setY( mnTextY ); } void StatusBar::MouseButtonDown( const MouseEvent& rMEvt ) @@ -771,11 +771,11 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt ) { tools::Rectangle aItemRect = GetItemRect( nItemId ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); - aItemRect.Left() = aPt.X(); - aItemRect.Top() = aPt.Y(); + aItemRect.SetLeft( aPt.X() ); + aItemRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aItemRect.BottomRight() ); - aItemRect.Right() = aPt.X(); - aItemRect.Bottom() = aPt.Y(); + aItemRect.SetRight( aPt.X() ); + aItemRect.SetBottom( aPt.Y() ); if ( rHEvt.GetMode() & HelpEventMode::BALLOON ) { @@ -884,7 +884,7 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt ) Size aSize = GetSizePixel(); // do not disturb current width, since // CalcWindowSizePixel calculates a minimum width - aSize.Height() = CalcWindowSizePixel().Height(); + aSize.setHeight( CalcWindowSizePixel().Height() ); SetSizePixel( aSize ); Invalidate(); } @@ -1082,10 +1082,10 @@ tools::Rectangle StatusBar::GetItemRect( sal_uInt16 nItemId ) const // get rectangle and subtract frame aRect = ImplGetItemRectPos( nPos ); long nW = mpImplData->mnItemBorderWidth+1; - aRect.Top() += nW-1; - aRect.Bottom() -= nW-1; - aRect.Left() += nW; - aRect.Right() -= nW; + aRect.AdjustTop(nW-1 ); + aRect.AdjustBottom( -(nW-1) ); + aRect.AdjustLeft(nW ); + aRect.AdjustRight( -nW ); return aRect; } } @@ -1111,8 +1111,8 @@ Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const pItem->mnBits ); if ( !mbInUserDraw ) { - aPos.X() += aTextRect.Left(); - aPos.Y() += aTextRect.Top(); + aPos.AdjustX(aTextRect.Left() ); + aPos.AdjustY(aTextRect.Top() ); } return aPos; } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index d418d69518e2..5f8b22416dfc 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -372,7 +372,7 @@ void SystemWindow::RollUp() maOrgSize = GetOutputSizePixel(); Size aSize = maRollUpOutSize; if ( !aSize.Width() ) - aSize.Width() = GetOutputSizePixel().Width(); + aSize.setWidth( GetOutputSizePixel().Width() ); mbRollUp = true; if ( mpWindowImpl->mpBorderWindow ) static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetRollUp( true, aSize ); @@ -410,9 +410,9 @@ void SystemWindow::SetMaxOutputSizePixel( const Size& rSize ) { Size aSize( rSize ); if( aSize.Width() > SHRT_MAX || aSize.Width() <= 0 ) - aSize.Width() = SHRT_MAX; + aSize.setWidth( SHRT_MAX ); if( aSize.Height() > SHRT_MAX || aSize.Height() <= 0 ) - aSize.Height() = SHRT_MAX; + aSize.setHeight( SHRT_MAX ); mpImplData->maMaxOutSize = aSize; if ( mpWindowImpl->mpBorderWindow ) @@ -864,7 +864,7 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const if ( IsRollUp() ) { - aSize.Height() += maOrgSize.Height(); + aSize.AdjustHeight(maOrgSize.Height() ); nState = WindowStateState::Rollup; } @@ -1066,8 +1066,8 @@ Size SystemWindow::GetOptimalSize() const sal_Int32 nBorderWidth = get_border_width(); - aSize.Height() += 2 * nBorderWidth; - aSize.Width() += 2 * nBorderWidth; + aSize.AdjustHeight(2 * nBorderWidth ); + aSize.AdjustWidth(2 * nBorderWidth ); return Window::CalcWindowSize(aSize); } @@ -1076,8 +1076,8 @@ void SystemWindow::setPosSizeOnContainee(Size aSize, Window &rBox) { sal_Int32 nBorderWidth = get_border_width(); - aSize.Width() -= 2 * nBorderWidth; - aSize.Height() -= 2 * nBorderWidth; + aSize.AdjustWidth( -(2 * nBorderWidth) ); + aSize.AdjustHeight( -(2 * nBorderWidth) ); Point aPos(nBorderWidth, nBorderWidth); VclContainer::setLayoutAllocation(rBox, aPos, CalcOutputSize(aSize)); @@ -1125,8 +1125,8 @@ void SystemWindow::setOptimalLayoutSize() Size aMax(bestmaxFrameSizeForScreenSize(GetDesktopRectPixel().GetSize())); - aSize.Width() = std::min(aMax.Width(), aSize.Width()); - aSize.Height() = std::min(aMax.Height(), aSize.Height()); + aSize.setWidth( std::min(aMax.Width(), aSize.Width()) ); + aSize.setHeight( std::min(aMax.Height(), aSize.Height()) ); SetMinOutputSizePixel(aSize); SetSizePixel(aSize); diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index a6559d835e22..1cda73af9e44 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -53,10 +53,10 @@ void TabDialog::ImplPosControls() Size aOptimalSize(pChild->get_preferred_size()); long nTxtWidth = aOptimalSize.Width(); if ( nTxtWidth > aCtrlSize.Width() ) - aCtrlSize.Width() = nTxtWidth; + aCtrlSize.setWidth( nTxtWidth ); long nTxtHeight = aOptimalSize.Height(); if ( nTxtHeight > aCtrlSize.Height() ) - aCtrlSize.Height() = nTxtHeight; + aCtrlSize.setHeight( nTxtHeight ); nDownCtrl++; } else @@ -103,8 +103,8 @@ void TabDialog::ImplPosControls() nViewOffY = nOffY+IMPL_DIALOG_OFFSET; nViewWidth = aTabSize.Width(); nViewPosFlags |= PosSizeFlags::Width; - aTabOffset.Y() += aViewSize.Height()+IMPL_DIALOG_OFFSET; - aDlgSize.Height() += aViewSize.Height()+IMPL_DIALOG_OFFSET; + aTabOffset.AdjustY(aViewSize.Height()+IMPL_DIALOG_OFFSET ); + aDlgSize.AdjustHeight(aViewSize.Height()+IMPL_DIALOG_OFFSET ); } else if ( meViewAlign == WindowAlign::Bottom ) { @@ -112,7 +112,7 @@ void TabDialog::ImplPosControls() nViewOffY = aTabOffset.Y()+aTabSize.Height()+IMPL_DIALOG_OFFSET; nViewWidth = aTabSize.Width(); nViewPosFlags |= PosSizeFlags::Width; - aDlgSize.Height() += aViewSize.Height()+IMPL_DIALOG_OFFSET; + aDlgSize.AdjustHeight(aViewSize.Height()+IMPL_DIALOG_OFFSET ); } else if ( meViewAlign == WindowAlign::Right ) { @@ -120,7 +120,7 @@ void TabDialog::ImplPosControls() nViewOffY = aTabOffset.Y(); nViewHeight = aTabSize.Height(); nViewPosFlags |= PosSizeFlags::Height; - aDlgSize.Width() += aViewSize.Width()+IMPL_DIALOG_OFFSET; + aDlgSize.AdjustWidth(aViewSize.Width()+IMPL_DIALOG_OFFSET ); nBtnEx = aViewSize.Width()+IMPL_DIALOG_OFFSET; } else // meViewAlign == WindowAlign::Left @@ -129,8 +129,8 @@ void TabDialog::ImplPosControls() nViewOffY = aTabOffset.Y(); nViewHeight = aTabSize.Height(); nViewPosFlags |= PosSizeFlags::Height; - aTabOffset.X() += aViewSize.Width()+IMPL_DIALOG_OFFSET; - aDlgSize.Width() += aViewSize.Width()+IMPL_DIALOG_OFFSET; + aTabOffset.AdjustX(aViewSize.Width()+IMPL_DIALOG_OFFSET ); + aDlgSize.AdjustWidth(aViewSize.Width()+IMPL_DIALOG_OFFSET ); nBtnEx = aViewSize.Width()+IMPL_DIALOG_OFFSET; } @@ -188,7 +188,7 @@ void TabDialog::ImplPosControls() pChild2 = pChild2->GetWindow( GetWindowType::Next ); } - aDlgSize.Height() += nLines * (aCtrlSize.Height()+IMPL_DIALOG_OFFSET); + aDlgSize.AdjustHeight(nLines * (aCtrlSize.Height()+IMPL_DIALOG_OFFSET) ); SetOutputSizePixel( aDlgSize ); } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 3bfbe0eff6b3..e46fd4a0cee8 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -340,12 +340,12 @@ void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext) if (mnWinHeight > mnMaxItemHeight) nLineSize = mnWinHeight; - aLineSz.Height() = nLineSize; + aLineSz.setHeight( nLineSize ); } else { nLineSize = mnMaxItemWidth; - aLineSz.Width() = nLineSize; + aLineSz.setWidth( nLineSize ); } } @@ -359,19 +359,19 @@ void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext) { if (mbHorz) { - aTopLineSz.Height() += TB_BORDER_OFFSET2 + nTop; - aBottomLineSz.Height() += TB_BORDER_OFFSET2 + nBottom; + aTopLineSz.AdjustHeight(TB_BORDER_OFFSET2 + nTop ); + aBottomLineSz.AdjustHeight(TB_BORDER_OFFSET2 + nBottom ); if (mnCurLines == 1) - aTopLineSz.Height() += TB_BORDER_OFFSET2 + nBottom; + aTopLineSz.AdjustHeight(TB_BORDER_OFFSET2 + nBottom ); } else { - aTopLineSz.Width() += TB_BORDER_OFFSET1 + nLeft; - aBottomLineSz.Width() += TB_BORDER_OFFSET1 + nRight; + aTopLineSz.AdjustWidth(TB_BORDER_OFFSET1 + nLeft ); + aBottomLineSz.AdjustWidth(TB_BORDER_OFFSET1 + nRight ); if (mnCurLines == 1) - aTopLineSz.Width() += TB_BORDER_OFFSET1 + nLeft; + aTopLineSz.AdjustWidth(TB_BORDER_OFFSET1 + nLeft ); } } @@ -379,15 +379,15 @@ void ToolBox::ImplDrawGradientBackground(vcl::RenderContext& rRenderContext) { if (mbHorz) { - aLineSz.Height() += TB_LINESPACING; + aLineSz.AdjustHeight(TB_LINESPACING ); if (mnCurLines > 1) - aTopLineSz.Height() += TB_LINESPACING; + aTopLineSz.AdjustHeight(TB_LINESPACING ); } else { - aLineSz.Width() += TB_LINESPACING; + aLineSz.AdjustWidth(TB_LINESPACING ); if (mnCurLines > 1) - aTopLineSz.Width() += TB_LINESPACING; + aTopLineSz.AdjustWidth(TB_LINESPACING ); } } @@ -690,41 +690,41 @@ Size ToolBox::ImplCalcSize( ImplToolItems::size_type nCalcLines, sal_uInt16 nCal if ( mbHorz ) { if ( mnWinHeight > mnMaxItemHeight ) - aSize.Height() = nCalcLines * mnWinHeight; + aSize.setHeight( nCalcLines * mnWinHeight ); else - aSize.Height() = nCalcLines * mnMaxItemHeight; + aSize.setHeight( nCalcLines * mnMaxItemHeight ); if ( mnWinStyle & WB_LINESPACING ) - aSize.Height() += (nCalcLines-1)*TB_LINESPACING; + aSize.AdjustHeight((nCalcLines-1)*TB_LINESPACING ); if ( mnWinStyle & WB_BORDER ) - aSize.Height() += (TB_BORDER_OFFSET2*2) + nTop + nBottom; + aSize.AdjustHeight((TB_BORDER_OFFSET2*2) + nTop + nBottom ); nMax = 0; ImplCalcBreaks( TB_MAXNOSCROLL, &nMax, mbHorz ); if ( nMax ) - aSize.Width() += nMax; + aSize.AdjustWidth(nMax ); if ( mnWinStyle & WB_BORDER ) - aSize.Width() += (TB_BORDER_OFFSET1*2) + nLeft + nRight; + aSize.AdjustWidth((TB_BORDER_OFFSET1*2) + nLeft + nRight ); } else { - aSize.Width() = nCalcLines * mnMaxItemWidth; + aSize.setWidth( nCalcLines * mnMaxItemWidth ); if ( mnWinStyle & WB_LINESPACING ) - aSize.Width() += (nCalcLines-1)*TB_LINESPACING; + aSize.AdjustWidth((nCalcLines-1)*TB_LINESPACING ); if ( mnWinStyle & WB_BORDER ) - aSize.Width() += (TB_BORDER_OFFSET2*2) + nLeft + nRight; + aSize.AdjustWidth((TB_BORDER_OFFSET2*2) + nLeft + nRight ); nMax = 0; ImplCalcBreaks( TB_MAXNOSCROLL, &nMax, mbHorz ); if ( nMax ) - aSize.Height() += nMax; + aSize.AdjustHeight(nMax ); if ( mnWinStyle & WB_BORDER ) - aSize.Height() += (TB_BORDER_OFFSET1*2) + nTop + nBottom; + aSize.AdjustHeight((TB_BORDER_OFFSET1*2) + nTop + nBottom ); } } // restore previous values @@ -838,14 +838,14 @@ void ToolBox::ImplCalcMinMaxFloatSize( Size& rMinSize, Size& rMaxSize ) while ( ++i < maFloatSizes.size() ) { if( maFloatSizes[i].mnWidth < rMinSize.Width() ) - rMinSize.Width() = maFloatSizes[i].mnWidth; + rMinSize.setWidth( maFloatSizes[i].mnWidth ); if( maFloatSizes[i].mnHeight < rMinSize.Height() ) - rMinSize.Height() = maFloatSizes[i].mnHeight; + rMinSize.setHeight( maFloatSizes[i].mnHeight ); if( maFloatSizes[i].mnWidth > rMaxSize.Width() ) - rMaxSize.Width() = maFloatSizes[i].mnWidth; + rMaxSize.setWidth( maFloatSizes[i].mnWidth ); if( maFloatSizes[i].mnHeight > rMaxSize.Height() ) - rMaxSize.Height() = maFloatSizes[i].mnHeight; + rMaxSize.setHeight( maFloatSizes[i].mnHeight ); } } @@ -1013,13 +1013,13 @@ void ToolBox::ImplLineSizing( const Point& rPos, tools::Rectangle& rRect, sal_uI } if ( nLineMode & DOCK_LINERIGHT ) - rRect.Right() = rRect.Left()+nSize-1; + rRect.SetRight( rRect.Left()+nSize-1 ); else if ( nLineMode & DOCK_LINEBOTTOM ) - rRect.Bottom() = rRect.Top()+nSize-1; + rRect.SetBottom( rRect.Top()+nSize-1 ); else if ( nLineMode & DOCK_LINELEFT ) - rRect.Left() = rRect.Right()-nSize; + rRect.SetLeft( rRect.Right()-nSize ); else - rRect.Top() = rRect.Bottom()-nSize; + rRect.SetTop( rRect.Bottom()-nSize ); mnDockLines = i; } @@ -1047,8 +1047,8 @@ void ImplTBDragMgr::StartDragging( ToolBox* pToolBox, mnStartLines = pToolBox->mnDockLines; // MouseOffset berechnen - maMouseOff.X() = rRect.Left() - rPos.X(); - maMouseOff.Y() = rRect.Top() - rPos.Y(); + maMouseOff.setX( rRect.Left() - rPos.X() ); + maMouseOff.setY( rRect.Top() - rPos.Y() ); maRect = rRect; maStartRect = rRect; pToolBox->ShowTracking( maRect ); @@ -1545,30 +1545,30 @@ bool ToolBox::ImplCalcItem() else { // we're drawing images and text - item.maItemSize.Width() = bText ? GetCtrlTextWidth( item.maText )+TB_TEXTOFFSET : 0; - item.maItemSize.Height() = bText ? GetTextHeight() : 0; + item.maItemSize.setWidth( bText ? GetCtrlTextWidth( item.maText )+TB_TEXTOFFSET : 0 ); + item.maItemSize.setHeight( bText ? GetTextHeight() : 0 ); if ( meTextPosition == ToolBoxTextPosition::Right ) { // leave space between image and text if( bText ) - item.maItemSize.Width() += TB_IMAGETEXTOFFSET; + item.maItemSize.AdjustWidth(TB_IMAGETEXTOFFSET ); // image and text side by side - item.maItemSize.Width() += item.maImage.GetSizePixel().Width(); + item.maItemSize.AdjustWidth(item.maImage.GetSizePixel().Width() ); if ( item.maImage.GetSizePixel().Height() > item.maItemSize.Height() ) - item.maItemSize.Height() = item.maImage.GetSizePixel().Height(); + item.maItemSize.setHeight( item.maImage.GetSizePixel().Height() ); } else { // leave space between image and text if( bText ) - item.maItemSize.Height() += TB_IMAGETEXTOFFSET; + item.maItemSize.AdjustHeight(TB_IMAGETEXTOFFSET ); // text below image - item.maItemSize.Height() += item.maImage.GetSizePixel().Height(); + item.maItemSize.AdjustHeight(item.maImage.GetSizePixel().Height() ); if ( item.maImage.GetSizePixel().Width() > item.maItemSize.Width() ) - item.maItemSize.Width() = item.maImage.GetSizePixel().Width(); + item.maItemSize.setWidth( item.maImage.GetSizePixel().Width() ); } item.mbVisibleText = bText; @@ -1596,12 +1596,12 @@ bool ToolBox::ImplCalcItem() { if ( meTextPosition == ToolBoxTextPosition::Right ) { - item.maItemSize.Width() += nDropDownArrowWidth; + item.maItemSize.AdjustWidth(nDropDownArrowWidth ); item.mnDropDownArrowWidth = nDropDownArrowWidth; } else { - item.maItemSize.Height() += nDropDownArrowWidth; + item.maItemSize.AdjustHeight(nDropDownArrowWidth ); item.mnDropDownArrowWidth = nDropDownArrowWidth; } } @@ -1611,12 +1611,12 @@ bool ToolBox::ImplCalcItem() if( item.mbVisibleText && !mbHorz ) { long tmp = item.maItemSize.Width(); - item.maItemSize.Width() = item.maItemSize.Height(); - item.maItemSize.Height() = tmp; + item.maItemSize.setWidth( item.maItemSize.Height() ); + item.maItemSize.setHeight( tmp ); tmp = item.maContentSize.Width(); - item.maContentSize.Width() = item.maContentSize.Height(); - item.maContentSize.Height() = tmp; + item.maContentSize.setWidth( item.maContentSize.Height() ); + item.maContentSize.setHeight( tmp ); } } else if ( item.meType == ToolBoxItemType::SPACE ) @@ -1641,17 +1641,17 @@ bool ToolBox::ImplCalcItem() if( item.maItemSize.Width() < nMinW ) { nGrowContentWidth = nMinW - item.maItemSize.Width(); - item.maItemSize.Width() = nMinW; + item.maItemSize.setWidth( nMinW ); } if( item.maItemSize.Height() < nMinH ) { nGrowContentHeight = nMinH - item.maItemSize.Height(); - item.maItemSize.Height() = nMinH; + item.maItemSize.setHeight( nMinH ); } // grow the content size by the additional available space - item.maContentSize.Width() += nGrowContentWidth; - item.maContentSize.Height() += nGrowContentHeight; + item.maContentSize.AdjustWidth(nGrowContentWidth ); + item.maContentSize.AdjustHeight(nGrowContentHeight ); } // keep track of max item size @@ -1882,12 +1882,12 @@ Size ToolBox::ImplGetOptimalFloatingSize() ImplToolItems::size_type manyLines = 1000; Size aMinimalFloatSize = ImplCalcFloatSize( manyLines ); - aSz.Height() = nBorderY + nLineHeight * nLines; + aSz.setHeight( nBorderY + nLineHeight * nLines ); // line space when more than one line if ( mnWinStyle & WB_LINESPACING ) - aSz.Height() += (nLines-1)*TB_LINESPACING; + aSz.AdjustHeight((nLines-1)*TB_LINESPACING ); - aSz.Width() = nBorderX + maxX; + aSz.setWidth( nBorderX + maxX ); // avoid clipping of any items if( aSz.Width() < aMinimalFloatSize.Width() ) @@ -2135,29 +2135,29 @@ void ToolBox::ImplFormat( bool bResize ) { if( !ImplIsFloatingMode() ) { - mpData->maMenubuttonItem.maRect.Right() = mnDX - 2; - mpData->maMenubuttonItem.maRect.Top() = nTop; - mpData->maMenubuttonItem.maRect.Bottom() = mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1; + mpData->maMenubuttonItem.maRect.SetRight( mnDX - 2 ); + mpData->maMenubuttonItem.maRect.SetTop( nTop ); + mpData->maMenubuttonItem.maRect.SetBottom( mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1 ); } else { - mpData->maMenubuttonItem.maRect.Right() = mnDX - mnRightBorder-TB_BORDER_OFFSET1-1; - mpData->maMenubuttonItem.maRect.Top() = nTop; - mpData->maMenubuttonItem.maRect.Bottom() = mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1; + mpData->maMenubuttonItem.maRect.SetRight( mnDX - mnRightBorder-TB_BORDER_OFFSET1-1 ); + mpData->maMenubuttonItem.maRect.SetTop( nTop ); + mpData->maMenubuttonItem.maRect.SetBottom( mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1 ); } - mpData->maMenubuttonItem.maRect.Left() = mpData->maMenubuttonItem.maRect.Right() - mpData->mnMenuButtonWidth; + mpData->maMenubuttonItem.maRect.SetLeft( mpData->maMenubuttonItem.maRect.Right() - mpData->mnMenuButtonWidth ); } else { - maUpperRect.Left() = nLeft+nMax+TB_SPIN_OFFSET; - maUpperRect.Right() = maUpperRect.Left()+TB_SPIN_SIZE-1; - maUpperRect.Top() = nTop; - maLowerRect.Bottom() = mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1; - maLowerRect.Left() = maUpperRect.Left(); - maLowerRect.Right() = maUpperRect.Right(); - maUpperRect.Bottom() = maUpperRect.Top() + - (maLowerRect.Bottom()-maUpperRect.Top())/2; - maLowerRect.Top() = maUpperRect.Bottom(); + maUpperRect.SetLeft( nLeft+nMax+TB_SPIN_OFFSET ); + maUpperRect.SetRight( maUpperRect.Left()+TB_SPIN_SIZE-1 ); + maUpperRect.SetTop( nTop ); + maLowerRect.SetBottom( mnDY-mnBottomBorder-TB_BORDER_OFFSET2-1 ); + maLowerRect.SetLeft( maUpperRect.Left() ); + maLowerRect.SetRight( maUpperRect.Right() ); + maUpperRect.SetBottom( maUpperRect.Top() + + (maLowerRect.Bottom()-maUpperRect.Top())/2 ); + maLowerRect.SetTop( maUpperRect.Bottom() ); } } else @@ -2166,29 +2166,29 @@ void ToolBox::ImplFormat( bool bResize ) { if( !ImplIsFloatingMode() ) { - mpData->maMenubuttonItem.maRect.Bottom() = mnDY - 2; - mpData->maMenubuttonItem.maRect.Left() = nLeft; - mpData->maMenubuttonItem.maRect.Right() = mnDX-mnRightBorder-TB_BORDER_OFFSET2-1; + mpData->maMenubuttonItem.maRect.SetBottom( mnDY - 2 ); + mpData->maMenubuttonItem.maRect.SetLeft( nLeft ); + mpData->maMenubuttonItem.maRect.SetRight( mnDX-mnRightBorder-TB_BORDER_OFFSET2-1 ); } else { - mpData->maMenubuttonItem.maRect.Bottom() = mnDY - mnBottomBorder-TB_BORDER_OFFSET1-1; - mpData->maMenubuttonItem.maRect.Left() = nLeft; - mpData->maMenubuttonItem.maRect.Right() = mnDX-mnRightBorder-TB_BORDER_OFFSET2-1; + mpData->maMenubuttonItem.maRect.SetBottom( mnDY - mnBottomBorder-TB_BORDER_OFFSET1-1 ); + mpData->maMenubuttonItem.maRect.SetLeft( nLeft ); + mpData->maMenubuttonItem.maRect.SetRight( mnDX-mnRightBorder-TB_BORDER_OFFSET2-1 ); } - mpData->maMenubuttonItem.maRect.Top() = mpData->maMenubuttonItem.maRect.Bottom() - mpData->mnMenuButtonWidth; + mpData->maMenubuttonItem.maRect.SetTop( mpData->maMenubuttonItem.maRect.Bottom() - mpData->mnMenuButtonWidth ); } else { - maUpperRect.Top() = nTop+nMax+TB_SPIN_OFFSET; - maUpperRect.Bottom() = maUpperRect.Top()+TB_SPIN_SIZE-1; - maUpperRect.Left() = nLeft; - maLowerRect.Right() = mnDX-mnRightBorder-TB_BORDER_OFFSET2-1; - maLowerRect.Top() = maUpperRect.Top(); - maLowerRect.Bottom() = maUpperRect.Bottom(); - maUpperRect.Right() = maUpperRect.Left() + - (maLowerRect.Right()-maUpperRect.Left())/2; - maLowerRect.Left() = maUpperRect.Right(); + maUpperRect.SetTop( nTop+nMax+TB_SPIN_OFFSET ); + maUpperRect.SetBottom( maUpperRect.Top()+TB_SPIN_SIZE-1 ); + maUpperRect.SetLeft( nLeft ); + maLowerRect.SetRight( mnDX-mnRightBorder-TB_BORDER_OFFSET2-1 ); + maLowerRect.SetTop( maUpperRect.Top() ); + maLowerRect.SetBottom( maUpperRect.Bottom() ); + maUpperRect.SetRight( maUpperRect.Left() + + (maLowerRect.Right()-maUpperRect.Left())/2 ); + maLowerRect.SetLeft( maUpperRect.Right() ); } } } @@ -2251,7 +2251,7 @@ void ToolBox::ImplFormat( bool bResize ) // advance nX and nY accordingly if ( mbHorz ) { - item.maCalcRect.Left() = nX; + item.maCalcRect.SetLeft( nX ); // if special ToolBoxLayoutMode::LockVert lock vertical position // don't recalculate the vertical position of the item if ( meLayoutMode == ToolBoxLayoutMode::LockVert && mnLines == 1 ) @@ -2269,25 +2269,25 @@ void ToolBox::ImplFormat( bool bResize ) if ( item.maRect.Top() || (item.mpWindow && item.mpWindow->GetType() == WindowType::CALCINPUTLINE) ) // tdf#83099 { - item.maCalcRect.Top() = item.maRect.Top(); + item.maCalcRect.SetTop( item.maRect.Top() ); } else { - item.maCalcRect.Top() = nY+(mnMaxItemHeight-aCurrentItemSize.Height())/2; + item.maCalcRect.SetTop( nY+(mnMaxItemHeight-aCurrentItemSize.Height())/2 ); } } else - item.maCalcRect.Top() = nY+(nLineSize-aCurrentItemSize.Height())/2; - item.maCalcRect.Right() = nX+aCurrentItemSize.Width()-1; - item.maCalcRect.Bottom() = item.maCalcRect.Top()+aCurrentItemSize.Height()-1; + item.maCalcRect.SetTop( nY+(nLineSize-aCurrentItemSize.Height())/2 ); + item.maCalcRect.SetRight( nX+aCurrentItemSize.Width()-1 ); + item.maCalcRect.SetBottom( item.maCalcRect.Top()+aCurrentItemSize.Height()-1 ); nX += aCurrentItemSize.Width(); } else { - item.maCalcRect.Left() = nX+(nLineSize-aCurrentItemSize.Width())/2; - item.maCalcRect.Top() = nY; - item.maCalcRect.Right() = item.maCalcRect.Left()+aCurrentItemSize.Width()-1; - item.maCalcRect.Bottom() = nY+aCurrentItemSize.Height()-1; + item.maCalcRect.SetLeft( nX+(nLineSize-aCurrentItemSize.Width())/2 ); + item.maCalcRect.SetTop( nY ); + item.maCalcRect.SetRight( item.maCalcRect.Left()+aCurrentItemSize.Width()-1 ); + item.maCalcRect.SetBottom( nY+aCurrentItemSize.Height()-1 ); nY += aCurrentItemSize.Height(); } } @@ -2320,18 +2320,18 @@ void ToolBox::ImplFormat( bool bResize ) if ( mbHorz ) { - rIt.maRect.Left() = nX+TB_MENUBUTTON_OFFSET; - rIt.maRect.Top() = nY; - rIt.maRect.Right() = rIt.maRect.Left() + mpData->mnMenuButtonWidth; - rIt.maRect.Bottom() = nY+nLineSize-1; + rIt.maRect.SetLeft( nX+TB_MENUBUTTON_OFFSET ); + rIt.maRect.SetTop( nY ); + rIt.maRect.SetRight( rIt.maRect.Left() + mpData->mnMenuButtonWidth ); + rIt.maRect.SetBottom( nY+nLineSize-1 ); nX += rIt.maItemSize.Width(); } else { - rIt.maRect.Left() = nX; - rIt.maRect.Top() = nY+TB_MENUBUTTON_OFFSET; - rIt.maRect.Right() = nX+nLineSize-1; - rIt.maRect.Bottom() = rIt.maRect.Top() + mpData->mnMenuButtonWidth; + rIt.maRect.SetLeft( nX ); + rIt.maRect.SetTop( nY+TB_MENUBUTTON_OFFSET ); + rIt.maRect.SetRight( nX+nLineSize-1 ); + rIt.maRect.SetBottom( rIt.maRect.Top() + mpData->mnMenuButtonWidth ); nY += rIt.maItemSize.Height(); } } @@ -2717,10 +2717,10 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si { tools::Rectangle aArrowRect = pItem->GetDropDownRect( mbHorz && ( meTextPosition == ToolBoxTextPosition::Right ) ); if( aArrowRect.Top() == pItem->maRect.Top() ) // dropdown arrow on right side - aBtnSize.Width() -= aArrowRect.GetWidth(); + aBtnSize.AdjustWidth( -(aArrowRect.GetWidth()) ); else if ( !( (meTextPosition == ToolBoxTextPosition::Bottom) && ((pItem->mnBits & ToolBoxItemBits::DROPDOWNONLY) == ToolBoxItemBits::DROPDOWNONLY) ) ) - aBtnSize.Height() -= aArrowRect.GetHeight(); // dropdown arrow on bottom side + aBtnSize.AdjustHeight( -(aArrowRect.GetHeight()) ); // dropdown arrow on bottom side } } @@ -2786,8 +2786,8 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, ImplToolItems::si if ( bText ) { - aTxtSize.Width() = GetCtrlTextWidth( pItem->maText ); - aTxtSize.Height() = GetTextHeight(); + aTxtSize.setWidth( GetCtrlTextWidth( pItem->maText ) ); + aTxtSize.setHeight( GetTextHeight() ); } if ( bImage ) @@ -2954,25 +2954,25 @@ void ToolBox::ImplDrawFloatwinBorder(vcl::RenderContext& rRenderContext, ImplToo Point p1, p2; p1 = pItem->maRect.TopLeft(); - p1.X()++; + p1.AdjustX( 1 ); p2 = pItem->maRect.TopRight(); - p2.X()--; + p2.AdjustX( -1 ); rRenderContext.DrawLine( p1, p2); p1 = pItem->maRect.BottomLeft(); - p1.X()++; + p1.AdjustX( 1 ); p2 = pItem->maRect.BottomRight(); - p2.X()--; + p2.AdjustX( -1 ); rRenderContext.DrawLine( p1, p2); p1 = pItem->maRect.TopLeft(); - p1.Y()++; + p1.AdjustY( 1 ); p2 = pItem->maRect.BottomLeft(); - p2.Y()--; + p2.AdjustY( -1 ); rRenderContext.DrawLine( p1, p2); p1 = pItem->maRect.TopRight(); - p1.Y()++; + p1.AdjustY( 1 ); p2 = pItem->maRect.BottomRight(); - p2.Y()--; + p2.AdjustY( -1 ); rRenderContext.DrawLine( p1, p2); } @@ -3749,7 +3749,7 @@ void ToolBox::Resize() continue; Size aWinSize(pWindow->GetSizePixel()); Size aPrefSize(pWindow->get_preferred_size()); - aWinSize.Width() = aPrefSize.Width(); + aWinSize.setWidth( aPrefSize.Width() ); pWindow->SetSizePixel(aWinSize); aExpandables.push_back(i); } @@ -3785,7 +3785,7 @@ void ToolBox::Resize() vcl::Window *pWindow = mpData->m_aItems[nIndex].mpWindow; Size aWinSize(pWindow->GetSizePixel()); Size aPrefSize(pWindow->get_preferred_size()); - aWinSize.Width() = aPrefSize.Width() + nDiff; + aWinSize.setWidth( aPrefSize.Width() + nDiff ); pWindow->SetSizePixel(aWinSize); } @@ -3875,11 +3875,11 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt ) // get rectangle tools::Rectangle aTempRect = GetItemRect( nItemId ); Point aPt = OutputToScreenPixel( aTempRect.TopLeft() ); - aTempRect.Left() = aPt.X(); - aTempRect.Top() = aPt.Y(); + aTempRect.SetLeft( aPt.X() ); + aTempRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aTempRect.BottomRight() ); - aTempRect.Right() = aPt.X(); - aTempRect.Bottom() = aPt.Y(); + aTempRect.SetRight( aPt.X() ); + aTempRect.SetBottom( aPt.Y() ); // get text and display it OUString aStr = GetQuickHelpText( nItemId ); @@ -4278,7 +4278,7 @@ Size ToolBox::GetOptimalSize() const Size aWinSize(pWindow->GetSizePixel()); aExpandables[pWindow] = aWinSize; Size aPrefSize(pWindow->get_preferred_size()); - aWinSize.Width() = aPrefSize.Width(); + aWinSize.setWidth( aPrefSize.Width() ); pWindow->SetSizePixel(aWinSize); } } diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 6cdd0edc7fce..c1e5d9ab4d7d 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -145,16 +145,16 @@ Size ImplToolItem::GetSize( bool bHorz, bool bCheckMaxWidth, long maxWidth, cons if ( !bCheckMaxWidth || (aWinSize.Width() <= maxWidth) ) { - aSize.Width() = aWinSize.Width(); - aSize.Height() = aWinSize.Height(); + aSize.setWidth( aWinSize.Width() ); + aSize.setHeight( aWinSize.Height() ); mbShowWindow = true; } else { if ( mbEmptyBtn ) { - aSize.Width() = 0; - aSize.Height() = 0; + aSize.setWidth( 0 ); + aSize.setHeight( 0 ); } } } @@ -163,19 +163,19 @@ Size ImplToolItem::GetSize( bool bHorz, bool bCheckMaxWidth, long maxWidth, cons { if ( bHorz ) { - aSize.Width() = mnSepSize; - aSize.Height() = rDefaultSize.Height(); + aSize.setWidth( mnSepSize ); + aSize.setHeight( rDefaultSize.Height() ); } else { - aSize.Width() = rDefaultSize.Width(); - aSize.Height() = mnSepSize; + aSize.setWidth( rDefaultSize.Width() ); + aSize.setHeight( mnSepSize ); } } else if ( meType == ToolBoxItemType::BREAK ) { - aSize.Width() = 0; - aSize.Height() = 0; + aSize.setWidth( 0 ); + aSize.setHeight( 0 ); } return aSize; @@ -241,10 +241,10 @@ tools::Rectangle ImplToolItem::GetDropDownRect( bool bHorz ) const aRect = maRect; if( mbVisibleText && !bHorz ) // item will be rotated -> place dropdown to the bottom - aRect.Top() = aRect.Bottom() - mnDropDownArrowWidth; + aRect.SetTop( aRect.Bottom() - mnDropDownArrowWidth ); else // place dropdown to the right - aRect.Left() = aRect.Right() - mnDropDownArrowWidth; + aRect.SetLeft( aRect.Right() - mnDropDownArrowWidth ); } return aRect; } @@ -810,31 +810,31 @@ Point ToolBox::ImplGetPopupPosition( const tools::Rectangle& rRect ) const { case WindowAlign::Top: aPos = rRect.BottomLeft(); - aPos.Y()++; + aPos.AdjustY( 1 ); devPos = OutputToAbsoluteScreenPixel( aPos ); if( devPos.Y() >= aScreen.Bottom() ) - aPos.Y() = rRect.Top(); + aPos.setY( rRect.Top() ); break; case WindowAlign::Bottom: aPos = rRect.TopLeft(); - aPos.Y()--; + aPos.AdjustY( -1 ); devPos = OutputToAbsoluteScreenPixel( aPos ); if( devPos.Y() <= aScreen.Top() ) - aPos.Y() = rRect.Bottom(); + aPos.setY( rRect.Bottom() ); break; case WindowAlign::Left: aPos = rRect.TopRight(); - aPos.X()++; + aPos.AdjustX( 1 ); devPos = OutputToAbsoluteScreenPixel( aPos ); if( devPos.X() >= aScreen.Right() ) - aPos.X() = rRect.Left(); + aPos.setX( rRect.Left() ); break; case WindowAlign::Right: aPos = rRect.TopLeft(); - aPos.X()--; + aPos.AdjustX( -1 ); devPos = OutputToAbsoluteScreenPixel( aPos ); if( devPos.X() <= aScreen.Left() ) - aPos.X() = rRect.Right(); + aPos.setX( rRect.Right() ); break; default: break; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index e33862a45e98..4540cfdf3dcd 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1358,13 +1358,13 @@ void Window::ImplPointToLogic(vcl::RenderContext const & rRenderContext, vcl::Fo if (aSize.Width()) { - aSize.Width() *= mpWindowImpl->mpFrameData->mnDPIX; - aSize.Width() += 72 / 2; - aSize.Width() /= 72; + aSize.setWidth( aSize.Width() * ( mpWindowImpl->mpFrameData->mnDPIX) ); + aSize.AdjustWidth(72 / 2 ); + aSize.setWidth( aSize.Width() / 72 ); } - aSize.Height() *= mpWindowImpl->mpFrameData->mnDPIY; - aSize.Height() += 72/2; - aSize.Height() /= 72; + aSize.setHeight( aSize.Height() * ( mpWindowImpl->mpFrameData->mnDPIY) ); + aSize.AdjustHeight(72/2 ); + aSize.setHeight( aSize.Height() / 72 ); if (rRenderContext.IsMapModeEnabled()) aSize = rRenderContext.PixelToLogic(aSize); @@ -1381,13 +1381,13 @@ void Window::ImplLogicToPoint(vcl::RenderContext const & rRenderContext, vcl::Fo if (aSize.Width()) { - aSize.Width() *= 72; - aSize.Width() += mpWindowImpl->mpFrameData->mnDPIX / 2; - aSize.Width() /= mpWindowImpl->mpFrameData->mnDPIX; + aSize.setWidth( aSize.Width() * 72 ); + aSize.AdjustWidth(mpWindowImpl->mpFrameData->mnDPIX / 2 ); + aSize.setWidth( aSize.Width() / ( mpWindowImpl->mpFrameData->mnDPIX) ); } - aSize.Height() *= 72; - aSize.Height() += mpWindowImpl->mpFrameData->mnDPIY / 2; - aSize.Height() /= mpWindowImpl->mpFrameData->mnDPIY; + aSize.setHeight( aSize.Height() * 72 ); + aSize.AdjustHeight(mpWindowImpl->mpFrameData->mnDPIY / 2 ); + aSize.setHeight( aSize.Height() / ( mpWindowImpl->mpFrameData->mnDPIY) ); rFont.SetFontSize(aSize); } @@ -1517,7 +1517,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, { if( ImplIsAntiparallel() ) { - aPtDev.X() = mpWindowImpl->mnAbsScreenX; + aPtDev.setX( mpWindowImpl->mnAbsScreenX ); nOrgX = mpWindowImpl->maPos.X(); } } @@ -1539,7 +1539,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, *pOverlapRegion, false, true ); } mpWindowImpl->mnX = nX; - mpWindowImpl->maPos.X() = nOrgX; + mpWindowImpl->maPos.setX( nOrgX ); mpWindowImpl->mnAbsScreenX = aPtDev.X(); bNewPos = true; } @@ -1557,7 +1557,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, *pOverlapRegion, false, true ); } mpWindowImpl->mnY = nY; - mpWindowImpl->maPos.Y() = nY; + mpWindowImpl->maPos.setY( nY ); bNewPos = true; } } @@ -1755,9 +1755,9 @@ void Window::ImplNewInputContext() // only set default sizes if the font height in logical // coordinates equals 0 if ( rFont.GetFontSize().Height() ) - aSize.Height() = 1; + aSize.setHeight( 1 ); else - aSize.Height() = (12*pFocusWin->mnDPIY)/72; + aSize.setHeight( (12*pFocusWin->mnDPIY)/72 ); } pFontInstance = pFocusWin->mpFontCache->GetFontInstance( pFocusWin->mpFontCollection, rFont, aSize, static_cast<float>(aSize.Height()) ); @@ -2252,10 +2252,10 @@ void Window::Show(bool bVisible, ShowFlags nFlags) */ const int workaround_border = 5; tools::Rectangle aBounds( aInvRegion.GetBoundRect() ); - aBounds.Left() -= workaround_border; - aBounds.Top() -= workaround_border; - aBounds.Right() += workaround_border; - aBounds.Bottom() += workaround_border; + aBounds.AdjustLeft( -workaround_border ); + aBounds.AdjustTop( -workaround_border ); + aBounds.AdjustRight(workaround_border ); + aBounds.AdjustBottom(workaround_border ); aInvRegion = aBounds; } if ( !mpWindowImpl->mbNoParentUpdate && !(nFlags & ShowFlags::NoParentUpdate) ) @@ -2908,8 +2908,8 @@ Point Window::OutputToAbsoluteScreenPixel( const Point& rPos ) const // relative to the screen Point p = OutputToScreenPixel( rPos ); SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry(); - p.X() += g.nX; - p.Y() += g.nY; + p.AdjustX(g.nX ); + p.AdjustY(g.nY ); return p; } @@ -2918,8 +2918,8 @@ Point Window::AbsoluteScreenToOutputPixel( const Point& rPos ) const // relative to the screen Point p = ScreenToOutputPixel( rPos ); SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry(); - p.X() -= g.nX; - p.Y() -= g.nY; + p.AdjustX( -(g.nX) ); + p.AdjustY( -(g.nY) ); return p; } @@ -2930,12 +2930,12 @@ tools::Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const tools: SalFrameGeometry g = mpWindowImpl->mpFrame->GetUnmirroredGeometry(); Point p1 = OutputToScreenPixel( rRect.TopRight() ); - p1.X() = g.nX+g.nWidth-p1.X(); - p1.Y() += g.nY; + p1.setX( g.nX+g.nWidth-p1.X() ); + p1.AdjustY(g.nY ); Point p2 = OutputToScreenPixel( rRect.BottomLeft() ); - p2.X() = g.nX+g.nWidth-p2.X(); - p2.Y() += g.nY; + p2.setX( g.nX+g.nWidth-p2.X() ); + p2.AdjustY(g.nY ); return tools::Rectangle( p1, p2 ); } @@ -2960,16 +2960,16 @@ tools::Rectangle Window::ImplGetWindowExtentsRelative( vcl::Window *pRelativeWin const vcl::Window *pWin = (!bClientOnly && mpWindowImpl->mpBorderWindow) ? mpWindowImpl->mpBorderWindow : this; Point aPos( pWin->OutputToScreenPixel( Point(0,0) ) ); - aPos.X() += g.nX; - aPos.Y() += g.nY; + aPos.AdjustX(g.nX ); + aPos.AdjustY(g.nY ); Size aSize ( pWin->GetSizePixel() ); // #104088# do not add decoration to the workwindow to be compatible to java accessibility api if( !bClientOnly && (mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame && GetType() != WindowType::WORKWINDOW)) ) { - aPos.X() -= g.nLeftDecoration; - aPos.Y() -= g.nTopDecoration; - aSize.Width() += g.nLeftDecoration + g.nRightDecoration; - aSize.Height() += g.nTopDecoration + g.nBottomDecoration; + aPos.AdjustX( -sal_Int32(g.nLeftDecoration) ); + aPos.AdjustY( -sal_Int32(g.nTopDecoration) ); + aSize.AdjustWidth(g.nLeftDecoration + g.nRightDecoration ); + aSize.AdjustHeight(g.nTopDecoration + g.nBottomDecoration ); } if( pRelativeWindow ) { @@ -3510,7 +3510,7 @@ bool Window::IsScrollable() const void Window::ImplMirrorFramePos( Point &pt ) const { - pt.X() = mpWindowImpl->mpFrame->maGeometry.nWidth-1-pt.X(); + pt.setX( mpWindowImpl->mpFrame->maGeometry.nWidth-1-pt.X() ); } // frame based modal counter (dialogs are not modal to the whole application anymore) diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 6aa4182b11bd..72896dbce9fe 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -448,8 +448,8 @@ void Window::SetZoomedPointFont(vcl::RenderContext& rRenderContext, const vcl::F { vcl::Font aFont(rFont); Size aSize = aFont.GetFontSize(); - aSize.Width() = WinFloatRound(double(aSize.Width() * rZoom)); - aSize.Height() = WinFloatRound(double(aSize.Height() * rZoom)); + aSize.setWidth( WinFloatRound(double(aSize.Width() * rZoom)) ); + aSize.setHeight( WinFloatRound(double(aSize.Height() * rZoom)) ); aFont.SetFontSize(aSize); SetPointFont(rRenderContext, aFont); } @@ -602,16 +602,16 @@ void Window::ApplyControlBackground(vcl::RenderContext& rRenderContext, const Co Size Window::CalcWindowSize( const Size& rOutSz ) const { Size aSz = rOutSz; - aSz.Width() += mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder; - aSz.Height() += mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder; + aSz.AdjustWidth(mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder ); + aSz.AdjustHeight(mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder ); return aSz; } Size Window::CalcOutputSize( const Size& rWinSz ) const { Size aSz = rWinSz; - aSz.Width() -= mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder; - aSz.Height() -= mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder; + aSz.AdjustWidth( -(mpWindowImpl->mnLeftBorder+mpWindowImpl->mnRightBorder) ); + aSz.AdjustHeight( -(mpWindowImpl->mnTopBorder+mpWindowImpl->mnBottomBorder) ); return aSz; } @@ -1656,9 +1656,9 @@ Size Window::get_ungrouped_preferred_size() const } if (aRet.Width() == -1) - aRet.Width() = pWindowImpl->mnOptimalWidthCache; + aRet.setWidth( pWindowImpl->mnOptimalWidthCache ); if (aRet.Height() == -1) - aRet.Height() = pWindowImpl->mnOptimalHeightCache; + aRet.setHeight( pWindowImpl->mnOptimalHeightCache ); } return aRet; } @@ -1684,9 +1684,9 @@ Size Window::get_preferred_size() const continue; Size aOtherSize = pOther->get_ungrouped_preferred_size(); if (eMode == VclSizeGroupMode::Both || eMode == VclSizeGroupMode::Horizontal) - aRet.Width() = std::max(aRet.Width(), aOtherSize.Width()); + aRet.setWidth( std::max(aRet.Width(), aOtherSize.Width()) ); if (eMode == VclSizeGroupMode::Both || eMode == VclSizeGroupMode::Vertical) - aRet.Height() = std::max(aRet.Height(), aOtherSize.Height()); + aRet.setHeight( std::max(aRet.Height(), aOtherSize.Height()) ); } } } diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index efe671705472..d7fb245500e8 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -1247,7 +1247,7 @@ static void ImplHandleExtTextInputPos( vcl::Window* pWindow, Point aPos = pChildOutDev->ImplLogicToDevicePixel( pCursor->GetPos() ); Size aSize = pChild->LogicToPixel( pCursor->GetSize() ); if ( !aSize.Width() ) - aSize.Width() = pChild->GetSettings().GetStyleSettings().GetCursorSize(); + aSize.setWidth( pChild->GetSettings().GetStyleSettings().GetCursorSize() ); rRect = tools::Rectangle( aPos, aSize ); } else diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx index 301e7f85622e..c80846e621ca 100644 --- a/vcl/unx/generic/app/i18n_status.cxx +++ b/vcl/unx/generic/app/i18n_status.cxx @@ -139,14 +139,14 @@ void XIMStatusWindow::toggle( bool bOn ) void XIMStatusWindow::layout() { - m_aWindowSize.Width() = m_aStatusText->GetTextWidth( m_aStatusText->GetText() )+8; + m_aWindowSize.setWidth( m_aStatusText->GetTextWidth( m_aStatusText->GetText() )+8 ); Font aFont( m_aStatusText->GetFont() ); - m_aWindowSize.Height() = aFont.GetFontHeight()+10; + m_aWindowSize.setHeight( aFont.GetFontHeight()+10 ); m_aWindowSize = LogicToPixel( m_aWindowSize ); Size aControlSize( m_aWindowSize ); - aControlSize.Width() -= 4; - aControlSize.Height() -= 4; + aControlSize.AdjustWidth( -4 ); + aControlSize.AdjustHeight( -4 ); m_aStatusText->SetPosSizePixel( Point( 1, 1 ), aControlSize ); m_aStatusText->SetFont( aFont ); @@ -215,15 +215,15 @@ Point XIMStatusWindow::updatePosition() int const nGap = 4; // between cursor and status window if (aPosEvent.mbVertical) { - aRet.X() = x + aPosEvent.mnX + (bLeft + aRet.setX( x + aPosEvent.mnX + (bLeft ? -m_aWindowSize.Width() - nGap - : aPosEvent.mnHeight + nGap); - aRet.Y() = y + aPosEvent.mnY; + : aPosEvent.mnHeight + nGap) ); + aRet.setY( y + aPosEvent.mnY ); } else { - aRet.X() = x + aPosEvent.mnX + (bLeft ? -m_aWindowSize.Width() : 0); - aRet.Y() = y + aPosEvent.mnY+aPosEvent.mnHeight + nGap; + aRet.setX( x + aPosEvent.mnX + (bLeft ? -m_aWindowSize.Width() : 0) ); + aRet.setY( y + aPosEvent.mnY+aPosEvent.mnHeight + nGap ); } m_bAnchoredAtRight = bLeft; @@ -284,7 +284,7 @@ void XIMStatusWindow::show( bool bShow, I18NStatus::ShowReason ) void XIMStatusWindow::setText( const OUString& rText ) { m_aStatusText->SetText( rText ); - m_aWindowSize.Width() = m_aStatusText->GetTextWidth( rText )+8; + m_aWindowSize.setWidth( m_aStatusText->GetTextWidth( rText )+8 ); } /* diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx index b21f35cdb8ab..898931147c64 100644 --- a/vcl/unx/generic/app/wmadaptor.cxx +++ b/vcl/unx/generic/app/wmadaptor.cxx @@ -1470,9 +1470,9 @@ void WMAdaptor::maximizeFrame( X11SalFrame* pFrame, bool bHorizontal, bool bVert aTarget.GetHeight() ) ); - aTarget.Left() = + aTarget.SetLeft( pFrame->maRestorePosSize.IsEmpty() ? - rGeom.nX : pFrame->maRestorePosSize.Left(); + rGeom.nX : pFrame->maRestorePosSize.Left() ); } else if( ! bVertical ) { @@ -1483,9 +1483,9 @@ void WMAdaptor::maximizeFrame( X11SalFrame* pFrame, bool bHorizontal, bool bVert rGeom.nHeight : pFrame->maRestorePosSize.GetHeight() ) ); - aTarget.Top() = + aTarget.SetTop( pFrame->maRestorePosSize.IsEmpty() ? - rGeom.nY : pFrame->maRestorePosSize.Top(); + rGeom.nY : pFrame->maRestorePosSize.Top() ); } tools::Rectangle aRestore( Point( rGeom.nX, rGeom.nY ), Size( rGeom.nWidth, rGeom.nHeight ) ); diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index e81202334e65..449b6c080831 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -426,11 +426,11 @@ bool CairoTextRender::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangl { double nCos = pSF->mnCos / 65536.0; double nSin = pSF->mnSin / 65536.0; - rRect.Left() = nCos*aRect.Left() + nSin*aRect.Top(); - rRect.Top() = -nSin*aRect.Left() - nCos*aRect.Top(); + rRect.SetLeft( nCos*aRect.Left() + nSin*aRect.Top() ); + rRect.SetTop( -nSin*aRect.Left() - nCos*aRect.Top() ); - rRect.Right() = nCos*aRect.Right() + nSin*aRect.Bottom(); - rRect.Bottom() = -nSin*aRect.Right() - nCos*aRect.Bottom(); + rRect.SetRight( nCos*aRect.Right() + nSin*aRect.Bottom() ); + rRect.SetBottom( -nSin*aRect.Right() - nCos*aRect.Bottom() ); } else rRect = aRect; diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index 69ca5b041d11..5da3e9637d74 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -831,13 +831,13 @@ Size X11SalBitmap::GetSize() const if( mpDIB ) { - aSize.Width() = mpDIB->mnWidth; - aSize.Height() = mpDIB->mnHeight; + aSize.setWidth( mpDIB->mnWidth ); + aSize.setHeight( mpDIB->mnHeight ); } else if( mpDDB ) { - aSize.Width() = mpDDB->ImplGetWidth(); - aSize.Height() = mpDDB->ImplGetHeight(); + aSize.setWidth( mpDDB->ImplGetWidth() ); + aSize.setHeight( mpDDB->ImplGetHeight() ); } return aSize; diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 8d925ffb371a..ba0aac67b129 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -1791,10 +1791,10 @@ void X11SalFrame::SetWindowState( const SalFrameState *pState ) bool bVert(pState->mnState & WindowStateState::MaximizedVert); GetDisplay()->getWMAdaptor()->maximizeFrame( this, bHorz, bVert ); } - maRestorePosSize.Left() = pState->mnX; - maRestorePosSize.Top() = pState->mnY; - maRestorePosSize.Right() = maRestorePosSize.Left() + pState->mnWidth; - maRestorePosSize.Right() = maRestorePosSize.Left() + pState->mnHeight; + maRestorePosSize.SetLeft( pState->mnX ); + maRestorePosSize.SetTop( pState->mnY ); + maRestorePosSize.SetRight( maRestorePosSize.Left() + pState->mnWidth ); + maRestorePosSize.SetRight( maRestorePosSize.Left() + pState->mnHeight ); } else if( mbMaximizedHorz || mbMaximizedVert ) GetDisplay()->getWMAdaptor()->maximizeFrame( this, false, false ); @@ -3767,9 +3767,9 @@ bool X11SalFrame::HandleReparentEvent( XReparentEvent *pEvent ) Size aSize(maGeometry.nWidth, maGeometry.nHeight); if (nFrameWidth > nScreenWidth) - aSize.Width() = nScreenWidth - maGeometry.nRightDecoration - maGeometry.nLeftDecoration; + aSize.setWidth( nScreenWidth - maGeometry.nRightDecoration - maGeometry.nLeftDecoration ); if (nFrameHeight > nScreenHeight) - aSize.Height() = nScreenHeight - maGeometry.nBottomDecoration - maGeometry.nTopDecoration; + aSize.setHeight( nScreenHeight - maGeometry.nBottomDecoration - maGeometry.nTopDecoration ); SetSize( aSize ); bResized = false; diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index c376bb03eb18..fab9cdff57bf 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -1897,8 +1897,8 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect // #i110881# for the benefit of compiz set a max size here // else setting to fullscreen fails for unknown reasons - m_aMaxSize.Width() = aNewMonitor.width; - m_aMaxSize.Height() = aNewMonitor.height; + m_aMaxSize.setWidth( aNewMonitor.width ); + m_aMaxSize.setHeight( aNewMonitor.height ); } if( pSize && eType == SetType::UnFullscreen ) diff --git a/vcl/unx/gtk/salnativewidgets-gtk.cxx b/vcl/unx/gtk/salnativewidgets-gtk.cxx index 1636037bb5b4..11e67cbd3ae2 100644 --- a/vcl/unx/gtk/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/salnativewidgets-gtk.cxx @@ -1122,9 +1122,9 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, //See fdo#33523, possibly makes sense to do this test for all return values if (!rNativeContentRegion.GetWidth()) - rNativeContentRegion.Right() = rNativeContentRegion.Left() + 1; + rNativeContentRegion.SetRight( rNativeContentRegion.Left() + 1 ); if (!rNativeContentRegion.GetHeight()) - rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1; + rNativeContentRegion.SetBottom( rNativeContentRegion.Top() + 1 ); returnVal = true; } if( (nType == ControlType::Menubar) && (nPart == ControlPart::Entire) ) @@ -1251,13 +1251,13 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, tools::Rectangle aRect( rControlRegion ); if( nPart == ControlPart::ThumbHorz ) { - aRect.Right() = aRect.Left() + slider_length - 1; - aRect.Bottom() = aRect.Top() + slider_width - 1; + aRect.SetRight( aRect.Left() + slider_length - 1 ); + aRect.SetBottom( aRect.Top() + slider_width - 1 ); } else { - aRect.Bottom() = aRect.Top() + slider_length - 1; - aRect.Right() = aRect.Left() + slider_width - 1; + aRect.SetBottom( aRect.Top() + slider_length - 1 ); + aRect.SetRight( aRect.Left() + slider_width - 1 ); } rNativeBoundingRegion = rNativeContentRegion = aRect; returnVal = true; @@ -1958,11 +1958,11 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlPart nPart, button21BoundRect.SetSize( Size( stepper_size, slider_width ) ); button22BoundRect.SetSize( Size( stepper_size, slider_width ) ); - thumbRect.Bottom() = thumbRect.Top() + slider_width - 1; + thumbRect.SetBottom( thumbRect.Top() + slider_width - 1 ); // Make sure the thumb is at least the default width (so we don't get tiny thumbs), // but if the VCL gives us a size smaller than the theme's default thumb size, // honor the VCL size - thumbRect.Right() += magic; + thumbRect.AdjustRight(magic ); // Center vertically in the track thumbRect.Move( 0, (scrollbarRect.GetHeight() - slider_width) / 2 ); } @@ -2002,9 +2002,9 @@ bool GtkSalGraphics::NWPaintGTKScrollbar( ControlPart nPart, button21BoundRect.SetSize( Size( slider_width, stepper_size ) ); button22BoundRect.SetSize( Size( slider_width, stepper_size ) ); - thumbRect.Right() = thumbRect.Left() + slider_width - 1; + thumbRect.SetRight( thumbRect.Left() + slider_width - 1 ); - thumbRect.Bottom() += magic; + thumbRect.AdjustBottom(magic ); // Center horizontally in the track thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 ); } @@ -2473,24 +2473,24 @@ static tools::Rectangle NWGetSpinButtonRect( SalX11Screen nScreen, if ( nPart == ControlPart::ButtonUp ) { buttonRect.setY( aAreaRect.Top() ); - buttonRect.Bottom() = buttonRect.Top() + (aAreaRect.GetHeight() / 2); + buttonRect.SetBottom( buttonRect.Top() + (aAreaRect.GetHeight() / 2) ); } else if( nPart == ControlPart::ButtonDown ) { buttonRect.setY( aAreaRect.Top() + (aAreaRect.GetHeight() / 2) ); - buttonRect.Bottom() = aAreaRect.Bottom(); // cover area completely + buttonRect.SetBottom( aAreaRect.Bottom() ); // cover area completely } else { if( AllSettings::GetLayoutRTL() ) { - buttonRect.Left() = buttonRect.Right()+1; - buttonRect.Right() = aAreaRect.Right(); + buttonRect.SetLeft( buttonRect.Right()+1 ); + buttonRect.SetRight( aAreaRect.Right() ); } else { - buttonRect.Right() = buttonRect.Left()-1; - buttonRect.Left() = aAreaRect.Left(); + buttonRect.SetRight( buttonRect.Left()-1 ); + buttonRect.SetLeft( aAreaRect.Left() ); } - buttonRect.Top() = aAreaRect.Top(); - buttonRect.Bottom() = aAreaRect.Bottom(); + buttonRect.SetTop( aAreaRect.Top() ); + buttonRect.SetBottom( aAreaRect.Bottom() ); } return buttonRect; @@ -2565,7 +2565,7 @@ bool GtkSalGraphics::NWPaintGTKComboBox( GdkDrawable* gdkDrawable, buttonRect = NWGetComboBoxButtonRect( m_nXScreen, ControlPart::ButtonDown, pixmapRect ); if( nPart == ControlPart::ButtonDown ) - buttonRect.Left() += 1; + buttonRect.AdjustLeft(1 ); tools::Rectangle aEditBoxRect( pixmapRect ); aEditBoxRect.SetSize( Size( pixmapRect.GetWidth() - buttonRect.GetWidth(), aEditBoxRect.GetHeight() ) ); @@ -2652,10 +2652,10 @@ static tools::Rectangle NWGetComboBoxButtonRect( SalX11Screen nScreen, aButtonRect.SetSize( Size( aAreaRect.GetWidth() - nButtonWidth - 2 * adjust_x, aAreaRect.GetHeight() - 2 * adjust_y ) ); Point aEditPos = aAreaRect.TopLeft(); - aEditPos.X() += adjust_x; - aEditPos.Y() += adjust_y; + aEditPos.AdjustX(adjust_x ); + aEditPos.AdjustY(adjust_y ); if( AllSettings::GetLayoutRTL() ) - aEditPos.X() += nButtonWidth; + aEditPos.AdjustX(nButtonWidth ); aButtonRect.SetPos( aEditPos ); } @@ -2714,16 +2714,16 @@ bool GtkSalGraphics::NWPaintGTKTabItem( ControlType nType, { // In GTK+, the selected tab is 2px taller than all other tabs pixmapRect.Move( 0, -2 ); - pixmapRect.Bottom() += 2; + pixmapRect.AdjustBottom(2 ); tabRect = pixmapRect; // Only draw over 1 pixel of the tab pane that this tab is drawn on top of. - tabRect.Bottom() -= 1; + tabRect.AdjustBottom( -1 ); } else tabRect = pixmapRect; // Allow the tab to draw a right border if needed - tabRect.Right() -= 1; + tabRect.AdjustRight( -1 ); // avoid degenerate cases which might lead to crashes if( tabRect.GetWidth() <= 1 || tabRect.GetHeight() <= 1 ) @@ -3356,10 +3356,10 @@ bool GtkSalGraphics::NWPaintGTKListNode( NWEnsureGTKTreeView( m_nXScreen ); tools::Rectangle aRect( rControlRectangle ); - aRect.Left() -= 2; - aRect.Right() += 2; - aRect.Top() -= 2; - aRect.Bottom() += 2; + aRect.AdjustLeft( -2 ); + aRect.AdjustRight(2 ); + aRect.AdjustTop( -2 ); + aRect.AdjustBottom(2 ); gint w, h; w = aRect.GetWidth(); h = aRect.GetHeight(); @@ -3574,21 +3574,21 @@ static tools::Rectangle NWGetListBoxButtonRect( SalX11Screen nScreen, switch( nPart ) { case ControlPart::ButtonDown: - aPartSize.Width() = nButtonAreaWidth; - aPartPos.X() = aAreaRect.Left() + aAreaRect.GetWidth() - aPartSize.Width(); + aPartSize.setWidth( nButtonAreaWidth ); + aPartPos.setX( aAreaRect.Left() + aAreaRect.GetWidth() - aPartSize.Width() ); break; case ControlPart::SubEdit: - aPartSize.Width() = aAreaRect.GetWidth() - nButtonAreaWidth - xthickness; + aPartSize.setWidth( aAreaRect.GetWidth() - nButtonAreaWidth - xthickness ); if( AllSettings::GetLayoutRTL() ) - aPartPos.X() = aAreaRect.Left() + nButtonAreaWidth; + aPartPos.setX( aAreaRect.Left() + nButtonAreaWidth ); else - aPartPos.X() = aAreaRect.Left() + xthickness; + aPartPos.setX( aAreaRect.Left() + xthickness ); break; default: - aPartSize.Width() = aAreaRect.GetWidth(); - aPartPos.X() = aAreaRect.Left(); + aPartSize.setWidth( aAreaRect.GetWidth() ); + aPartPos.setX( aAreaRect.Left() ); break; } aPartRect = tools::Rectangle( aPartPos, aPartSize ); @@ -3676,9 +3676,9 @@ static tools::Rectangle NWGetToolbarRect( SalX11Screen nScreen, gtk_widget_ensure_style( gWidgetData[nScreen].gToolbarButtonWidget ); if( aAreaRect.GetWidth() < nMinWidth ) - aRet.Right() = aRet.Left() + nMinWidth; + aRet.SetRight( aRet.Left() + nMinWidth ); if( aAreaRect.GetHeight() < nMinHeight ) - aRet.Bottom() = aRet.Top() + nMinHeight; + aRet.SetBottom( aRet.Top() + nMinHeight ); } return aRet; diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx index 42c0014a81d8..162d46286941 100644 --- a/vcl/unx/gtk3/gtk3gtkframe.cxx +++ b/vcl/unx/gtk3/gtk3gtkframe.cxx @@ -1386,8 +1386,8 @@ Size GtkSalFrame::calcDefaultSize() { Size aScreenSize(getDisplay()->GetScreenSize(GetDisplayScreen())); int scale = gtk_widget_get_scale_factor(m_pWindow); - aScreenSize.Width() /= scale; - aScreenSize.Height() /= scale; + aScreenSize.setWidth( aScreenSize.Width() / scale ); + aScreenSize.setHeight( aScreenSize.Height() / scale ); return bestmaxFrameSizeForScreenSize(aScreenSize); } @@ -1869,8 +1869,8 @@ void GtkSalFrame::SetScreen( unsigned int nNewScreen, SetType eType, tools::Rect // #i110881# for the benefit of compiz set a max size here // else setting to fullscreen fails for unknown reasons - m_aMaxSize.Width() = aNewMonitor.width; - m_aMaxSize.Height() = aNewMonitor.height; + m_aMaxSize.setWidth( aNewMonitor.width ); + m_aMaxSize.setHeight( aNewMonitor.height ); } if( pSize && eType == SetType::UnFullscreen ) diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index f9c1b119ac63..5ea9cbcde7bd 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -183,7 +183,7 @@ tools::Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, tools:: tools::Rectangle buttonRect; buttonRect.SetSize(Size(buttonWidth, buttonHeight)); buttonRect.setY(aAreaRect.Top()); - buttonRect.Bottom() = buttonRect.Top() + aAreaRect.GetHeight(); + buttonRect.SetBottom( buttonRect.Top() + aAreaRect.GetHeight() ); tools::Rectangle partRect(buttonRect); if ( nPart == ControlPart::ButtonUp ) { @@ -203,16 +203,16 @@ tools::Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, tools:: { if (AllSettings::GetLayoutRTL()) { - partRect.Right() = aAreaRect.Left() + aAreaRect.GetWidth(); - partRect.Left() = aAreaRect.Left() + (2 * buttonRect.GetWidth()) - 1; + partRect.SetRight( aAreaRect.Left() + aAreaRect.GetWidth() ); + partRect.SetLeft( aAreaRect.Left() + (2 * buttonRect.GetWidth()) - 1 ); } else { - partRect.Right() = (aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * buttonRect.GetWidth())) - 1; - partRect.Left() = aAreaRect.Left(); + partRect.SetRight( (aAreaRect.Left() + (aAreaRect.GetWidth() - 2 * buttonRect.GetWidth())) - 1 ); + partRect.SetLeft( aAreaRect.Left() ); } - partRect.Top() = aAreaRect.Top(); - partRect.Bottom() = aAreaRect.Bottom(); + partRect.SetTop( aAreaRect.Top() ); + partRect.SetBottom( aAreaRect.Bottom() ); } return partRect; @@ -288,25 +288,25 @@ tools::Rectangle GtkSalGraphics::NWGetScrollButtonRect( ControlPart nPart, tools if (nPart == ControlPart::ButtonUp) { - aSize.Height() *= nFirst; + aSize.setHeight( aSize.Height() * nFirst ); buttonRect.setX(aAreaRect.Left()); buttonRect.setY(aAreaRect.Top()); } else if (nPart == ControlPart::ButtonLeft) { - aSize.Width() *= nFirst; + aSize.setWidth( aSize.Width() * nFirst ); buttonRect.setX(aAreaRect.Left()); buttonRect.setY(aAreaRect.Top()); } else if (nPart == ControlPart::ButtonDown) { - aSize.Height() *= nSecond; + aSize.setHeight( aSize.Height() * nSecond ); buttonRect.setX(aAreaRect.Left()); buttonRect.setY(aAreaRect.Top() + aAreaRect.GetHeight() - aSize.Height()); } else if (nPart == ControlPart::ButtonRight) { - aSize.Width() *= nSecond; + aSize.setWidth( aSize.Width() * nSecond ); buttonRect.setX(aAreaRect.Left() + aAreaRect.GetWidth() - aSize.Width()); buttonRect.setY(aAreaRect.Top()); } @@ -409,10 +409,10 @@ namespace GtkBorder margin; gtk_style_context_get_margin(pContext, gtk_style_context_get_state(pContext), &margin); - aRect.Left() += margin.left; - aRect.Top() += margin.top; - aRect.Right() -= margin.right; - aRect.Bottom() -= margin.bottom; + aRect.AdjustLeft(margin.left ); + aRect.AdjustTop(margin.top ); + aRect.AdjustRight( -(margin.right) ); + aRect.AdjustBottom( -(margin.bottom) ); gtk_render_background(pContext, cr, aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight()); @@ -423,10 +423,10 @@ namespace gtk_style_context_get_border(pContext, gtk_style_context_get_state(pContext), &border); gtk_style_context_get_padding(pContext, gtk_style_context_get_state(pContext), &padding); - aRect.Left() += border.left + padding.left; - aRect.Top() += border.top + padding.top; - aRect.Right() -= border.right + padding.right; - aRect.Bottom() -= border.bottom + padding.bottom; + aRect.AdjustLeft(border.left + padding.left ); + aRect.AdjustTop(border.top + padding.top ); + aRect.AdjustRight( -(border.right + padding.right) ); + aRect.AdjustBottom( -(border.bottom + padding.bottom) ); return aRect; } @@ -712,15 +712,15 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, { tools::Rectangle aBtn1Rect = NWGetScrollButtonRect(ControlPart::ButtonLeft, aTrackRect); tools::Rectangle aBtn2Rect = NWGetScrollButtonRect(ControlPart::ButtonRight, aTrackRect); - aTrackRect.Left() = aBtn1Rect.Right(); - aTrackRect.Right() = aBtn2Rect.Left(); + aTrackRect.SetLeft( aBtn1Rect.Right() ); + aTrackRect.SetRight( aBtn2Rect.Left() ); } else { tools::Rectangle aBtn1Rect = NWGetScrollButtonRect(ControlPart::ButtonUp, aTrackRect); tools::Rectangle aBtn2Rect = NWGetScrollButtonRect(ControlPart::ButtonDown, aTrackRect); - aTrackRect.Top() = aBtn1Rect.Bottom() + 1; - aTrackRect.Bottom() = aBtn2Rect.Top(); + aTrackRect.SetTop( aBtn1Rect.Bottom() + 1 ); + aTrackRect.SetBottom( aBtn2Rect.Top() ); } GtkStyleContext* pScrollbarTroughStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ? @@ -841,11 +841,11 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, button21BoundRect.SetSize( Size( stepper_size, slider_width ) ); button22BoundRect.SetSize( Size( stepper_size, slider_width ) ); - thumbRect.Bottom() = thumbRect.Top() + slider_width - 1; + thumbRect.SetBottom( thumbRect.Top() + slider_width - 1 ); // Make sure the thumb is at least the default width (so we don't get tiny thumbs), // but if the VCL gives us a size smaller than the theme's default thumb size, // honor the VCL size - thumbRect.Right() += magic; + thumbRect.AdjustRight(magic ); // Center vertically in the track thumbRect.Move( 0, (scrollbarRect.GetHeight() - slider_width) / 2 ); } @@ -880,9 +880,9 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, button21BoundRect.SetSize( Size( slider_width, stepper_size ) ); button22BoundRect.SetSize( Size( slider_width, stepper_size ) ); - thumbRect.Right() = thumbRect.Left() + slider_width - 1; + thumbRect.SetRight( thumbRect.Left() + slider_width - 1 ); - thumbRect.Bottom() += magic; + thumbRect.AdjustBottom(magic ); // Center horizontally in the track thumbRect.Move( (scrollbarRect.GetWidth() - slider_width) / 2, 0 ); } @@ -1169,7 +1169,7 @@ tools::Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( { Point aPos = Point(aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth, aAreaRect.Top()); if (AllSettings::GetLayoutRTL()) - aPos.X() = aAreaRect.Left(); + aPos.setX( aAreaRect.Left() ); aButtonRect.SetSize( Size( nButtonWidth, aAreaRect.GetHeight() ) ); aButtonRect.SetPos(aPos); } @@ -1184,10 +1184,10 @@ tools::Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( aAreaRect.GetHeight() - (adjust_top + adjust_bottom)) ); Point aEditPos = aAreaRect.TopLeft(); if (AllSettings::GetLayoutRTL()) - aEditPos.X() += nButtonWidth; + aEditPos.AdjustX(nButtonWidth ); else - aEditPos.X() += adjust_left; - aEditPos.Y() += adjust_top; + aEditPos.AdjustX(adjust_left ); + aEditPos.AdjustY(adjust_top ); aButtonRect.SetPos( aEditPos ); } @@ -2679,9 +2679,9 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar rNativeContentRegion = rNativeBoundingRegion; if (!rNativeContentRegion.GetWidth()) - rNativeContentRegion.Right() = rNativeContentRegion.Left() + 1; + rNativeContentRegion.SetRight( rNativeContentRegion.Left() + 1 ); if (!rNativeContentRegion.GetHeight()) - rNativeContentRegion.Bottom() = rNativeContentRegion.Top() + 1; + rNativeContentRegion.SetBottom( rNativeContentRegion.Top() + 1 ); return true; } diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index fbd6089617a2..8763ab398636 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -270,8 +270,8 @@ IMPL_LINK_NOARG( MyWin, SelectHdl, ListBox&, void) SAL_INFO("vcl", "got bitmap of size " << aBitmap.GetSizePixel().Width() << "x" << aBitmap.GetSizePixel().Height()); Size aFixedSize( aBitmap.GetSizePixel() ); - aFixedSize.Width() += 10; - aFixedSize.Height() += 10; + aFixedSize.AdjustWidth(10 ); + aFixedSize.AdjustHeight(10 ); m_aImage->SetSizePixel( aFixedSize ); m_aImage->SetImage( Image( BitmapEx( aBitmap ) ) ); diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index e1d36cfe46b7..4d33ff7934a9 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -310,11 +310,11 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rR rRenderContext.DrawLine(project(aP1) + aCenter, project(aP2) + aCenter, aLineInfo); - aPoint.X() = static_cast<int>((static_cast<double>(aP1.X())*cosd - static_cast<double>(aP1.Y())*sind)*factor); - aPoint.Y() = static_cast<int>((static_cast<double>(aP1.Y())*cosd + static_cast<double>(aP1.X())*sind)*factor); + aPoint.setX( static_cast<int>((static_cast<double>(aP1.X())*cosd - static_cast<double>(aP1.Y())*sind)*factor) ); + aPoint.setY( static_cast<int>((static_cast<double>(aP1.Y())*cosd + static_cast<double>(aP1.X())*sind)*factor) ); aP1 = aPoint; - aPoint.X() = static_cast<int>((static_cast<double>(aP2.X())*cosd - static_cast<double>(aP2.Y())*sind)*factor); - aPoint.Y() = static_cast<int>((static_cast<double>(aP2.Y())*cosd + static_cast<double>(aP2.X())*sind)*factor); + aPoint.setX( static_cast<int>((static_cast<double>(aP2.X())*cosd - static_cast<double>(aP2.Y())*sind)*factor) ); + aPoint.setY( static_cast<int>((static_cast<double>(aP2.Y())*cosd + static_cast<double>(aP2.X())*sind)*factor) ); aP2 = aPoint; } rRenderContext.Pop(); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index b3008fedf471..dc170e644fb7 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -460,8 +460,8 @@ public: int nHeight = r.GetHeight(); // move the text to the bottom of the bounding rect before rotating - aFontRect.Top() += nHeight/2; - aFontRect.Bottom() += nHeight; + aFontRect.AdjustTop(nHeight/2 ); + aFontRect.AdjustBottom(nHeight ); aFont.SetOrientation(45 * 10); // 45 degrees @@ -582,7 +582,7 @@ public: long nNewX = drawStringBox(rDev, aPos, aString, nMaxTextHeight); - aPos.X() = nNewX; + aPos.setX( nNewX ); if (aPos.X() >= r.Right()) { @@ -1987,8 +1987,8 @@ class DemoPopup : public FloatingWindow SetLineColor(COL_BLACK); SetFillColor(); DrawRect( tools::Rectangle( Point(), aSize ) ); - aSize.Width() -= 2; - aSize.Height() -= 2; + aSize.AdjustWidth( -2 ); + aSize.AdjustHeight( -2 ); Color aColor( GetLineColor() ); SetLineColor( COL_GRAY ); DrawRect( tools::Rectangle( Point( 1, 1 ), aSize ) ); |