summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 09:20:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-16 13:24:23 +0100
commit3987c2b0e8477152e4f85ce7fa1b70eb38e171f7 (patch)
treeb6973e97085fcb0a7457828763faddbfc703b2a8
parent4beed2ba7335fdb211aca7f70a144ffecf90a781 (diff)
Revert "loplugin:changetoolsgen in sfx2" and reapply plugin...
because I (a) forgot to insert parentheses which changes the meaning of some expressions and (b) I now use the AdjustFoo calls when changing unary operations, which reads much better This reverts commit c82802a9ee3514d0b98fbb3783abbc17ec02c3b6. Change-Id: I44a5316ebd3d0bde6bd75ad24e9a4406cd8e8db0 Reviewed-on: https://gerrit.libreoffice.org/49836 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sfx2/source/appl/newhelp.cxx16
-rw-r--r--sfx2/source/appl/workwin.cxx74
-rw-r--r--sfx2/source/control/charwin.cxx4
-rw-r--r--sfx2/source/dialog/basedlgs.cxx4
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--sfx2/source/dialog/dockwin.cxx36
-rw-r--r--sfx2/source/dialog/recfloat.cxx4
-rw-r--r--sfx2/source/dialog/splitwin.cxx8
-rw-r--r--sfx2/source/dialog/templdlg.cxx6
-rw-r--r--sfx2/source/dialog/titledockwin.cxx4
-rw-r--r--sfx2/source/doc/doctemplates.cxx4
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx4
-rw-r--r--sfx2/source/notebookbar/ContextVBox.cxx4
-rw-r--r--sfx2/source/sidebar/Deck.cxx8
-rw-r--r--sfx2/source/sidebar/DeckLayouter.cxx2
-rw-r--r--sfx2/source/sidebar/TitleBar.cxx2
-rw-r--r--sfx2/source/view/classificationcontroller.cxx2
-rw-r--r--sfx2/source/view/frame.cxx4
-rw-r--r--sfx2/source/view/viewfrm.cxx16
-rw-r--r--sfx2/source/view/viewsh.cxx4
20 files changed, 103 insertions, 105 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 1afc7258af4a..9ecbf4672d46 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -488,8 +488,8 @@ void IndexBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )
{
// indent sub entries
Point aPos( rUDEvt.GetRect().TopLeft() );
- aPos.setX( aPos.X() + 8 );
- aPos.setY( aPos.Y() + (rUDEvt.GetRect().GetHeight() - rUDEvt.GetRenderContext()->GetTextHeight()) / 2 );
+ aPos.AdjustX(8 );
+ aPos.AdjustY((rUDEvt.GetRect().GetHeight() - rUDEvt.GetRenderContext()->GetTextHeight()) / 2 );
OUString aEntry( GetEntry( rUDEvt.GetItemId() ) );
sal_Int32 nPos = aEntry.indexOf( ';' );
rUDEvt.GetRenderContext()->DrawText(aPos, (nPos !=-1) ? aEntry.copy(nPos + 1) : aEntry);
@@ -1983,7 +1983,7 @@ void SfxHelpTextWindow_Impl::InitToolBoxImages()
);
Size aSize = aToolBox->CalcWindowSizePixel();
- aSize.Height() += TOOLBOX_OFFSET;
+ aSize.AdjustHeight(TOOLBOX_OFFSET );
aToolBox->SetPosSizePixel( Point( 0, TOOLBOX_OFFSET ), aSize );
SvtMiscOptions aMiscOptions;
@@ -2073,8 +2073,8 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox()
Size aTBSize = aToolBox->GetSizePixel();
Size aCBSize = aOnStartupCB->GetSizePixel();
Point aPnt = aToolBox->GetPosPixel();
- aPnt.setX( aPnt.X() + aTBSize.Width() + a3Size.Width() );
- aPnt.setY( aPnt.Y() + ( ( aTBSize.Height() - aCBSize.Height() ) / 2 ) );
+ aPnt.AdjustX(aTBSize.Width() + a3Size.Width() );
+ aPnt.AdjustY( ( aTBSize.Height() - aCBSize.Height() ) / 2 );
aOnStartupCB->SetPosPixel( aPnt );
nMinPos = aPnt.X();
}
@@ -2312,7 +2312,7 @@ void SfxHelpTextWindow_Impl::Resize()
{
Size aSize = GetOutputSizePixel();
long nToolBoxHeight = aToolBox->GetSizePixel().Height() + TOOLBOX_OFFSET;
- aSize.setHeight( aSize.Height() - nToolBoxHeight );
+ aSize.AdjustHeight( -nToolBoxHeight );
pTextWin->SetPosSizePixel( Point( 0, nToolBoxHeight ), aSize );
SetOnStartupBoxPosition();
}
@@ -2334,7 +2334,7 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt )
aPos = pCmdEvt->GetMousePosPixel();
else
aPos = Point( pTextWin->GetPosPixel().X() + 20, 20 );
- aPos.setY( aPos.Y() + pTextWin->GetPosPixel().Y() );
+ aPos.AdjustY(pTextWin->GetPosPixel().Y() );
ScopedVclPtrInstance<PopupMenu> aMenu;
if ( bIsIndexOn )
aMenu->InsertItem(TBI_INDEX, aIndexOffText, Image(BitmapEx(BMP_HELP_TOOLBOX_INDEX_OFF)));
@@ -2667,7 +2667,7 @@ void SfxHelpWindow_Impl::MakeLayout()
tools::Rectangle aScreenRect = pScreenWin->GetClientWindowExtentsRelative();
Point aNewPos = aScreenRect.TopLeft();
sal_Int32 nDiffWidth = nOldWidth - nWidth;
- aNewPos.setX( aNewPos.X() + nDiffWidth );
+ aNewPos.AdjustX(nDiffWidth );
pScreenWin->SetPosPixel( aNewPos );
}
else if ( aWinPos.X() > 0 && aWinPos.Y() > 0 )
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index daaf69943ce1..48554dd8284d 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -754,9 +754,9 @@ SvBorder SfxWorkWindow::Arrange_Impl()
bAllowHiding = false;
aBorder.Top() += aSize.Height();
aPos = aTmp.TopLeft();
- aTmp.SetTop( aTmp.Top() + aSize.Height() );
+ aTmp.AdjustTop(aSize.Height() );
if ( pCli->eAlign == SfxChildAlignment::HIGHESTTOP )
- aUpperClientArea.SetTop( aUpperClientArea.Top() + aSize.Height() );
+ aUpperClientArea.AdjustTop(aSize.Height() );
break;
case SfxChildAlignment::LOWESTBOTTOM:
@@ -768,10 +768,10 @@ SvBorder SfxWorkWindow::Arrange_Impl()
aSize = static_cast<SplitWindow *>(pCli->pWin.get())->CalcLayoutSizePixel( aSize );
aBorder.Bottom() += aSize.Height();
aPos = aTmp.BottomLeft();
- aPos.setY( aPos.Y() - (aSize.Height()-1) );
- aTmp.SetBottom( aTmp.Bottom() - aSize.Height() );
+ aPos.AdjustY( -(aSize.Height()-1) );
+ aTmp.AdjustBottom( -(aSize.Height()) );
if ( pCli->eAlign == SfxChildAlignment::LOWESTBOTTOM )
- aUpperClientArea.SetBottom( aUpperClientArea.Bottom() - aSize.Height() );
+ aUpperClientArea.AdjustBottom( -(aSize.Height()) );
break;
case SfxChildAlignment::FIRSTLEFT:
@@ -784,9 +784,9 @@ SvBorder SfxWorkWindow::Arrange_Impl()
bAllowHiding = false;
aBorder.Left() += aSize.Width();
aPos = aTmp.TopLeft();
- aTmp.SetLeft( aTmp.Left() + aSize.Width() );
+ aTmp.AdjustLeft(aSize.Width() );
if ( pCli->eAlign != SfxChildAlignment::TOOLBOXLEFT )
- aUpperClientArea.SetLeft( aUpperClientArea.Left() + aSize.Width() );
+ aUpperClientArea.AdjustLeft(aSize.Width() );
break;
case SfxChildAlignment::FIRSTRIGHT:
@@ -798,10 +798,10 @@ SvBorder SfxWorkWindow::Arrange_Impl()
aSize = static_cast<SplitWindow *>(pCli->pWin.get())->CalcLayoutSizePixel( aSize );
aBorder.Right() += aSize.Width();
aPos = aTmp.TopRight();
- aPos.setX( aPos.X() - (aSize.Width()-1) );
- aTmp.SetRight( aTmp.Right() - aSize.Width() );
+ aPos.AdjustX( -(aSize.Width()-1) );
+ aTmp.AdjustRight( -(aSize.Width()) );
if ( pCli->eAlign != SfxChildAlignment::TOOLBOXRIGHT )
- aUpperClientArea.SetRight( aUpperClientArea.Right() - aSize.Width() );
+ aUpperClientArea.AdjustRight( -(aSize.Width()) );
break;
default:
@@ -822,28 +822,26 @@ SvBorder SfxWorkWindow::Arrange_Impl()
if ( aClientArea.GetWidth() >= aBorder.Left() + aBorder.Right() )
{
- aClientArea.SetLeft( aClientArea.Left() + aBorder.Left() );
- aClientArea.SetRight( aClientArea.Right() - aBorder.Right() );
+ aClientArea.AdjustLeft(aBorder.Left() );
+ aClientArea.AdjustRight( -(aBorder.Right()) );
}
else
{
aBorder.Left() = aClientArea.Left();
aBorder.Right() = aClientArea.Right();
- aClientArea.SetRight( aTmp.Left() );
- aClientArea.SetLeft( aTmp.Left() );
+ aClientArea.Right() = aClientArea.Left() = aTmp.Left();
}
if ( aClientArea.GetHeight() >= aBorder.Top() + aBorder.Bottom() )
{
- aClientArea.SetTop( aClientArea.Top() + aBorder.Top() );
- aClientArea.SetBottom( aClientArea.Bottom() - aBorder.Bottom() );
+ aClientArea.AdjustTop(aBorder.Top() );
+ aClientArea.AdjustBottom( -(aBorder.Bottom()) );
}
else
{
aBorder.Top() = aClientArea.Top();
aBorder.Bottom() = aClientArea.Bottom();
- aClientArea.SetTop( aTmp.Top() );
- aClientArea.SetBottom( aTmp.Top() );
+ aClientArea.Top() = aClientArea.Bottom() = aTmp.Top();
}
return IsDockingAllowed() ? aBorder : SvBorder();
@@ -1596,66 +1594,66 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
{
case SfxChildAlignment::TOP:
// Object-Toolboxes come always last
- aInnerRect.SetTop( aInnerRect.Top() + pCli->aSize.Height() );
+ aInnerRect.AdjustTop(pCli->aSize.Height() );
break;
case SfxChildAlignment::HIGHESTTOP:
// Always performed first
- aInnerRect.SetTop( aInnerRect.Top() + pCli->aSize.Height() );
+ aInnerRect.AdjustTop(pCli->aSize.Height() );
break;
case SfxChildAlignment::LOWESTTOP:
// Is only counted if it is the current window
if ( i == nPos )
- aInnerRect.SetTop( aInnerRect.Top() + pCli->aSize.Height() );
+ aInnerRect.AdjustTop(pCli->aSize.Height() );
break;
case SfxChildAlignment::BOTTOM:
// Object-Toolboxes come always last
- aInnerRect.SetBottom( aInnerRect.Bottom() - pCli->aSize.Height() );
+ aInnerRect.AdjustBottom( -(pCli->aSize.Height()) );
break;
case SfxChildAlignment::LOWESTBOTTOM:
// Always performed first
- aInnerRect.SetBottom( aInnerRect.Bottom() - pCli->aSize.Height() );
+ aInnerRect.AdjustBottom( -(pCli->aSize.Height()) );
break;
case SfxChildAlignment::HIGHESTBOTTOM:
// Is only counted if it is the current window
if ( i == nPos )
- aInnerRect.SetBottom( aInnerRect.Bottom() - pCli->aSize.Height() );
+ aInnerRect.AdjustBottom( -(pCli->aSize.Height()) );
break;
case SfxChildAlignment::LEFT:
// Toolboxes come always last
- aInnerRect.SetLeft( aInnerRect.Left() + pCli->aSize.Width() );
+ aInnerRect.AdjustLeft(pCli->aSize.Width() );
break;
case SfxChildAlignment::FIRSTLEFT:
// Always performed first
- aInnerRect.SetLeft( aInnerRect.Left() + pCli->aSize.Width() );
+ aInnerRect.AdjustLeft(pCli->aSize.Width() );
break;
case SfxChildAlignment::LASTLEFT:
// Is only counted if it is the current window
if (i == nPos)
- aInnerRect.SetLeft( aInnerRect.Left() + pCli->aSize.Width() );
+ aInnerRect.AdjustLeft(pCli->aSize.Width() );
break;
case SfxChildAlignment::RIGHT:
// Toolboxes come always last
- aInnerRect.SetRight( aInnerRect.Right() - pCli->aSize.Width() );
+ aInnerRect.AdjustRight( -(pCli->aSize.Width()) );
break;
case SfxChildAlignment::FIRSTRIGHT:
// Is only counted if it is the current window
if (i == nPos)
- aInnerRect.SetRight( aInnerRect.Right() - pCli->aSize.Width() );
+ aInnerRect.AdjustRight( -(pCli->aSize.Width()) );
break;
case SfxChildAlignment::LASTRIGHT:
// Always performed first
- aInnerRect.SetRight( aInnerRect.Right() - pCli->aSize.Width() );
+ aInnerRect.AdjustRight( -(pCli->aSize.Width()) );
break;
default:
@@ -2373,13 +2371,13 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
{
// Right SplitWindow
// Position to correct the difference of the widths
- aPos.setX( aPos.X() + aSize.Width() );
+ aPos.AdjustX(aSize.Width() );
// Get the width of the Window yourself, if no DummyWindow
if ( !bDummyWindow )
aSize.setWidth( pSplitWin->GetSizePixel().Width() );
- aPos.setX( aPos.X() - aSize.Width() );
+ aPos.AdjustX( -(aSize.Width()) );
// If already a window is opened at the left side, then the
// right is not allowed to overlap this one.
@@ -2420,13 +2418,13 @@ void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
{
// The bottom SplitWindow
// Position to correct the difference of the heights
- aPos.setY( aPos.Y() + aSize.Height() );
+ aPos.AdjustY(aSize.Height() );
// Get the height of the Window yourself, if no DummyWindow
if ( !bDummyWindow )
aSize.setHeight( pSplitWin->GetSizePixel().Height() );
- aPos.setY( aPos.Y() - aSize.Height() );
+ aPos.AdjustY( -(aSize.Height()) );
// Adjust width with regard to if a Window is already open
// to the left or right.
@@ -2469,16 +2467,16 @@ tools::Rectangle SfxWorkWindow::GetFreeArea( bool bAutoHide ) const
switch ( n )
{
case 0 :
- aArea.SetLeft( aArea.Left() + aSize.Width() );
+ aArea.AdjustLeft(aSize.Width() );
break;
case 1 :
- aArea.SetRight( aArea.Right() - aSize.Width() );
+ aArea.AdjustRight( -(aSize.Width()) );
break;
case 2 :
- aArea.SetTop( aArea.Top() + aSize.Height() );
+ aArea.AdjustTop(aSize.Height() );
break;
case 3 :
- aArea.SetBottom( aArea.Bottom() - aSize.Height() );
+ aArea.AdjustBottom( -(aSize.Height()) );
break;
}
}
diff --git a/sfx2/source/control/charwin.cxx b/sfx2/source/control/charwin.cxx
index 82e69b33b489..f58c76e04dd5 100644
--- a/sfx2/source/control/charwin.cxx
+++ b/sfx2/source/control/charwin.cxx
@@ -180,9 +180,9 @@ void SvxCharView::Paint(vcl::RenderContext& rRenderContext, const ::tools::Recta
int nYLDelta = aBoundRect.Top();
int nYHDelta = aSize.Height() - aBoundRect.Bottom();
if( nYLDelta <= 0 )
- aPoint.setY( aPoint.Y() - nYLDelta - 1 );
+ aPoint.AdjustY( -(nYLDelta - 1) );
else if( nYHDelta <= 0 )
- aPoint.setY( aPoint.Y() + nYHDelta - 1 );
+ aPoint.AdjustY(nYHDelta - 1 );
// centrally align glyph
aPoint.setX( -aBoundRect.Left() + (aSize.Width() - aBoundRect.GetWidth()) / 2 );
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 76f181536e44..f08e26f702d7 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -230,8 +230,8 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
Size aParentSize = GetParent()->GetOutputSizePixel();
Size aDlgSize = GetSizePixel();
- aPos.setX( aPos.X() + ( aParentSize.Width() - aDlgSize.Width() ) / 2 );
- aPos.setY( aPos.Y() + ( aParentSize.Height() - aDlgSize.Height() ) / 2 );
+ aPos.AdjustX(( aParentSize.Width() - aDlgSize.Width() ) / 2 );
+ aPos.AdjustY(( aParentSize.Height() - aDlgSize.Height() ) / 2 );
Point aPoint;
tools::Rectangle aRect = GetDesktopRectPixel();
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index ebd4c8f37250..91e21b80360a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1393,7 +1393,7 @@ void CustomPropertiesYesNoButton::Resize()
Size aSize(nNewWidth, m_aYesButton->get_preferred_size().Height());
Point aPos(n1Width, (aParentSize.Height() - aSize.Height()) / 2);
m_aYesButton->SetPosSizePixel(aPos, aSize);
- aPos.setX( aPos.X() + aSize.Width() + n3Width );
+ aPos.AdjustX(aSize.Width() + n3Width );
m_aNoButton->SetPosSizePixel(aPos, aSize);
}
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 117511d4d544..958423e4473b 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -697,7 +697,7 @@ bool SfxDockingWindow::Docking( const Point& rPos, tools::Rectangle& rRect )
case SfxChildAlignment::LASTLEFT:
aPos = aInnerRect.TopLeft();
if ( pImpl->GetDockAlignment() == GetAlignment() )
- aPos.setX( aPos.X() - aSize.Width() );
+ aPos.AdjustX( -(aSize.Width()) );
break;
case SfxChildAlignment::TOP:
@@ -705,7 +705,7 @@ bool SfxDockingWindow::Docking( const Point& rPos, tools::Rectangle& rRect )
case SfxChildAlignment::HIGHESTTOP:
aPos = Point(aOuterRect.Left(), aInnerRect.Top());
if ( pImpl->GetDockAlignment() == GetAlignment() )
- aPos.setY( aPos.Y() - aSize.Height() );
+ aPos.AdjustY( -(aSize.Height()) );
break;
case SfxChildAlignment::RIGHT:
@@ -714,7 +714,7 @@ bool SfxDockingWindow::Docking( const Point& rPos, tools::Rectangle& rRect )
aPos = Point(aInnerRect.Right() - rRect.GetSize().Width(),
aInnerRect.Top());
if ( pImpl->GetDockAlignment() == GetAlignment() )
- aPos.setX( aPos.X() + aSize.Width() );
+ aPos.AdjustX(aSize.Width() );
break;
case SfxChildAlignment::BOTTOM:
@@ -723,7 +723,7 @@ bool SfxDockingWindow::Docking( const Point& rPos, tools::Rectangle& rRect )
aPos = Point(aOuterRect.Left(),
aInnerRect.Bottom() - rRect.GetSize().Height());
if ( pImpl->GetDockAlignment() == GetAlignment() )
- aPos.setY( aPos.Y() + aSize.Height() );
+ aPos.AdjustY(aSize.Height() );
break;
default:
break;
@@ -1184,13 +1184,13 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, tools::Rect
// shrink area for floating mode if possible
tools::Rectangle aInRect = GetInnerRect();
if ( aInRect.GetWidth() > nLRBorder )
- aInRect.SetLeft( aInRect.Left() + nLRBorder/2 );
+ aInRect.AdjustLeft(nLRBorder/2 );
if ( aInRect.GetWidth() > nLRBorder )
- aInRect.SetRight( aInRect.Right() - nLRBorder/2 );
+ aInRect.AdjustRight( -(nLRBorder/2) );
if ( aInRect.GetHeight() > nTBBorder )
- aInRect.SetTop( aInRect.Top() + nTBBorder/2 );
+ aInRect.AdjustTop(nTBBorder/2 );
if ( aInRect.GetHeight() > nTBBorder )
- aInRect.SetBottom( aInRect.Bottom() - nTBBorder/2 );
+ aInRect.AdjustBottom( -(nTBBorder/2) );
// calculate alignment resulting from docking rectangle
bool bBecomesFloating = false;
@@ -1220,8 +1220,8 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, tools::Rect
tools::Rectangle aSmallDockingRect;
aSmallDockingRect.SetSize( Size( MAX_TOGGLEAREA_WIDTH, MAX_TOGGLEAREA_HEIGHT ) );
Point aNewPos(rPos);
- aNewPos.setX( aNewPos.X() - aSmallDockingRect.GetWidth()/2 );
- aNewPos.setY( aNewPos.Y() - aSmallDockingRect.GetHeight()/2 );
+ aNewPos.AdjustX( -(aSmallDockingRect.GetWidth()/2) );
+ aNewPos.AdjustY( -(aSmallDockingRect.GetHeight()/2) );
aSmallDockingRect.SetPos(rPos);
tools::Rectangle aIntersectRect = aInRect.GetIntersection( aSmallDockingRect );
if ( aIntersectRect == aSmallDockingRect )
@@ -1393,7 +1393,7 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, tools::Rect
else
{
aPoint = aInnerRect.TopRight();
- aPoint.setX( aPoint.X() - aSize.Width() );
+ aPoint.AdjustX( -(aSize.Width()) );
}
}
else
@@ -1417,7 +1417,7 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, tools::Rect
else
{
aPoint = aInnerRect.BottomLeft();
- aPoint.setY( aPoint.Y() - aSize.Height() );
+ aPoint.AdjustY( -(aSize.Height()) );
}
}
else
@@ -1450,7 +1450,7 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, tools::Rect
case SfxChildAlignment::LASTRIGHT:
{
Point aPt( aInnerRect.TopRight() );
- aPt.setX( aPt.X() - aDockingRect.GetWidth() );
+ aPt.AdjustX( -(aDockingRect.GetWidth()) );
aDockingRect.SetPos( aPt );
aDockingRect.SetSize( aVerticalSize );
break;
@@ -1467,7 +1467,7 @@ SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, tools::Rect
case SfxChildAlignment::HIGHESTBOTTOM:
{
Point aPt( aInnerRect.BottomLeft() );
- aPt.setY( aPt.Y() - aDockingRect.GetHeight() );
+ aPt.AdjustY( -(aDockingRect.GetHeight()) );
aDockingRect.SetPos( aPt );
aDockingRect.SetSize( aHorizontalSize );
break;
@@ -1567,28 +1567,28 @@ void SfxDockingWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Re
case SfxChildAlignment::TOP:
{
rRenderContext.DrawLine(aRect.BottomLeft(), aRect.BottomRight());
- aRect.SetBottom( --aRect.Bottom() );
+ aRect.AdjustBottom( -1 );
break;
}
case SfxChildAlignment::BOTTOM:
{
rRenderContext.DrawLine(aRect.TopLeft(), aRect.TopRight());
- aRect.SetTop( ++aRect.Top() );
+ aRect.AdjustTop( 1 );
break;
}
case SfxChildAlignment::LEFT:
{
rRenderContext.DrawLine(aRect.TopRight(), aRect.BottomRight());
- aRect.SetRight( --aRect.Right() );
+ aRect.AdjustRight( -1 );
break;
}
case SfxChildAlignment::RIGHT:
{
rRenderContext.DrawLine(aRect.TopLeft(), aRect.BottomLeft());
- aRect.SetLeft( ++aRect.Left() );
+ aRect.AdjustLeft( 1 );
break;
}
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index 539589e62b53..09fbdce65552 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -108,8 +108,8 @@ void SfxRecordingFloat_Impl::StateChanged( StateChangedType nStateChange )
Point aPoint = pEditWin->OutputToScreenPixel( pEditWin->GetPosPixel() );
aPoint = GetParent()->ScreenToOutputPixel( aPoint );
- aPoint.setX( aPoint.X() + 20 );
- aPoint.setY( aPoint.Y() + 10 );
+ aPoint.AdjustX(20 );
+ aPoint.AdjustY(10 );
SetPosPixel( aPoint );
}
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 456e7abf213e..d51a54c3e6ac 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -986,10 +986,10 @@ bool SfxSplitWindow::CursorIsOverRect() const
Size aVisSize = GetSizePixel();
// Extend with +/- a few pixels, otherwise it is too nervous
- aVisPos.X() -= nPixel;
- aVisPos.Y() -= nPixel;
- aVisSize.Width() += 2 * nPixel;
- aVisSize.Height() += 2 * nPixel;
+ aVisPos.AdjustX( -(nPixel) );
+ aVisPos.AdjustY( -(nPixel) );
+ aVisSize.AdjustWidth(2 * nPixel );
+ aVisSize.AdjustHeight(2 * nPixel );
tools::Rectangle aVisRect( aVisPos, aVisSize );
aRect = aRect.GetUnion( aVisRect );
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index de2cf05e7743..38d9fd8b4cc4 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -374,8 +374,8 @@ void SfxTemplatePanelControl::StateChanged( StateChangedType nStateChange )
Point aPoint = pEditWin->OutputToScreenPixel( pEditWin->GetPosPixel() );
aPoint = GetParent()->ScreenToOutputPixel( aPoint );
Size aWinSize = GetSizePixel();
- aPoint.setX( aPoint.X() + aSize.Width() - aWinSize.Width() - 20 );
- aPoint.setY( aPoint.Y() + aSize.Height() / 2 - aWinSize.Height() / 2 );
+ aPoint.AdjustX(aSize.Width() - aWinSize.Width() - 20 );
+ aPoint.AdjustY(aSize.Height() / 2 - aWinSize.Height() / 2 );
// SetFloatingPos( aPoint );
}
@@ -2310,7 +2310,7 @@ void SfxTemplateDialog_Impl::Resize()
pTreeBox->SetPosPixel(aFmtPos);
}
else
- aFmtSize.setHeight( aFmtSize.Height() + aFilterSize.Height() );
+ aFmtSize.AdjustHeight(aFilterSize.Height() );
aFilterLb->SetSizePixel(aFilterSize);
aFmtLb->SetSizePixel( aFmtSize );
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index f8d621bee9a0..3c5effaae2ba 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -122,7 +122,7 @@ namespace sfx2
// Place the content window.
if ( m_nTitleBarHeight < aToolBoxSize.Height() )
m_nTitleBarHeight = aToolBoxSize.Height();
- aWindowSize.setHeight( aWindowSize.Height() - m_nTitleBarHeight );
+ aWindowSize.AdjustHeight( -(m_nTitleBarHeight) );
m_aContentWindow->SetPosSizePixel(
Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ),
Size(
@@ -200,7 +200,7 @@ namespace sfx2
// Paint title bar text.
rRenderContext.SetLineColor(rStyleSettings.GetActiveTextColor());
- aTitleBarBox.SetLeft( aTitleBarBox.Left() + 3 );
+ aTitleBarBox.AdjustLeft(3 );
rRenderContext.DrawText(aTitleBarBox,
!m_sTitle.isEmpty() ? m_sTitle : GetText(),
DrawTextFlags::Left | DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 80d6ce983667..2545ceed4127 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -2287,8 +2287,8 @@ WaitWindow_Impl::WaitWindow_Impl() : WorkWindow(nullptr, WB_BORDER | WB_3DLOOK)
maText = SfxResId(RID_CNT_STR_WAITING);
maRect = GetTextRect(aRect, maText, mnTextStyle);
aRect = maRect;
- aRect.Right() += 2 * X_OFFSET;
- aRect.Bottom() += 2 * Y_OFFSET;
+ aRect.AdjustRight(2 * X_OFFSET );
+ aRect.AdjustBottom(2 * Y_OFFSET );
maRect.SetPos(Point(X_OFFSET, Y_OFFSET));
SetOutputSizePixel(aRect.GetSize());
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index d1364196077e..41c91c2fbdaa 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3513,8 +3513,8 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
awt::Size aCurrent = getVisualAreaSize( nAspect );
Size aDiff( aSize.Width-aCurrent.Width, aSize.Height-aCurrent.Height );
aDiff = pViewFrm->GetViewShell()->GetWindow()->LogicToPixel( aDiff );
- aWinSize.setWidth( aWinSize.Width() + aDiff.Width() );
- aWinSize.setHeight( aWinSize.Height() + aDiff.Height() );
+ aWinSize.AdjustWidth(aDiff.Width() );
+ aWinSize.AdjustHeight(aDiff.Height() );
pWindow->SetSizePixel( aWinSize );
}
else
diff --git a/sfx2/source/notebookbar/ContextVBox.cxx b/sfx2/source/notebookbar/ContextVBox.cxx
index 9a894cf1b6ee..62494c2e9203 100644
--- a/sfx2/source/notebookbar/ContextVBox.cxx
+++ b/sfx2/source/notebookbar/ContextVBox.cxx
@@ -53,7 +53,7 @@ public:
if ( pChild->HasContext( eContext ) || pChild->HasContext( vcl::EnumContext::Context::Any ) )
{
Size aSize( pChild->GetOptimalSize() );
- aSize.setHeight( aSize.Height() + 6 );
+ aSize.AdjustHeight(6 );
pChild->Show();
pChild->SetSizePixel( aSize );
}
@@ -65,7 +65,7 @@ public:
}
}
Size aSize( GetOptimalSize() );
- aSize.setWidth( aSize.Width() + 6 );
+ aSize.AdjustWidth(6 );
SetSizePixel( aSize );
}
};
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 1717ca27ac6e..ca6dd192f581 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -130,10 +130,10 @@ void Deck::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*r
// Paint the border.
const int nBorderSize(Theme::GetInteger(Theme::Int_DeckBorderSize));
- aBox.SetLeft( aBox.Left() + aPadding.Left() );
- aBox.SetTop( aBox.Top() + aPadding.Top() );
- aBox.SetRight( aBox.Right() - aPadding.Right() );
- aBox.SetBottom( aBox.Bottom() - aPadding.Bottom() );
+ aBox.AdjustLeft(aPadding.Left() );
+ aBox.AdjustTop(aPadding.Top() );
+ aBox.AdjustRight( -(aPadding.Right()) );
+ aBox.AdjustBottom( -(aPadding.Bottom()) );
const sfx2::sidebar::Paint& rHorizontalBorderPaint(Theme::GetPaint(Theme::Paint_HorizontalBorder));
DrawHelper::DrawBorder(rRenderContext, aBox,
SvBorder(nBorderSize, nBorderSize, nBorderSize, nBorderSize),
diff --git a/sfx2/source/sidebar/DeckLayouter.cxx b/sfx2/source/sidebar/DeckLayouter.cxx
index cfc2f14a5e4b..2b7f7df382b5 100644
--- a/sfx2/source/sidebar/DeckLayouter.cxx
+++ b/sfx2/source/sidebar/DeckLayouter.cxx
@@ -234,7 +234,7 @@ tools::Rectangle LayoutPanels (
SetupVerticalScrollBar(rVerticalScrollBar, nContentHeight, aBox.GetHeight());
const sal_Int32 nUsedHeight (PlacePanels(rLayoutItems, nWidth, eMode, rScrollContainer));
- aBox.SetTop( aBox.Top() + nUsedHeight );
+ aBox.AdjustTop(nUsedHeight );
return aBox;
}
diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx
index 74de65d4b9bc..3d6f7ad5a5d1 100644
--- a/sfx2/source/sidebar/TitleBar.cxx
+++ b/sfx2/source/sidebar/TitleBar.cxx
@@ -128,7 +128,7 @@ void TitleBar::PaintTitle(vcl::RenderContext& rRenderContext, const tools::Recta
rRenderContext.DrawImage(Point(aTitleBox.Left() + gnLeftIconSpace,
aTitleBox.Top() + (aTitleBox.GetHeight() - maIcon.GetSizePixel().Height()) / 2),
maIcon);
- aTitleBox.SetLeft( aTitleBox.Left() + gnLeftIconSpace + maIcon.GetSizePixel().Width() + gnRightIconSpace );
+ aTitleBox.AdjustLeft(gnLeftIconSpace + maIcon.GetSizePixel().Width() + gnRightIconSpace );
}
vcl::Font aFont(rRenderContext.GetFont());
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index f584f366c9b2..7388da69d427 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -258,7 +258,7 @@ ClassificationControl::ClassificationControl(vcl::Window* pParent)
Size aTextSize(m_pLabel->GetTextWidth(aText), m_pLabel->GetTextHeight());
// Padding.
- aTextSize.setWidth( aTextSize.Width() + 12 );
+ aTextSize.AdjustWidth(12 );
m_pLabel->SetText(aText);
m_pLabel->SetSizePixel(aTextSize);
m_pLabel->Show();
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 1b7bc574641b..82facc714be5 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -582,13 +582,13 @@ void SfxFrame::SetToolSpaceBorderPixel_Impl( const SvBorder& rBorder )
Size aSize( GetWindow().GetOutputSizePixel() );
long nDeltaX = rBorder.Left() + rBorder.Right();
if ( aSize.Width() > nDeltaX )
- aSize.setWidth( aSize.Width() - nDeltaX );
+ aSize.AdjustWidth( -nDeltaX );
else
aSize.setWidth( 0 );
long nDeltaY = rBorder.Top() + rBorder.Bottom();
if ( aSize.Height() > nDeltaY )
- aSize.setHeight( aSize.Height() - nDeltaY );
+ aSize.AdjustHeight( -nDeltaY );
else
aSize.setHeight( 0 );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index d24bb5b7b623..ea7e02d26475 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1160,8 +1160,8 @@ void SfxViewFrame::SetBorderPixelImpl
Size aSize = pVSh->GetWindow()->GetOutputSizePixel();
if ( aSize.Width() && aSize.Height() )
{
- aSize.setWidth( aSize.Width() + rBorder.Left() + rBorder.Right() );
- aSize.setHeight( aSize.Height() + rBorder.Top() + rBorder.Bottom() );
+ aSize.AdjustWidth(rBorder.Left() + rBorder.Right() );
+ aSize.AdjustHeight(rBorder.Top() + rBorder.Bottom() );
Size aOldSize = GetWindow().GetOutputSizePixel();
GetWindow().SetOutputSizePixel( aSize );
@@ -1169,8 +1169,8 @@ void SfxViewFrame::SetBorderPixelImpl
while ( pParent->GetParent() )
pParent = pParent->GetParent();
Size aOuterSize = pParent->GetOutputSizePixel();
- aOuterSize.setWidth( aOuterSize.Width() + ( aSize.Width() - aOldSize.Width() ) );
- aOuterSize.setHeight( aOuterSize.Height() + ( aSize.Height() - aOldSize.Height() ) );
+ aOuterSize.AdjustWidth( aSize.Width() - aOldSize.Width() );
+ aOuterSize.AdjustHeight( aSize.Height() - aOldSize.Height() );
pParent->SetOutputSizePixel( aOuterSize );
}
}
@@ -1178,10 +1178,10 @@ void SfxViewFrame::SetBorderPixelImpl
{
Point aPoint;
tools::Rectangle aEditArea( aPoint, GetWindow().GetOutputSizePixel() );
- aEditArea.SetLeft( aEditArea.Left() + rBorder.Left() );
- aEditArea.SetRight( aEditArea.Right() - rBorder.Right() );
- aEditArea.SetTop( aEditArea.Top() + rBorder.Top() );
- aEditArea.SetBottom( aEditArea.Bottom() - rBorder.Bottom() );
+ aEditArea.AdjustLeft(rBorder.Left() );
+ aEditArea.AdjustRight( -(rBorder.Right()) );
+ aEditArea.AdjustTop(rBorder.Top() );
+ aEditArea.AdjustBottom( -(rBorder.Bottom()) );
pVSh->GetWindow()->SetPosSizePixel( aEditArea.TopLeft(), aEditArea.GetSize() );
}
}
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 30f90c4e26c8..d7962e72be16 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1707,9 +1707,9 @@ void SfxViewShell::SetMargin( const Size& rSize )
// the default margin was verified using www.apple.com !!
Size aMargin = rSize;
if ( aMargin.Width() == -1 )
- aMargin.Width() = DEFAULT_MARGIN_WIDTH;
+ aMargin.setWidth( DEFAULT_MARGIN_WIDTH );
if ( aMargin.Height() == -1 )
- aMargin.Height() = DEFAULT_MARGIN_HEIGHT;
+ aMargin.setHeight( DEFAULT_MARGIN_HEIGHT );
if ( aMargin != pImpl->aMargin )
{