diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 13:01:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 19:50:47 +0100 |
commit | bddd6c77811e0489a5632437116f5eec356cc397 (patch) | |
tree | 761111e37f065d040a6d63ef1098de2afce16eae | |
parent | eb5563e7e636a9856d4f1cc23d00a21193b9d0cc (diff) |
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@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | avmedia/source/framework/mediacontrol.cxx | 42 | ||||
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 10 | ||||
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 18 | ||||
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/objdlg.cxx | 4 | ||||
-rw-r--r-- | basctl/source/dlged/dlged.cxx | 24 | ||||
-rw-r--r-- | basctl/source/dlged/dlgedobj.cxx | 24 | ||||
-rw-r--r-- | basctl/source/dlged/propbrw.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/inputbox.cxx | 6 |
9 files changed, 71 insertions, 71 deletions
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)); } |