diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 08:43:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-16 13:23:40 +0100 |
commit | 4beed2ba7335fdb211aca7f70a144ffecf90a781 (patch) | |
tree | 23b645a3a2dca69466eaa664a34556d110745c95 | |
parent | 79afa1d9b3ac33b75512095c6383db7f47342f26 (diff) |
Revert "loplugin:changetoolsgen in sd" and reapply the 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 0d9f3f7628f88fa66aaeea1f7148db620e17e728.
Change-Id: I33f79bf755aedc1ed48d95f7b82f3fabed1347fb
Reviewed-on: https://gerrit.libreoffice.org/49834
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
45 files changed, 218 insertions, 218 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 867c4df6c3c0..ad906e23c556 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -987,12 +987,12 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind) Point aPos ( nLftBorder, nUppBorder ); Size aSize ( GetSize() ); - aSize.setWidth( aSize.Width() - nLftBorder + GetRightBorder() ); - aSize.setHeight( aSize.Height() - nUppBorder + GetLowerBorder() ); + aSize.AdjustWidth( -(nLftBorder + GetRightBorder()) ); + aSize.AdjustHeight( -(nUppBorder + GetLowerBorder()) ); getPresObjProp( *this, sObjKind, sPageKind, propvalue); - aPos.setX( aPos.X() + long( aSize.Width() * propvalue[2] ) ); - aPos.setY( aPos.Y() + long( aSize.Height() * propvalue[3] ) ); + aPos.AdjustX(long( aSize.Width() * propvalue[2] ) ); + aPos.AdjustY(long( aSize.Height() * propvalue[3] ) ); aSize.setWidth( long( aSize.Width() * propvalue[1] ) ); aSize.setHeight( long( aSize.Height() * propvalue[0] ) ); @@ -1011,8 +1011,8 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind) { // create header&footer objects for handout and notes master Size aPageSize ( GetSize() ); - aPageSize.setWidth( aPageSize.Width() - GetLeftBorder() + GetRightBorder() ); - aPageSize.setHeight( aPageSize.Height() - GetUpperBorder() + GetLowerBorder() ); + aPageSize.AdjustWidth( -(GetLeftBorder() + GetRightBorder()) ); + aPageSize.AdjustHeight( -(GetUpperBorder() + GetLowerBorder()) ); Point aPosition ( GetLeftBorder(), GetUpperBorder() ); @@ -1079,15 +1079,15 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) ******************************************************************/ Point aTitlePos ( GetLeftBorder(), GetUpperBorder() ); Size aTitleSize ( GetSize() ); - aTitleSize.setWidth( aTitleSize.Width() - GetLeftBorder() + GetRightBorder() ); - aTitleSize.setHeight( aTitleSize.Height() - GetUpperBorder() + GetLowerBorder() ); + aTitleSize.AdjustWidth( -(GetLeftBorder() + GetRightBorder()) ); + aTitleSize.AdjustHeight( -(GetUpperBorder() + GetLowerBorder()) ); const char* sPageKind = PageKindVector[mePageKind]; if (mePageKind == PageKind::Standard) { getPresObjProp( *this , "PRESOBJ_TITLE" ,sPageKind, propvalue); - aTitlePos.setX( aTitlePos.X() + long( aTitleSize.Width() * propvalue[2] ) ); - aTitlePos.setY( aTitlePos.Y() + long( aTitleSize.Height() * propvalue[3] ) ); + aTitlePos.AdjustX(long( aTitleSize.Width() * propvalue[2] ) ); + aTitlePos.AdjustY(long( aTitleSize.Height() * propvalue[3] ) ); aTitleSize.setWidth( long( aTitleSize.Width() * propvalue[1] ) ); aTitleSize.setHeight( long( aTitleSize.Height() * propvalue[0] ) ); } @@ -1095,8 +1095,8 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) { Point aPos = aTitlePos; getPresObjProp( *this, "PRESOBJ_TITLE" ,sPageKind, propvalue); - aPos.setX( aPos.X() + long( aTitleSize.Width() * propvalue[2] ) ); - aPos.setY( aPos.Y() + long( aTitleSize.Height() * propvalue[3] ) ); + aPos.AdjustX(long( aTitleSize.Width() * propvalue[2] ) ); + aPos.AdjustY(long( aTitleSize.Height() * propvalue[3] ) ); // limit height aTitleSize.setHeight( long( aTitleSize.Height() * propvalue[0] ) ); @@ -1131,8 +1131,8 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) aSize.setWidth( static_cast<long>(fH * pRefPage->GetWidth()) ); aSize.setHeight( static_cast<long>(fH * pRefPage->GetHeight()) ); - aPos.setX( aPos.X() + (aPartArea.Width() - aSize.Width()) / 2 ); - aPos.setY( aPos.Y() + (aPartArea.Height()- aSize.Height())/ 2 ); + aPos.AdjustX((aPartArea.Width() - aSize.Width()) / 2 ); + aPos.AdjustY((aPartArea.Height()- aSize.Height())/ 2 ); } aTitlePos = aPos; @@ -1162,15 +1162,15 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) Point aLayoutPos ( GetLeftBorder(), GetUpperBorder() ); Size aLayoutSize ( GetSize() ); - aLayoutSize.setWidth( aLayoutSize.Width() - GetLeftBorder() + GetRightBorder() ); - aLayoutSize.setHeight( aLayoutSize.Height() - GetUpperBorder() + GetLowerBorder() ); + aLayoutSize.AdjustWidth( -(GetLeftBorder() + GetRightBorder()) ); + aLayoutSize.AdjustHeight( -(GetUpperBorder() + GetLowerBorder()) ); const char* sPageKind = PageKindVector[mePageKind]; if (mePageKind == PageKind::Standard) { getPresObjProp( *this ,"PRESOBJ_OUTLINE", sPageKind, propvalue); - aLayoutPos.setX( aLayoutPos.X() + long( aLayoutSize.Width() * propvalue[2] ) ); - aLayoutPos.setY( aLayoutPos.Y() + long( aLayoutSize.Height() * propvalue[3] ) ); + aLayoutPos.AdjustX(long( aLayoutSize.Width() * propvalue[2] ) ); + aLayoutPos.AdjustY(long( aLayoutSize.Height() * propvalue[3] ) ); aLayoutSize.setWidth( long( aLayoutSize.Width() * propvalue[1] ) ); aLayoutSize.setHeight( long( aLayoutSize.Height() * propvalue[0] ) ); aLayoutRect.SetPos(aLayoutPos); @@ -1179,8 +1179,8 @@ void SdPage::DestroyDefaultPresObj(PresObjKind eObjKind) else if (mePageKind == PageKind::Notes) { getPresObjProp( *this, "PRESOBJ_NOTES", sPageKind, propvalue); - aLayoutPos.setX( aLayoutPos.X() + long( aLayoutSize.Width() * propvalue[2] ) ); - aLayoutPos.setY( aLayoutPos.Y() + long( aLayoutSize.Height() * propvalue[3] ) ); + aLayoutPos.AdjustX(long( aLayoutSize.Width() * propvalue[2] ) ); + aLayoutPos.AdjustY(long( aLayoutSize.Height() * propvalue[3] ) ); aLayoutSize.setWidth( long( aLayoutSize.Width() * propvalue[1] ) ); aLayoutSize.setHeight( long( aLayoutSize.Height() * propvalue[0] ) ); aLayoutRect.SetPos(aLayoutPos); @@ -1861,8 +1861,8 @@ void SdPage::ScaleObjects(const Size& rNewPageSize, const ::tools::Rectangle& rN if (mbScaleObjects) { - aBackgroundSize.setWidth( aBackgroundSize.Width() - nLeft + nRight ); - aBackgroundSize.setHeight( aBackgroundSize.Height() - nUpper + nLower ); + aBackgroundSize.AdjustWidth( -(nLeft + nRight) ); + aBackgroundSize.AdjustHeight( -(nUpper + nLower) ); aBorderRect.SetSize(aBackgroundSize); aNewPageSize = aBackgroundSize; } @@ -2969,8 +2969,8 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, long nX = nGapW + nLeftBorder; long nY = nGapH + nTopBorder; - aArea.setWidth( aArea.Width() - nGapW * 2 + nLeftBorder + nRightBorder ); - aArea.setHeight( aArea.Height() - nGapH * 2 + nTopBorder + nBottomBorder ); + aArea.AdjustWidth( -(nGapW * 2 + nLeftBorder + nRightBorder) ); + aArea.AdjustHeight( -(nGapH * 2 + nTopBorder + nBottomBorder) ); const bool bLandscape = aArea.Width() > aArea.Height(); @@ -3087,10 +3087,10 @@ void SdPage::CalculateHandoutAreas( SdDrawDocument& rModel, AutoLayout eLayout, for(sal_uInt16 nCol = 0; nCol < nColCnt; nCol++) { rAreas[*pOffsets++] = ::tools::Rectangle(aPos, aSize); - aPos.setX( aPos.X() + nOffsetX ); + aPos.AdjustX(nOffsetX ); } - aPos.setY( aPos.Y() + nOffsetY ); + aPos.AdjustY(nOffsetY ); } } } diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index 2b8018ef35c6..84bbcc53dc28 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -669,9 +669,9 @@ awt::Size PPTWriterBase::MapSize( const awt::Size& rSize ) Size aRetSize( OutputDevice::LogicToLogic( Size( rSize.Width, rSize.Height ), maMapModeSrc, maMapModeDest ) ); if ( !aRetSize.Width() ) - aRetSize.setWidth( ++aRetSize.Width() ); + aRetSize.AdjustWidth( 1 ); if ( !aRetSize.Height() ) - aRetSize.setHeight( ++aRetSize.Height() ); + aRetSize.AdjustHeight( 1 ); return awt::Size( aRetSize.Width(), aRetSize.Height() ); } diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index f9cd9cda06fc..537f9e579b5d 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -178,8 +178,8 @@ bool SdGRFFilter::Import() Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM))); - aPagSize.setWidth( aPagSize.Width() - pPage->GetLeftBorder() + pPage->GetRightBorder() ); - aPagSize.setHeight( aPagSize.Height() - pPage->GetUpperBorder() + pPage->GetLowerBorder() ); + aPagSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) ); + aPagSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) ); // scale to fit page if ( ( ( aGrfSize.Height() > aPagSize.Height() ) || ( aGrfSize.Width() > aPagSize.Width() ) ) && diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx index 56e0e70cebfe..31693f3885a0 100644 --- a/sd/source/filter/html/buttonset.cxx +++ b/sd/source/filter/html/buttonset.cxx @@ -210,13 +210,13 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton aGraphics.push_back(aGraphic); Size aGraphicSize( aGraphic.GetSizePixel( pDev ) ); - aSize.setWidth( aSize.Width() + aGraphicSize.Width() ); + aSize.AdjustWidth(aGraphicSize.Width() ); if( aSize.Height() < aGraphicSize.Height() ) aSize.setHeight( aGraphicSize.Height() ); if( aIter != rButtons.end() ) - aSize.setWidth( aSize.Width() + 3 ); + aSize.AdjustWidth(3 ); } pDev->SetOutputSizePixel( aSize ); @@ -230,7 +230,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton aGraphic.Draw( pDev, aPos ); - aPos.setX( aPos.X() + aGraphic.GetSizePixel().Width() + 3 ); + aPos.AdjustX(aGraphic.GetSizePixel().Width() + 3 ); } rImage = Image( pDev->GetBitmapEx( Point(), aSize ) ); diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index d1fcaecd3659..086162e99fdb 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -277,12 +277,12 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, //FIXME With previous image not defined in CustomAnimation.src } - aPos.setX( aPos.X() + nIconWidth ); + aPos.AdjustX(nIconWidth ); rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msDescription, rDev.GetOutputSizePixel().Width() - aPos.X())); - aPos.setY( aPos.Y() + nIconWidth ); + aPos.AdjustY(nIconWidth ); OUString sImage; switch (mpEffect->getPresetClass()) @@ -318,12 +318,12 @@ void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, BitmapEx aBitmap(sImage); Image aImage(aBitmap); Point aImagePos(aPos); - aImagePos.setY( aImagePos.Y() + ((aSize.Height()/2 - aImage.GetSizePixel().Height()) >> 1) ); + aImagePos.AdjustY((aSize.Height()/2 - aImage.GetSizePixel().Height()) >> 1 ); rRenderContext.DrawImage(aImagePos, aImage); } - aPos.setX( aPos.X() + nIconWidth ); - aPos.setY( aPos.Y() + ((aSize.Height()/2 - rDev.GetTextHeight()) >> 1) ); + aPos.AdjustX(nIconWidth ); + aPos.AdjustY((aSize.Height()/2 - rDev.GetTextHeight()) >> 1 ); rRenderContext.DrawText(aPos, rRenderContext.GetEllipsisString(msEffectName, rDev.GetOutputSizePixel().Width() - aPos.X())); } @@ -419,10 +419,10 @@ void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rD int nVertBorder = ((aSize.Height() - rDev.GetTextHeight()) >> 1); int nHorzBorder = rRenderContext.LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont)).Width(); - aOutRect.SetLeft( aOutRect.Left() + nHorzBorder ); - aOutRect.SetRight( aOutRect.Right() - nHorzBorder ); - aOutRect.SetTop( aOutRect.Top() + nVertBorder ); - aOutRect.SetBottom( aOutRect.Bottom() - nVertBorder ); + aOutRect.AdjustLeft(nHorzBorder ); + aOutRect.AdjustRight( -nHorzBorder ); + aOutRect.Top() += nVertBorder; + aOutRect.AdjustBottom( -nVertBorder ); rRenderContext.DrawText(aOutRect, rRenderContext.GetEllipsisString(msDescription, aOutRect.GetWidth())); rRenderContext.Pop(); @@ -950,10 +950,10 @@ void CustomAnimationList::Paint(vcl::RenderContext& rRenderContext, const ::tool ::tools::Rectangle aRect(Point(0,0), GetOutputSizePixel()); - aRect.SetLeft( aRect.Left() + aOffset.X() ); - aRect.SetTop( aRect.Top() + aOffset.Y() ); - aRect.SetRight( aRect.Right() - aOffset.X() ); - aRect.SetBottom( aRect.Bottom() - aOffset.Y() ); + aRect.AdjustLeft(aOffset.X() ); + aRect.AdjustTop(aOffset.Y() ); + aRect.AdjustRight( -(aOffset.X()) ); + aRect.AdjustBottom( -(aOffset.Y()) ); rRenderContext.DrawText(aRect, SdResId(STR_CUSTOMANIMATION_LIST_HELPTEXT), DrawTextFlags::MultiLine | DrawTextFlags::WordBreak | DrawTextFlags::Center | DrawTextFlags::VCenter ); diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index 6f8eab0d3b58..b69984bf76a0 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -568,8 +568,8 @@ void AnnotationTag::OpenPopup( bool bEdit ) RealPoint2D aPosition( mxAnnotation->getPosition() ); Point aPos( pWindow->OutputToScreenPixel( pWindow->LogicToPixel( Point( static_cast<long>(aPosition.X * 100.0), static_cast<long>(aPosition.Y * 100.0) ) ) ) ); - aPos.setX( aPos.X() + 4 ); // magic! - aPos.setY( aPos.Y() + 1 ); + aPos.AdjustX(4 ); // magic! + aPos.AdjustY(1 ); ::tools::Rectangle aRect( aPos, maSize ); diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx index b7ace9c85632..da3de53d4855 100644 --- a/sd/source/ui/controller/displaymodecontroller.cxx +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -153,8 +153,8 @@ DisplayModeToolbarMenu::DisplayModeToolbarMenu( DisplayModeController& rControll fillLayoutValueSet( mpDisplayModeSet1, &editmodes[0] ); Size aSize( mpDisplayModeSet1->GetOutputSizePixel() ); - aSize.setWidth( aSize.Width() + (mpDisplayModeSet1->GetColCount() + 1) * LAYOUT_BORDER_PIX ); - aSize.setHeight( aSize.Height() + (mpDisplayModeSet1->GetLineCount() +1) * LAYOUT_BORDER_PIX ); + aSize.AdjustWidth((mpDisplayModeSet1->GetColCount() + 1) * LAYOUT_BORDER_PIX ); + aSize.AdjustHeight((mpDisplayModeSet1->GetLineCount() +1) * LAYOUT_BORDER_PIX ); mpDisplayModeSet1->SetOutputSizePixel( aSize ); appendEntry( -1, aTitle1 ); @@ -168,8 +168,8 @@ DisplayModeToolbarMenu::DisplayModeToolbarMenu( DisplayModeController& rControll fillLayoutValueSet( mpDisplayModeSet2, &mastermodes[0] ); aSize = mpDisplayModeSet2->GetOutputSizePixel(); - aSize.setWidth( aSize.Width() + (mpDisplayModeSet2->GetColCount() + 1) * LAYOUT_BORDER_PIX ); - aSize.setHeight( aSize.Height() + (mpDisplayModeSet2->GetLineCount() + 1) * LAYOUT_BORDER_PIX ); + aSize.AdjustWidth((mpDisplayModeSet2->GetColCount() + 1) * LAYOUT_BORDER_PIX ); + aSize.AdjustHeight((mpDisplayModeSet2->GetLineCount() + 1) * LAYOUT_BORDER_PIX ); mpDisplayModeSet2->SetOutputSizePixel( aSize ); appendEntry( -1, aTitle2 ); diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx index 0d9beec89730..13f694b99834 100644 --- a/sd/source/ui/controller/slidelayoutcontroller.cxx +++ b/sd/source/ui/controller/slidelayoutcontroller.cxx @@ -197,8 +197,8 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, vcl::W fillLayoutValueSet( mpLayoutSet1, pInfo ); Size aSize( mpLayoutSet1->GetOutputSizePixel() ); - aSize.setWidth( aSize.Width() + (mpLayoutSet1->GetColCount() + 1) * LAYOUT_BORDER_PIX ); - aSize.setHeight( aSize.Height() + (mpLayoutSet1->GetLineCount() +1) * LAYOUT_BORDER_PIX ); + aSize.AdjustWidth((mpLayoutSet1->GetColCount() + 1) * LAYOUT_BORDER_PIX ); + aSize.AdjustHeight((mpLayoutSet1->GetLineCount() +1) * LAYOUT_BORDER_PIX ); mpLayoutSet1->SetOutputSizePixel( aSize ); if( bVerticalEnabled && (eMode == DrawViewMode_DRAW) ) @@ -217,8 +217,8 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, vcl::W fillLayoutValueSet( mpLayoutSet2, &v_standard[0] ); aSize = mpLayoutSet2->GetOutputSizePixel(); - aSize.setWidth( aSize.Width() + (mpLayoutSet2->GetColCount() + 1) * LAYOUT_BORDER_PIX ); - aSize.setHeight( aSize.Height() + (mpLayoutSet2->GetLineCount() + 1) * LAYOUT_BORDER_PIX ); + aSize.AdjustWidth((mpLayoutSet2->GetColCount() + 1) * LAYOUT_BORDER_PIX ); + aSize.AdjustHeight((mpLayoutSet2->GetLineCount() + 1) * LAYOUT_BORDER_PIX ); mpLayoutSet2->SetOutputSizePixel( aSize ); appendEntry( -1, aTitle2 ); diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 79561e267895..1fbd88cef57f 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -150,7 +150,7 @@ void ClientBox::CalcActiveHeight() // Text entry height Size aSize = GetOutputSizePixel(); if ( m_bHasScrollBar ) - aSize.setWidth( aSize.Width() - m_aScrollBar->GetSizePixel().Width() ); + aSize.AdjustWidth( -(m_aScrollBar->GetSizePixel().Width()) ); aSize.Width() -= ICON_OFFSET; @@ -171,7 +171,7 @@ void ClientBox::CalcActiveHeight() Size aSize( GetOutputSizePixel() ); if ( m_bHasScrollBar ) - aSize.setWidth( aSize.Width() - m_aScrollBar->GetSizePixel().Width() ); + aSize.AdjustWidth( -(m_aScrollBar->GetSizePixel().Width()) ); if ( m_vEntries[ nPos ]->m_bActive ) aSize.setHeight( m_nActiveHeight ); @@ -180,7 +180,7 @@ void ClientBox::CalcActiveHeight() Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight ); if ( m_bHasActive && ( nPos < m_nActive ) ) - aPos.setY( aPos.Y() + m_nActiveHeight - m_nStdHeight ); + aPos.AdjustY(m_nActiveHeight - m_nStdHeight ); return ::tools::Rectangle( aPos, aSize ); } @@ -321,7 +321,7 @@ void ClientBox::DrawRow(vcl::RenderContext& rRenderContext, const ::tools::Recta SetFont(aStdFont); - aPos.setY( aPos.Y() + aTextHeight ); + aPos.AdjustY(aTextHeight ); if (rEntry->m_bActive) { OUString sPinText(SdResId(STR_ENTER_PIN)); @@ -479,7 +479,7 @@ void ClientBox::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectang Size aSize(GetOutputSizePixel()); if (m_bHasScrollBar) - aSize.setWidth( aSize.Width() - m_aScrollBar->GetSizePixel().Width() ); + aSize.AdjustWidth( -(m_aScrollBar->GetSizePixel().Width()) ); const ::osl::MutexGuard aGuard(m_entriesMutex); @@ -489,7 +489,7 @@ void ClientBox::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectang aSize.setHeight( (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight ); ::tools::Rectangle aEntryRect(aStart, aSize); DrawRow(rRenderContext, aEntryRect, *iIndex); - aStart.setY( aStart.Y() + aSize.Height() ); + aStart.AdjustY(aSize.Height() ); } } @@ -688,7 +688,7 @@ void ClientBox::DoScroll( long nDelta ) Point aNewSBPt( m_aScrollBar->GetPosPixel() ); ::tools::Rectangle aScrRect( Point(), GetOutputSizePixel() ); - aScrRect.SetRight( aScrRect.Right() - m_aScrollBar->GetSizePixel().Width() ); + aScrRect.AdjustRight( -(m_aScrollBar->GetSizePixel().Width()) ); Scroll( 0, -nDelta, aScrRect ); m_aScrollBar->SetPosPixel( aNewSBPt ); diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index 2572268b243a..14e8bf068fa1 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -657,8 +657,8 @@ Fraction AnimationWindow::GetScale() aBmpSize.setHeight( std::max( aBmpSize.Height(), aTempSize.Height() ) ); } - aBmpSize.setWidth( aBmpSize.Width() + 10 ); - aBmpSize.setHeight( aBmpSize.Height() + 10 ); + aBmpSize.AdjustWidth(10 ); + aBmpSize.AdjustHeight(10 ); Size aDisplaySize(m_pCtlDisplay->GetOutputSize()); diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 4260572f7264..be8c9b9641eb 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -781,9 +781,9 @@ void PresLayoutPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools: nWidth = maPageSize.Height() == 0 ? 0 : long( static_cast<double>(nHeight * maPageSize.Width()) / static_cast<double>(maPageSize.Height()) ); } - maOutRect.SetLeft( maOutRect.Left() + ((maOutRect.GetWidth() - nWidth) >> 1) ); + maOutRect.AdjustLeft((maOutRect.GetWidth() - nWidth) >> 1 ); maOutRect.SetRight( maOutRect.Left() + nWidth - 1 ); - maOutRect.SetTop( maOutRect.Top() + ((maOutRect.GetHeight() - nHeight) >> 1) ); + maOutRect.AdjustTop((maOutRect.GetHeight() - nHeight) >> 1 ); maOutRect.SetBottom( maOutRect.Top() + nHeight - 1 ); // draw decoration frame diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index e9c09b70b722..d25c6c0abb94 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -103,8 +103,8 @@ void DrawDocShell::Draw(OutputDevice* pOut, const JobSetup&, sal_uInt16 nAspect) { MapMode aMapMode = aOldMapMode; Point aOrigin = aMapMode.GetOrigin(); - aOrigin.setX( aOrigin.X() + 1 ); - aOrigin.setY( aOrigin.Y() + 1 ); + aOrigin.AdjustX(1 ); + aOrigin.AdjustY(1 ); aMapMode.SetOrigin(aOrigin); pOut->SetMapMode(aMapMode); } diff --git a/sd/source/ui/func/fudraw.cxx b/sd/source/ui/func/fudraw.cxx index 082bacbbd982..8d507f4302e1 100644 --- a/sd/source/ui/func/fudraw.cxx +++ b/sd/source/ui/func/fudraw.cxx @@ -599,10 +599,10 @@ bool FuDraw::SetPointer(SdrObject* pObj, const Point& rPos) Point aHitPosT(rPos); Point aHitPosB(rPos); - aHitPosR.setX( aHitPosR.X() + n2HitLog ); - aHitPosL.setX( aHitPosL.X() - n2HitLog ); - aHitPosT.setY( aHitPosT.Y() + n2HitLog ); - aHitPosB.setY( aHitPosB.Y() - n2HitLog ); + aHitPosR.AdjustX(n2HitLog ); + aHitPosL.AdjustX( -n2HitLog ); + aHitPosT.AdjustY(n2HitLog ); + aHitPosB.AdjustY( -n2HitLog ); if ( !pObj->IsClosedObj() || ( SdrObjectPrimitiveHit(*pObj, aHitPosR, nHitLog, *mpView->GetSdrPageView(), pVisiLayer, false) && diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 8a63c098f0f0..77cd60c685ea 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -384,8 +384,8 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) ::tools::Rectangle aWinRect(aPos, mpWindow->GetOutputSizePixel() ); aPos = aWinRect.Center(); aPos = mpWindow->PixelToLogic(aPos); - aPos.setX( aPos.X() - aSize.Width() / 2 ); - aPos.setY( aPos.Y() - aSize.Height() / 2 ); + aPos.AdjustX( -(aSize.Width() / 2) ); + aPos.AdjustY( -(aSize.Height() / 2) ); aRect = ::tools::Rectangle(aPos, aSize); } @@ -747,8 +747,8 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq ) if( mpWindow ) { aPos = mpWindow->PixelToLogic( ::tools::Rectangle( aPos, mpWindow->GetOutputSizePixel() ).Center() ); - aPos.setX( aPos.X() - (aSize.Width() >> 1) ); - aPos.setY( aPos.Y() - (aSize.Height() >> 1) ); + aPos.AdjustX( -(aSize.Width() >> 1) ); + aPos.AdjustY( -(aSize.Height() >> 1) ); } mpView->InsertMediaURL( aURL, nAction, aPos, aSize, bLink ) ; diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index b3f3d4ec158f..0cd20acf99c8 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -523,8 +523,8 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) // put it at the center of the window Size aTemp(mpWindow->GetOutputSizePixel()); Point aPos(aTemp.Width() / 2, aTemp.Height() / 2); - aPos.setX( aPos.X() - aSize.Width() / 2 ); - aPos.setY( aPos.Y() - aSize.Height() / 2 ); + aPos.AdjustX( -(aSize.Width() / 2) ); + aPos.AdjustY( -(aSize.Height() / 2) ); aSize = mpWindow->PixelToLogic(aSize); aPos = mpWindow->PixelToLogic(aPos); pTO->SetLogicRect(::tools::Rectangle(aPos, aSize)); diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 29e578c7ffa2..3746ebacb4d6 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -1220,10 +1220,10 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) Point aHitPosT(rPos); Point aHitPosB(rPos); - aHitPosR.setX( aHitPosR.X() + n2HitLog ); - aHitPosL.setX( aHitPosL.X() - n2HitLog ); - aHitPosT.setY( aHitPosT.Y() + n2HitLog ); - aHitPosB.setY( aHitPosB.Y() - n2HitLog ); + aHitPosR.AdjustX(n2HitLog ); + aHitPosL.AdjustX( -n2HitLog ); + aHitPosT.Y() += n2HitLog; + aHitPosB.AdjustY( -n2HitLog ); if ( !bClosed || !bFilled || diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 9108f5709c2a..2711d8a383c5 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -784,8 +784,8 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) if (bSnapEnabled) mpView->SetSnapEnabled(false); - aPnt.setX( aPnt.X() + nDrgLog + nDrgLog ); - aPnt.setY( aPnt.Y() + nDrgLog + nDrgLog ); + aPnt.AdjustX(nDrgLog + nDrgLog ); + aPnt.AdjustY(nDrgLog + nDrgLog ); mpView->MovAction(aPnt); mxTextObj.reset( dynamic_cast< SdrTextObj* >( mpView->GetCreateObj() ) ); diff --git a/sd/source/ui/func/fuzoom.cxx b/sd/source/ui/func/fuzoom.cxx index b059d2e2dba5..a6d5011e1923 100644 --- a/sd/source/ui/func/fuzoom.cxx +++ b/sd/source/ui/func/fuzoom.cxx @@ -117,8 +117,8 @@ bool FuZoom::MouseMove(const MouseEvent& rMEvt) { Size aWorkSize = mpView->GetWorkArea().GetSize(); Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize(); - aScroll.setX( aScroll.X() / aWorkSize.Width() / aPageSize.Width() ); - aScroll.setY( aScroll.Y() / aWorkSize.Height() / aPageSize.Height() ); + aScroll.setX( aScroll.X() / ( aWorkSize.Width() / aPageSize.Width()) ); + aScroll.Y() /= aWorkSize.Height() / aPageSize.Height(); mpViewShell->Scroll(aScroll.X(), aScroll.Y()); aBeginPosPix = aPosPix; } @@ -164,15 +164,15 @@ bool FuZoom::MouseButtonUp(const MouseEvent& rMEvt) if ( rMEvt.IsMod1() ) { aSize.setWidth( aSize.Width() * 2 ); - aSize.setHeight( aSize.Height() * 2 ); + aSize.Height() *= 2; } else { aSize.setWidth( aSize.Width() / 2 ); - aSize.setHeight( aSize.Height() / 2 ); + aSize.Height() /= 2; } - aPos.setX( aPos.X() - aSize.Width() / 2 ); - aPos.setY( aPos.Y() - aSize.Height() / 2 ); + aPos.AdjustX( -(aSize.Width() / 2) ); + aPos.AdjustY( -(aSize.Height() / 2) ); aZoomRect.SetPos(aPos); aZoomRect.SetSize(aSize); } diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx index 23cbdbf1624a..935f34d7be00 100644 --- a/sd/source/ui/sidebar/LayoutMenu.cxx +++ b/sd/source/ui/sidebar/LayoutMenu.cxx @@ -238,8 +238,8 @@ ui::LayoutSize LayoutMenu::GetHeightForWidth (const sal_Int32 nWidth) Size aItemSize = CalcItemSizePixel (aImage.GetSizePixel()); if (nWidth>0 && aItemSize.Width()>0) { - aItemSize.setWidth( aItemSize.Width() + 8 ); - aItemSize.setHeight( aItemSize.Height() + 8 ); + aItemSize.AdjustWidth(8 ); + aItemSize.AdjustHeight(8 ); int nColumnCount = nWidth / aItemSize.Width(); if (nColumnCount <= 0) nColumnCount = 1; @@ -263,8 +263,8 @@ void LayoutMenu::Resize() Image aImage = GetItemImage(GetItemId(0)); Size aItemSize = CalcItemSizePixel ( aImage.GetSizePixel()); - aItemSize.setWidth( aItemSize.Width() + 8 ); - aItemSize.setHeight( aItemSize.Height() + 8 ); + aItemSize.AdjustWidth(8 ); + aItemSize.AdjustHeight(8 ); int nColumnCount = aWindowSize.Width() / aItemSize.Width(); if (nColumnCount < 1) nColumnCount = 1; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 790e157c0ad7..d55b9adb66a1 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -786,7 +786,7 @@ bool SlideshowImpl::startPreview( if (AllSettings::GetLayoutRTL()) { aContentRect.SetLeft( aContentRect.Right() ); - aContentRect.SetRight( aContentRect.Right() + aContentRect.Right() ); + aContentRect.AdjustRight(aContentRect.Right() ); } maPresSize = aContentRect.GetSize(); mpShowWindow->SetPosPixel( aContentRect.TopLeft() ); diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index 2cf4a60e4c4a..236035c1f73d 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -354,8 +354,8 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation( ) // Reduce available width by one, as the slides might actually // render one pixel wider and higher as aPageSize below specifies // (when shapes of page size have visible border lines) - aOutputSize.setWidth( --aOutputSize.Width() ); - aOutputSize.setHeight( --aOutputSize.Height() ); + aOutputSize.AdjustWidth( -1 ); + aOutputSize.Height() --; // Record mTranslationOffset mTranslationOffset.Height = aOutputOffset.Y(); diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx index 377b0932438c..31be00214317 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapFactory.cxx @@ -57,7 +57,7 @@ Bitmap BitmapFactory::CreateBitmap ( // Supersampling factor int aSuperSamplingFactor = 2; aSize.setWidth( aSize.Width() * aSuperSamplingFactor ); - aSize.setHeight( aSize.Height() * aSuperSamplingFactor ); + aSize.Height() *= aSuperSamplingFactor; } Bitmap aPreview (maRenderer.RenderPage ( diff --git a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx index 57cfef617d8f..a91e18f0fbd2 100644 --- a/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsScrollBarManager.cxx @@ -337,9 +337,9 @@ void ScrollBarManager::SetWindowOrigin ( // Adapt the remaining space accordingly. ::tools::Rectangle aRemainingSpace (rAvailableArea); if (bShowVertical) - aRemainingSpace.SetRight( aRemainingSpace.Right() - mpVerticalScrollBar->GetSizePixel().Width() ); + aRemainingSpace.AdjustRight( -(mpVerticalScrollBar->GetSizePixel().Width()) ); if (bShowHorizontal) - aRemainingSpace.SetBottom( aRemainingSpace.Bottom() - mpHorizontalScrollBar->GetSizePixel().Height() ); + aRemainingSpace.AdjustBottom( -(mpHorizontalScrollBar->GetSizePixel().Height()) ); return aRemainingSpace; } @@ -355,9 +355,9 @@ bool ScrollBarManager::TestScrollBarVisibilities ( // visible in this combination. Size aBrowserSize (rAvailableArea.GetSize()); if (bHorizontalScrollBarVisible) - aBrowserSize.setHeight( aBrowserSize.Height() - mpHorizontalScrollBar->GetSizePixel().Height() ); + aBrowserSize.AdjustHeight( -(mpHorizontalScrollBar->GetSizePixel().Height()) ); if (bVerticalScrollBarVisible) - aBrowserSize.setWidth( aBrowserSize.Width() - mpVerticalScrollBar->GetSizePixel().Width() ); + aBrowserSize.AdjustWidth( -(mpVerticalScrollBar->GetSizePixel().Width()) ); // Tell the view to rearrange its page objects and check whether the // page objects can be shown without clipping. @@ -560,9 +560,9 @@ void ScrollBarManager::Scroll( // Calculate estimate of new location. if (bIsVertical) - aNewTopLeft.setY( aNewTopLeft.Y() + nDistance * rLayouter.GetPageObjectSize().Height() ); + aNewTopLeft.AdjustY(nDistance * rLayouter.GetPageObjectSize().Height() ); else - aNewTopLeft.setX( aNewTopLeft.X() + nDistance * rLayouter.GetPageObjectSize().Width() ); + aNewTopLeft.AdjustX(nDistance * rLayouter.GetPageObjectSize().Width() ); // Adapt location to show whole slides. if (bIsVertical) diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 6db47041e20b..abbeea3919b7 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -585,8 +585,8 @@ void SlideSorterViewShell::SetZoomRect (const ::tools::Rectangle& rZoomRect) { long nWidthDiff = (aPageSize.Width() - aRect.GetWidth()) / 2; - aRect.SetLeft( aRect.Left() - nWidthDiff ); - aRect.SetRight( aRect.Right() + nWidthDiff ); + aRect.AdjustLeft( -nWidthDiff ); + aRect.AdjustRight(nWidthDiff ); if (aRect.Left() < 0) { @@ -598,8 +598,8 @@ void SlideSorterViewShell::SetZoomRect (const ::tools::Rectangle& rZoomRect) { long nHeightDiff = (aPageSize.Height() - aRect.GetHeight()) / 2; - aRect.SetTop( aRect.Top() - nHeightDiff ); - aRect.SetBottom( aRect.Bottom() + nHeightDiff ); + aRect.AdjustTop( -nHeightDiff ); + aRect.AdjustBottom(nHeightDiff ); if (aRect.Top() < 0) { diff --git a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx index 5fae78af3854..e93e9d101b0f 100644 --- a/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay.cxx @@ -179,8 +179,8 @@ Point InsertionIndicatorOverlay::PaintRepresentatives ( break; } aPageOffset += aOffset; - aPageOffset.setX( aPageOffset.X() + gnShadowBorder ); - aPageOffset.setY( aPageOffset.Y() + gnShadowBorder ); + aPageOffset.AdjustX(gnShadowBorder ); + aPageOffset.AdjustY(gnShadowBorder ); // Paint the preview. Bitmap aPreview (rRepresentatives[nIndex].maBitmap); diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx index 3e0199d2db73..d746f0f10bf4 100644 --- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx @@ -929,19 +929,19 @@ sal_Int32 Layouter::Implementation::GetIndex ( if (nColumn == 0) aBoundingBox.SetLeft( 0 ); else - aBoundingBox.SetLeft( aBoundingBox.Left() - mnHorizontalGap/2 ); + aBoundingBox.AdjustLeft( -(mnHorizontalGap/2) ); if (nColumn == mnColumnCount-1) - aBoundingBox.SetRight( aBoundingBox.Right() + mnRightBorder ); + aBoundingBox.AdjustRight(mnRightBorder ); else - aBoundingBox.SetRight( aBoundingBox.Right() + mnHorizontalGap/2 ); + aBoundingBox.AdjustRight(mnHorizontalGap/2 ); if (nRow == 0) aBoundingBox.SetTop( 0 ); else - aBoundingBox.SetTop( aBoundingBox.Top() - mnVerticalGap/2 ); + aBoundingBox.AdjustTop( -(mnVerticalGap/2) ); if (nRow == mnRowCount-1) - aBoundingBox.SetBottom( aBoundingBox.Bottom() + mnBottomBorder ); + aBoundingBox.AdjustBottom(mnBottomBorder ); else - aBoundingBox.SetBottom( aBoundingBox.Bottom() + mnVerticalGap/2 ); + aBoundingBox.AdjustBottom(mnVerticalGap/2 ); return aBoundingBox; } diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index f5f411906fb7..9b29cb0531be 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -312,7 +312,7 @@ void TableValueSet::Resize() Image aImage = GetItemImage(GetItemId(0)); Size aItemSize = aImage.GetSizePixel(); - aItemSize.setHeight( aItemSize.Height() + 10 ); + aItemSize.AdjustHeight(10 ); int nColumnCount = (aValueSetSize.Width() - GetScrollWidth()) / aItemSize.Width(); if (nColumnCount < 1) nColumnCount = 1; @@ -761,8 +761,8 @@ void TableDesignWidget::FillDesignPreviewControl() WinBits nStyle = m_pValueSet->GetStyle() & ~WB_VSCROLL; m_pValueSet->SetStyle(nStyle); Size aSize(m_pValueSet->GetOptimalSize()); - aSize.setWidth( aSize.Width() + (10 * nCols) ); - aSize.setHeight( aSize.Height() + (10 * nRows) ); + aSize.AdjustWidth(10 * nCols); + aSize.AdjustHeight(10 * nRows); m_pValueSet->set_width_request(aSize.Width()); m_pValueSet->set_height_request(aSize.Height()); m_pValueSet->Resize(); diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx index 1ae40890b3f2..5b737f1d764a 100644 --- a/sd/source/ui/table/tablefunction.cxx +++ b/sd/source/ui/table/tablefunction.cxx @@ -181,8 +181,8 @@ void DrawViewShell::FuTable(SfxRequest& rReq) } aPos = aWinRect.Center(); - aPos.setX( aPos.X() - aSize.Width() / 2 ); - aPos.setY( aPos.Y() - aSize.Height() / 2 ); + aPos.AdjustX( -(aSize.Width() / 2) ); + aPos.AdjustY( -(aSize.Height() / 2) ); aRect = ::tools::Rectangle(aPos, aSize); } diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index b9f8ba53244a..8572f566b739 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1939,8 +1939,8 @@ private: && aPageWidth > aPageHeight ) ) { const sal_Int32 nTmp (rInfo.maPrintSize.Width()); - rInfo.maPrintSize.setWidth( rInfo.maPrintSize.Height() ); - rInfo.maPrintSize.setHeight( nTmp ); + rInfo.maPrintSize.Width() = rInfo.maPrintSize.Height(); + rInfo.maPrintSize.Height() = nTmp; } if (mpOptions->IsTilePage() @@ -1979,13 +1979,13 @@ private: if( fPageWH < fPrintWH ) { - aPageSize_2.setWidth( static_cast<long>( aPrintSize_2.Height() * fPageWH ) ); - aPageSize_2.setHeight( aPrintSize_2.Height() ); + aPageSize_2.Width() = static_cast<long>( aPrintSize_2.Height() * fPageWH ); + aPageSize_2.Height()= aPrintSize_2.Height(); } else { - aPageSize_2.setWidth( aPrintSize_2.Width() ); - aPageSize_2.setHeight( static_cast<long>( aPrintSize_2.Width() / fPageWH ) ); + aPageSize_2.Width() = aPrintSize_2.Width(); + aPageSize_2.Height() = static_cast<long>( aPrintSize_2.Width() / fPageWH ); } MapMode aMap (rInfo.maMap); @@ -2000,13 +2000,13 @@ private: if (rInfo.meOrientation == Orientation::Landscape) { - aOffset.setX( ( ( aAdjustedPrintSize.Width() >> 1 ) - rInfo.maPageSize.Width() ) >> 1 ); - aOffset.setY( ( aAdjustedPrintSize.Height() - rInfo.maPageSize.Height() ) >> 1 ); + aOffset.X() = ( ( aAdjustedPrintSize.Width() >> 1 ) - rInfo.maPageSize.Width() ) >> 1; + aOffset.Y() = ( aAdjustedPrintSize.Height() - rInfo.maPageSize.Height() ) >> 1; } else { - aOffset.setX( ( aAdjustedPrintSize.Width() - rInfo.maPageSize.Width() ) >> 1 ); - aOffset.setY( ( ( aAdjustedPrintSize.Height() >> 1 ) - rInfo.maPageSize.Height() ) >> 1 ); + aOffset.X() = ( aAdjustedPrintSize.Width() - rInfo.maPageSize.Width() ) >> 1; + aOffset.Y() = ( ( aAdjustedPrintSize.Height() >> 1 ) - rInfo.maPageSize.Height() ) >> 1; } // create vector of pages to print @@ -2059,9 +2059,9 @@ private: const std::pair<sal_uInt16, sal_uInt16> aPair (aPairVector[nIndex]); Point aSecondOffset (aOffset); if (rInfo.meOrientation == Orientation::Landscape) - aSecondOffset.setX( aSecondOffset.X() + aAdjustedPrintSize.Width() / 2 ); + aSecondOffset.X() += aAdjustedPrintSize.Width() / 2; else - aSecondOffset.setY( aSecondOffset.Y() + aAdjustedPrintSize.Height() / 2 ); + aSecondOffset.Y() += aAdjustedPrintSize.Height() / 2; maPrinterPages.push_back( std::shared_ptr<PrinterPage>( new BookletPrinterPage( @@ -2171,11 +2171,11 @@ private: for (Point aPageOrigin = aOrigin; -aPageOrigin.Y()<nPageHeight; - aPageOrigin.setY( aPageOrigin.Y() - rInfo.maPrintSize.Height() )) + aPageOrigin.Y() -= rInfo.maPrintSize.Height()) { - for (aPageOrigin.setX(aOrigin.X() ); + for (aPageOrigin.X()=aOrigin.X(); -aPageOrigin.X()<nPageWidth; - aPageOrigin.setX( aPageOrigin.X() - rInfo.maPrintSize.Width() )) + aPageOrigin.X() -= rInfo.maPrintSize.Width()) { aMap.SetOrigin(aPageOrigin); maPrinterPages.push_back( diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 12ac6a0d72e8..e43556891e61 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -477,8 +477,8 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize, b { SvBorder aBorder( GetBorderPixel() ); Size aSize( rSize ); - aSize.setWidth( aSize.Width() - (aBorder.Left() + aBorder.Right()) ); - aSize.setHeight( aSize.Height() - (aBorder.Top() + aBorder.Bottom()) ); + aSize.AdjustWidth( -(aBorder.Left() + aBorder.Right()) ); + aSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) ); Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel(aObjSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), static_cast<long int>(1) ) ), diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index deebe476ed38..256dcf0a32ee 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -603,7 +603,7 @@ IMPL_LINK( DrawViewShell, TabSplitHdl, TabBar *, pTab, void ) } Point aPos = maTabControl->GetPosPixel(); - aPos.setX( aPos.X() + aTabSize.Width() ); + aPos.AdjustX(aTabSize.Width() ); Size aScrSize(nMax - aTabSize.Width(), maScrBarWH.Height()); mpHorizontalScrollBar->SetPosSizePixel(aPos, aScrSize); diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index f811bca1d51f..de6c08948bd3 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -529,8 +529,8 @@ public: ::tools::Rectangle aRectangle(Point(), pMasterPage->GetSize()); Point aPosition(aRectangle.Center().X(), aRectangle.Bottom()); - aPosition.setX( aPosition.X() - aTextSize.Width() / 2 ); - aPosition.setY( aPosition.Y() - aTextSize.Height() ); + aPosition.AdjustX( -(aTextSize.Width() / 2) ); + aPosition.AdjustY( -(aTextSize.Height()) ); pObject->SetLogicRect(::tools::Rectangle(aPosition, aTextSize)); } @@ -2338,8 +2338,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) ::tools::Rectangle aRect( aPos, GetActiveWindow()->GetOutputSizePixel() ); aPos = aRect.Center(); aPos = GetActiveWindow()->PixelToLogic(aPos); - aPos.setX( aPos.X() - aSize.Width() / 2 ); - aPos.setY( aPos.Y() - aSize.Height() / 2 ); + aPos.AdjustX( -(aSize.Width() / 2) ); + aPos.AdjustY( -(aSize.Height() / 2) ); ::tools::Rectangle aLogicRect(aPos, aSize); pRectObj->SetLogicRect(aLogicRect); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index d7723952ffbb..2615d8b7505e 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -926,7 +926,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) { const SdrMetricItem& rTLDItem = aEditAttr.Get( SDRATTR_TEXT_LEFTDIST ); long nLD = rTLDItem.GetValue(); - aPos.setX( aPos.X() + nLD ); + aPos.AdjustX(nLD ); } aPointItem.SetValue( aPos ); diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 4bdb4c509c82..06a1c9ae8ec6 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -108,7 +108,7 @@ void DrawViewShell::ArrangeGUIElements() maScrBarWH = Size (nScrollBarSize, nScrollBarSize); Point aHPos = maViewPos; - aHPos.setY( aHPos.Y() + maViewSize.Height() ); + aHPos.AdjustY(maViewSize.Height() ); ViewShell::ArrangeGUIElements (); diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 7268e327ed0f..01472424b848 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -74,8 +74,8 @@ void DrawViewShell::ScannerEvent() else aBmpSize = OutputDevice::LogicToLogic( aBmpSize, aScanBmp.GetPrefMapMode(), aMap100 ); - aPageSize.setWidth( aPageSize.Width() - pPage->GetLeftBorder() + pPage->GetRightBorder() ); - aPageSize.setHeight( aPageSize.Height() - pPage->GetUpperBorder() + pPage->GetLowerBorder() ); + aPageSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) ); + aPageSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) ); if( ( ( aBmpSize.Height() > aPageSize.Height() ) || ( aBmpSize.Width() > aPageSize.Width() ) ) && aBmpSize.Height() && aPageSize.Height() ) { diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx index 0ee31d473f4d..d2ea8c5565fd 100644 --- a/sd/source/ui/view/drviews9.cxx +++ b/sd/source/ui/view/drviews9.cxx @@ -97,8 +97,8 @@ void DrawViewShell::ExecGallery(SfxRequest const & rReq) // constrain size to page size if necessary SdrPage* pPage = mpDrawView->GetSdrPageView()->GetPage(); Size aPageSize = pPage->GetSize(); - aPageSize.setWidth( aPageSize.Width() - pPage->GetLeftBorder() + pPage->GetRightBorder() ); - aPageSize.setHeight( aPageSize.Height() - pPage->GetUpperBorder() + pPage->GetLowerBorder() ); + aPageSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) ); + aPageSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) ); // If the image is too large we make it fit into the page if ( ( ( aSize.Height() > aPageSize.Height() ) || ( aSize.Width() > aPageSize.Width() ) ) && diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index a4c7860f5177..d92d1b9eb0fe 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -574,14 +574,14 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) Point aPagePos(0, 0); Size aPageSize = pPageView->GetPage()->GetSize(); - aPagePos.setX( aPagePos.X() + aPageSize.Width() / 2 ); + aPagePos.AdjustX(aPageSize.Width() / 2 ); aPageSize.setWidth( static_cast<long>(aPageSize.Width() * 1.03) ); - aPagePos.setY( aPagePos.Y() + aPageSize.Height() / 2 ); + aPagePos.AdjustY(aPageSize.Height() / 2 ); aPageSize.setHeight( static_cast<long>(aPageSize.Height() * 1.03) ); - aPagePos.setY( aPagePos.Y() - aPageSize.Height() / 2 ); + aPagePos.AdjustY( -(aPageSize.Height() / 2) ); - aPagePos.setX( aPagePos.X() - aPageSize.Width() / 2 ); + aPagePos.AdjustX( -(aPageSize.Width() / 2) ); ::tools::Rectangle aFullPageZoomRect( aPagePos, aPageSize ); aZoomItem.AddSnappingPoint( pActiveWindow->GetZoomForRect( aFullPageZoomRect ) ); diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 2b343f7115ee..becb587d9e33 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -280,8 +280,8 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) ::tools::Rectangle aVisArea = GetActiveWindow()->PixelToLogic(::tools::Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel())); Point aObjPos(aVisArea.Center()); Size aObjSize(pNewDBField->GetLogicRect().GetSize()); - aObjPos.setX( aObjPos.X() - aObjSize.Width() / 2 ); - aObjPos.setY( aObjPos.Y() - aObjSize.Height() / 2 ); + aObjPos.AdjustX( -(aObjSize.Width() / 2) ); + aObjPos.AdjustY( -(aObjSize.Height() / 2) ); ::tools::Rectangle aNewObjectRectangle(aObjPos, aObjSize); pNewDBField->SetLogicRect(aNewObjectRectangle); @@ -592,8 +592,8 @@ void DrawViewShell::FuPermanent(SfxRequest& rReq) // calc position and size ::tools::Rectangle aVisArea = GetActiveWindow()->PixelToLogic(::tools::Rectangle(Point(0,0), GetActiveWindow()->GetOutputSizePixel())); Point aPagePos = aVisArea.Center(); - aPagePos.setX( aPagePos.X() - nDefaultObjectSizeWidth / 2 ); - aPagePos.setY( aPagePos.Y() - nDefaultObjectSizeHeight / 2 ); + aPagePos.AdjustX( -sal_Int32(nDefaultObjectSizeWidth / 2) ); + aPagePos.AdjustY( -sal_Int32(nDefaultObjectSizeHeight / 2) ); ::tools::Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight)); SdrPageView* pPageView = mpDrawView->GetSdrPageView(); @@ -1089,23 +1089,23 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) Point aPagePos(0, 0); // = pPageView->GetOffset(); Size aPageSize = pPageView->GetPage()->GetSize(); - aPagePos.setX( aPagePos.X() + aPageSize.Width() / 2 ); + aPagePos.AdjustX(aPageSize.Width() / 2 ); aPageSize.setWidth( static_cast<long>(aPageSize.Width() * 1.03) ); if( rReq.GetSlot() == SID_SIZE_PAGE ) { - aPagePos.setY( aPagePos.Y() + aPageSize.Height() / 2 ); + aPagePos.AdjustY(aPageSize.Height() / 2 ); aPageSize.setHeight( static_cast<long>(aPageSize.Height() * 1.03) ); - aPagePos.setY( aPagePos.Y() - aPageSize.Height() / 2 ); + aPagePos.AdjustY( -(aPageSize.Height() / 2) ); } else { Point aPt = GetActiveWindow()->PixelToLogic( Point( 0, GetActiveWindow()->GetSizePixel().Height() / 2 ) ); - aPagePos.setY( aPagePos.Y() + aPt.Y() ); + aPagePos.AdjustY(aPt.Y() ); aPageSize.setHeight( 2 ); } - aPagePos.setX( aPagePos.X() - aPageSize.Width() / 2 ); + aPagePos.AdjustX( -(aPageSize.Width() / 2) ); SetZoomRect( ::tools::Rectangle( aPagePos, aPageSize ) ); @@ -1189,8 +1189,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) long nW = static_cast<long>(maMarkRect.GetWidth() * 1.03); long nH = static_cast<long>(maMarkRect.GetHeight() * 1.03); Point aPos = maMarkRect.Center(); - aPos.setX( aPos.X() - nW / 2 ); - aPos.setY( aPos.Y() - nH / 2 ); + aPos.AdjustX( -(nW / 2) ); + aPos.AdjustY( -(nH / 2) ); if ( nW && nH ) { SetZoomRect(::tools::Rectangle(aPos, Size(nW, nH))); @@ -1221,8 +1221,8 @@ void DrawViewShell::FuSupport(SfxRequest& rReq) long nW = static_cast<long>(aBoundRect.GetWidth() * 1.03); long nH = static_cast<long>(aBoundRect.GetHeight() * 1.03); Point aPos = aBoundRect.Center(); - aPos.setX( aPos.X() - nW / 2 ); - aPos.setY( aPos.Y() - nH / 2 ); + aPos.AdjustX( -(nW / 2) ); + aPos.AdjustY( -(nH / 2) ); if ( nW && nH ) { SetZoomRect( ::tools::Rectangle( aPos, Size( nW, nH ) ) ); @@ -1458,8 +1458,8 @@ void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText, ::tools::Rectangle aRect(aPos, GetActiveWindow()->GetOutputSizePixel() ); aPos = aRect.Center(); aPos = GetActiveWindow()->PixelToLogic(aPos); - aPos.setX( aPos.X() - aSize.Width() / 2 ); - aPos.setY( aPos.Y() - aSize.Height() / 2 ); + aPos.AdjustX( -(aSize.Width() / 2) ); + aPos.AdjustY( -(aSize.Height() / 2) ); ::tools::Rectangle aLogicRect(aPos, aSize); pRectObj->SetLogicRect(aLogicRect); @@ -1554,8 +1554,8 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText, } Size aSize(4000, 1000); - aPos.setX( aPos.X() - aSize.Width() / 2 ); - aPos.setY( aPos.Y() - aSize.Height() / 2 ); + aPos.AdjustX( -(aSize.Width() / 2) ); + aPos.AdjustY( -(aSize.Height() / 2) ); pUnoCtrl->SetLogicRect(::tools::Rectangle(aPos, aSize)); SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; diff --git a/sd/source/ui/view/drviewsh.cxx b/sd/source/ui/view/drviewsh.cxx index c5102503f3cd..b7502b16a193 100644 --- a/sd/source/ui/view/drviewsh.cxx +++ b/sd/source/ui/view/drviewsh.cxx @@ -113,13 +113,13 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW if(aInnerRectangle.Left() > rRect.Right()) { // object moves out to the left - aNewPos.setX( aNewPos.X() - aVisAreaSize.Width() / 2 ); + aNewPos.AdjustX( -(aVisAreaSize.Width() / 2) ); } if(aInnerRectangle.Right() < rRect.Left()) { // object moves out to the right - aNewPos.setX( aNewPos.X() + aVisAreaSize.Width() / 2 ); + aNewPos.AdjustX(aVisAreaSize.Width() / 2 ); } } else @@ -140,7 +140,7 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW if(distRight > 0) { long mult = (distRight / nFreeSpaceX) + 1; - aNewPos.setX( aNewPos.X() + mult * nFreeSpaceX ); + aNewPos.AdjustX(mult * nFreeSpaceX ); } const long distLeft(aNewPos.X() - rRect.Left()); @@ -148,7 +148,7 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW if(distLeft > 0) { long mult = (distLeft / nFreeSpaceX) + 1; - aNewPos.setX( aNewPos.X() - mult * nFreeSpaceX ); + aNewPos.AdjustX( -(mult * nFreeSpaceX) ); } } } @@ -158,13 +158,13 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW if(aInnerRectangle.Top() > rRect.Bottom()) { // object moves out to the top - aNewPos.setY( aNewPos.Y() - aVisAreaSize.Height() / 2 ); + aNewPos.AdjustY( -(aVisAreaSize.Height() / 2) ); } if(aInnerRectangle.Bottom() < rRect.Top()) { // object moves out to the right - aNewPos.setY( aNewPos.Y() + aVisAreaSize.Height() / 2 ); + aNewPos.AdjustY(aVisAreaSize.Height() / 2 ); } } else @@ -185,7 +185,7 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW if(distBottom > 0) { long mult = (distBottom / nFreeSpaceY) + 1; - aNewPos.setY( aNewPos.Y() + mult * nFreeSpaceY ); + aNewPos.AdjustY(mult * nFreeSpaceY ); } const long distTop(aNewPos.Y() - rRect.Top()); @@ -193,7 +193,7 @@ void DrawViewShell::MakeVisible(const ::tools::Rectangle& rRect, vcl::Window& rW if(distTop > 0) { long mult = (distTop / nFreeSpaceY) + 1; - aNewPos.setY( aNewPos.Y() - mult * nFreeSpaceY ); + aNewPos.AdjustY( -(mult * nFreeSpaceY) ); } } } diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 8b44b983c101..decd3e3b935a 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -657,7 +657,7 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr if( pValue->Value >>= nTop ) { ::tools::Rectangle aVisArea( GetVisArea() ); - aVisArea.SetBottom( aVisArea.Bottom() + nTop - aVisArea.Top() ); + aVisArea.AdjustBottom(nTop - aVisArea.Top() ); aVisArea.SetTop( nTop ); SetVisArea( aVisArea ); } @@ -668,7 +668,7 @@ void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::Pr if( pValue->Value >>= nLeft ) { ::tools::Rectangle aVisArea( GetVisArea() ); - aVisArea.SetRight( aVisArea.Right() + nLeft - aVisArea.Left() ); + aVisArea.AdjustRight(nLeft - aVisArea.Left() ); aVisArea.SetLeft( nLeft ); SetVisArea( aVisArea ); } diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index a99844def58e..48ce3459d989 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -1633,8 +1633,8 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) aImageSize.setHeight( static_cast<long>(fImageHeight) ); Point aImagePos( pInfo->mrStartPos ); - aImagePos.setX( aImagePos.X() + aOutSize.Width() - aImageSize.Width() - aOffset.Width() ) ; - aImagePos.setY( aImagePos.Y() + (aOutSize.Height() - aImageSize.Height()) / 2 ); + aImagePos.AdjustX(aOutSize.Width() - aImageSize.Width() - aOffset.Width() ) ; + aImagePos.AdjustY((aOutSize.Height() - aImageSize.Height()) / 2 ); pInfo->mpOutDev->DrawImage( aImagePos, aImageSize, maSlideImage ); @@ -1656,20 +1656,20 @@ IMPL_LINK(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, void) aTextSz.setHeight( pInfo->mpOutDev->GetTextHeight() ); if ( !bVertical ) { - aTextPos.setY( aTextPos.Y() + (aOutSize.Height() - aTextSz.Height()) / 2 ); + aTextPos.AdjustY((aOutSize.Height() - aTextSz.Height()) / 2 ); if ( !bRightToLeftPara ) { - aTextPos.setX( aTextPos.X() - aTextSz.Width() ); + aTextPos.AdjustX( -(aTextSz.Width()) ); } else { - aTextPos.setX( aTextPos.X() + aTextSz.Width() ); + aTextPos.AdjustX(aTextSz.Width() ); } } else { - aTextPos.setY( aTextPos.Y() - aTextSz.Width() ); - aTextPos.setX( aTextPos.X() + nBulletHeight / 2 ); + aTextPos.AdjustY( -(aTextSz.Width()) ); + aTextPos.AdjustX(nBulletHeight / 2 ); } pInfo->mpOutDev->DrawText( aTextPos, aPageText ); } diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 3297d81d01db..c0f5f5e19413 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -124,22 +124,22 @@ void ImpCheckInsertPos(Point& rPos, const Size& rSize, const ::tools::Rectangle& { if(aMarkRect.Left() < rWorkArea.Left()) { - rPos.setX( rPos.X() + rWorkArea.Left() - aMarkRect.Left() ); + rPos.AdjustX(rWorkArea.Left() - aMarkRect.Left() ); } if(aMarkRect.Right() > rWorkArea.Right()) { - rPos.setX( rPos.X() - aMarkRect.Right() - rWorkArea.Right() ); + rPos.AdjustX( -(aMarkRect.Right() - rWorkArea.Right()) ); } if(aMarkRect.Top() < rWorkArea.Top()) { - rPos.setY( rPos.Y() + rWorkArea.Top() - aMarkRect.Top() ); + rPos.AdjustY(rWorkArea.Top() - aMarkRect.Top() ); } if(aMarkRect.Bottom() > rWorkArea.Bottom()) { - rPos.setY( rPos.Y() - aMarkRect.Bottom() - rWorkArea.Bottom() ); + rPos.AdjustY( -(aMarkRect.Bottom() - rWorkArea.Bottom()) ); } } } @@ -545,8 +545,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { const SdrGluePoint& rGluePoint = (*pGlueList)[nInd]; Point aPosition = rGluePoint.GetAbsolutePos(*pConnObj); - aPosition.setX( aPosition.X() + aVector.Width() ); - aPosition.setY( aPosition.Y() + aVector.Height() ); + aPosition.AdjustX(aVector.Width() ); + aPosition.AdjustY(aVector.Height() ); pCloneEdge->SetTailPoint(false, aPosition); } } @@ -577,8 +577,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { const SdrGluePoint& rGluePoint = (*pGlueList)[nInd]; Point aPosition = rGluePoint.GetAbsolutePos(*pConnObj); - aPosition.setX( aPosition.X() + aVector.Width() ); - aPosition.setY( aPosition.Y() + aVector.Height() ); + aPosition.AdjustX(aVector.Width() ); + aPosition.AdjustY(aVector.Height() ); pCloneEdge->SetTailPoint(true, aPosition); } } @@ -844,8 +844,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, ::tools::Rectangle aRect( pObj->GetLogicRect() ); Size aSize( aRect.GetSize() ); - maDropPos.setX( maDropPos.X() - ( aSize.Width() >> 1 ) ); - maDropPos.setY( maDropPos.Y() - ( aSize.Height() >> 1 ) ); + maDropPos.AdjustX( -( aSize.Width() >> 1 ) ); + maDropPos.AdjustY( -( aSize.Height() >> 1 ) ); aRect.SetPos( maDropPos ); pObj->SetLogicRect( aRect ); @@ -991,8 +991,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Size aMaxSize( mrDoc.GetMaxObjSize() ); - maDropPos.setX( maDropPos.X() - (std::min( aSize.Width(), aMaxSize.Width() ) >> 1) ); - maDropPos.setY( maDropPos.Y() - (std::min( aSize.Height(), aMaxSize.Height() ) >> 1) ); + maDropPos.AdjustX( -(std::min( aSize.Width(), aMaxSize.Width() ) >> 1) ); + maDropPos.AdjustY( -(std::min( aSize.Height(), aMaxSize.Height() ) >> 1) ); ::tools::Rectangle aRect( maDropPos, aSize ); SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect ); @@ -1161,8 +1161,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Size aMaxSize( mrDoc.GetMaxObjSize() ); - maDropPos.setX( maDropPos.X() - (std::min( aSize.Width(), aMaxSize.Width() ) >> 1) ); - maDropPos.setY( maDropPos.Y() - (std::min( aSize.Height(), aMaxSize.Height() ) >> 1) ); + maDropPos.AdjustX( -(std::min( aSize.Width(), aMaxSize.Width() ) >> 1) ); + maDropPos.AdjustY( -(std::min( aSize.Height(), aMaxSize.Height() ) >> 1) ); ::tools::Rectangle aRect( maDropPos, aSize ); SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect ); @@ -1353,10 +1353,10 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, Point aHitPosB( rPos ); const SdrLayerIDSet* pVisiLayer = &GetSdrPageView()->GetVisibleLayers(); - aHitPosR.setX( aHitPosR.X() + n2HitLog ); - aHitPosL.setX( aHitPosL.X() - n2HitLog ); - aHitPosT.setY( aHitPosT.Y() + n2HitLog ); - aHitPosB.setY( aHitPosB.Y() - n2HitLog ); + aHitPosR.AdjustX(n2HitLog ); + aHitPosL.AdjustX( -n2HitLog ); + aHitPosT.AdjustY(n2HitLog ); + aHitPosB.AdjustY( -n2HitLog ); if( bClosed && SdrObjectPrimitiveHit(*pPickObj, aHitPosR, nHitLog, *GetSdrPageView(), pVisiLayer, false) && diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index de973ae8e82d..37366b5bf9cb 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -193,8 +193,8 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, pNewGrafObj = new SdrGrafObj( rGraphic, ::tools::Rectangle( rPos, aSize ) ); SdrPage* pPage = pPV->GetPage(); Size aPageSize( pPage->GetSize() ); - aPageSize.setWidth( aPageSize.Width() - pPage->GetLeftBorder() + pPage->GetRightBorder() ); - aPageSize.setHeight( aPageSize.Height() - pPage->GetUpperBorder() + pPage->GetLowerBorder() ); + aPageSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) ); + aPageSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) ); pNewGrafObj->AdjustToMaxRect( ::tools::Rectangle( Point(), aPageSize ), true ); SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER; diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index c6358bbf4618..8d4a634c60de 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -374,8 +374,8 @@ void Window::SetZoomIntegral(long nZoom) Size aSize = PixelToLogic(GetOutputSizePixel()); long nW = aSize.Width() * GetZoom() / nZoom; long nH = aSize.Height() * GetZoom() / nZoom; - maWinPos.setX( maWinPos.X() + (aSize.Width() - nW) / 2 ); - maWinPos.setY( maWinPos.Y() + (aSize.Height() - nH) / 2 ); + maWinPos.AdjustX((aSize.Width() - nW) / 2 ); + maWinPos.AdjustY((aSize.Height() - nH) / 2 ); if ( maWinPos.X() < 0 ) maWinPos.setX( 0 ); if ( maWinPos.Y() < 0 ) maWinPos.setY( 0 ); @@ -507,9 +507,9 @@ long Window::SetZoomRect (const ::tools::Rectangle& rZoomRect) maWinPos = maViewOrigin + aPos; aWinSize.setWidth( static_cast<long>(static_cast<double>(aWinSize.Width()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(nFact)) ); - maWinPos.setX( maWinPos.X() + (rZoomRect.GetWidth() - aWinSize.Width()) / 2 ); + maWinPos.AdjustX((rZoomRect.GetWidth() - aWinSize.Width()) / 2 ); aWinSize.setHeight( static_cast<long>(static_cast<double>(aWinSize.Height()) * double(ZOOM_MULTIPLICATOR) / static_cast<double>(nFact)) ); - maWinPos.setY( maWinPos.Y() + (rZoomRect.GetHeight() - aWinSize.Height()) / 2 ); + maWinPos.AdjustY((rZoomRect.GetHeight() - aWinSize.Height()) / 2 ); if ( maWinPos.X() < 0 ) maWinPos.setX( 0 ); if ( maWinPos.Y() < 0 ) maWinPos.setY( 0 ); @@ -543,8 +543,8 @@ void Window::UpdateMapOrigin(bool bInvalidate) { // keep view centered around current pos, when window // resizes - maWinPos.setX( maWinPos.X() - (aWinSize.Width() - maPrevSize.Width()) / 2 ); - maWinPos.setY( maWinPos.Y() - (aWinSize.Height() - maPrevSize.Height()) / 2 ); + maWinPos.AdjustX( -((aWinSize.Width() - maPrevSize.Width()) / 2) ); + maWinPos.AdjustY( -((aWinSize.Height() - maPrevSize.Height()) / 2) ); bChanged = true; } @@ -598,14 +598,14 @@ void Window::UpdateMapMode() // #i2237# // Since BRUSH_SIZE alignment is outdated now, i use the // former constant here directly - aPix.setWidth( aPix.Width() - 8 ); + aPix.AdjustWidth( -8 ); } if (aPix.Height() == 0) { // #i2237# // Since BRUSH_SIZE alignment is outdated now, i use the // former constant here directly - aPix.setHeight( aPix.Height() - 8 ); + aPix.AdjustHeight( -8 ); } } diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index 63f68347e5d7..7db5e61a6929 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -384,8 +384,8 @@ void ChangePlaceholderTag::addCustomHandles( SdrHdlList& rHandlerList ) long all_height = nRows * aButtonSize.Height(); Point aPos( rSnapRect.Center() ); - aPos.setX( aPos.X() - (all_width >> 1) ); - aPos.setY( aPos.Y() - (all_height >> 1) ); + aPos.X() -= all_width >> 1; + aPos.Y() -= all_height >> 1; ImageButtonHdl* pHdl = new ImageButtonHdl( xThis, aPoint ); pHdl->SetObjHdlNum( SMART_TAG_HDL_NUM ); |