diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-21 10:13:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-21 12:58:49 +0100 |
commit | 180f2860525fb7ed4892b417b20c3f2f9cbb44e0 (patch) | |
tree | f4c11ab79c1ba022f31944668eae2f20a8f5c808 /sw/source/uibase | |
parent | b99dd5350c21ad4096af0ae281c518b127fa37b5 (diff) |
loplugin:changetoolsgen in sw
Change-Id: If07efe4c15cfc28df38a9327856d39313ca78d50
Reviewed-on: https://gerrit.libreoffice.org/50078
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
38 files changed, 330 insertions, 330 deletions
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 53670177d97e..1cc101938fa9 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -857,7 +857,7 @@ void SwDocShell::SetVisArea( const tools::Rectangle &rRect ) if (m_pView) { Size aSz( m_pView->GetDocSz() ); - aSz.Width() += DOCUMENTBORDER; aSz.Height() += DOCUMENTBORDER; + aSz.AdjustWidth(DOCUMENTBORDER ); aSz.AdjustHeight(DOCUMENTBORDER ); long nMoveX = 0, nMoveY = 0; if ( aRect.Right() > aSz.Width() ) nMoveX = aSz.Width() - aRect.Right(); diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index c47f88b6dfaf..d7ad06fe6a3d 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -446,8 +446,8 @@ void SwGridConfig::Load() case 0: rParent.SetSnap(bSet); break;// "Option/SnapToGrid", case 1: rParent.SetGridVisible(bSet); break;//"Option/VisibleGrid", case 2: rParent.SetSynchronize(bSet); break;// "Option/Synchronize", - case 3: aSnap.Width() = convertMm100ToTwip(nSet); break;// "Resolution/XAxis", - case 4: aSnap.Height() = convertMm100ToTwip(nSet); break;// "Resolution/YAxis", + case 3: aSnap.setWidth( convertMm100ToTwip(nSet) ); break;// "Resolution/XAxis", + case 4: aSnap.setHeight( convertMm100ToTwip(nSet) ); break;// "Resolution/YAxis", case 5: rParent.SetDivisionX(static_cast<short>(nSet)); break;// "Subdivision/XAxis", case 6: rParent.SetDivisionY(static_cast<short>(nSet)); break;// "Subdivision/YAxis" } diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index f4211f6a8f46..e544ff05b333 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -317,13 +317,13 @@ void SwAddressPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Re sal_uInt16 nStartRow = 0; if(aVScrollBar->IsVisible()) { - aSize.Width() -= aVScrollBar->GetSizePixel().Width(); + aSize.AdjustWidth( -(aVScrollBar->GetSizePixel().Width()) ); nStartRow = static_cast<sal_uInt16>(aVScrollBar->GetThumbPos()); } Size aPartSize(aSize.Width() / pImpl->nColumns, aSize.Height() / pImpl->nRows); - aPartSize.Width() -= 2; - aPartSize.Height() -= 2; + aPartSize.AdjustWidth( -2 ); + aPartSize.AdjustHeight( -2 ); sal_uInt16 nAddress = nStartRow * pImpl->nColumns; const sal_uInt16 nNumAddresses = static_cast<sal_uInt16>(pImpl->aAddresses.size()); @@ -444,7 +444,7 @@ void SwAddressPreview::DrawText_Impl(vcl::RenderContext& rRenderContext, const O do { rRenderContext.DrawText(aStart, rAddress.getToken(0, '\n', nPos)); - aStart.Y() += nHeight; + aStart.AdjustY(nHeight ); } while (nPos >= 0); } diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx index af7af8aa60f4..b8da589d4ad2 100644 --- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx +++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx @@ -168,14 +168,14 @@ void AnnotationMenuButton::Paint(vcl::RenderContext& rRenderContext, const tools tools::Rectangle aSymbolRect(aRect); // 25% distance to the left and right button border const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000; - aSymbolRect.Left() += nBorderDistanceLeftAndRight; - aSymbolRect.Right() -= nBorderDistanceLeftAndRight; + aSymbolRect.AdjustLeft(nBorderDistanceLeftAndRight ); + aSymbolRect.AdjustRight( -nBorderDistanceLeftAndRight ); // 40% distance to the top button border const long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000; - aSymbolRect.Top()+=nBorderDistanceTop; + aSymbolRect.AdjustTop(nBorderDistanceTop ); // 15% distance to the bottom button border const long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000; - aSymbolRect.Bottom() -= nBorderDistanceBottom; + aSymbolRect.AdjustBottom( -nBorderDistanceBottom ); DecorationView aDecoView(&rRenderContext); aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, (bHighContrast ? Color(COL_WHITE) : Color(COL_BLACK))); } diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index e8540298706e..132387b9ff6b 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -134,7 +134,7 @@ void SidebarTextControl::Draw(OutputDevice* pDev, const Point& rPt, const Size& { //Take the control's height, but overwrite the scrollbar area if there was one Size aSize(PixelToLogic(GetSizePixel())); - aSize.Width() = rSz.Width(); + aSize.setWidth( rSz.Width() ); if ( GetTextView() ) { diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx index a379a5f4e2e0..e45561269217 100644 --- a/sw/source/uibase/docvw/edtdd.cxx +++ b/sw/source/uibase/docvw/edtdd.cxx @@ -341,10 +341,10 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) Point aPoint; tools::Rectangle aWin(aPoint,GetOutputSizePixel()); const int nMargin = 10; - aWin.Left() += nMargin; - aWin.Top() += nMargin; - aWin.Right() -= nMargin; - aWin.Bottom() -= nMargin; + aWin.AdjustLeft(nMargin ); + aWin.AdjustTop(nMargin ); + aWin.AdjustRight( -nMargin ); + aWin.AdjustBottom( -nMargin ); if(!aWin.IsInside(aPixPt)) { static sal_uInt64 last_tick = 0; sal_uInt64 current_tick = tools::Time::GetSystemTicks(); @@ -356,10 +356,10 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) m_bOldIdleSet = true; } CleanupDropUserMarker(); - if(aPixPt.X() > aWin.Right()) aPixPt.X() += nMargin; - if(aPixPt.X() < aWin.Left()) aPixPt.X() -= nMargin; - if(aPixPt.Y() > aWin.Bottom()) aPixPt.Y() += nMargin; - if(aPixPt.Y() < aWin.Top()) aPixPt.Y() -= nMargin; + if(aPixPt.X() > aWin.Right()) aPixPt.AdjustX(nMargin ); + if(aPixPt.X() < aWin.Left()) aPixPt.AdjustX( -nMargin ); + if(aPixPt.Y() > aWin.Bottom()) aPixPt.AdjustY(nMargin ); + if(aPixPt.Y() < aWin.Top()) aPixPt.AdjustY( -nMargin ); Point aDocPt(PixelToLogic(aPixPt)); SwRect rect(aDocPt,Size(1,1)); rSh.MakeVisible(rect); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 832a20bcc4c4..6168e4fde52f 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1038,10 +1038,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) aSnap = rSh.GetViewOptions()->GetSnapSize(); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Width()) / nDiv ); + aSnap.setWidth( std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Width()) / nDiv ) ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Height()) / nDiv ); + aSnap.setHeight( std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Height()) / nDiv ) ); } if(bHuge) @@ -1239,10 +1239,10 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) Size aSnap( rSh.GetViewOptions()->GetSnapSize() ); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Width()) / nDiv ); + aSnap.setWidth( std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Width()) / nDiv ) ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Height()) / nDiv ); + aSnap.setHeight( std::max( sal_uLong(1), static_cast<sal_uLong>(aSnap.Height()) / nDiv ) ); if(bOnePixel) { @@ -2958,8 +2958,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) m_bIsInMove = false; m_aStartPos = rMEvt.GetPosPixel(); - m_aRszMvHdlPt.X() = 0; - m_aRszMvHdlPt.Y() = 0; + m_aRszMvHdlPt.setX( 0 ); + m_aRszMvHdlPt.setY( 0 ); SwTab nMouseTabCol = SwTab::COL_NONE; const bool bTmp = !rSh.IsDrawCreate() && !m_pApplyTempl && !rSh.IsInSelect() && @@ -5667,8 +5667,8 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) aEEPos -= rOutputArea.TopRight(); //invert the horizontal direction and exchange X and Y long nTemp = -aEEPos.X(); - aEEPos.X() = aEEPos.Y(); - aEEPos.Y() = nTemp; + aEEPos.setX( aEEPos.Y() ); + aEEPos.setY( nTemp ); } else aEEPos -= rOutputArea.TopLeft(); @@ -5950,7 +5950,7 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen ) { Point aPt( rWin.OutputToScreenPixel( rWin.LogicToPixel( rSh.GetCharRect().Pos() ))); - aPt.Y() -= 3; + aPt.AdjustY( -3 ); nTipId = Help::ShowPopover(&rWin, tools::Rectangle( aPt, Size( 1, 1 )), m_aHelpStrings[ nCurArrPos ], QuickHelpFlags::Left | QuickHelpFlags::Bottom); diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index e279bc2d2d98..35f73733bd3d 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -371,11 +371,11 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) { tools::Rectangle aRect( aFieldRect.SVRect() ); Point aPt( OutputToScreenPixel( LogicToPixel( aRect.TopLeft() ))); - aRect.Left() = aPt.X(); - aRect.Top() = aPt.Y(); + aRect.SetLeft( aPt.X() ); + aRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( LogicToPixel( aRect.BottomRight() )); - aRect.Right() = aPt.X(); - aRect.Bottom() = aPt.Y(); + aRect.SetRight( aPt.X() ); + aRect.SetBottom( aPt.Y() ); if( bBalloon ) Help::ShowBalloon( this, rEvt.GetMousePosPixel(), aRect, sText ); diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 5f3e0de062dc..dd82b1b4124e 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -338,7 +338,7 @@ void SwSrcEditWindow::Resize() if ( m_pTextView->GetStartDocPos().Y() > nMaxVisAreaStart ) { Point aStartDocPos( m_pTextView->GetStartDocPos() ); - aStartDocPos.Y() = nMaxVisAreaStart; + aStartDocPos.setY( nMaxVisAreaStart ); m_pTextView->SetStartDocPos( aStartDocPos ); m_pTextView->ShowCursor(); } @@ -348,13 +348,13 @@ void SwSrcEditWindow::Resize() m_pHScrollbar->SetPosSizePixel( aScrollPos, aScrollSz); - aScrollSz.Width() = aScrollSz.Height(); - aScrollSz.Height() = aOutSz.Height(); + aScrollSz.setWidth( aScrollSz.Height() ); + aScrollSz.setHeight( aOutSz.Height() ); aScrollPos = Point(aOutSz.Width() - nScrollStd, 0); m_pVScrollbar->SetPosSizePixel( aScrollPos, aScrollSz); - aOutSz.Width() -= nScrollStd; - aOutSz.Height() -= nScrollStd; + aOutSz.AdjustWidth( -nScrollStd ); + aOutSz.AdjustHeight( -nScrollStd ); m_pOutWin->SetOutputSizePixel(aOutSz); InitScrollBars(); @@ -989,8 +989,8 @@ void SwSrcEditWindow::SetFont() vcl::Font aFont(aFontMetric); Size aSize(rFont.GetFontSize()); //font height is stored in point and set in twip - aSize.Height() = - officecfg::Office::Common::Font::SourceViewFont::FontHeight::get() * 20; + aSize.setHeight( + officecfg::Office::Common::Font::SourceViewFont::FontHeight::get() * 20 ); aFont.SetFontSize(m_pOutWin->LogicToPixel(aSize, MapMode(MapUnit::MapTwip))); GetTextEngine()->SetFont( aFont ); m_pOutWin->SetFont(aFont); diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index 3c5fa5f07478..11568bd934a9 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -215,10 +215,10 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr rRenderContext.SetFillColor(Color(COL_LIGHTGRAY)); tools::Rectangle aRect; - aRect.Right() = rOrg.X() + GetSize().Width() - nR; - aRect.Left() = rOrg.X() + nL; - aRect.Top() = rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist(); - aRect.Bottom()= rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist(); + aRect.SetRight( rOrg.X() + GetSize().Width() - nR ); + aRect.SetLeft( rOrg.X() + nL ); + aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() ); + aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() ); rRenderContext.DrawRect(aRect); const tools::Rectangle aDefineRect(aRect); @@ -252,9 +252,9 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr nAutoColWidth = pColMgr->GetColWidth(i); if (!m_bVertical) - aRect.Right() = aRect.Left() + nAutoColWidth; + aRect.SetRight( aRect.Left() + nAutoColWidth ); else - aRect.Bottom() = aRect.Top() + nAutoColWidth; + aRect.SetBottom( aRect.Top() + nAutoColWidth ); // use primitive draw command drawFillAttributes(rRenderContext, getPageFillAttributes(), aRect, aDefineRect); @@ -262,9 +262,9 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr if (i < nColumnCount - 1) { if (!m_bVertical) - aRect.Left() = aRect.Right() + pColMgr->GetGutterWidth(i); + aRect.SetLeft( aRect.Right() + pColMgr->GetGutterWidth(i) ); else - aRect.Top() = aRect.Bottom() + pColMgr->GetGutterWidth(i); + aRect.SetTop( aRect.Bottom() + pColMgr->GetGutterWidth(i) ); } } if (pColMgr->HasLine()) @@ -281,26 +281,26 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr { case COLADJ_BOTTOM: if (!m_bVertical) - aUp.Y() += nLength; + aUp.AdjustY(nLength ); else - aUp.X() += nLength; + aUp.AdjustX(nLength ); break; case COLADJ_TOP: if (!m_bVertical) - aDown.Y() -= nLength; + aDown.AdjustY( -nLength ); else - aDown.X() -= nLength; + aDown.AdjustX( -nLength ); break; case COLADJ_CENTER: if (!m_bVertical) { - aUp.Y() += nLength / 2; - aDown.Y() -= nLength / 2; + aUp.AdjustY(nLength / 2 ); + aDown.AdjustY( -(nLength / 2) ); } else { - aUp.X() += nLength / 2; - aDown.X() -= nLength / 2; + aUp.AdjustX(nLength / 2 ); + aDown.AdjustX( -(nLength / 2) ); } break; default: @@ -315,13 +315,13 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr nDist -= (i == 0) ? nGutter / 2 : 0; if (!m_bVertical) { - aUp.X() += nDist; - aDown.X() += nDist; + aUp.AdjustX(nDist ); + aDown.AdjustX(nDist ); } else { - aUp.Y() += nDist; - aDown.Y() += nDist; + aUp.AdjustY(nDist ); + aDown.AdjustY(nDist ); } rRenderContext.DrawLine(aUp, aDown); @@ -337,8 +337,8 @@ SwColumnOnlyExample::SwColumnOnlyExample(vcl::Window* pParent) { SetMapMode( MapMode( MapUnit::MapTwip ) ); m_aWinSize = GetOptimalSize(); - m_aWinSize.Height() -= 4; - m_aWinSize.Width() -= 4; + m_aWinSize.AdjustHeight( -4 ); + m_aWinSize.AdjustWidth( -4 ); m_aWinSize = PixelToLogic( m_aWinSize ); @@ -404,11 +404,11 @@ void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools: nLength -= nLength * nPercent / 100; switch(m_aCols.GetLineAdj()) { - case COLADJ_BOTTOM: aUp.Y() += nLength; break; - case COLADJ_TOP: aDown.Y() -= nLength; break; + case COLADJ_BOTTOM: aUp.AdjustY(nLength ); break; + case COLADJ_TOP: aDown.AdjustY( -nLength ); break; case COLADJ_CENTER: - aUp.Y() += nLength / 2; - aDown.Y() -= nLength / 2; + aUp.AdjustY(nLength / 2 ); + aDown.AdjustY( -(nLength / 2) ); break; default: break; //prevent warning @@ -427,9 +427,9 @@ void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools: for (sal_uInt16 i = 0; i < nColCount; i++) { const SwColumn* pCol = &rCols[i]; - aFrameRect.Left() = nSum + pCol->GetLeft(); //nSum + pCol->GetLeft() + aTL.X(); + aFrameRect.SetLeft( nSum + pCol->GetLeft() ); //nSum + pCol->GetLeft() + aTL.X(); nSum += pCol->GetWishWidth(); - aFrameRect.Right() = nSum - pCol->GetRight(); + aFrameRect.SetRight( nSum - pCol->GetRight() ); rRenderContext.DrawRect(aFrameRect); } if (bLines) @@ -438,8 +438,8 @@ void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools: for (sal_uInt16 i = 0; i < nColCount - 1; i++) { nSum += rCols[i].GetWishWidth(); - aUp.X() = nSum; - aDown.X() = nSum; + aUp.setX( nSum ); + aDown.setX( nSum ); rRenderContext.DrawLine(aUp, aDown); } } @@ -533,10 +533,10 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point } tools::Rectangle aRect; - aRect.Right() = rOrg.X() + GetSize().Width() - nR; - aRect.Left() = rOrg.X() + nL; - aRect.Top() = rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist(); - aRect.Bottom()= rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist(); + aRect.SetRight( rOrg.X() + GetSize().Width() - nR ); + aRect.SetLeft( rOrg.X() + nL ); + aRect.SetTop( rOrg.Y() + GetTop() + GetHdHeight() + GetHdDist() ); + aRect.SetBottom( rOrg.Y() + GetSize().Height() - GetBottom() - GetFtHeight() - GetFtDist() ); //increase the values to get a 'viewable' preview sal_Int32 nBaseHeight = pGridItem->GetBaseHeight() * 3; @@ -595,9 +595,9 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point { rRenderContext.DrawLine(aStart, aEnd); if(m_bVertical) - aStart.Y() = aEnd.Y() += nBaseHeight; + aStart.setY( aEnd.AdjustY(nBaseHeight ) ); else - aStart.X() = aEnd.X() += nBaseHeight; + aStart.setX( aEnd.AdjustX(nBaseHeight ) ); } } aRubyRect.Move(nXMove, nYMove); diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 2a7bce931465..1debb81ca787 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -271,12 +271,12 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, { Point aPos(aBoundRect.Pos()); long nTmp = aPos.X(); - aPos.X() = aPos.Y(); - aPos.Y() = nTmp; + aPos.setX( aPos.Y() ); + aPos.setY( nTmp ); Size aSize(aBoundRect.SSize()); nTmp = aSize.Width(); - aSize.Width() = aSize.Height(); - aSize.Height() = nTmp; + aSize.setWidth( aSize.Height() ); + aSize.setHeight( nTmp ); aBoundRect.Chg( aPos, aSize ); //exchange width/height to enable correct values nTmp = rVal.nWidth; diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx index 21f2470bc2f7..51d65e760f44 100644 --- a/sw/source/uibase/misc/swruler.cxx +++ b/sw/source/uibase/misc/swruler.cxx @@ -136,22 +136,22 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext) Point aArrowPos; bool bArrowToRight; // TODO Discover why it should be 0 instead of CONTROL_BORDER_WIDTH + CONTROL_TOP_OFFSET - aLabelPos.Y() = 0; - aArrowPos.Y() = CONTROL_BORDER_WIDTH + CONTROL_TOP_OFFSET; + aLabelPos.setY( 0 ); + aArrowPos.setY( CONTROL_BORDER_WIDTH + CONTROL_TOP_OFFSET ); if ( !AllSettings::GetLayoutRTL() ) { // LTR if ( bIsCollapsed ) { // It should draw something like | > Comments | - aLabelPos.X() = CONTROL_LEFT_OFFSET + CONTROL_TRIANGLE_WIDTH + CONTROL_TRIANGLE_PAD; - aArrowPos.X() = CONTROL_LEFT_OFFSET; + aLabelPos.setX( CONTROL_LEFT_OFFSET + CONTROL_TRIANGLE_WIDTH + CONTROL_TRIANGLE_PAD ); + aArrowPos.setX( CONTROL_LEFT_OFFSET ); } else { // It should draw something like | Comments < | - aLabelPos.X() = CONTROL_LEFT_OFFSET; - aArrowPos.X() = aControlRect.GetSize().Width() - 1 - CONTROL_RIGHT_OFFSET - CONTROL_BORDER_WIDTH - CONTROL_TRIANGLE_WIDTH; + aLabelPos.setX( CONTROL_LEFT_OFFSET ); + aArrowPos.setX( aControlRect.GetSize().Width() - 1 - CONTROL_RIGHT_OFFSET - CONTROL_BORDER_WIDTH - CONTROL_TRIANGLE_WIDTH ); } bArrowToRight = bIsCollapsed; } @@ -162,14 +162,14 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext) if ( bIsCollapsed ) { // It should draw something like | Comments < | - aArrowPos.X() = aControlRect.GetSize().Width() - 1 - CONTROL_RIGHT_OFFSET - CONTROL_BORDER_WIDTH - CONTROL_TRIANGLE_WIDTH; - aLabelPos.X() = aArrowPos.X() - CONTROL_TRIANGLE_PAD - nLabelWidth; + aArrowPos.setX( aControlRect.GetSize().Width() - 1 - CONTROL_RIGHT_OFFSET - CONTROL_BORDER_WIDTH - CONTROL_TRIANGLE_WIDTH ); + aLabelPos.setX( aArrowPos.X() - CONTROL_TRIANGLE_PAD - nLabelWidth ); } else { // It should draw something like | > Comments | - aLabelPos.X() = aControlRect.GetSize().Width() - 1 - CONTROL_RIGHT_OFFSET - CONTROL_BORDER_WIDTH - nLabelWidth; - aArrowPos.X() = CONTROL_LEFT_OFFSET; + aLabelPos.setX( aControlRect.GetSize().Width() - 1 - CONTROL_RIGHT_OFFSET - CONTROL_BORDER_WIDTH - nLabelWidth ); + aArrowPos.setX( CONTROL_LEFT_OFFSET ); } bArrowToRight = !bIsCollapsed; } diff --git a/sw/source/uibase/ribbar/conform.cxx b/sw/source/uibase/ribbar/conform.cxx index 0694358ce096..c7ecb91f0903 100644 --- a/sw/source/uibase/ribbar/conform.cxx +++ b/sw/source/uibase/ribbar/conform.cxx @@ -91,10 +91,10 @@ void ConstFormControl::CreateDefaultObject() { Point aStartPos(GetDefaultCenterPos()); Point aEndPos(aStartPos); - aStartPos.X() -= 2 * MM50; - aStartPos.Y() -= MM50; - aEndPos.X() += 2 * MM50; - aEndPos.Y() += MM50; + aStartPos.AdjustX( -(2 * MM50) ); + aStartPos.AdjustY( -(MM50) ); + aEndPos.AdjustX(2 * MM50 ); + aEndPos.AdjustY(MM50 ); if(!m_pSh->HasDrawView()) m_pSh->MakeDrawView(); diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx index 7bfea2cb6b9d..bb5fd3b9a5e9 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -598,10 +598,10 @@ void SwDrawBase::CreateDefaultObject() { Point aStartPos = GetDefaultCenterPos(); Point aEndPos(aStartPos); - aStartPos.X() -= 8 * MM50; - aStartPos.Y() -= 4 * MM50; - aEndPos.X() += 8 * MM50; - aEndPos.Y() += 4 * MM50; + aStartPos.AdjustX( -(8 * MM50) ); + aStartPos.AdjustY( -(4 * MM50) ); + aEndPos.AdjustX(8 * MM50 ); + aEndPos.AdjustY(4 * MM50 ); tools::Rectangle aRect(aStartPos, aEndPos); m_pSh->CreateDefaultShape( static_cast< sal_uInt16 >(m_pWin->GetSdrDrawMode()), aRect, m_nSlotId); } @@ -612,9 +612,9 @@ Point SwDrawBase::GetDefaultCenterPos() const SwRect& rVisArea = m_pSh->VisArea(); Point aStartPos = rVisArea.Center(); if(rVisArea.Width() > aDocSz.Width()) - aStartPos.X() = aDocSz.Width() / 2 + rVisArea.Left(); + aStartPos.setX( aDocSz.Width() / 2 + rVisArea.Left() ); if(rVisArea.Height() > aDocSz.Height()) - aStartPos.Y() = aDocSz.Height() / 2 + rVisArea.Top(); + aStartPos.setY( aDocSz.Height() / 2 + rVisArea.Top() ); return aStartPos; } diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 4e45d29dfbd5..90673645e40a 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -113,19 +113,19 @@ SwInputWindow::SwInputWindow(vcl::Window* pParent, SfxDispatcher const * pDispat tools::Rectangle aItemRect( GetItemRect(FN_FORMULA_CALC) ); long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight()); if( nMaxHeight+2 > aSizeTbx.Height() ) - aSizeTbx.Height() = nMaxHeight+2; + aSizeTbx.setHeight( nMaxHeight+2 ); Size aSize = GetSizePixel(); - aSize.Height() = aSizeTbx.Height(); + aSize.setHeight( aSizeTbx.Height() ); SetSizePixel( aSize ); // align edit and item vcentered Size aPosSize = aPos->GetSizePixel(); - aPosSize.Height() = nMaxHeight; - aEditSize.Height() = nMaxHeight; + aPosSize.setHeight( nMaxHeight ); + aEditSize.setHeight( nMaxHeight ); Point aPosPos = aPos->GetPosPixel(); Point aEditPos = aEdit->GetPosPixel(); - aPosPos.Y() = (aSize.Height() - nMaxHeight)/2 + 1; - aEditPos.Y() = (aSize.Height() - nMaxHeight)/2 + 1; + aPosPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 ); + aEditPos.setY( (aSize.Height() - nMaxHeight)/2 + 1 ); aPos->SetPosSizePixel( aPosPos, aPosSize ); aEdit->SetPosSizePixel( aEditPos, aEditSize ); } @@ -179,7 +179,7 @@ void SwInputWindow::Resize() long nLeft = aEdit->GetPosPixel().X(); Size aEditSize = aEdit->GetSizePixel(); - aEditSize.Width() = std::max( static_cast<long>(nWidth - nLeft - 5), long(0) ); + aEditSize.setWidth( std::max( static_cast<long>(nWidth - nLeft - 5), long(0) ) ); aEdit->SetSizePixel( aEditSize ); aEdit->Invalidate(); } diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index a084667ce87e..0e5254e41049 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -801,12 +801,12 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, { Point aPos(aBoundRect.Pos()); long nTmp = aPos.X(); - aPos.X() = aPos.Y(); - aPos.Y() = nTmp; + aPos.setX( aPos.Y() ); + aPos.setY( nTmp ); Size aSize(aBoundRect.SSize()); nTmp = aSize.Width(); - aSize.Width() = aSize.Height(); - aSize.Height() = nTmp; + aSize.setWidth( aSize.Height() ); + aSize.setHeight( nTmp ); aBoundRect.Chg( aPos, aSize ); //exchange width/height to enable correct values nTmp = rValidation.nWidth; diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 0ed1ec139f27..3d2e439b1083 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -347,8 +347,8 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put( aSzItm ); Size aSz( aSizeCopy.GetWidthPercent(), aSizeCopy.GetHeightPercent() ); - if( SwFormatFrameSize::SYNCED == aSz.Width() ) aSz.Width() = 0; - if( SwFormatFrameSize::SYNCED == aSz.Height() ) aSz.Height() = 0; + if( SwFormatFrameSize::SYNCED == aSz.Width() ) aSz.setWidth( 0 ); + if( SwFormatFrameSize::SYNCED == aSz.Height() ) aSz.setHeight( 0 ); aSzItm.SetSize( aSz ); aSzItm.SetWhich( SID_ATTR_GRAF_FRMSIZE_PERCENT ); diff --git a/sw/source/uibase/shells/grfshex.cxx b/sw/source/uibase/shells/grfshex.cxx index 1f8f9928a021..0d842fe8f8fd 100644 --- a/sw/source/uibase/shells/grfshex.cxx +++ b/sw/source/uibase/shells/grfshex.cxx @@ -102,10 +102,10 @@ bool SwTextShell::InsertMediaDlg( SfxRequest const & rReq ) Size aSize; if( rVisArea.Width() > aDocSz.Width()) - aPos.X() = aDocSz.Width() / 2 + rVisArea.Left(); + aPos.setX( aDocSz.Width() / 2 + rVisArea.Left() ); if(rVisArea.Height() > aDocSz.Height()) - aPos.Y() = aDocSz.Height() / 2 + rVisArea.Top(); + aPos.setY( aDocSz.Height() / 2 + rVisArea.Top() ); if( aPrefSize.Width() && aPrefSize.Height() ) { diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 58fcb9b33d52..57c63ba22ad2 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -394,8 +394,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) Size aWinSize = rEdtWin.GetSizePixel(); Point aStartPos(aWinSize.Width()/2, aWinSize.Height() / 2); aStartPos = rEdtWin.PixelToLogic(aStartPos); - aStartPos.X() -= 8 * MM50; - aStartPos.Y() -= 4 * MM50; + aStartPos.AdjustX( -(8 * MM50) ); + aStartPos.AdjustY( -(4 * MM50) ); Size aSize(16 * MM50, 8 * MM50); GetShell().LockPaint(); GetShell().StartAllAction(); @@ -434,7 +434,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) if(pArgs) { Size aSize(aMgr.GetSize()); - aSize.Width() = GetShell().GetAnyCurRect(CurRectType::PagePrt).Width(); + aSize.setWidth( GetShell().GetAnyCurRect(CurRectType::PagePrt).Width() ); Point aPos = aMgr.GetPos(); RndStdIds eAnchor = RndStdIds::FLY_AT_PARA; if(pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET) diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx index 283449964c5f..fa0dbd934e2c 100644 --- a/sw/source/uibase/table/chartins.cxx +++ b/sw/source/uibase/table/chartins.cxx @@ -78,13 +78,13 @@ Point SwGetChartDialogPos( const vcl::Window *pParentWin, const Size& rDialogSiz if ( aDesktop.Bottom() - aObjAbs.Bottom() >= rDialogSize.Height() + aSpace.Height() ) { // first preference: below the chart - aRet.Y() = aObjAbs.Bottom() + aSpace.Height(); + aRet.setY( aObjAbs.Bottom() + aSpace.Height() ); bCenterHor = true; } else if ( aObjAbs.Top() - aDesktop.Top() >= rDialogSize.Height() + aSpace.Height() ) { // second preference: above the chart - aRet.Y() = aObjAbs.Top() - rDialogSize.Height() - aSpace.Height(); + aRet.setY( aObjAbs.Top() - rDialogSize.Height() - aSpace.Height() ); bCenterHor = true; } else @@ -97,32 +97,32 @@ Point SwGetChartDialogPos( const vcl::Window *pParentWin, const Size& rDialogSiz // if both fit, prefer right in RTL mode, left otherwise bool bPutRight = bFitRight && ( bLayoutRTL || !bFitLeft ); if ( bPutRight ) - aRet.X() = aObjAbs.Right() + aSpace.Width(); + aRet.setX( aObjAbs.Right() + aSpace.Width() ); else - aRet.X() = aObjAbs.Left() - rDialogSize.Width() - aSpace.Width(); + aRet.setX( aObjAbs.Left() - rDialogSize.Width() - aSpace.Width() ); // center vertically - aRet.Y() = aObjAbs.Top() + ( aObjAbs.GetHeight() - rDialogSize.Height() ) / 2; + aRet.setY( aObjAbs.Top() + ( aObjAbs.GetHeight() - rDialogSize.Height() ) / 2 ); } else { // doesn't fit on any edge - put at the bottom of the screen - aRet.Y() = aDesktop.Bottom() - rDialogSize.Height(); + aRet.setY( aDesktop.Bottom() - rDialogSize.Height() ); bCenterHor = true; } } if ( bCenterHor ) - aRet.X() = aObjAbs.Left() + ( aObjAbs.GetWidth() - rDialogSize.Width() ) / 2; + aRet.setX( aObjAbs.Left() + ( aObjAbs.GetWidth() - rDialogSize.Width() ) / 2 ); // limit to screen (centering might lead to invalid positions) if ( aRet.X() + rDialogSize.Width() - 1 > aDesktop.Right() ) - aRet.X() = aDesktop.Right() - rDialogSize.Width() + 1; + aRet.setX( aDesktop.Right() - rDialogSize.Width() + 1 ); if ( aRet.X() < aDesktop.Left() ) - aRet.X() = aDesktop.Left(); + aRet.setX( aDesktop.Left() ); if ( aRet.Y() + rDialogSize.Height() - 1 > aDesktop.Bottom() ) - aRet.Y() = aDesktop.Bottom() - rDialogSize.Height() + 1; + aRet.setY( aDesktop.Bottom() - rDialogSize.Height() + 1 ); if ( aRet.Y() < aDesktop.Top() ) - aRet.Y() = aDesktop.Top(); + aRet.setY( aDesktop.Top() ); } return aRet; diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 5d96f855411b..6d8c4e14c27e 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1375,17 +1375,17 @@ void SwPagePreview::SetVisArea( const tools::Rectangle &rRect ) if(aLR.Top() < 0) { - aLR.Bottom() += std::abs(aLR.Top()); - aLR.Top() = 0; + aLR.AdjustBottom(std::abs(aLR.Top()) ); + aLR.SetTop( 0 ); } if(aLR.Left() < 0) { - aLR.Right() += std::abs(aLR.Left()); - aLR.Left() = 0; + aLR.AdjustRight(std::abs(aLR.Left()) ); + aLR.SetLeft( 0 ); } - if(aLR.Right() < 0) aLR.Right() = 0; - if(aLR.Bottom() < 0) aLR.Bottom() = 0; + if(aLR.Right() < 0) aLR.SetRight( 0 ); + if(aLR.Bottom() < 0) aLR.SetBottom( 0 ); if(aLR == m_aVisArea || // Ignore empty rectangle ( 0 == aLR.Bottom() - aLR.Top() && 0 == aLR.Right() - aLR.Left() ) ) @@ -1429,12 +1429,12 @@ IMPL_LINK( SwPagePreview, ScrollHdl, ScrollBar *, p, void ) sStateStr += OUString::number( nThmbPos ); Point aPos = pScrollbar->GetParent()->OutputToScreenPixel( pScrollbar->GetPosPixel()); - aPos.Y() = pScrollbar->OutputToScreenPixel(pScrollbar->GetPointerPosPixel()).Y(); + aPos.setY( pScrollbar->OutputToScreenPixel(pScrollbar->GetPointerPosPixel()).Y() ); tools::Rectangle aRect; - aRect.Left() = aPos.X() -8; - aRect.Right() = aRect.Left(); - aRect.Top() = aPos.Y(); - aRect.Bottom() = aRect.Top(); + aRect.SetLeft( aPos.X() -8 ); + aRect.SetRight( aRect.Left() ); + aRect.SetTop( aPos.Y() ); + aRect.SetBottom( aRect.Top() ); Help::ShowQuickHelp(pScrollbar, aRect, sStateStr, QuickHelpFlags::Right|QuickHelpFlags::VCenter); diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 746dd72fb49b..a3775558fed1 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -161,7 +161,7 @@ static void lcl_PrintHeader( vcl::RenderContext &rOutDev, sal_Int32 nPages, sal_ aPageStr += " "; aPageStr += OUString::number( nCurPage ); aPageStr += "]"; - aPos.X() += rOutDev.GetTextWidth( rTitle ); + aPos.AdjustX(rOutDev.GetTextWidth( rTitle ) ); rOutDev.DrawText( aPos, aPageStr ); } @@ -696,8 +696,8 @@ sal_Int32 SwSrcView::PrintSource( const long nParaSpace = 10; Size aPaperSz = pOutDev->GetOutputSize(); - aPaperSz.Width() -= (LMARGPRN + RMARGPRN); - aPaperSz.Height() -= (TMARGPRN + BMARGPRN); + aPaperSz.AdjustWidth( -(LMARGPRN + RMARGPRN) ); + aPaperSz.AdjustHeight( -(TMARGPRN + BMARGPRN) ); // nLinepPage is not true, if lines have to be wrapped... const long nLinespPage = nLineHeight ? aPaperSz.Height() / nLineHeight : 1; @@ -720,7 +720,7 @@ sal_Int32 SwSrcView::PrintSource( const sal_Int32 nLines = (nLineLen+nCharspLine-1) / nCharspLine; for ( sal_Int32 nLine = 0; nLine < nLines; ++nLine ) { - aPos.Y() += nLineHeight; + aPos.AdjustY(nLineHeight ); if ( aPos.Y() > ( aPaperSz.Height() + TMARGPRN - nLineHeight/2 ) ) { ++nCurPage; @@ -735,7 +735,7 @@ sal_Int32 SwSrcView::PrintSource( pOutDev->DrawText( aPos, aLine.copy(nStart, nLen) ); } } - aPos.Y() += nParaSpace; + aPos.AdjustY(nParaSpace ); } pOutDev->Pop(); diff --git a/sw/source/uibase/uiview/swcli.cxx b/sw/source/uibase/uiview/swcli.cxx index 6d1f08d7e296..c533427b67ca 100644 --- a/sw/source/uibase/uiview/swcli.cxx +++ b/sw/source/uibase/uiview/swcli.cxx @@ -142,8 +142,8 @@ void SwOleClient::ViewChanged() const MapMode aObjMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) ); aVisSize = OutputDevice::LogicToLogic( aVisSize, aObjMap, aMyMap ); - aVisSize.Width() = long(aVisSize.Width() * GetScaleWidth()); - aVisSize.Height() = long(aVisSize.Height() * GetScaleHeight()); + aVisSize.setWidth( long(aVisSize.Width() * GetScaleWidth()) ); + aVisSize.setHeight( long(aVisSize.Height() * GetScaleHeight()) ); SwRect aRect( Point( LONG_MIN, LONG_MIN ), aVisSize ); rSh.LockView( true ); // Prevent scrolling in the EndAction diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 494949dbe62a..2dec6c0c5054 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1441,13 +1441,13 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > const SwTwips lBorder = IsDocumentBorder() ? DOCUMENTBORDER : 2 * DOCUMENTBORDER; SwTwips nEditWidth = GetEditWin().GetOutputSize().Width(); if(nEditWidth > (m_aDocSz.Width() + lBorder )) - aTopLeft.X() = ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2; + aTopLeft.setX( ( m_aDocSz.Width() + lBorder - nEditWidth ) / 2 ); else { //check if the values are possible long nXMax = m_pHScrollbar->GetRangeMax() - m_pHScrollbar->GetVisibleSize(); if( aTopLeft.X() > nXMax ) - aTopLeft.X() = nXMax < 0 ? 0 : nXMax; + aTopLeft.setX( nXMax < 0 ? 0 : nXMax ); } SetVisArea( aTopLeft ); } diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index bf28fa0059c6..62212cae6083 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1385,9 +1385,9 @@ void SwView::StateStatusLine(SfxItemSet &rSet) const SwRect aPageRect( m_pWrtShell->GetAnyCurRect( CurRectType::PageCalc ) ); const SwRect aRootRect( m_pWrtShell->GetAnyCurRect( CurRectType::PagesArea ) ); // width of columns Size aPageSize( aPageRect.SSize() ); - aPageSize.Width() += pMgr->HasNotes() && pMgr->ShowNotes() ? + aPageSize.AdjustWidth(pMgr->HasNotes() && pMgr->ShowNotes() ? pMgr->GetSidebarWidth() + pMgr->GetSidebarBorderWidth() : - 0; + 0 ); Size aRootSize( aRootRect.SSize() ); @@ -1398,7 +1398,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) const long nOf = pVOpt->GetDocumentBorder() * 2; long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); nTmpWidth += nOf; - aPageSize.Height() += nOf; + aPageSize.AdjustHeight(nOf ); long nFac = aWindowSize.Width() * 100 / nTmpWidth; long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 4366440bf8d4..b80b3008be62 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -123,16 +123,16 @@ void SwView::ExecDraw(SfxRequest& rReq) const SwRect& rVisArea = m_pWrtShell->VisArea(); Point aStartPos = rVisArea.Center(); if(rVisArea.Width() > aDocSize.Width()) - aStartPos.X() = aDocSize.Width() / 2 + rVisArea.Left(); + aStartPos.setX( aDocSize.Width() / 2 + rVisArea.Left() ); if(rVisArea.Height() > aDocSize.Height()) - aStartPos.Y() = aDocSize.Height() / 2 + rVisArea.Top(); + aStartPos.setY( aDocSize.Height() / 2 + rVisArea.Top() ); //determine the size of the object if(pObj->IsGroupObject()) { const tools::Rectangle& rBoundRect = static_cast<SdrObjGroup*>(pObj)->GetCurrentBoundRect(); - aStartPos.X() -= rBoundRect.GetWidth()/2; - aStartPos.Y() -= rBoundRect.GetHeight()/2; + aStartPos.AdjustX( -(rBoundRect.GetWidth()/2) ); + aStartPos.AdjustY( -(rBoundRect.GetHeight()/2) ); } // TODO: unmark all other @@ -168,10 +168,10 @@ void SwView::ExecDraw(SfxRequest& rReq) Size aPrefSize( pObj->GetSnapRect().GetSize() ); if( rVisArea.Width() > aDocSize.Width()) - aPos.X() = aDocSize.Width() / 2 + rVisArea.Left(); + aPos.setX( aDocSize.Width() / 2 + rVisArea.Left() ); if(rVisArea.Height() > aDocSize.Height()) - aPos.Y() = aDocSize.Height() / 2 + rVisArea.Top(); + aPos.setY( aDocSize.Height() / 2 + rVisArea.Top() ); if( aPrefSize.Width() && aPrefSize.Height() ) { diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 2057a113ad0c..1bcd1e5c6872 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -864,8 +864,8 @@ SwFieldDialog::SwFieldDialog( SwEditWin* parent, IFieldmark *fieldBM ) : } Size lbSize(aListBox->GetOptimalSize()); - lbSize.Width()+=50; - lbSize.Height()+=20; + lbSize.AdjustWidth(50 ); + lbSize.AdjustHeight(20 ); aListBox->SetSizePixel(lbSize); aListBox->SetSelectHdl( LINK( this, SwFieldDialog, MyListBoxHandler ) ); aListBox->Show(); diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index bf66c9d424a5..64973b481103 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -97,7 +97,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, //mod #i6193# added sidebar width SwPostItMgr* pPostItMgr = GetPostItMgr(); if (pPostItMgr->HasNotes() && pPostItMgr->ShowNotes()) - aPageSize.Width() += pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth(); + aPageSize.AdjustWidth(pPostItMgr->GetSidebarWidth() + pPostItMgr->GetSidebarBorderWidth() ); const MapMode aTmpMap( MapUnit::MapTwip ); const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) ); @@ -105,13 +105,13 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, if( UseOnPage::Mirror == rDesc.GetUseOn() ) // mirrored pages { const SvxLRSpaceItem &rLeftLRSpace = rDesc.GetLeft().GetLRSpace(); - aPageSize.Width() += std::abs( rLeftLRSpace.GetLeft() - rLRSpace.GetLeft() ); + aPageSize.AdjustWidth(std::abs( rLeftLRSpace.GetLeft() - rLRSpace.GetLeft() ) ); } if( SvxZoomType::OPTIMAL == eZoomType ) { if (!pPostItMgr->HasNotes() || !pPostItMgr->ShowNotes()) - aPageSize.Width() -= ( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 ); + aPageSize.AdjustWidth( -( rLRSpace.GetLeft() + rLRSpace.GetRight() + nLeftOfst * 2 ) ); lLeftMargin = rLRSpace.GetLeft() + DOCUMENTBORDER + nLeftOfst; nFac = aWindowSize.Width() * 100 / aPageSize.Width(); } @@ -120,7 +120,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, const long nOf = DOCUMENTBORDER * 2; long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); nTmpWidth += nOf; - aPageSize.Height() += nOf; + aPageSize.AdjustHeight(nOf ); nFac = aWindowSize.Width() * 100 / nTmpWidth; if ( SvxZoomType::WHOLEPAGE == eZoomType ) @@ -163,18 +163,18 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, Point aPos; if ( eZoomType == SvxZoomType::WHOLEPAGE ) - aPos.Y() = m_pWrtShell->GetAnyCurRect(CurRectType::Page).Top() - DOCUMENTBORDER; + aPos.setY( m_pWrtShell->GetAnyCurRect(CurRectType::Page).Top() - DOCUMENTBORDER ); else { // Make sure that the cursor is in the visible range, so that // the scrolling will be performed only once. - aPos.X() = lLeftMargin; + aPos.setX( lLeftMargin ); const SwRect &rCharRect = m_pWrtShell->GetCharRect(); if ( rCharRect.Top() > GetVisArea().Bottom() || rCharRect.Bottom() < aPos.Y() ) - aPos.Y() = rCharRect.Top() - rCharRect.Height(); + aPos.setY( rCharRect.Top() - rCharRect.Height() ); else - aPos.Y() = GetVisArea().Top(); + aPos.setY( GetVisArea().Top() ); } SetVisArea( aPos ); } diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index d2419aa4b2ee..c1ce4ffe4d1a 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -177,8 +177,8 @@ m_aDocSz = rSz; if ( aNewVisArea.Right() >= lTmp ) { lTmp = aNewVisArea.Right() - lTmp; - aNewVisArea.Right() -= lTmp; - aNewVisArea.Left() -= lTmp; + aNewVisArea.AdjustRight( -lTmp ); + aNewVisArea.AdjustLeft( -lTmp ); bModified = true; } @@ -186,8 +186,8 @@ m_aDocSz = rSz; if ( aNewVisArea.Bottom() >= lTmp ) { lTmp = aNewVisArea.Bottom() - lTmp; - aNewVisArea.Bottom() -= lTmp; - aNewVisArea.Top() -= lTmp; + aNewVisArea.AdjustBottom( -lTmp ); + aNewVisArea.AdjustTop( -lTmp ); bModified = true; } @@ -218,18 +218,18 @@ void SwView::SetVisArea( const tools::Rectangle &rRect, bool bUpdateScrollbar ) tools::Rectangle aLR = rRect; if( aLR.Top() < lMin ) { - aLR.Bottom() += lMin - aLR.Top(); - aLR.Top() = lMin; + aLR.AdjustBottom(lMin - aLR.Top() ); + aLR.SetTop( lMin ); } if( aLR.Left() < lMin ) { - aLR.Right() += lMin - aLR.Left(); - aLR.Left() = lMin; + aLR.AdjustRight(lMin - aLR.Left() ); + aLR.SetLeft( lMin ); } if( aLR.Right() < 0 ) - aLR.Right() = 0; + aLR.SetRight( 0 ); if( aLR.Bottom() < 0 ) - aLR.Bottom() = 0; + aLR.SetBottom( 0 ); if( aLR == m_aVisArea ) return; @@ -303,8 +303,8 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar ) aPt = GetEditWin().LogicToPixel( aPt ); #if HAVE_FEATURE_DESKTOP const long nTmp = GetWrtShell().IsFrameView() ? 4 : 8; - aPt.X() -= aPt.X() % nTmp; - aPt.Y() -= aPt.Y() % nTmp; + aPt.AdjustX( -(aPt.X() % nTmp) ); + aPt.AdjustY( -(aPt.Y() % nTmp) ); #endif aPt = GetEditWin().PixelToLogic( aPt ); @@ -356,35 +356,35 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle &rRect, nYScroll = std::min(nYScroll, nCurHeight - nDesHeight); // If it is scarce, then scroll not too much. if(nDesHeight > nCurHeight) // the height is not sufficient, then nYScroll is no longer of interest { - pPt->Y() = rRect.Top(); - pPt->Y() = std::max( lMin, pPt->Y() ); + pPt->setY( rRect.Top() ); + pPt->setY( std::max( lMin, pPt->Y() ) ); } else if ( rRect.Top() < m_aVisArea.Top() ) // Upward shift { - pPt->Y() = rRect.Top() - (nRangeY != USHRT_MAX ? nRangeY : nYScroll); - pPt->Y() = std::max( lMin, pPt->Y() ); + pPt->setY( rRect.Top() - (nRangeY != USHRT_MAX ? nRangeY : nYScroll) ); + pPt->setY( std::max( lMin, pPt->Y() ) ); } else if( rRect.Bottom() > m_aVisArea.Bottom() ) // Downward shift { - pPt->Y() = rRect.Bottom() - + pPt->setY( rRect.Bottom() - (m_aVisArea.GetHeight()) + ( nRangeY != USHRT_MAX ? - nRangeY : nYScroll ); - pPt->Y() = SetVScrollMax( pPt->Y() ); + nRangeY : nYScroll ) ); + pPt->setY( SetVScrollMax( pPt->Y() ) ); } long nXScroll = GetXScroll(); if ( rRect.Right() > m_aVisArea.Right() ) // Shift right { - pPt->X() = rRect.Right() - + pPt->setX( rRect.Right() - (m_aVisArea.GetWidth()) + - (nRangeX != USHRT_MAX ? nRangeX : nXScroll); - pPt->X() = SetHScrollMax( pPt->X() ); + (nRangeX != USHRT_MAX ? nRangeX : nXScroll) ); + pPt->setX( SetHScrollMax( pPt->X() ) ); } else if ( rRect.Left() < m_aVisArea.Left() ) // Shift left { - pPt->X() = rRect.Left() - (nRangeX != USHRT_MAX ? nRangeX : nXScroll); - pPt->X() = std::max( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ); - pPt->X() = std::min( rRect.Left() - nScrollX, pPt->X() ); - pPt->X() = std::max( 0L, pPt->X() ); + pPt->setX( rRect.Left() - (nRangeX != USHRT_MAX ? nRangeX : nXScroll) ); + pPt->setX( std::max( ::GetLeftMargin( *this ) + nLeftOfst, pPt->X() ) ); + pPt->setX( std::min( rRect.Left() - nScrollX, pPt->X() ) ); + pPt->setX( std::max( 0L, pPt->X() ) ); } } @@ -429,13 +429,13 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt if ( nBottomDiff > 0 ) // Is there room below at all? { // then we move the upper edge and we remember this nDiffY = aDlgRect.Bottom() - m_aVisArea.Top(); - m_aVisArea.Top() += nDiffY; + m_aVisArea.AdjustTop(nDiffY ); } } else { if ( nTopDiff > 0 ) // Is there room below at all? - m_aVisArea.Bottom() = aDlgRect.Top(); // Modify the lower edge + m_aVisArea.SetBottom( aDlgRect.Top() ); // Modify the lower edge } } } @@ -455,8 +455,8 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt aSize.Height()+ GetYScroll() > aVisSize.Height() )) { Point aPt( m_aVisArea.TopLeft() ); - aSize.Width() = std::min( aSize.Width(), aVisSize.Width() ); - aSize.Height()= std::min( aSize.Height(),aVisSize.Height()); + aSize.setWidth( std::min( aSize.Width(), aVisSize.Width() ) ); + aSize.setHeight( std::min( aSize.Height(),aVisSize.Height()) ); CalcPt( &aPt, tools::Rectangle( rRect.TopLeft(), aSize ), static_cast< sal_uInt16 >((aVisSize.Width() - aSize.Width()) / 2), @@ -465,11 +465,11 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt if( m_bTopCursor ) { const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPt.Y() = std::min( std::max( nBorder, rRect.Top() ), + aPt.setY( std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - - m_aVisArea.GetHeight() ); + m_aVisArea.GetHeight() ) ); } - aPt.Y() -= nDiffY; + aPt.AdjustY( -nDiffY ); m_aVisArea = aOldVisArea; SetVisArea( aPt ); return; @@ -482,12 +482,12 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt if( m_bTopCursor ) { const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPt.Y() = std::min( std::max( nBorder, rRect.Top() ), + aPt.setY( std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - - m_aVisArea.GetHeight() ); + m_aVisArea.GetHeight() ) ); } - aPt.Y() -= nDiffY; + aPt.AdjustY( -nDiffY ); m_aVisArea = aOldVisArea; SetVisArea( aPt ); return; @@ -496,22 +496,22 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt //Center cursor Point aPnt( m_aVisArea.TopLeft() ); // ... in Y-direction in any case - aPnt.Y() += ( rRect.Top() + rRect.Bottom() - - m_aVisArea.Top() - m_aVisArea.Bottom() ) / 2 - nDiffY; + aPnt.AdjustY(( rRect.Top() + rRect.Bottom() + - m_aVisArea.Top() - m_aVisArea.Bottom() ) / 2 - nDiffY ); // ... in X-direction, only if the rectangle protrudes over the right or left of the VisArea. if ( rRect.Right() > m_aVisArea.Right() || rRect.Left() < m_aVisArea.Left() ) { - aPnt.X() += ( rRect.Left() + rRect.Right() - - m_aVisArea.Left() - m_aVisArea.Right() ) / 2; - aPnt.X() = SetHScrollMax( aPnt.X() ); + aPnt.AdjustX(( rRect.Left() + rRect.Right() + - m_aVisArea.Left() - m_aVisArea.Right() ) / 2 ); + aPnt.setX( SetHScrollMax( aPnt.X() ) ); const SwTwips lMin = IsDocumentBorder() ? DOCUMENTBORDER : 0; - aPnt.X() = std::max( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ); + aPnt.setX( std::max( (GetLeftMargin( *this ) - lMin) + nLeftOfst, aPnt.X() ) ); } m_aVisArea = aOldVisArea; if( pCareWn ) { // If we want to avoid only a dialogue, we do // not want to go beyond the end of the document. - aPnt.Y() = SetVScrollMax( aPnt.Y() ); + aPnt.setY( SetVScrollMax( aPnt.Y() ) ); } SetVisArea( aPnt ); } @@ -572,8 +572,8 @@ long SwView::PageUp() return 0; Point aPos(m_aVisArea.TopLeft()); - aPos.Y() -= m_aVisArea.GetHeight() - (GetYScroll() / 2); - aPos.Y() = std::max(0L, aPos.Y()); + aPos.AdjustY( -(m_aVisArea.GetHeight() - (GetYScroll() / 2)) ); + aPos.setY( std::max(0L, aPos.Y()) ); SetVisArea( aPos ); return 1; } @@ -583,8 +583,8 @@ long SwView::PageDown() if ( !m_aVisArea.GetHeight() ) return 0; Point aPos( m_aVisArea.TopLeft() ); - aPos.Y() += m_aVisArea.GetHeight() - (GetYScroll() / 2); - aPos.Y() = SetVScrollMax( aPos.Y() ); + aPos.AdjustY(m_aVisArea.GetHeight() - (GetYScroll() / 2) ); + aPos.setY( SetVScrollMax( aPos.Y() ) ); SetVisArea( aPos ); return 1; } @@ -602,7 +602,7 @@ long SwView::PhyPageUp() // If there is a difference, has been truncated --> then add one pixel, // so that no residue of the previous page is visible. if( aPt.Y() != aAlPt.Y() ) - aAlPt.Y() += 3 * GetEditWin().PixelToLogic( Size( 0, 1 ) ).Height(); + aAlPt.AdjustY(3 * GetEditWin().PixelToLogic( Size( 0, 1 ) ).Height() ); SetVisArea( aAlPt ); } return 1; @@ -621,7 +621,7 @@ long SwView::PhyPageDown() // If there is a difference, has been truncated --> then add one pixel, // so that no residue of the previous page is visible. if( aPt.Y() != aAlPt.Y() ) - aAlPt.Y() += 3 * GetEditWin().PixelToLogic( Size( 0, 1 ) ).Height(); + aAlPt.AdjustY(3 * GetEditWin().PixelToLogic( Size( 0, 1 ) ).Height() ); SetVisArea( aAlPt ); } return 1; @@ -708,12 +708,12 @@ IMPL_LINK( SwView, ScrollHdl, ScrollBar *, p, void ) if( m_pWrtShell->GetPageCnt() > 1 ) { tools::Rectangle aRect; - aRect.Left() = pScrollbar->GetParent()->OutputToScreenPixel( - pScrollbar->GetPosPixel() ).X() -8; - aRect.Top() = pScrollbar->OutputToScreenPixel( - pScrollbar->GetPointerPosPixel() ).Y(); - aRect.Right() = aRect.Left(); - aRect.Bottom() = aRect.Top(); + aRect.SetLeft( pScrollbar->GetParent()->OutputToScreenPixel( + pScrollbar->GetPosPixel() ).X() -8 ); + aRect.SetTop( pScrollbar->OutputToScreenPixel( + pScrollbar->GetPointerPosPixel() ).Y() ); + aRect.SetRight( aRect.Left() ); + aRect.SetBottom( aRect.Top() ); OUString sPageStr( GetPageStr( nPhNum, nVirtNum, sDisplay )); SwContentAtPos aCnt( IsAttrAtPos::Outline ); @@ -773,10 +773,10 @@ void SwView::CalcVisArea( const Size &rOutPixel ) aTopLeft = GetEditWin().PixelToLogic( aTopLeft ); Point aBottomRight( GetEditWin().PixelToLogic( aRect.BottomRight() ) ); - aRect.Left() = aTopLeft.X(); - aRect.Top() = aTopLeft.Y(); - aRect.Right() = aBottomRight.X(); - aRect.Bottom() = aBottomRight.Y(); + aRect.SetLeft( aTopLeft.X() ); + aRect.SetTop( aTopLeft.Y() ); + aRect.SetRight( aBottomRight.X() ); + aRect.SetBottom( aBottomRight.Y() ); // The shifts to the right and/or below can now be incorrect // (e.g. change zoom level, change view size). @@ -787,8 +787,8 @@ void SwView::CalcVisArea( const Size &rOutPixel ) if ( aRect.Right() > lWidth ) { long lDelta = aRect.Right() - lWidth; - aRect.Left() -= lDelta; - aRect.Right() -= lDelta; + aRect.AdjustLeft( -lDelta ); + aRect.AdjustRight( -lDelta ); } } if ( aRect.Top() ) @@ -797,8 +797,8 @@ void SwView::CalcVisArea( const Size &rOutPixel ) if ( aRect.Bottom() > lHeight ) { long lDelta = aRect.Bottom() - lHeight; - aRect.Top() -= lDelta; - aRect.Bottom() -= lDelta; + aRect.AdjustTop( -lDelta ); + aRect.AdjustBottom( -lDelta ); } } SetVisArea( aRect ); @@ -869,12 +869,12 @@ void ViewResizePixel( const vcl::RenderContext &rRef, Point aPos( rOfst.X(), rOfst.Y()+nHLinSzHeight ); if(bVRulerRight) { - aPos.X() += rSize.Width() - nVLinSzWidth; + aPos.AdjustX(rSize.Width() - nVLinSzWidth ); nStyle |= WB_RIGHT_ALIGNED; } Size aSize( nVLinSzWidth, rEditSz.Height() ); if(!aSize.Width()) - aSize.Width() = pVRuler->GetSizePixel().Width(); + aSize.setWidth( pVRuler->GetSizePixel().Width() ); pVRuler->SetStyle(nStyle); pVRuler->SetPosSizePixel( aPos, aSize ); if(!pVRuler->IsVisible()) @@ -885,9 +885,9 @@ void ViewResizePixel( const vcl::RenderContext &rRef, { Size aSize( rSize.Width(), nHLinSzHeight ); if ( nVBSzWidth && !bVRulerRight) - aSize.Width() -= nVBSzWidth; + aSize.AdjustWidth( -nVBSzWidth ); if(!aSize.Height()) - aSize.Height() = pHRuler->GetSizePixel().Height(); + aSize.setHeight( pHRuler->GetSizePixel().Height() ); pHRuler->SetPosSizePixel( rOfst, aSize ); // VCL calls no resize on invisible windows // but that is not a good idea for the ruler @@ -902,14 +902,14 @@ void ViewResizePixel( const vcl::RenderContext &rRef, rOfst.Y()+rSize.Height()-nHBSzHeight ); if(bVRulerRight) { - aPos.X() += nVBSzWidth; + aPos.AdjustX(nVBSzWidth ); } Size aSize( rSize.Width(), nHBSzHeight ); if ( nVBSzWidth ) - aSize.Width() -= nVBSzWidth; + aSize.AdjustWidth( -nVBSzWidth ); rHScrollbar.SetPosSizePixel( aPos, aSize ); - aScrollFillPos.Y() = aPos.Y(); + aScrollFillPos.setY( aPos.Y() ); } { Point aPos( rOfst.X()+rSize.Width()-nVBSzWidth, @@ -917,21 +917,21 @@ void ViewResizePixel( const vcl::RenderContext &rRef, Size aSize( nVBSzWidth, rSize.Height() ); if(bVRulerRight) { - aPos.X() = rOfst.X(); + aPos.setX( rOfst.X() ); if(bHRuler) { - aPos.Y() += nHLinSzHeight; - aSize.Height() -= nHLinSzHeight; + aPos.AdjustY(nHLinSzHeight ); + aSize.AdjustHeight( -nHLinSzHeight ); } } if ( nHBSzHeight ) - aSize.Height() -= nHBSzHeight; + aSize.AdjustHeight( -nHBSzHeight ); rVScrollbar.SetPosSizePixel( aPos, aSize ); - aPos.Y() += aSize.Height(); + aPos.AdjustY(aSize.Height() ); - aScrollFillPos.X() = aPos.X(); + aScrollFillPos.setX( aPos.X() ); } rScrollBarBox.SetPosSizePixel(aScrollFillPos, Size(nVBSzWidth, nHBSzHeight)); @@ -951,8 +951,8 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize, bool ) { SvBorder aBorder( GetBorderPixel() ); Size aSize( rSize ); - aSize.Width() -= (aBorder.Left() + aBorder.Right()); - aSize.Height() -= (aBorder.Top() + aBorder.Bottom()); + aSize.AdjustWidth( -(aBorder.Left() + aBorder.Right()) ); + aSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) ); Size aObjSizePixel = GetWindow()->LogicToPixel(aObjSize, MapMode(MapUnit::MapTwip)); SfxViewShell::SetZoomFactor( Fraction( aSize.Width(), aObjSizePixel.Width() ), Fraction( aSize.Height(), aObjSizePixel.Height() ) ); @@ -971,16 +971,16 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize, bool ) { Size aViewSize( aSz ); Point aViewPos( rOfst ); - aViewSize.Height() -= (aBorder.Top() + aBorder.Bottom()); - aViewSize.Width() -= (aBorder.Left() + aBorder.Right()); - aViewPos.X() += aBorder.Left(); - aViewPos.Y() += aBorder.Top(); + aViewSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) ); + aViewSize.AdjustWidth( -(aBorder.Left() + aBorder.Right()) ); + aViewPos.AdjustX(aBorder.Left() ); + aViewPos.AdjustY(aBorder.Top() ); GetEditWin().SetPosSizePixel( aViewPos, aViewSize ); } else { - aSz.Height() += aBorder.Top() + aBorder.Bottom(); - aSz.Width() += aBorder.Left() + aBorder.Right(); + aSz.AdjustHeight(aBorder.Top() + aBorder.Bottom() ); + aSz.AdjustWidth(aBorder.Left() + aBorder.Right() ); } Size aEditSz( GetEditWin().GetOutputSizePixel() ); @@ -1169,7 +1169,7 @@ bool SwView::UpdateScrollbars() Size aTmpSz( m_aDocSz ); const long lOfst = bBorder ? 0 : DOCUMENTBORDER * 2; - aTmpSz.Width() += lOfst; aTmpSz.Height() += lOfst; + aTmpSz.AdjustWidth(lOfst ); aTmpSz.AdjustHeight(lOfst ); { const bool bVScrollVisible = m_pVScrollbar->IsVisible(true); diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 145a17cb8088..4fad05c26eda 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1787,7 +1787,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) if(bVerticalWriting) { aRect.Pos() += Point(aTmpRect.Left(), aTmpRect.Top()); - aRect.Pos().Y() -= rPageRect.Top(); + aRect.Pos().AdjustY( -(rPageRect.Top()) ); aColItem.SetLeft(aRect.Top()); aColItem.SetRight(nPageHeight - aRect.Bottom()); } @@ -2014,18 +2014,18 @@ void SwView::StateTabWin(SfxItemSet& rSet) const sal_uInt16 nL = std::max< sal_uInt16 >(nLft, 0); const sal_uInt16 nR = std::max< sal_uInt16 >(nRgt, 0); - aRectangle.Left() = nL; + aRectangle.SetLeft( nL ); if(nNum > 1) - aRectangle.Left() += aTabCols[nNum - 2]; + aRectangle.AdjustLeft(aTabCols[nNum - 2] ); if(nNum) - aRectangle.Left() += MINLAY; + aRectangle.AdjustLeft(MINLAY ); if(aTabCols.Count() <= nNum + 1 ) - aRectangle.Right() = nR; + aRectangle.SetRight( nR ); else - aRectangle.Right() = nPageWidth - (nL + aTabCols[nNum + 1]); + aRectangle.SetRight( nPageWidth - (nL + aTabCols[nNum + 1]) ); if(nNum < aTabCols.Count()) - aRectangle.Right() += MINLAY; + aRectangle.AdjustRight(MINLAY ); } else { @@ -2048,42 +2048,42 @@ void SwView::StateTabWin(SfxItemSet& rSet) const sal_uInt16 nOuterWidth = static_cast<sal_uInt16>(aAbsRect.Width()); int nWidth = 0, nEnd = 0; - aRectangle.Left() = 0; + aRectangle.SetLeft( 0 ); for ( sal_uInt16 i = 0; i < nCount; ++i ) { const SwColumn* pCol = &rCols[i]; const int nStart = pCol->GetLeft() + nWidth; if(i == nNum - 2) - aRectangle.Left() = nStart; + aRectangle.SetLeft( nStart ); nWidth += pCols->CalcColWidth( i, nTotalWidth ); nEnd = nWidth - pCol->GetRight(); } - aRectangle.Right() = rPageRect.Right() - nEnd; - aRectangle.Left() -= rPageRect.Left(); + aRectangle.SetRight( rPageRect.Right() - nEnd ); + aRectangle.AdjustLeft( -(rPageRect.Left()) ); if(nNum > 1) { - aRectangle.Left() += MINLAY; - aRectangle.Left() += aRect.Left(); + aRectangle.AdjustLeft(MINLAY ); + aRectangle.AdjustLeft(aRect.Left() ); } if(pFormat) // Range in frame - here you may up to the edge aRectangle.Left() = aRectangle.Right() = 0; else { // Move the rectangle to the correct absolute position. - aRectangle.Left() += aAbsRect.Left(); - aRectangle.Right() -= aAbsRect.Left(); + aRectangle.AdjustLeft(aAbsRect.Left() ); + aRectangle.AdjustRight( -(aAbsRect.Left()) ); // Include distance to the border. - aRectangle.Right() -= (nOuterWidth - nTotalWidth) / 2; + aRectangle.AdjustRight( -((nOuterWidth - nTotalWidth) / 2) ); } if(nNum < rCols.size()) { - aRectangle.Right() += MINLAY; + aRectangle.AdjustRight(MINLAY ); } else // Right is only the margin now. - aRectangle.Right() = 0; + aRectangle.SetRight( 0 ); } } @@ -2105,18 +2105,18 @@ void SwView::StateTabWin(SfxItemSet& rSet) aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded, pPt ).Pos(); - aRectangle.Left() = aRect.Left() - rPageRect.Left(); - aRectangle.Right() = rPageRect.Right() - aRect.Right(); + aRectangle.SetLeft( aRect.Left() - rPageRect.Left() ); + aRectangle.SetRight( rPageRect.Right() - aRect.Right() ); } else if( bBrowse ) { - aRectangle.Left() = rPagePrtRect.Left(); - aRectangle.Right() = nPageWidth - rPagePrtRect.Right(); + aRectangle.SetLeft( rPagePrtRect.Left() ); + aRectangle.SetRight( nPageWidth - rPagePrtRect.Right() ); } else { - aRectangle.Left() = aPageLRSpace.GetLeft(); - aRectangle.Right() = aPageLRSpace.GetRight(); + aRectangle.SetLeft( aPageLRSpace.GetLeft() ); + aRectangle.SetRight( aPageLRSpace.GetRight() ); } } else @@ -2183,31 +2183,31 @@ void SwView::StateTabWin(SfxItemSet& rSet) } if( bFrame || bColSct ) { - aRectangle.Left() = aRect.Left() - rPageRect.Left() + nStart; - aRectangle.Right() = nPageWidth - aRectangle.Left() - nEnd + nStart; + aRectangle.SetLeft( aRect.Left() - rPageRect.Left() + nStart ); + aRectangle.SetRight( nPageWidth - aRectangle.Left() - nEnd + nStart ); } else if(!bBrowse) { - aRectangle.Left() = aPageLRSpace.GetLeft() + nStart; - aRectangle.Right() = nPageWidth - nEnd - aPageLRSpace.GetLeft(); + aRectangle.SetLeft( aPageLRSpace.GetLeft() + nStart ); + aRectangle.SetRight( nPageWidth - nEnd - aPageLRSpace.GetLeft() ); } else { long nLeft = rPagePrtRect.Left(); - aRectangle.Left() = nStart + nLeft; - aRectangle.Right() = nPageWidth - nEnd - nLeft; + aRectangle.SetLeft( nStart + nLeft ); + aRectangle.SetRight( nPageWidth - nEnd - nLeft ); } if(!bFrame) { - aRectangle.Left() += nBorder; - aRectangle.Right() -= nBorder; + aRectangle.AdjustLeft(nBorder ); + aRectangle.AdjustRight( -nBorder ); } } } else if ( nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER )) { - aRectangle.Left() = aPageLRSpace.GetLeft(); - aRectangle.Right() = aPageLRSpace.GetRight(); + aRectangle.SetLeft( aPageLRSpace.GetLeft() ); + aRectangle.SetRight( aPageLRSpace.GetRight() ); } else aRectangle.Left() = aRectangle.Right() = 0; diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index df78f47fc843..16fabb29760a 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -598,7 +598,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c if(!(rValue >>= nTmp) || nTmp < 10) throw IllegalArgumentException(); Size aSize( mpViewOption->GetSnapSize() ); - aSize.Width() = convertMm100ToTwip( nTmp ); + aSize.setWidth( convertMm100ToTwip( nTmp ) ); mpViewOption->SetSnapSize( aSize ); } break; @@ -608,7 +608,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c if(!(rValue >>= nTmp) || nTmp < 10) throw IllegalArgumentException(); Size aSize( mpViewOption->GetSnapSize() ); - aSize.Height() = convertMm100ToTwip( nTmp ); + aSize.setHeight( convertMm100ToTwip( nTmp ) ); mpViewOption->SetSnapSize( aSize ); } break; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 489073d55341..264cb7245b27 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2968,17 +2968,17 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) { aPos = GetEntryPosition( pEntry ); - aPos.X() = GetTabPos( pEntry, pTab ); + aPos.setX( GetTabPos( pEntry, pTab ) ); Size aSize( pItem->GetSize( this, pEntry ) ); if((aPos.X() + aSize.Width()) > GetSizePixel().Width()) - aSize.Width() = GetSizePixel().Width() - aPos.X(); + aSize.setWidth( GetSizePixel().Width() - aPos.X() ); aPos = OutputToScreenPixel(aPos); tools::Rectangle aItemRect( aPos, aSize ); if(bBalloon) { - aPos.X() += aSize.Width(); + aPos.AdjustX(aSize.Width() ); Help::ShowBalloon( this, aPos, aItemRect, sEntry ); } else diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 6eab5a4aac29..a4aeaf143853 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -508,17 +508,17 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) sEntry = m_aContextStrings[IDX_STR_BROKEN_LINK] + sEntry; Point aEntryPos = GetEntryPosition( pEntry ); - aEntryPos.X() = GetTabPos( pEntry, pTab ); + aEntryPos.setX( GetTabPos( pEntry, pTab ) ); Size aSize( pItem->GetSize( this, pEntry ) ); if((aEntryPos.X() + aSize.Width()) > GetSizePixel().Width()) - aSize.Width() = GetSizePixel().Width() - aEntryPos.X(); + aSize.setWidth( GetSizePixel().Width() - aEntryPos.X() ); aEntryPos = OutputToScreenPixel(aEntryPos); tools::Rectangle aItemRect( aEntryPos, aSize ); if(Help::IsBalloonHelpEnabled()) { - aEntryPos.X() += aSize.Width(); + aEntryPos.AdjustX(aSize.Width() ); Help::ShowBalloon( this, aEntryPos, aItemRect, sEntry ); } else diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 7bb230d9725d..69d0f82981b0 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -546,7 +546,7 @@ void SwNavigationPI::ZoomOut() Size aOptimalSize(GetOptimalSize()); Size aNewSize(pNav->GetOutputSizePixel()); - aNewSize.Height() = m_aExpandedSize.Height(); + aNewSize.setHeight( m_aExpandedSize.Height() ); pNav->SetMinOutputSizePixel(aOptimalSize); pNav->SetOutputSizePixel(aNewSize); @@ -576,7 +576,7 @@ void SwNavigationPI::ZoomIn() Size aOptimalSize(GetOptimalSize()); Size aNewSize(pNav->GetOutputSizePixel()); - aNewSize.Height() = aOptimalSize.Height(); + aNewSize.setHeight( aOptimalSize.Height() ); pNav->SetMinOutputSizePixel(aOptimalSize); pNav->SetOutputSizePixel(aNewSize); @@ -651,7 +651,7 @@ SwNavigationPI::SwNavigationPI(SfxBindings* _pBindings, Size aItemWinSize( aFirstRect.Left() - aSecondRect.Left(), aFirstRect.Bottom() - aFirstRect.Top() ); Size aOptimalSize(m_xEdit->get_preferred_size()); - aItemWinSize.Width() = std::max(aItemWinSize.Width(), aOptimalSize.Width()); + aItemWinSize.setWidth( std::max(aItemWinSize.Width(), aOptimalSize.Width()) ); m_xEdit->SetSizePixel(aItemWinSize); m_aContentToolBox->InsertSeparator(4); m_aContentToolBox->InsertWindow( FN_PAGENUMBER, m_xEdit, ToolBoxItemBits::NONE, 4); diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx index 8180141cafbb..47e6613af6b0 100644 --- a/sw/source/uibase/utlui/shdwcrsr.cxx +++ b/sw/source/uibase/utlui/shdwcrsr.cxx @@ -61,9 +61,9 @@ void SwShadowCursor::DrawTri( const Point& rPt, long nHeight, bool bLeft ) while( aPt1.Y() <= aPt2.Y() ) { pWin->DrawLine( aPt1, aPt2 ); - aPt1.Y()++; - aPt2.Y()--; - aPt2.X() = aPt1.X() += nDiff; + aPt1.AdjustY( 1 ); + aPt2.AdjustY( -1 ); + aPt2.setX( aPt1.AdjustX(nDiff ) ); } } @@ -108,11 +108,11 @@ tools::Rectangle SwShadowCursor::GetRect() const Size aSz( nWidth, nH ); if( text::HoriOrientation::RIGHT == nOldMode ) - aPt.X() -= aSz.Width(); + aPt.AdjustX( -(aSz.Width()) ); else if( text::HoriOrientation::CENTER == nOldMode ) { - aPt.X() -= aSz.Width(); - aSz.Width() *= 2; + aPt.AdjustX( -(aSz.Width()) ); + aSz.setWidth( aSz.Width() * 2 ); } return pWin->PixelToLogic( tools::Rectangle( aPt, aSz ) ); diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx index a9360fe8dfb2..caca9733bc7a 100644 --- a/sw/source/uibase/utlui/viewlayoutctrl.cxx +++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx @@ -103,18 +103,18 @@ void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt ) const long nXOffset = (aRect.GetWidth() - nImageWidthSum) / 2; const long nYOffset = (aControlRect.GetHeight() - mpImpl->maImageSingleColumn.GetSizePixel().Height()) / 2; - aRect.Left() = aRect.Left() + nXOffset; - aRect.Top() = aRect.Top() + nYOffset; + aRect.SetLeft( aRect.Left() + nXOffset ); + aRect.SetTop( aRect.Top() + nYOffset ); // draw single column image: pDev->DrawImage( aRect.TopLeft(), bSingleColumn ? mpImpl->maImageSingleColumn_Active : mpImpl->maImageSingleColumn ); // draw automatic image: - aRect.Left() += mpImpl->maImageSingleColumn.GetSizePixel().Width(); + aRect.AdjustLeft(mpImpl->maImageSingleColumn.GetSizePixel().Width() ); pDev->DrawImage( aRect.TopLeft(), bAutomatic ? mpImpl->maImageAutomatic_Active : mpImpl->maImageAutomatic ); // draw bookmode image: - aRect.Left() += mpImpl->maImageAutomatic.GetSizePixel().Width(); + aRect.AdjustLeft(mpImpl->maImageAutomatic.GetSizePixel().Width() ); pDev->DrawImage( aRect.TopLeft(), bBookMode ? mpImpl->maImageBookMode_Active : mpImpl->maImageBookMode ); } diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx index 65b11dc743a3..91f629cddb25 100644 --- a/sw/source/uibase/wrtsh/move.cxx +++ b/sw/source/uibase/wrtsh/move.cxx @@ -102,7 +102,7 @@ bool SwWrtShell::Left( sal_uInt16 nMode, bool bSelect, if ( !bSelect && !bBasicCall && IsCursorReadonly() && !GetViewOptions()->IsSelectionInReadonly()) { Point aTmp( VisArea().Pos() ); - aTmp.X() -= VisArea().Width() * nReadOnlyScrollOfst / 100; + aTmp.AdjustX( -(VisArea().Width() * nReadOnlyScrollOfst / 100) ); m_rView.SetVisArea( aTmp ); return true; } @@ -119,8 +119,8 @@ bool SwWrtShell::Right( sal_uInt16 nMode, bool bSelect, if ( !bSelect && !bBasicCall && IsCursorReadonly() && !GetViewOptions()->IsSelectionInReadonly() ) { Point aTmp( VisArea().Pos() ); - aTmp.X() += VisArea().Width() * nReadOnlyScrollOfst / 100; - aTmp.X() = m_rView.SetHScrollMax( aTmp.X() ); + aTmp.AdjustX(VisArea().Width() * nReadOnlyScrollOfst / 100 ); + aTmp.setX( m_rView.SetHScrollMax( aTmp.X() ) ); m_rView.SetVisArea( aTmp ); return true; } @@ -136,7 +136,7 @@ bool SwWrtShell::Up( bool bSelect, sal_uInt16 nCount, bool bBasicCall ) if ( !bSelect && !bBasicCall && IsCursorReadonly() && !GetViewOptions()->IsSelectionInReadonly()) { Point aTmp( VisArea().Pos() ); - aTmp.Y() -= VisArea().Height() * nReadOnlyScrollOfst / 100; + aTmp.AdjustY( -(VisArea().Height() * nReadOnlyScrollOfst / 100) ); m_rView.SetVisArea( aTmp ); return true; } @@ -150,8 +150,8 @@ bool SwWrtShell::Down( bool bSelect, sal_uInt16 nCount, bool bBasicCall ) if ( !bSelect && !bBasicCall && IsCursorReadonly() && !GetViewOptions()->IsSelectionInReadonly()) { Point aTmp( VisArea().Pos() ); - aTmp.Y() += VisArea().Height() * nReadOnlyScrollOfst / 100; - aTmp.Y() = m_rView.SetVScrollMax( aTmp.Y() ); + aTmp.AdjustY(VisArea().Height() * nReadOnlyScrollOfst / 100 ); + aTmp.setY( m_rView.SetVScrollMax( aTmp.Y() ) ); m_rView.SetVisArea( aTmp ); return true; } @@ -165,7 +165,7 @@ bool SwWrtShell::LeftMargin( bool bSelect, bool bBasicCall ) if ( !bSelect && !bBasicCall && IsCursorReadonly() ) { Point aTmp( VisArea().Pos() ); - aTmp.X() = DOCUMENTBORDER; + aTmp.setX( DOCUMENTBORDER ); m_rView.SetVisArea( aTmp ); return true; } @@ -181,9 +181,9 @@ bool SwWrtShell::RightMargin( bool bSelect, bool bBasicCall ) if ( !bSelect && !bBasicCall && IsCursorReadonly() ) { Point aTmp( VisArea().Pos() ); - aTmp.X() = GetDocSize().Width() - VisArea().Width() + DOCUMENTBORDER; + aTmp.setX( GetDocSize().Width() - VisArea().Width() + DOCUMENTBORDER ); if( DOCUMENTBORDER > aTmp.X() ) - aTmp.X() = DOCUMENTBORDER; + aTmp.setX( DOCUMENTBORDER ); m_rView.SetVisArea( aTmp ); return true; } @@ -408,11 +408,11 @@ bool SwWrtShell::PushCursor(SwTwips lOffset, bool bSelect) if( !IsCursorVisible() ) // set CursorPos to top-/bottom left pos. So the pagescroll is not // be dependent on the current cursor, but on the visarea. - aPt.Y() = aTmpArea.Top() + aTmpArea.Height() / 2; + aPt.setY( aTmpArea.Top() + aTmpArea.Height() / 2 ); - aPt.Y() += lOffset; + aPt.AdjustY(lOffset ); m_aDest = GetContentPos(aPt,lOffset > 0); - m_aDest.X() = aPt.X(); + m_aDest.setX( aPt.X() ); m_bDestOnStack = true; } @@ -424,7 +424,7 @@ bool SwWrtShell::PushCursor(SwTwips lOffset, bool bSelect) //Place the cursor at the target position; remember that no target //position is longer on the stack. //The new visible region is to be determined beforehand. - aTmpArea.Pos().Y() += lOffset; + aTmpArea.Pos().AdjustY(lOffset ); if( aTmpArea.IsInside(m_aDest) ) { if( bSelect ) @@ -482,7 +482,7 @@ bool SwWrtShell::PopCursor(bool bUpdate, bool bSelect) // If a predecessor is on the stack, // use the flag for a valid position. SwRect aTmpArea(VisArea()); - aTmpArea.Pos().Y() -= m_pCursorStack->lOffset; + aTmpArea.Pos().AdjustY( -(m_pCursorStack->lOffset) ); if( aTmpArea.IsInside( m_pCursorStack->aDocPos ) ) { if( bSelect ) diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index c8e9b93712b4..b68b4b77df00 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -303,8 +303,8 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter, // Add the margin attributes to GrfSize, // because these counts at the margin additionally - aGrfSize.Width() += pFrameMgr->CalcWidthBorder(); - aGrfSize.Height()+= pFrameMgr->CalcHeightBorder(); + aGrfSize.AdjustWidth(pFrameMgr->CalcWidthBorder() ); + aGrfSize.AdjustHeight(pFrameMgr->CalcHeightBorder() ); const BigInt aTempWidth( aGrfSize.Width() ); const BigInt aTempHeight( aGrfSize.Height()); @@ -312,14 +312,14 @@ void SwWrtShell::Insert( const OUString &rPath, const OUString &rFilter, // Fit width if necessary, scale down the height proportional thereafter. if( aGrfSize.Width() > aBound.Width() ) { - aGrfSize.Width() = aBound.Width(); - aGrfSize.Height() = BigInt(aBound.Width()) * aTempHeight / aTempWidth; + aGrfSize.setWidth( aBound.Width() ); + aGrfSize.setHeight( BigInt(aBound.Width()) * aTempHeight / aTempWidth ); } // Fit height if necessary, scale down the width proportional thereafter. if( aGrfSize.Height() > aBound.Height() ) { - aGrfSize.Height() = aBound.Height(); - aGrfSize.Width() = BigInt(aBound.Height()) * aTempWidth / aTempHeight; + aGrfSize.setHeight( aBound.Height() ); + aGrfSize.setWidth( BigInt(aBound.Height()) * aTempWidth / aTempHeight ); } pFrameMgr->SetSize( aGrfSize ); pFrameMgr->UpdateFlyFrame(); @@ -508,8 +508,8 @@ bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrame if ( aSz.Width() > aBound.Width() ) { //Always limit proportional. - aSz.Height() = aSz.Height() * aBound.Width() / aSz.Width(); - aSz.Width() = aBound.Width(); + aSz.setHeight( aSz.Height() * aBound.Width() / aSz.Width() ); + aSz.setWidth( aBound.Width() ); } aFrameMgr.SetSize( aSz ); SwFlyFrameFormat *pFormat = SwFEShell::InsertObject( xRef, &aFrameMgr.GetAttrSet() ); |