[Libreoffice-commits] core.git: vcl/backendtest vcl/headless vcl/opengl vcl/source vcl/unx vcl/workben
Noel Grandin
noel.grandin at collabora.co.uk
Thu Feb 22 19:19:24 UTC 2018
vcl/backendtest/VisualBackendTest.cxx | 4
vcl/headless/svpbmp.cxx | 4
vcl/opengl/gdiimpl.cxx | 12
vcl/source/app/help.cxx | 48 +--
vcl/source/app/svapp.cxx | 4
vcl/source/control/button.cxx | 398 +++++++++++++++---------------
vcl/source/control/combobox.cxx | 58 ++--
vcl/source/control/edit.cxx | 42 +--
vcl/source/control/field.cxx | 10
vcl/source/control/fixed.cxx | 12
vcl/source/control/group.cxx | 4
vcl/source/control/imgctrl.cxx | 12
vcl/source/control/imp_listbox.cxx | 66 ++--
vcl/source/control/listbox.cxx | 62 ++--
vcl/source/control/listctrl.cxx | 8
vcl/source/control/morebtn.cxx | 8
vcl/source/control/notebookbar.cxx | 2
vcl/source/control/prgsbar.cxx | 4
vcl/source/control/scrbar.cxx | 60 ++--
vcl/source/control/slider.cxx | 96 +++----
vcl/source/control/spinbtn.cxx | 8
vcl/source/control/spinfld.cxx | 54 ++--
vcl/source/control/tabctrl.cxx | 192 +++++++-------
vcl/source/edit/texteng.cxx | 34 +-
vcl/source/edit/textview.cxx | 76 ++---
vcl/source/edit/vclmedit.cxx | 54 ++--
vcl/source/filter/graphicfilter.cxx | 4
vcl/source/filter/graphicfilter2.cxx | 44 +--
vcl/source/filter/wmf/emfwr.cxx | 4
vcl/source/filter/wmf/wmfwr.cxx | 12
vcl/source/gdi/CommonSalLayout.cxx | 12
vcl/source/gdi/animate.cxx | 4
vcl/source/gdi/bitmap.cxx | 20 -
vcl/source/gdi/gdimtf.cxx | 26 -
vcl/source/gdi/gradient.cxx | 32 +-
vcl/source/gdi/graph.cxx | 36 +-
vcl/source/gdi/impanmvw.cxx | 52 +--
vcl/source/gdi/impvect.cxx | 152 +++++------
vcl/source/gdi/metaact.cxx | 4
vcl/source/gdi/pdfwriter_impl.cxx | 180 ++++++-------
vcl/source/gdi/pdfwriter_impl2.cxx | 16 -
vcl/source/gdi/pngread.cxx | 12
vcl/source/gdi/print.cxx | 8
vcl/source/gdi/print2.cxx | 26 -
vcl/source/gdi/print3.cxx | 16 -
vcl/source/gdi/region.cxx | 8
vcl/source/gdi/regionband.cxx | 8
vcl/source/gdi/sallayout.cxx | 14 -
vcl/source/gdi/svmconverter.cxx | 8
vcl/source/helper/canvasbitmap.cxx | 4
vcl/source/outdev/bitmap.cxx | 16 -
vcl/source/outdev/font.cxx | 34 +-
vcl/source/outdev/gradient.cxx | 96 +++----
vcl/source/outdev/hatch.cxx | 30 +-
vcl/source/outdev/map.cxx | 44 +--
vcl/source/outdev/outdev.cxx | 6
vcl/source/outdev/text.cxx | 58 ++--
vcl/source/outdev/textline.cxx | 8
vcl/source/outdev/transparent.cxx | 8
vcl/source/outdev/wallpaper.cxx | 24 -
vcl/source/window/brdwin.cxx | 144 +++++-----
vcl/source/window/btndlg.cxx | 12
vcl/source/window/cursor.cxx | 22 -
vcl/source/window/decoview.cxx | 180 ++++++-------
vcl/source/window/dockingarea.cxx | 16 -
vcl/source/window/dockmgr.cxx | 46 +--
vcl/source/window/dockwin.cxx | 52 +--
vcl/source/window/floatwin.cxx | 54 ++--
vcl/source/window/layout.cxx | 144 +++++-----
vcl/source/window/menu.cxx | 132 ++++-----
vcl/source/window/menubarwindow.cxx | 8
vcl/source/window/menufloatingwindow.cxx | 22 -
vcl/source/window/mouse.cxx | 4
vcl/source/window/msgbox.cxx | 44 +--
vcl/source/window/paint.cxx | 8
vcl/source/window/printdlg.cxx | 20 -
vcl/source/window/scrwnd.cxx | 4
vcl/source/window/split.cxx | 36 +-
vcl/source/window/splitwin.cxx | 234 ++++++++---------
vcl/source/window/status.cxx | 82 +++---
vcl/source/window/syswin.cxx | 20 -
vcl/source/window/tabdlg.cxx | 18 -
vcl/source/window/toolbox.cxx | 246 +++++++++---------
vcl/source/window/toolbox2.cxx | 40 +--
vcl/source/window/window.cxx | 72 ++---
vcl/source/window/window2.cxx | 20 -
vcl/source/window/winproc.cxx | 2
vcl/unx/generic/app/i18n_status.cxx | 20 -
vcl/unx/generic/app/wmadaptor.cxx | 8
vcl/unx/generic/gdi/cairotextrender.cxx | 8
vcl/unx/generic/gdi/salbmp.cxx | 8
vcl/unx/generic/window/salframe.cxx | 12
vcl/unx/gtk/gtksalframe.cxx | 4
vcl/unx/gtk/salnativewidgets-gtk.cxx | 76 ++---
vcl/unx/gtk3/gtk3gtkframe.cxx | 8
vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 66 ++--
vcl/workben/svpclient.cxx | 4
vcl/workben/svptest.cxx | 8
vcl/workben/vcldemo.cxx | 10
99 files changed, 2136 insertions(+), 2136 deletions(-)
New commits:
commit 4a8968039a2e1d9e7aee10433ced1f59c0392d7a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Wed Feb 21 15:56:58 2018 +0200
loplugin:changetoolsgen in vcl
Change-Id: I0fc68cf51fb23ed9bb86a5087e8247c81b024494
Reviewed-on: https://gerrit.libreoffice.org/50107
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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;
}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list