[Libreoffice-commits] core.git: 2 commits - avmedia/source basctl/source basic/source canvas/source chart2/source cui/source
Noel Grandin
noel.grandin at collabora.co.uk
Fri Feb 16 18:51:01 UTC 2018
avmedia/source/framework/mediacontrol.cxx | 42 ++++++++--------
basctl/source/basicide/baside2.cxx | 10 +--
basctl/source/basicide/baside2b.cxx | 18 +++---
basctl/source/basicide/basides1.cxx | 6 +-
basctl/source/basicide/objdlg.cxx | 4 -
basctl/source/dlged/dlged.cxx | 24 ++++-----
basctl/source/dlged/dlgedobj.cxx | 24 ++++-----
basctl/source/dlged/propbrw.cxx | 8 +--
basic/source/runtime/inputbox.cxx | 6 +-
canvas/source/vcl/canvashelper_texturefill.cxx | 4 -
chart2/source/controller/dialogs/DataBrowser.cxx | 2
chart2/source/controller/dialogs/dlg_CreationWizard.cxx | 2
chart2/source/controller/main/DrawCommandDispatch.cxx | 4 -
cui/source/customize/macropg.cxx | 6 +-
cui/source/dialogs/colorpicker.cxx | 20 +++----
cui/source/dialogs/cuicharmap.cxx | 8 +--
cui/source/dialogs/hangulhanjadlg.cxx | 26 ++++-----
cui/source/dialogs/thesdlg.cxx | 6 +-
cui/source/options/dbregister.cxx | 4 -
cui/source/options/optlingu.cxx | 6 +-
cui/source/tabpages/autocdlg.cxx | 4 -
cui/source/tabpages/backgrnd.cxx | 4 -
cui/source/tabpages/grfpage.cxx | 8 +--
cui/source/tabpages/numpages.cxx | 8 +--
cui/source/tabpages/page.cxx | 6 +-
25 files changed, 130 insertions(+), 130 deletions(-)
New commits:
commit bddd6c77811e0489a5632437116f5eec356cc397
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Feb 16 13:01:37 2018 +0200
Revert "loplugin:changetoolsgen in avmedia..basic" 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 1adb1a320a7e9832a41545bde13fd59d27ce7954.
Change-Id: I52924b35008c8e4b44c8a6b6657cc3a1ac513886
Reviewed-on: https://gerrit.libreoffice.org/49848
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index e7ea43d2eb4c..59f6c3cce90e 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -71,22 +71,22 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpTimeSlider->SetEndSlideHdl( LINK( this, MediaControl, implTimeEndHdl ) );
mpTimeSlider->SetSizePixel( Size( 128, mpPlayToolBox->GetSizePixel().Height() ) );
mpTimeSlider->Show();
- maMinSize.Width() += mpTimeSlider->GetSizePixel().Width();
+ maMinSize.AdjustWidth(mpTimeSlider->GetSizePixel().Width() );
const OUString aTimeText( " 00:00:00/00:00:00 " );
mpTimeEdit->SetSizePixel( Size( mpTimeEdit->GetTextWidth( aTimeText ) + 8, mpPlayToolBox->GetSizePixel().Height() ) );
mpTimeEdit->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
- maMinSize.Width() += mpTimeEdit->GetSizePixel().Width();
+ maMinSize.AdjustWidth(mpTimeEdit->GetSizePixel().Width() );
mpMuteToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
mpMuteToolBox->SetSizePixel( mpMuteToolBox->CalcWindowSizePixel() );
mpMuteToolBox->Show();
- maMinSize.Width() += mpMuteToolBox->GetSizePixel().Width();
+ maMinSize.AdjustWidth(mpMuteToolBox->GetSizePixel().Width() );
mpVolumeSlider->SetSlideHdl( LINK( this, MediaControl, implVolumeHdl ) );
mpVolumeSlider->SetSizePixel( Size( 48, mpPlayToolBox->GetSizePixel().Height() ) );
mpVolumeSlider->Show();
- maMinSize.Width() += mpVolumeSlider->GetSizePixel().Width();
+ maMinSize.AdjustWidth(mpVolumeSlider->GetSizePixel().Width() );
mpZoomListBox->SetSizePixel( Size( mpTimeEdit->GetSizePixel().Width(), 260 ) );
mpZoomListBox->SetSelectHdl( LINK( this, MediaControl, implZoomSelectHdl ) );
@@ -98,7 +98,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpZoomToolBox->SetSelectHdl( LINK( this, MediaControl, implSelectHdl ) );
mpZoomToolBox->SetSizePixel( mpZoomToolBox->CalcWindowSizePixel() );
mpZoomToolBox->Show();
- maMinSize.Width() += mpZoomToolBox->GetSizePixel().Width();
+ maMinSize.AdjustWidth(mpZoomToolBox->GetSizePixel().Width() );
const OUString aMediaPath( AvmResId( AVMEDIA_MEDIA_PATH_DEFAULT ) );
mpMediaPath->SetText(aMediaPath);
@@ -106,12 +106,12 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aMediaPath ) + 400, mpPlayToolBox->GetSizePixel().Height() ) ); // maybe extend the no. 400 to span the screen width
mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
mpMediaPath->Show();
- maMinSize.Width() += mpMediaPath->GetSizePixel().Width();
+ maMinSize.AdjustWidth(mpMediaPath->GetSizePixel().Width() );
if( meControlStyle == MEDIACONTROLSTYLE_MULTILINE )
{
- maMinSize.Width() = 256;
- maMinSize.Height() = ( maMinSize.Height() << 1 ) + AVMEDIA_CONTROLOFFSET;
+ maMinSize.setWidth( 256 );
+ maMinSize.setHeight( ( maMinSize.Height() << 1 ) + AVMEDIA_CONTROLOFFSET );
mpZoomToolBox->SetBackground();
mpZoomToolBox->SetPaintTransparent( true );
}
@@ -178,7 +178,7 @@ void MediaControl::UpdateURLField(MediaItem const & tempItem)
mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aURL ) + 8, mpPlayToolBox->GetSizePixel().Height() ) );
mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
mpMediaPath->Show();
- maMinSize.Width() += mpMediaPath->GetSizePixel().Width();
+ maMinSize.AdjustWidth(mpMediaPath->GetSizePixel().Width() );
}
void MediaControl::Resize()
@@ -199,22 +199,22 @@ void MediaControl::Resize()
mpPlayToolBox->SetPosSizePixel( aPos, mpPlayToolBox->GetSizePixel() );
- aPos.X() += nPlayToolBoxWidth;
+ aPos.AdjustX(nPlayToolBoxWidth );
mpTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
- aPos.X() += nTimeSliderWidth + AVMEDIA_CONTROLOFFSET;
+ aPos.AdjustX(nTimeSliderWidth + AVMEDIA_CONTROLOFFSET );
mpTimeEdit->SetPosSizePixel( aPos, mpTimeEdit->GetSizePixel() );
- aPos.X() += nTimeEditWidth + AVMEDIA_CONTROLOFFSET;
+ aPos.AdjustX(nTimeEditWidth + AVMEDIA_CONTROLOFFSET );
mpMuteToolBox->SetPosSizePixel( aPos, mpMuteToolBox->GetSizePixel() );
- aPos.X() += nMuteToolBoxWidth;
+ aPos.AdjustX(nMuteToolBoxWidth );
mpVolumeSlider->SetPosSizePixel( aPos, mpVolumeSlider->GetSizePixel() );
- aPos.X() += nVolumeSliderWidth + AVMEDIA_CONTROLOFFSET;
+ aPos.AdjustX(nVolumeSliderWidth + AVMEDIA_CONTROLOFFSET );
mpZoomToolBox->SetPosSizePixel( aPos, mpZoomToolBox->GetSizePixel() );
- aPos.X() += nZoomToolBoxWidth + AVMEDIA_CONTROLOFFSET;
+ aPos.AdjustX(nZoomToolBoxWidth + AVMEDIA_CONTROLOFFSET );
mpMediaPath->SetPosSizePixel( aPos, mpMediaPath->GetSizePixel() );
}
else
@@ -223,20 +223,20 @@ void MediaControl::Resize()
mpTimeSlider->SetPosSizePixel( aPos, Size( nTimeSliderWidth, nTimeSliderHeight ) );
- aPos.X() += nTimeSliderWidth + AVMEDIA_CONTROLOFFSET;
+ aPos.AdjustX(nTimeSliderWidth + AVMEDIA_CONTROLOFFSET );
mpTimeEdit->SetPosSizePixel( aPos, mpTimeEdit->GetSizePixel() );
- aPos.X() = 0;
- aPos.Y() += nTimeSliderHeight + AVMEDIA_CONTROLOFFSET;
+ aPos.setX( 0 );
+ aPos.AdjustY(nTimeSliderHeight + AVMEDIA_CONTROLOFFSET );
mpPlayToolBox->SetPosSizePixel( aPos, mpPlayToolBox->GetSizePixel() );
- aPos.X() = GetSizePixel().Width() - nVolumeSliderWidth - nMuteToolBoxWidth - nZoomToolBoxWidth - AVMEDIA_CONTROLOFFSET;
+ aPos.setX( GetSizePixel().Width() - nVolumeSliderWidth - nMuteToolBoxWidth - nZoomToolBoxWidth - AVMEDIA_CONTROLOFFSET );
mpMuteToolBox->SetPosSizePixel( aPos, mpMuteToolBox->GetSizePixel() );
- aPos.X() += nMuteToolBoxWidth;
+ aPos.AdjustX(nMuteToolBoxWidth );
mpVolumeSlider->SetPosSizePixel( aPos, mpVolumeSlider->GetSizePixel() );
- aPos.X() = GetSizePixel().Width() - nZoomToolBoxWidth;
+ aPos.setX( GetSizePixel().Width() - nZoomToolBoxWidth );
mpZoomToolBox->SetPosSizePixel( aPos, mpZoomToolBox->GetSizePixel() );
}
}
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 43d7d0fd9f19..7edd29b9bbb7 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -131,7 +131,7 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, sal_uInt16 nCurPage,
{
aFont.SetWeight( WEIGHT_NORMAL );
pPrinter->SetFont( aFont );
- aPos.setX( aPos.X() + pPrinter->GetTextWidth( rTitle ) );
+ aPos.AdjustX(pPrinter->GetTextWidth( rTitle ) );
if( bOutput )
{
@@ -810,8 +810,8 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
}
Size aPaperSz = pPrinter->GetOutputSize();
- aPaperSz.setWidth( aPaperSz.Width() - (Print::nLeftMargin + Print::nRightMargin) );
- aPaperSz.setHeight( aPaperSz.Height() - (Print::nTopMargin + Print::nBottomMargin) );
+ aPaperSz.AdjustWidth( -(Print::nLeftMargin + Print::nRightMargin) );
+ aPaperSz.AdjustHeight( -(Print::nTopMargin + Print::nBottomMargin) );
// nLinepPage is not correct if there's a line break
sal_Int32 nLinespPage = aPaperSz.Height()/nLineHeight;
@@ -835,7 +835,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
sal_Int32 nBeginIndex = nLine*nCharspLine;
sal_Int32 nCopyCount = std::min<sal_Int32>(nCharspLine, aLine.getLength()-nBeginIndex);
OUString aTmpLine = aLine.copy(nBeginIndex, nCopyCount);
- aPos.setY( aPos.Y() + nLineHeight );
+ aPos.AdjustY(nLineHeight );
if ( aPos.Y() > ( aPaperSz.Height() + Print::nTopMargin ) )
{
nCurPage++;
@@ -845,7 +845,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
if( nCurPage-1 == nPrintPage )
pPrinter->DrawText( aPos, aTmpLine );
}
- aPos.setY( aPos.Y() + 10 ); // nParaSpace
+ aPos.AdjustY(10 ); // nParaSpace
}
pPrinter->SetFont( aOldFont );
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 2e5ec45676bd..3f81bde3bb5a 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -372,8 +372,8 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
{
aTopLeft = GetEditView()->GetTextEngine()->PaMtoEditCursor( aStartOfWord ).BottomLeft();
aTopLeft = GetEditView()->GetWindowPos( aTopLeft );
- aTopLeft.setX( aTopLeft.X() + 5 );
- aTopLeft.setY( aTopLeft.Y() + 5 );
+ aTopLeft.AdjustX(5 );
+ aTopLeft.AdjustY(5 );
aTopLeft = OutputToScreenPixel( aTopLeft );
}
}
@@ -1571,8 +1571,8 @@ WatchWindow::WatchWindow (Layout* pParent)
aRemoveWatchButton->SetModeImage(Image(BitmapEx(RID_BMP_REMOVEWATCH)));
aRemoveWatchButton->SetQuickHelpText(IDEResId(RID_STR_REMOVEWATCHTIP));
Size aSz( aRemoveWatchButton->GetModeImage().GetSizePixel() );
- aSz.setWidth( aSz.Width() + 6 );
- aSz.setHeight( aSz.Height() + 6 );
+ aSz.AdjustWidth(6 );
+ aSz.AdjustHeight(6 );
aRemoveWatchButton->SetSizePixel( aSz );
aRemoveWatchButton->Show();
@@ -1656,7 +1656,7 @@ void WatchWindow::Resize()
if ( aBoxSz.Height() < 4 )
aBoxSz.setHeight( 0 );
- aBoxSz.setHeight( aBoxSz.Height() - nHeaderBarHeight );
+ aBoxSz.AdjustHeight( -nHeaderBarHeight );
aTreeListBox->SetSizePixel( aBoxSz );
aTreeListBox->GetHScroll()->SetPageSize( aTreeListBox->GetHScroll()->GetVisibleSize() );
@@ -1991,8 +1991,8 @@ void ComplexEditorWindow::Resize()
{
Size aOutSz = GetOutputSizePixel();
Size aSz(aOutSz);
- aSz.setWidth( aSz.Width() - 2*DWBORDER );
- aSz.setHeight( aSz.Height() - 2*DWBORDER );
+ aSz.AdjustWidth( -(2*DWBORDER) );
+ aSz.AdjustHeight( -(2*DWBORDER) );
long nBrkWidth = 20;
long nSBWidth = aEWVScrollBar->GetSizePixel().Width();
@@ -2844,12 +2844,12 @@ void CodeCompleteWindow::ResizeAndPositionListBox()
if( aVisArea.TopRight().getY() + aPos.getY() + aSize.getHeight() > aBottomPoint.getY() )
{//clipped at the bottom: move it up
const long& nParentFontHeight = pParent->GetEditEngine()->GetFont().GetFontHeight(); //parent's font (in the IDE): needed for height
- aPos.setY( aPos.Y() - aSize.getHeight() + nParentFontHeight + nCursorPad );
+ aPos.AdjustY( -(aSize.getHeight() + nParentFontHeight + nCursorPad) );
}
if( aVisArea.TopLeft().getX() + aPos.getX() + aSize.getWidth() > aBottomPoint.getX() )
{//clipped at the right side, move it a bit left
- aPos.setX( aPos.X() - aSize.getWidth() + aVisArea.TopLeft().getX() );
+ aPos.AdjustX( -(aSize.getWidth() + aVisArea.TopLeft().getX()) );
}
//set the position
SetPosPixel( aPos );
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index c79557501913..b78f9138bf32 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -1247,11 +1247,11 @@ void Shell::AdjustPosSizePixel( const Point &rPos, const Size &rSize )
Size aSz( rSize );
Size aScrollBarBoxSz( aScrollBarBox->GetSizePixel() );
- aSz.setHeight( aSz.Height() - aScrollBarBoxSz.Height() );
- aSz.setHeight( aSz.Height() - aTabBarSize.Height() );
+ aSz.AdjustHeight( -(aScrollBarBoxSz.Height()) );
+ aSz.AdjustHeight( -(aTabBarSize.Height()) );
Size aOutSz( aSz );
- aSz.setWidth( aSz.Width() - aScrollBarBoxSz.Width() );
+ aSz.AdjustWidth( -(aScrollBarBoxSz.Width()) );
aScrollBarBox->SetPosPixel( Point( rSize.Width() - aScrollBarBoxSz.Width(), rSize.Height() - aScrollBarBoxSz.Height() ) );
aVScrollBar->SetPosSizePixel( Point( rPos.X()+aSz.Width(), rPos.Y() ), Size( aScrollBarBoxSz.Width(), aSz.Height() ) );
aHScrollBar->SetPosSizePixel( Point( rPos.X(), rPos.Y()+aSz.Height() ), Size( aSz.Width(), aScrollBarBoxSz.Height() ) );
diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx
index d5775b6278c0..34846e67e1fa 100644
--- a/basctl/source/basicide/objdlg.cxx
+++ b/basctl/source/basicide/objdlg.cxx
@@ -58,8 +58,8 @@ ObjectCatalog::ObjectCatalog (vcl::Window* pParent)
Point aPos = rParent.OutputToScreenPixel(Point(0, 0));
Size const aParentSize = rParent.GetSizePixel();
Size const aSize = GetSizePixel();
- aPos.setX( aPos.X() + (aParentSize.Width() - aSize.Width()) / 2 );
- aPos.setY( aPos.Y() + (aParentSize.Height() - aSize.Height()) / 2 );
+ aPos.AdjustX((aParentSize.Width() - aSize.Width()) / 2 );
+ aPos.AdjustY((aParentSize.Height() - aSize.Height()) / 2 );
SetPosPixel(aPos);
}
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 397a1bc69f75..dc01d9abde64 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -493,8 +493,8 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
// align with grid
Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY()));
- aSize.setWidth( aSize.Width() - aSize.Width() % aGridSize_.Width() );
- aSize.setHeight( aSize.Height() - aSize.Height() % aGridSize_.Height() );
+ aSize.AdjustWidth( -(aSize.Width() % aGridSize_.Width()) );
+ aSize.AdjustHeight( -(aSize.Height() % aGridSize_.Height()) );
Point aPos;
Size aOutSize = rRenderContext.GetOutputSize();
@@ -502,16 +502,16 @@ void DlgEditor::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
aPos.setY( (aOutSize.Height()>>1) - (aSize.Height()>>1) );
// align with grid
- aPos.setX( aPos.X() - aPos.X() % aGridSize_.Width() );
- aPos.setY( aPos.Y() - aPos.Y() % aGridSize_.Height() );
+ aPos.AdjustX( -(aPos.X() % aGridSize_.Width()) );
+ aPos.AdjustY( -(aPos.Y() % aGridSize_.Height()) );
// don't put in the corner
Point aMinPos = rRenderContext.PixelToLogic( Point( 30, 20 ) );
if( (aPos.X() < aMinPos.X()) || (aPos.Y() < aMinPos.Y()) )
{
aPos = aMinPos;
- aPos.setX( aPos.X() - aPos.X() % aGridSize_.Width() );
- aPos.setY( aPos.Y() - aPos.Y() % aGridSize_.Height() );
+ aPos.AdjustX( -(aPos.X() % aGridSize_.Width()) );
+ aPos.AdjustY( -(aPos.Y() % aGridSize_.Height()) );
}
// set dialog position and size
@@ -617,8 +617,8 @@ void DlgEditor::CreateDefaultObject()
// set position and size
Size aSize = rWindow.PixelToLogic( Size( 96, 24 ) );
Point aPoint = pDlgEdForm->GetSnapRect().Center();
- aPoint.setX( aPoint.X() - aSize.Width() / 2 );
- aPoint.setY( aPoint.Y() - aSize.Height() / 2 );
+ aPoint.AdjustX( -(aSize.Width() / 2) );
+ aPoint.AdjustY( -(aSize.Height() / 2) );
pDlgEdObj->SetSnapRect( tools::Rectangle( aPoint, aSize ) );
// set default property values
@@ -1156,8 +1156,8 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor
pPrinter->SetFont( aFont );
Size aPaperSz = pPrinter->GetOutputSize();
- aPaperSz.setWidth( aPaperSz.Width() - (Print::nLeftMargin + Print::nRightMargin) );
- aPaperSz.setHeight( aPaperSz.Height() - (Print::nTopMargin + Print::nBottomMargin) );
+ aPaperSz.AdjustWidth( -(Print::nLeftMargin + Print::nRightMargin) );
+ aPaperSz.AdjustHeight( -(Print::nTopMargin + Print::nBottomMargin) );
lcl_PrintHeader( pPrinter, rTitle );
@@ -1186,8 +1186,8 @@ void DlgEditor::Print( Printer* pPrinter, const OUString& rTitle ) // not wor
(aPaperSz.Width() / 2) - (aOutputSz.Width() / 2),
(aPaperSz.Height()/ 2) - (aOutputSz.Height() / 2));
- aPosOffs.setX( aPosOffs.X() + Print::nLeftMargin );
- aPosOffs.setY( aPosOffs.Y() + Print::nTopMargin );
+ aPosOffs.AdjustX(Print::nLeftMargin );
+ aPosOffs.AdjustY(Print::nTopMargin );
pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg );
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index d14f49fcdc9f..6eecc246a849 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -140,8 +140,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
aFormPos = pDevice->LogicToPixel( aFormPos, MapMode( MapUnit::Map100thMM ) );
// subtract form position
- aPos.setWidth( aPos.Width() - aFormPos.Width() );
- aPos.setHeight( aPos.Height() - aFormPos.Height() );
+ aPos.AdjustWidth( -(aFormPos.Width()) );
+ aPos.AdjustHeight( -(aFormPos.Height()) );
// take window borders into account
Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY );
@@ -153,8 +153,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aPos.setWidth( aPos.Width() - aDeviceInfo.LeftInset );
- aPos.setHeight( aPos.Height() - aDeviceInfo.TopInset );
+ aPos.AdjustWidth( -(aDeviceInfo.LeftInset) );
+ aPos.AdjustHeight( -(aDeviceInfo.TopInset) );
}
// convert pixel to logic units
@@ -201,8 +201,8 @@ bool DlgEdObj::TransformSdrToFormCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aSize.setWidth( aSize.Width() - aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
- aSize.setHeight( aSize.Height() - aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
+ aSize.AdjustWidth( -(aDeviceInfo.LeftInset + aDeviceInfo.RightInset) );
+ aSize.AdjustHeight( -(aDeviceInfo.TopInset + aDeviceInfo.BottomInset) );
}
// convert pixel to logic units
aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont));
@@ -251,8 +251,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
aFormPos = pDevice->LogicToPixel(aFormPos, MapMode(MapUnit::MapAppFont));
// add form position
- aPos.setWidth( aPos.Width() + aFormPos.Width() );
- aPos.setHeight( aPos.Height() + aFormPos.Height() );
+ aPos.AdjustWidth(aFormPos.Width() );
+ aPos.AdjustHeight(aFormPos.Height() );
// take window borders into account
bool bDecoration = true;
@@ -260,8 +260,8 @@ bool DlgEdObj::TransformControlToSdrCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aPos.setWidth( aPos.Width() + aDeviceInfo.LeftInset );
- aPos.setHeight( aPos.Height() + aDeviceInfo.TopInset );
+ aPos.AdjustWidth(aDeviceInfo.LeftInset );
+ aPos.AdjustHeight(aDeviceInfo.TopInset );
}
// convert pixel to 100th_mm
@@ -309,8 +309,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates(
if( bDecoration )
{
awt::DeviceInfo aDeviceInfo = pForm->getDeviceInfo();
- aSize.setWidth( aSize.Width() + aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
- aSize.setHeight( aSize.Height() + aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
+ aSize.AdjustWidth(aDeviceInfo.LeftInset + aDeviceInfo.RightInset );
+ aSize.AdjustHeight(aDeviceInfo.TopInset + aDeviceInfo.BottomInset );
}
// convert pixel to 100th_mm
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 963674da5f7f..cbf3e47b70ed 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -156,8 +156,8 @@ void PropBrw::ImplReCreateController()
Point aPropWinPos = Point( WIN_BORDER, WIN_BORDER );
Size aPropWinSize(STD_WIN_SIZE_X,STD_WIN_SIZE_Y);
- aPropWinSize.setWidth( aPropWinSize.Width() - (2*WIN_BORDER) );
- aPropWinSize.setHeight( aPropWinSize.Height() - (2*WIN_BORDER) );
+ aPropWinSize.AdjustWidth( -(2*WIN_BORDER) );
+ aPropWinSize.AdjustHeight( -(2*WIN_BORDER) );
if ( m_xBrowserComponentWindow.is() )
{
@@ -426,8 +426,8 @@ void PropBrw::Resize()
// adjust size
Size aSize_ = GetOutputSizePixel();
Size aPropWinSize( aSize_ );
- aPropWinSize.setWidth( aPropWinSize.Width() - (2*WIN_BORDER) );
- aPropWinSize.setHeight( aPropWinSize.Height() - (2*WIN_BORDER) );
+ aPropWinSize.AdjustWidth( -(2*WIN_BORDER) );
+ aPropWinSize.AdjustHeight( -(2*WIN_BORDER) );
if (m_xBrowserComponentWindow.is())
{
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index 3ff12c04a24c..c7f52dc47334 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -92,7 +92,7 @@ void SvRTLInputBox::InitButtons( const Size& rDlgSize )
aCancel->SetSizePixel( LogicToPixel( Size( 45, 15) ));
Point aPos( rDlgSize.Width()-45-10, 5 );
aOk->SetPosPixel( LogicToPixel( aPos ));
- aPos.setY( aPos.Y() + 16 );
+ aPos.AdjustY(16 );
aCancel->SetPosPixel( LogicToPixel( aPos ));
aOk->SetClickHdl(LINK(this,SvRTLInputBox, OkHdl));
aCancel->SetClickHdl(LINK(this,SvRTLInputBox,CancelHdl));
@@ -123,8 +123,8 @@ void SvRTLInputBox::PositionPrompt(const OUString& rPrompt,const Size& rDlgSize)
aPromptText->SetPosPixel( LogicToPixel(Point(5,5)));
aPromptText->SetText( aText_ );
Size aSize( rDlgSize );
- aSize.setWidth( aSize.Width() - 70 );
- aSize.setHeight( aSize.Height() - 50 );
+ aSize.AdjustWidth( -70 );
+ aSize.AdjustHeight( -50 );
aPromptText->SetSizePixel( LogicToPixel(aSize));
}
commit eb5563e7e636a9856d4f1cc23d00a21193b9d0cc
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Fri Feb 16 11:33:06 2018 +0200
Revert "loplugin:changetoolsgen in canvas..cui" and reapply
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 f841dada1a5018897cce29ccf972da33ece4738c.
Change-Id: Iff19e1fc99812c086b0a39b71a3f67b98e2f9c8f
Reviewed-on: https://gerrit.libreoffice.org/49841
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 892d6d781e8f..fcec72c0b475 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -90,8 +90,8 @@ namespace vclcanvas
rTileSize,
&rAttr );
- aCurrPos.setX( aCurrPos.X() + rNextTileX.Width() );
- aCurrPos.setY( aCurrPos.Y() + rNextTileX.Height() );
+ aCurrPos.AdjustX(rNextTileX.Width() );
+ aCurrPos.AdjustY(rNextTileX.Height() );
}
}
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index f58b25264fca..2a7a41e754cd 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -1006,7 +1006,7 @@ void DataBrowser::PaintCell(
OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColumnId ) const
{
Point aPos( rRect.TopLeft());
- aPos.setX( aPos.X() + 1 );
+ aPos.AdjustX(1 );
OUString aText = GetCellText( m_nSeekRow, nColumnId );
Size TxtSize( GetDataWindow().GetTextWidth( aText ), GetDataWindow().GetTextHeight());
diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
index ac7201d5e987..9967c6123a76 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx
@@ -73,7 +73,7 @@ CreationWizard::CreationWizard(vcl::Window* pParent, const uno::Reference<frame:
Size aAdditionalRoadmapSize(LogicToPixel(Size(85, 0), MapMode(MapUnit::MapAppFont)));
Size aSize(LogicToPixel(Size(CHART_WIZARD_PAGEWIDTH, CHART_WIZARD_PAGEHEIGHT), MapMode(MapUnit::MapAppFont)));
- aSize.setWidth( aSize.Width() + aAdditionalRoadmapSize.Width() );
+ aSize.AdjustWidth(aAdditionalRoadmapSize.Width() );
SetSizePixel(aSize);
if (!m_pDialogModel->getModel().isDataFromSpreadsheet())
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 8c62f46ef7b7..7e318646ebf5 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -432,8 +432,8 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
Size aObjectSize( 4000, 2500 );
tools::Rectangle aPageRect( tools::Rectangle( Point( 0, 0 ), pPage->GetSize() ) );
Point aObjectPos = aPageRect.Center();
- aObjectPos.setX( aObjectPos.X() - aObjectSize.Width() / 2 );
- aObjectPos.setY( aObjectPos.Y() - aObjectSize.Height() / 2 );
+ aObjectPos.AdjustX( -(aObjectSize.Width() / 2) );
+ aObjectPos.AdjustY( -(aObjectSize.Height() / 2) );
tools::Rectangle aRect( aObjectPos, aObjectSize );
switch ( nID )
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index e5c7629390f9..0aadee3e1191 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -170,8 +170,8 @@ void MacroEventListBox::Resize()
maHeaderBar->SetPosSizePixel( aPnt, aSize );
// calc pos and size of ListBox
- aPnt.setY( aPnt.Y() + aSize.Height() );
- aSize.Height() = aCtrlSize.Height() - aSize.Height();
+ aPnt.AdjustY(aSize.Height() );
+ aSize.setHeight( aCtrlSize.Height() - aSize.Height() );
maListBox->SetPosSizePixel( aPnt, aSize );
}
@@ -473,7 +473,7 @@ void IconLBoxString::Paint(const Point& aPos, SvTreeListBox& /*aDevice*/, vcl::R
}
Point aPnt(aPos);
- aPnt.setX( aPnt.X() + 20 );
+ aPnt.AdjustX(20 );
rRenderContext.DrawText(aPnt, aPureMethod);
}
}
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 0dc4370cfa6a..869917270eb7 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -469,17 +469,17 @@ void ColorFieldControl::KeyMove( int dx, int dy )
{
Size aSize(GetOutputSizePixel());
Point aPos(static_cast<long>(mdX * aSize.Width()), static_cast<long>((1.0 - mdY) * aSize.Height()));
- aPos.setX( aPos.X() + dx );
- aPos.Y() += dy;
+ aPos.AdjustX(dx );
+ aPos.AdjustY(dy );
if( aPos.X() < 0 )
- aPos.setX( aPos.X() + aSize.Width() );
+ aPos.AdjustX(aSize.Width() );
else if( aPos.X() >= aSize.Width() )
- aPos.setX( aPos.X() - aSize.Width() );
+ aPos.AdjustX( -(aSize.Width()) );
if( aPos.Y() < 0 )
- aPos.setY( aPos.Y() + aSize.Height() );
+ aPos.AdjustY(aSize.Height() );
else if( aPos.Y() >= aSize.Height() )
- aPos.setY( aPos.Y() - aSize.Height() );
+ aPos.AdjustY( -(aSize.Height()) );
ShowPosition( aPos, true );
Modify();
@@ -774,7 +774,7 @@ void ColorSliderControl::Paint(vcl::RenderContext& rRenderContext, const ::tools
while (x--)
{
rRenderContext.DrawOutDev(aPos, aSize, Point(0,0), aSize, *mxBitmap);
- aPos.setX( aPos.X() + 1 );
+ aPos.AdjustX(1 );
}
}
@@ -941,11 +941,11 @@ ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sa
Point aPos( mpColorSlider->GetPosPixel() );
- aPos.setX( aPos.X() - aSize.Width() );
- aPos.Y() -= aSize.Height() / 2;
+ aPos.AdjustX( -(aSize.Width()) );
+ aPos.AdjustY( -(aSize.Height() / 2) );
mpFISliderLeft->SetPosPixel( aPos );
- aPos.setX( aPos.X() + aSize.Width() + mpColorSlider->GetSizePixel().Width() );
+ aPos.AdjustX(aSize.Width() + mpColorSlider->GetSizePixel().Width() );
mpFISliderRight->SetPosPixel( aPos );
Color aColor( nColor );
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index aedebfa6654d..83e99cd10bf2 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -1195,9 +1195,9 @@ void SvxShowText::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 );
if (mbCenter)
{
@@ -1210,9 +1210,9 @@ void SvxShowText::Paint(vcl::RenderContext& rRenderContext, const ::tools::Recta
int nXLDelta = aBoundRect.Left();
int nXHDelta = aSize.Width() - aBoundRect.Right();
if( nXLDelta <= 0 )
- aPoint.setX( aPoint.X() - nXLDelta - 1 );
+ aPoint.AdjustX( -(nXLDelta - 1) );
else if( nXHDelta <= 0 )
- aPoint.setX( aPoint.X() + nXHDelta - 1 );
+ aPoint.AdjustX(nXHDelta - 1 );
}
}
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 90afcd2f700e..b26c7b0b6beb 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -236,15 +236,15 @@ namespace svx
// calculate the size of the radio image - we're to paint our text _after_ this image
DBG_ASSERT( !GetModeRadioImage(), "RubyRadioButton::Paint: images not supported!" );
Size aImageSize = GetRadioImage(rRenderContext.GetSettings(), DrawButtonFlags::NONE).GetSizePixel();
- aImageSize.Width() = CalcZoom( aImageSize.Width() ) + 2; // + 2 because otherwise the radiobuttons
- aImageSize.Height() = CalcZoom( aImageSize.Height() ) + 2; // appear a bit cut from right and top.
+ aImageSize.setWidth( CalcZoom( aImageSize.Width() ) + 2 ); // + 2 because otherwise the radiobuttons
+ aImageSize.setHeight( CalcZoom( aImageSize.Height() ) + 2 ); // appear a bit cut from right and top.
::tools::Rectangle aOverallRect( Point( 0, 0 ), GetOutputSizePixel() );
- aOverallRect.Left() += aImageSize.Width() + 4; // 4 is the separator between the image and the text
+ aOverallRect.AdjustLeft(aImageSize.Width() + 4 ); // 4 is the separator between the image and the text
// inflate the rect a little bit (because the VCL radio button does the same)
::tools::Rectangle aTextRect( aOverallRect );
- ++aTextRect.Left(); --aTextRect.Right();
- ++aTextRect.Top(); --aTextRect.Bottom();
+ aTextRect.AdjustLeft( 1 ); aTextRect.AdjustRight( -1 );
+ aTextRect.AdjustTop( 1 ); aTextRect.AdjustBottom( -1 );
// calculate the text flags for the painting
DrawTextFlags nTextStyle = DrawTextFlags::Mnemonic;
@@ -283,17 +283,17 @@ namespace svx
// for this, give it the proper location to paint the image (vertically centered, relative to our text)
::tools::Rectangle aImageLocation( Point( 0, 0 ), aImageSize );
sal_Int32 nTextHeight = aSecondaryTextLocation.Bottom() - aPrimaryTextLocation.Top();
- aImageLocation.Top() = aPrimaryTextLocation.Top() + ( nTextHeight - aImageSize.Height() ) / 2;
- aImageLocation.Bottom() = aImageLocation.Top() + aImageSize.Height();
+ aImageLocation.SetTop( aPrimaryTextLocation.Top() + ( nTextHeight - aImageSize.Height() ) / 2 );
+ aImageLocation.SetBottom( aImageLocation.Top() + aImageSize.Height() );
SetStateRect( aImageLocation );
DrawRadioButtonState(rRenderContext);
// mouse clicks should be recognized in a rect which is one pixel larger in each direction, plus
// includes the image
- aCombinedRect.Left() = aImageLocation.Left();
- ++aCombinedRect.Right();
- --aCombinedRect.Top();
- ++aCombinedRect.Bottom();
+ aCombinedRect.SetLeft( aImageLocation.Left() );
+ aCombinedRect.AdjustRight( 1 );
+ aCombinedRect.AdjustTop( -1 );
+ aCombinedRect.AdjustBottom( 1 );
SetMouseRect(aCombinedRect);
@@ -316,8 +316,8 @@ namespace svx
}
Size minimumSize = CalcMinimumSize();
- minimumSize.Height() = aPrimarySize.Height() + aSecondarySize.Height() + 5;
- minimumSize.Width() = aPrimarySize.Width() + aSecondarySize.Width() + 5;
+ minimumSize.setHeight( aPrimarySize.Height() + aSecondarySize.Height() + 5 );
+ minimumSize.setWidth( aPrimarySize.Width() + aSecondarySize.Width() + 5 );
return minimumSize;
}
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index d80a88c0ff53..bc4d8ca58ce3 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -158,7 +158,7 @@ void AlternativesString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::
aPos.setX( 0 );
}
else
- aPos.setX( aPos.X() + 5 );
+ aPos.AdjustX(5 );
rRenderContext.DrawText(aPos, GetText());
rRenderContext.Pop();
}
@@ -262,8 +262,8 @@ void ThesaurusAlternativesCtrl::Paint(vcl::RenderContext& rRenderContext, const
Size aTextSize(rRenderContext.GetTextWidth(m_pDialog->getErrStr()), rRenderContext.GetTextHeight());
aTextSize = rRenderContext.LogicToPixel(aTextSize);
Point aPos;
- aPos.setX( aPos.X() + GetSizePixel().Width() / 2 - aTextSize.Width() / 2 );
- aPos.Y() += GetSizePixel().Height() / 2;
+ aPos.AdjustX(GetSizePixel().Width() / 2 - aTextSize.Width() / 2 );
+ aPos.AdjustY(GetSizePixel().Height() / 2 );
aPos = rRenderContext.PixelToLogic(aPos);
rRenderContext.DrawText(aPos, m_pDialog->getErrStr());
}
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 0fbbce7611bd..2ab19ca73d15 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -133,11 +133,11 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
rBar.SetSelectHdl( LINK( this, DbRegistrationOptionsPage, HeaderSelect_Impl ) );
rBar.SetEndDragHdl( LINK( this, DbRegistrationOptionsPage, HeaderEndDrag_Impl ) );
Size aSz;
- aSz.Width() = TAB_WIDTH1;
+ aSz.setWidth( TAB_WIDTH1 );
rBar.InsertItem( ITEMID_TYPE, m_aTypeText,
LogicToPixel( aSz, MapMode( MapUnit::MapAppFont ) ).Width(),
HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW );
- aSz.Width() = TAB_WIDTH2;
+ aSz.setWidth( TAB_WIDTH2 );
rBar.InsertItem( ITEMID_PATH, m_aPathText,
LogicToPixel( aSz, MapMode( MapUnit::MapAppFont ) ).Width(),
HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index a0532772c7c1..9400320e3d2d 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -247,7 +247,7 @@ void BrwStringDic_Impl::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::R
aPos.setX( 0 );
}
else
- aPos.setX( aPos.X() + 5 );
+ aPos.AdjustX(5 );
rRenderContext.DrawText(aPos, GetText());
rRenderContext.Pop();
}
@@ -406,12 +406,12 @@ void BrwString_Impl::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::Rend
const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry)
{
Point aPos(rPos);
- aPos.setX( aPos.X() + 20 );
+ aPos.AdjustX(20 );
rRenderContext.DrawText(aPos, GetText());
if (rEntry.GetUserData())
{
Point aNewPos(aPos);
- aNewPos.setX( aNewPos.X() + rRenderContext.GetTextWidth(GetText()) );
+ aNewPos.AdjustX(rRenderContext.GetTextWidth(GetText()) );
rRenderContext.Push(PushFlags::FONT);
vcl::Font aFont(rRenderContext.GetFont());
aFont.SetWeight(WEIGHT_BOLD);
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 61995dec8816..7b575d0ed605 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -345,7 +345,7 @@ void OfaImpBrwString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::Ren
{
ImpUserData* pUserData = static_cast<ImpUserData*>(rEntry.GetUserData());
Point aNewPos(rPos);
- aNewPos.setX( aNewPos.X() + rRenderContext.GetTextWidth(GetText()) );
+ aNewPos.AdjustX(rRenderContext.GetTextWidth(GetText()) );
vcl::Font aOldFont(rRenderContext.GetFont());
vcl::Font aFont(aOldFont);
if (pUserData->pFont)
@@ -367,7 +367,7 @@ void OfaImpBrwString::Paint(const Point& rPos, SvTreeListBox& /*rDev*/, vcl::Ren
rRenderContext.DrawText(aNewPos, sTxt);
if (-1 != nPos)
- aNewPos.setX( aNewPos.X() + rRenderContext.GetTextWidth(sTxt) );
+ aNewPos.AdjustX(rRenderContext.GetTextWidth(sTxt) );
if (bFett)
rRenderContext.SetFont(aOldFont);
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index c2e6b05f0631..ddf8dcb024b4 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -237,8 +237,8 @@ void BackgroundPreviewImpl::recalcDrawPos()
Size aSize = GetOutputSizePixel();
// InnerSize == Size without one pixel border
Size aInnerSize = aSize;
- aInnerSize.setWidth( aInnerSize.Width() - 2 );
- aInnerSize.Height() -= 2;
+ aInnerSize.AdjustWidth( -2 );
+ aInnerSize.AdjustHeight( -2 );
aDrawSize = pBitmap->GetSizePixel();
// bitmap bigger than preview window?
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 06cdf8997943..3ce3925c937d 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -794,10 +794,10 @@ void SvxCropExample::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re
aSz = rRenderContext.PixelToLogic(aSz);
rRenderContext.SetFillColor(Color(COL_TRANSPARENT));
rRenderContext.SetRasterOp(RasterOp::Invert);
- aRect.SetLeft( aRect.Left() + aTopLeft.Y() );
- aRect.Top() += aTopLeft.X();
- aRect.SetRight( aRect.Right() - aBottomRight.Y() );
- aRect.Bottom() -= aBottomRight.X();
+ aRect.AdjustLeft(aTopLeft.Y() );
+ aRect.AdjustTop(aTopLeft.X() );
+ aRect.AdjustRight( -(aBottomRight.Y()) );
+ aRect.AdjustBottom( -(aBottomRight.X()) );
rRenderContext.DrawRect(aRect);
}
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index f1851f2b2def..9eb975a44921 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2259,10 +2259,10 @@ static long lcl_DrawBullet(VirtualDevice* pVDev,
// via Uno it's possible that no font has been set!
vcl::Font aFont(rFmt.GetBulletFont() ? *rFmt.GetBulletFont() : aTmpFont);
Size aTmpSize(rSize);
- aTmpSize.setWidth( aTmpSize.Width() * rFmt.GetBulletRelSize() );
- aTmpSize.Width() /= 100 ;
- aTmpSize.setHeight( aTmpSize.Height() * rFmt.GetBulletRelSize() );
- aTmpSize.Height() /= 100 ;
+ aTmpSize.setWidth( aTmpSize.Width() * ( rFmt.GetBulletRelSize()) );
+ aTmpSize.setWidth( aTmpSize.Width() / 100 ) ;
+ aTmpSize.setHeight( aTmpSize.Height() * ( rFmt.GetBulletRelSize()) );
+ aTmpSize.setHeight( aTmpSize.Height() / 100 ) ;
// in case of a height of zero it is drawed in original height
if(!aTmpSize.Height())
aTmpSize.setHeight( 1 );
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 643d5a14b438..dbde0bf2dc9c 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -106,9 +106,9 @@ Size GetMinBorderSpace_Impl( const SvxShadowItem& rShadow, const SvxBoxItem& rBo
{
Size aSz;
aSz.setHeight( rShadow.CalcShadowSpace( SvxShadowItemSide::BOTTOM ) + rBox.CalcLineSpace( SvxBoxItemLine::BOTTOM ) );
- aSz.setHeight( aSz.Height() + rShadow.CalcShadowSpace( SvxShadowItemSide::TOP ) + rBox.CalcLineSpace( SvxBoxItemLine::TOP ) );
- aSz.Width() = rShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ) + rBox.CalcLineSpace( SvxBoxItemLine::LEFT );
- aSz.setWidth( aSz.Width() + rShadow.CalcShadowSpace( SvxShadowItemSide::RIGHT ) + rBox.CalcLineSpace( SvxBoxItemLine::RIGHT ) );
+ aSz.AdjustHeight(rShadow.CalcShadowSpace( SvxShadowItemSide::TOP ) + rBox.CalcLineSpace( SvxBoxItemLine::TOP ) );
+ aSz.setWidth( rShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ) + rBox.CalcLineSpace( SvxBoxItemLine::LEFT ) );
+ aSz.AdjustWidth(rShadow.CalcShadowSpace( SvxShadowItemSide::RIGHT ) + rBox.CalcLineSpace( SvxBoxItemLine::RIGHT ) );
return aSz;
}
More information about the Libreoffice-commits
mailing list