From bea7bbcaaa757155c9cd0f33f1d50ab54cb946bb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 19 Feb 2018 08:35:33 +0200 Subject: loplugin:changetoolsgen in starmath Change-Id: Iafa99639e1fe2bc45ece2b3ef0744816446f3faf Reviewed-on: https://gerrit.libreoffice.org/49959 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/source/ElementsDockingWindow.cxx | 14 ++-- starmath/source/accessibility.cxx | 8 +- starmath/source/dialog.cxx | 8 +- starmath/source/document.cxx | 28 +++---- starmath/source/edit.cxx | 14 ++-- starmath/source/mathmlimport.cxx | 4 +- starmath/source/node.cxx | 128 +++++++++++++++--------------- starmath/source/rect.cxx | 72 ++++++++--------- starmath/source/unomodel.cxx | 22 ++--- starmath/source/utility.cxx | 2 +- starmath/source/view.cxx | 68 ++++++++-------- starmath/source/visitors.cxx | 10 +-- 12 files changed, 189 insertions(+), 189 deletions(-) diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index c39833f051bc..5353c344eec9 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -429,11 +429,11 @@ void SmElementsControl::RequestHelp(const HelpEvent& rHEvt) tools::Rectangle aHelpRect(pHelpElement->mBoxLocation, pHelpElement->mBoxSize); Point aPt = OutputToScreenPixel( aHelpRect.TopLeft() ); - aHelpRect.Left() = aPt.X(); - aHelpRect.Top()= aPt.Y(); + aHelpRect.SetLeft( aPt.X() ); + aHelpRect.SetTop( aPt.Y() ); aPt = OutputToScreenPixel( aHelpRect.BottomRight() ); - aHelpRect.Right() = aPt.X(); - aHelpRect.Bottom() = aPt.Y(); + aHelpRect.SetRight( aPt.X() ); + aHelpRect.SetBottom( aPt.Y() ); // get text and display it OUString aStr = pHelpElement->getHelpText(); @@ -514,7 +514,7 @@ void SmElementsControl::DoScroll(long nDelta) { Point aNewPoint = mxScroll->GetPosPixel(); tools::Rectangle aRect(Point(), GetOutputSize()); - aRect.Right() -= mxScroll->GetSizePixel().Width(); + aRect.AdjustRight( -(mxScroll->GetSizePixel().Width()) ); Scroll( 0, -nDelta, aRect ); mxScroll->SetPosPixel(aNewPoint); LayoutOrPaintContents(); @@ -531,11 +531,11 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin Size aSizePixel = LogicToPixel(Size(pNode->GetWidth(), pNode->GetHeight()), MapMode(MapUnit::Map100thMM)); if (aSizePixel.Width() > maMaxElementDimensions.Width()) { - maMaxElementDimensions.Width() = aSizePixel.Width(); + maMaxElementDimensions.setWidth( aSizePixel.Width() ); } if (aSizePixel.Height() > maMaxElementDimensions.Height()) { - maMaxElementDimensions.Height() = aSizePixel.Height(); + maMaxElementDimensions.setHeight( aSizePixel.Height() ); } maElementList.push_back(o3tl::make_unique(std::move(pNode), aElementSource, aHelpText)); diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index 057d2e0f62f5..afb79f841ee3 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -482,14 +482,14 @@ awt::Rectangle SAL_CALL SmGraphicAccessible::getCharacterBounds( sal_Int32 nInde // get appropriate rectangle Point aOffset(pNode->GetTopLeft() - pTree->GetTopLeft()); Point aTLPos (pWin->GetFormulaDrawPos() + aOffset); - aTLPos.X() -= 0; + aTLPos.AdjustX( -0 ); Size aSize (pNode->GetSize()); long* pXAry = new long[ aNodeText.getLength() ]; pWin->SetFont( pNode->GetFont() ); pWin->GetTextArray( aNodeText, pXAry, 0, aNodeText.getLength() ); - aTLPos.X() += nNodeIndex > 0 ? pXAry[nNodeIndex - 1] : 0; - aSize.Width() = nNodeIndex > 0 ? pXAry[nNodeIndex] - pXAry[nNodeIndex - 1] : pXAry[nNodeIndex]; + aTLPos.AdjustX(nNodeIndex > 0 ? pXAry[nNodeIndex - 1] : 0 ); + aSize.setWidth( nNodeIndex > 0 ? pXAry[nNodeIndex] - pXAry[nNodeIndex - 1] : pXAry[nNodeIndex] ); delete[] pXAry; aTLPos = pWin->LogicToPixel( aTLPos ); @@ -542,7 +542,7 @@ sal_Int32 SAL_CALL SmGraphicAccessible::getIndexAtPoint( const awt::Point& aPoin // get appropriate rectangle Point aOffset( pNode->GetTopLeft() - pTree->GetTopLeft() ); Point aTLPos ( aOffset ); - aTLPos.X() -= 0; + aTLPos.AdjustX( -0 ); Size aSize( pNode->GetSize() ); tools::Rectangle aRect( aTLPos, aSize ); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index ca70ff1626c8..5da957ec7650 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1156,11 +1156,11 @@ void SmShowSymbolSetWindow::MouseButtonDown(const MouseEvent& rMEvt) GrabFocus(); Size aOutputSize(nColumns * nLen, nRows * nLen); - aOutputSize.Width() += nXOffset; - aOutputSize.Height() += nYOffset; + aOutputSize.AdjustWidth(nXOffset ); + aOutputSize.AdjustHeight(nYOffset ); Point aPoint(rMEvt.GetPosPixel()); - aPoint.X() -= nXOffset; - aPoint.Y() -= nYOffset; + aPoint.AdjustX( -(nXOffset) ); + aPoint.AdjustY( -(nYOffset) ); if (rMEvt.IsLeft() && tools::Rectangle(Point(0, 0), aOutputSize).IsInside(rMEvt.GetPosPixel())) { diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index d1ab6b0d02fe..34cb86fa053f 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -385,8 +385,8 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel // VisArea (i.e. the size within the client) and the current size. // Idea: The difference could be adapted with SmNod::SetSize (no long-term solution) - rPosition.X() += maFormat.GetDistance( DIS_LEFTSPACE ); - rPosition.Y() += maFormat.GetDistance( DIS_TOPSPACE ); + rPosition.AdjustX(maFormat.GetDistance( DIS_LEFTSPACE ) ); + rPosition.AdjustY(maFormat.GetDistance( DIS_TOPSPACE ) ); //! in case of high contrast-mode (accessibility option!) //! the draw mode needs to be set to default, because when imbedding @@ -439,15 +439,15 @@ Size SmDocShell::GetSize() aRet = mpTree->GetSize(); if ( !aRet.Width() ) - aRet.Width() = 2000; + aRet.setWidth( 2000 ); else - aRet.Width() += maFormat.GetDistance( DIS_LEFTSPACE ) + - maFormat.GetDistance( DIS_RIGHTSPACE ); + aRet.AdjustWidth(maFormat.GetDistance( DIS_LEFTSPACE ) + + maFormat.GetDistance( DIS_RIGHTSPACE ) ); if ( !aRet.Height() ) - aRet.Height() = 1000; + aRet.setHeight( 1000 ); else - aRet.Height() += maFormat.GetDistance( DIS_TOPSPACE ) + - maFormat.GetDistance( DIS_BOTTOMSPACE ); + aRet.AdjustHeight(maFormat.GetDistance( DIS_TOPSPACE ) + + maFormat.GetDistance( DIS_BOTTOMSPACE ) ); } return aRet; @@ -489,8 +489,8 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell ) MapMode aMap( pPrinter->GetMapMode() ); aMap.SetMapUnit( MapUnit::Map100thMM ); Point aTmp( aMap.GetOrigin() ); - aTmp.X() = OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM ); - aTmp.Y() = OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM ); + aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM ) ); + aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM ) ); aMap.SetOrigin( aTmp ); pPrinter->SetMapMode( aMap ); } @@ -514,8 +514,8 @@ SmPrinterAccess::SmPrinterAccess( SmDocShell &rDocShell ) MapMode aMap( pRefDev->GetMapMode() ); aMap.SetMapUnit( MapUnit::Map100thMM ); Point aTmp( aMap.GetOrigin() ); - aTmp.X() = OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM ); - aTmp.Y() = OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM ); + aTmp.setX( OutputDevice::LogicToLogic( aTmp.X(), eOld, MapUnit::Map100thMM ) ); + aTmp.setY( OutputDevice::LogicToLogic( aTmp.Y(), eOld, MapUnit::Map100thMM ) ); aMap.SetOrigin( aTmp ); pRefDev->SetMapMode( aMap ); } @@ -1220,8 +1220,8 @@ void SmDocShell::SetVisArea(const tools::Rectangle & rVisArea) aNewRect.SetPos(Point()); - if (! aNewRect.Right()) aNewRect.Right() = 2000; - if (! aNewRect.Bottom()) aNewRect.Bottom() = 1000; + if (! aNewRect.Right()) aNewRect.SetRight( 2000 ); + if (! aNewRect.Bottom()) aNewRect.SetBottom( 1000 ); bool bIsEnabled = IsEnableSetModified(); if ( bIsEnabled ) diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index e6bf5138fd06..edd7db345037 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -284,7 +284,7 @@ void SmEditWindow::Resize() if (pEditView->GetVisArea().Top() > nMaxVisAreaStart) { tools::Rectangle aVisArea(pEditView->GetVisArea() ); - aVisArea.Top() = std::max(nMaxVisAreaStart, 0); + aVisArea.SetTop( std::max(nMaxVisAreaStart, 0) ); aVisArea.SetSize(pEditView->GetOutputArea().GetSize()); pEditView->SetVisArea(aVisArea); pEditView->ShowCursor(); @@ -560,18 +560,18 @@ tools::Rectangle SmEditWindow::AdjustScrollBars() if (pVScrollBar && pHScrollBar && pScrollBox) { const long nTmp = GetSettings().GetStyleSettings().GetScrollBarSize(); - Point aPt( aRect.TopRight() ); aPt.X() -= nTmp -1; + Point aPt( aRect.TopRight() ); aPt.AdjustX( -(nTmp -1) ); pVScrollBar->SetPosSizePixel( aPt, Size(nTmp, aOut.Height() - nTmp)); - aPt = aRect.BottomLeft(); aPt.Y() -= nTmp - 1; + aPt = aRect.BottomLeft(); aPt.AdjustY( -(nTmp - 1) ); pHScrollBar->SetPosSizePixel( aPt, Size(aOut.Width() - nTmp, nTmp)); - aPt.X() = pHScrollBar->GetSizePixel().Width(); - aPt.Y() = pVScrollBar->GetSizePixel().Height(); + aPt.setX( pHScrollBar->GetSizePixel().Width() ); + aPt.setY( pVScrollBar->GetSizePixel().Height() ); pScrollBox->SetPosSizePixel(aPt, Size(nTmp, nTmp )); - aRect.Right() = aPt.X() - 2; - aRect.Bottom() = aPt.Y() - 2; + aRect.SetRight( aPt.X() - 2 ); + aRect.SetBottom( aPt.Y() - 2 ); } return aRect; } diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx index bf90545a5e99..ed207aaa0f0b 100644 --- a/starmath/source/mathmlimport.cxx +++ b/starmath/source/mathmlimport.cxx @@ -3078,14 +3078,14 @@ void SmXMLImport::SetViewSettings(const Sequence& aViewProps) { pValue->Value >>= nTmp; Size aSize( aRect.GetSize() ); - aSize.Width() = nTmp; + aSize.setWidth( nTmp ); aRect.SaturatingSetSize(aSize); } else if (pValue->Name == "ViewAreaHeight" ) { pValue->Value >>= nTmp; Size aSize( aRect.GetSize() ); - aSize.Height() = nTmp; + aSize.setHeight( nTmp ); aRect.SaturatingSetSize(aSize); } pValue++; diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 6da2dd4bb0b9..d7dd6e4cd276 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -153,28 +153,28 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType) long nHeight = static_cast(aVal); aFntSize = GetFont().GetFontSize(); - aFntSize.Width() = 0; + aFntSize.setWidth( 0 ); switch(nType) { case FontSizeType::ABSOLUT: - aFntSize.Height() = nHeight; + aFntSize.setHeight( nHeight ); break; case FontSizeType::PLUS: - aFntSize.Height() += nHeight; + aFntSize.AdjustHeight(nHeight ); break; case FontSizeType::MINUS: - aFntSize.Height() -= nHeight; + aFntSize.AdjustHeight( -nHeight ); break; case FontSizeType::MULTIPLY: - aFntSize.Height() = static_cast(Fraction(aFntSize.Height()) * rSize); + aFntSize.setHeight( static_cast(Fraction(aFntSize.Height()) * rSize) ); break; case FontSizeType::DIVIDE: if (rSize != Fraction(0)) - aFntSize.Height() = static_cast(Fraction(aFntSize.Height()) / rSize); + aFntSize.setHeight( static_cast(Fraction(aFntSize.Height()) / rSize) ); break; default: break; @@ -183,7 +183,7 @@ void SmNode::SetFontSize(const Fraction &rSize, FontSizeType nType) // check the requested size against maximum value static int const nMaxVal = SmPtsTo100th_mm(128); if (aFntSize.Height() > nMaxVal) - aFntSize.Height() = nMaxVal; + aFntSize.setHeight( nMaxVal ); GetFont().SetSize(aFntSize); } @@ -517,7 +517,7 @@ void SmTableNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) aPos = rNodeRect.AlignTo(*this, RectPos::Bottom, eHorAlign, RectVerAlign::Baseline); if (i) - aPos.Y() += nDist; + aPos.AdjustY(nDist ); pNode->MoveTo(aPos); ExtendBy(rNodeRect, nSize > 1 ? RectCopyMBL::None : RectCopyMBL::Arg); } @@ -614,7 +614,7 @@ void SmLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) aPos = pNode->AlignTo(*this, RectPos::Right, RectHorAlign::Center, RectVerAlign::Baseline); // add horizontal space to the left for each but the first sub node - aPos.X() += nDist; + aPos.AdjustX(nDist ); pNode->MoveTo(aPos); ExtendBy( *pNode, RectCopyMBL::Xor ); @@ -661,7 +661,7 @@ void SmUnHorNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) SmRect::operator = (*pNode0); Point aPos = pNode1->AlignTo(*this, RectPos::Right, RectHorAlign::Center, RectVerAlign::Baseline); - aPos.X() += nDist; + aPos.AdjustX(nDist ); pNode1->MoveTo(aPos); ExtendBy(*pNode1, RectCopyMBL::Xor); } @@ -693,14 +693,14 @@ Point lcl_GetExtraPos(const SmRect &rRootSymbol, (rSymSize.Height() * 52) / 100); // from this calculate topleft edge of 'rExtra' - aPos.X() -= rExtra.GetWidth() + rExtra.GetItalicRightSpace(); - aPos.Y() -= rExtra.GetHeight(); + aPos.AdjustX( -(rExtra.GetWidth() + rExtra.GetItalicRightSpace()) ); + aPos.AdjustY( -(rExtra.GetHeight()) ); // if there's enough space move a bit less to the right // examples: "nroot i a", "nroot j a" // (it looks better if we don't use italic-spaces here) long nX = rRootSymbol.GetLeft() + (rSymSize.Width() * 30) / 100; if (aPos.X() > nX) - aPos.X() = nX; + aPos.setX( nX ); return aPos; } @@ -735,8 +735,8 @@ void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) Point aPos = pRootSym->AlignTo(*pBody, RectPos::Left, RectHorAlign::Center, RectVerAlign::Baseline); //! override calculated vertical position - aPos.Y() = pRootSym->GetTop() + pBody->GetBottom() - pRootSym->GetBottom(); - aPos.Y() -= nVerOffset; + aPos.setY( pRootSym->GetTop() + pBody->GetBottom() - pRootSym->GetBottom() ); + aPos.AdjustY( -nVerOffset ); pRootSym->MoveTo(aPos); if (pExtra) @@ -801,12 +801,12 @@ void SmBinHorNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) Point aPos; aPos = pOper->AlignTo(*this, RectPos::Right, RectHorAlign::Center, RectVerAlign::Baseline); - aPos.X() += nDist; + aPos.AdjustX(nDist ); pOper->MoveTo(aPos); ExtendBy(*pOper, RectCopyMBL::Xor); aPos = pRight->AlignTo(*this, RectPos::Right, RectHorAlign::Center, RectVerAlign::Baseline); - aPos.X() += nDist; + aPos.AdjustX(nDist ); pRight->MoveTo(aPos); ExtendBy(*pRight, RectCopyMBL::Xor); @@ -857,7 +857,7 @@ void SmBinVerNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) // move numerator to its position Point aPos = pNum->AlignTo(*pLine, RectPos::Top, eHorAlign, RectVerAlign::Baseline); - aPos.Y() -= nNumDist; + aPos.AdjustY( -nNumDist ); pNum->MoveTo(aPos); // get horizontal alignment for denominator @@ -866,7 +866,7 @@ void SmBinVerNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) // move denominator to its position aPos = pDenom->AlignTo(*pLine, RectPos::Bottom, eHorAlign, RectVerAlign::Baseline); - aPos.Y() += nDenomDist; + aPos.AdjustY(nDenomDist ); pDenom->MoveTo(aPos); SmRect::operator = (*pNum); @@ -1067,8 +1067,8 @@ void SmBinDiagonalNode::GetOperPosSize(Point &rPos, Size &rSize, } rSize = Size(nRight - nLeft + 1, nBottom - nTop + 1); - rPos.X() = nLeft; - rPos.Y() = nTop; + rPos.setX( nLeft ); + rPos.setY( nTop ); } @@ -1102,11 +1102,11 @@ void SmBinDiagonalNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) // determine TopLeft position from the right argument Point aPos; - aPos.X() = pLeft->GetItalicRight() + nDelta + pRight->GetItalicLeftSpace(); + aPos.setX( pLeft->GetItalicRight() + nDelta + pRight->GetItalicLeftSpace() ); if (IsAscending()) - aPos.Y() = pLeft->GetBottom() + nDelta; + aPos.setY( pLeft->GetBottom() + nDelta ); else - aPos.Y() = pLeft->GetTop() - nDelta - pRight->GetHeight(); + aPos.setY( pLeft->GetTop() - nDelta - pRight->GetHeight() ); pRight->MoveTo(aPos); @@ -1204,10 +1204,10 @@ void SmSubSupNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) aPos = pSubSup->GetRect().AlignTo(aTmpRect, eSubSup == LSUB ? RectPos::Left : RectPos::Right, RectHorAlign::Center, RectVerAlign::Bottom); - aPos.Y() += nDist; + aPos.AdjustY(nDist ); nDelta = nDelimLine - aPos.Y(); if (nDelta > 0) - aPos.Y() += nDelta; + aPos.AdjustY(nDelta ); break; case RSUP : case LSUP : @@ -1217,10 +1217,10 @@ void SmSubSupNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) aPos = pSubSup->GetRect().AlignTo(aTmpRect, eSubSup == LSUP ? RectPos::Left : RectPos::Right, RectHorAlign::Center, RectVerAlign::Top); - aPos.Y() -= nDist; + aPos.AdjustY( -nDist ); nDelta = aPos.Y() + pSubSup->GetHeight() - nDelimLine; if (nDelta > 0) - aPos.Y() -= nDelta; + aPos.AdjustY( -nDelta ); break; case CSUB : if (!bIsTextmode) @@ -1228,7 +1228,7 @@ void SmSubSupNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) * rFormat.GetDistance(DIS_LOWERLIMIT) / 100L; aPos = pSubSup->GetRect().AlignTo(rBodyRect, RectPos::Bottom, RectHorAlign::Center, RectVerAlign::Baseline); - aPos.Y() += nDist; + aPos.AdjustY(nDist ); break; case CSUP : if (!bIsTextmode) @@ -1236,7 +1236,7 @@ void SmSubSupNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) * rFormat.GetDistance(DIS_UPPERLIMIT) / 100L; aPos = pSubSup->GetRect().AlignTo(rBodyRect, RectPos::Top, RectHorAlign::Center, RectVerAlign::Baseline); - aPos.Y() -= nDist; + aPos.AdjustY( -nDist ); break; } @@ -1392,12 +1392,12 @@ void SmBraceNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) Size aTmpSize (pLeft->GetFont().GetFontSize()); OSL_ENSURE(pRight->GetFont().GetFontSize() == aTmpSize, "Sm : different font sizes"); - aTmpSize.Width() = std::min(nBraceHeight * 60L / 100L, - rFormat.GetBaseSize().Height() * 3L / 2L); + aTmpSize.setWidth( std::min(nBraceHeight * 60L / 100L, + rFormat.GetBaseSize().Height() * 3L / 2L) ); // correction factor since change from StarMath to OpenSymbol font // because of the different font width in the FontMetric - aTmpSize.Width() *= 182; - aTmpSize.Width() /= 267; + aTmpSize.setWidth( aTmpSize.Width() * 182 ); + aTmpSize.setWidth( aTmpSize.Width() / 267 ); sal_Unicode cChar = pLeft->GetToken().cMathChar; if (cChar != MS_LINE && cChar != MS_DLINE && @@ -1421,11 +1421,11 @@ void SmBraceNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) Point aPos; aPos = pLeft->AlignTo(*pBody, RectPos::Left, RectHorAlign::Center, eVerAlign); - aPos.X() -= nDist; + aPos.AdjustX( -nDist ); pLeft->MoveTo(aPos); aPos = pRight->AlignTo(*pBody, RectPos::Right, RectHorAlign::Center, eVerAlign); - aPos.X() += nDist; + aPos.AdjustX(nDist ); pRight->MoveTo(aPos); SmRect::operator = (*pBody); @@ -1487,7 +1487,7 @@ void SmBracebodyNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) SmNode *pRight = GetSubNode(i); Point aPosX = pRight->AlignTo(*pLeft, RectPos::Right, RectHorAlign::Center, eVerAlign), aPosY = pRight->AlignTo(aRefRect, RectPos::Right, RectHorAlign::Center, eVerAlign); - aPosX.X() += nDist; + aPosX.AdjustX(nDist ); pRight->MoveTo(Point(aPosX.X(), aPosY.Y())); ExtendBy(*pRight, bIsSeparator ? RectCopyMBL::This : RectCopyMBL::Xor); @@ -1546,11 +1546,11 @@ void SmVerticalBraceNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) nDistScript /= 100; Point aPos = pBrace->AlignTo(*pBody, eRectPos, RectHorAlign::Center, RectVerAlign::Baseline); - aPos.Y() += nDistBody; + aPos.AdjustY(nDistBody ); pBrace->MoveTo(aPos); aPos = pScript->AlignTo(*pBrace, eRectPos, RectHorAlign::Center, RectVerAlign::Baseline); - aPos.Y() += nDistScript; + aPos.AdjustY(nDistScript ); pScript->MoveTo(aPos); SmRect::operator = (*pBody); @@ -1633,7 +1633,7 @@ void SmOperNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) * rFormat.GetDistance(DIS_OPERATORSPACE) / 100L; Point aPos = pOper->AlignTo(*pBody, RectPos::Left, RectHorAlign::Center, bDynamicallySized ? RectVerAlign::CenterY : RectVerAlign::Mid); - aPos.X() -= nDist; + aPos.AdjustX( -nDist ); pOper->MoveTo(aPos); SmRect::operator = (*pBody); @@ -1702,7 +1702,7 @@ void SmAttributNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) * rFormat.GetDistance(DIS_ORNAMENTSPACE) / 100L; } Point aPos = pAttr->AlignTo(*pBody, RectPos::Attribute, RectHorAlign::Center, eVerAlign); - aPos.Y() -= nDist; + aPos.AdjustY( -nDist ); pAttr->MoveTo(aPos); SmRect::operator = (*pBody); @@ -1927,14 +1927,14 @@ SmPolyLineNode::SmPolyLineNode(const SmToken &rNodeToken) void SmPolyLineNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nNewWidth) { - maToSize.Width() = nNewWidth; + maToSize.setWidth( nNewWidth ); } void SmPolyLineNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nNewHeight) { GetFont().FreezeBorderWidth(); - maToSize.Height() = nNewHeight; + maToSize.setHeight( nNewHeight ); } @@ -1953,18 +1953,18 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) Point aPointA, aPointB; if (GetToken().eType == TWIDESLASH) { - aPointA.X() = nBorderwidth; - aPointA.Y() = maToSize.Height() - nBorderwidth; - aPointB.X() = maToSize.Width() - nBorderwidth; - aPointB.Y() = nBorderwidth; + aPointA.setX( nBorderwidth ); + aPointA.setY( maToSize.Height() - nBorderwidth ); + aPointB.setX( maToSize.Width() - nBorderwidth ); + aPointB.setY( nBorderwidth ); } else { OSL_ENSURE(GetToken().eType == TWIDEBACKSLASH, "Sm : unexpected token"); aPointA.X() = aPointA.Y() = nBorderwidth; - aPointB.X() = maToSize.Width() - nBorderwidth; - aPointB.Y() = maToSize.Height() - nBorderwidth; + aPointB.setX( maToSize.Width() - nBorderwidth ); + aPointB.setY( maToSize.Height() - nBorderwidth ); } maPoly.SetPoint(aPointA, 0); maPoly.SetPoint(aPointB, 1); @@ -1998,14 +1998,14 @@ void SmRootSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight) void SmRectangleNode::AdaptToX(OutputDevice &/*rDev*/, sal_uLong nWidth) { - maToSize.Width() = nWidth; + maToSize.setWidth( nWidth ); } void SmRectangleNode::AdaptToY(OutputDevice &/*rDev*/, sal_uLong nHeight) { GetFont().FreezeBorderWidth(); - maToSize.Height() = nHeight; + maToSize.setHeight( nHeight ); } @@ -2291,16 +2291,16 @@ void SmMatrixNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) // and horizontal alignment switch (eHorAlign) { case RectHorAlign::Left: - aPos.X() = aColLeft[j]; + aPos.setX( aColLeft[j] ); break; case RectHorAlign::Center: - aPos.X() = rNodeRect.GetLeft() + aColLeft[j] + aPos.setX( rNodeRect.GetLeft() + aColLeft[j] + aColWidth[j] / 2 - - rNodeRect.GetItalicCenterX(); + - rNodeRect.GetItalicCenterX() ); break; case RectHorAlign::Right: - aPos.X() = aColLeft[j] - + aColWidth[j] - rNodeRect.GetItalicWidth(); + aPos.setX( aColLeft[j] + + aColWidth[j] - rNodeRect.GetItalicWidth() ); break; default: assert(false); @@ -2312,7 +2312,7 @@ void SmMatrixNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) aPos = aLineRect.AlignTo(*this, RectPos::Bottom, RectHorAlign::Center, RectVerAlign::Baseline); if (i > 0) - aPos.Y() += nVerDist; + aPos.AdjustY(nVerDist ); // move 'aLineRect' and rectangles in that line to final position Point aDelta(0, // since horizontal alignment is already done @@ -2359,7 +2359,7 @@ void SmMathSymbolNode::AdaptToX(OutputDevice &rDev, sal_uLong nWidth) Size aFntSize (GetFont().GetFontSize()); //! however the result is a bit better with 'nWidth' as initial font width - aFntSize.Width() = nWidth; + aFntSize.setWidth( nWidth ); GetFont().SetSize(aFntSize); SmTmpDevice aTmpDev (rDev, true); @@ -2370,8 +2370,8 @@ void SmMathSymbolNode::AdaptToX(OutputDevice &rDev, sal_uLong nWidth) long nDenom = SmRect(aTmpDev, nullptr, GetText(), nTmpBorderWidth).GetItalicWidth(); // scale fontwidth with this error factor - aFntSize.Width() *= nWidth; - aFntSize.Width() /= nDenom ? nDenom : 1; + aFntSize.setWidth( aFntSize.Width() * nWidth ); + aFntSize.setWidth( aFntSize.Width() / ( nDenom ? nDenom : 1) ); GetFont().SetSize(aFntSize); } @@ -2387,14 +2387,14 @@ void SmMathSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight) { rDev.Push(PushFlags::FONT | PushFlags::MAPMODE); rDev.SetFont(GetFont()); - aFntSize.Width() = rDev.GetFontMetric().GetFontSize().Width(); + aFntSize.setWidth( rDev.GetFontMetric().GetFontSize().Width() ); rDev.Pop(); } OSL_ENSURE(aFntSize.Width() != 0, "Sm: "); //! however the result is a bit better with 'nHeight' as initial //! font height - aFntSize.Height() = nHeight; + aFntSize.setHeight( nHeight ); GetFont().SetSize(aFntSize); SmTmpDevice aTmpDev (rDev, true); @@ -2405,8 +2405,8 @@ void SmMathSymbolNode::AdaptToY(OutputDevice &rDev, sal_uLong nHeight) long nDenom = SmRect(aTmpDev, nullptr, GetText(), nTmpBorderWidth).GetHeight(); // scale fontwidth with this error factor - aFntSize.Height() *= nHeight; - aFntSize.Height() /= nDenom ? nDenom : 1; + aFntSize.setHeight( aFntSize.Height() * nHeight ); + aFntSize.setHeight( aFntSize.Height() / ( nDenom ? nDenom : 1) ); GetFont().SetSize(aFntSize); } diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index d9a235f621f7..c67c1a2b72f0 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -91,8 +91,8 @@ bool SmGetGlyphBoundRect(const vcl::RenderContext &rDev, if (nGDTextWidth != 0 && nTextWidth != nGDTextWidth) { - aResult.Right() *= nTextWidth; - aResult.Right() /= nGDTextWidth * nScaleFactor; + aResult.SetRight( aResult.Right() * nTextWidth ); + aResult.SetRight( aResult.Right() / ( nGDTextWidth * nScaleFactor) ); } } } @@ -285,8 +285,8 @@ SmRect::SmRect(long nWidth, long nHeight) void SmRect::SetLeft(long nLeft) { if (nLeft <= GetRight()) - { aSize.Width() = GetRight() - nLeft + 1; - aTopLeft.X() = nLeft; + { aSize.setWidth( GetRight() - nLeft + 1 ); + aTopLeft.setX( nLeft ); } } @@ -294,22 +294,22 @@ void SmRect::SetLeft(long nLeft) void SmRect::SetRight(long nRight) { if (nRight >= GetLeft()) - aSize.Width() = nRight - GetLeft() + 1; + aSize.setWidth( nRight - GetLeft() + 1 ); } void SmRect::SetBottom(long nBottom) { if (nBottom >= GetTop()) - aSize.Height() = nBottom - GetTop() + 1; + aSize.setHeight( nBottom - GetTop() + 1 ); } void SmRect::SetTop(long nTop) { if (nTop <= GetBottom()) - { aSize.Height() = GetBottom() - nTop + 1; - aTopLeft.Y() = nTop; + { aSize.setHeight( GetBottom() - nTop + 1 ); + aTopLeft.setY( nTop ); } } @@ -339,21 +339,21 @@ const Point SmRect::AlignTo(const SmRect &rRect, RectPos ePos, // set horizontal or vertical new rectangle position depending on ePos switch (ePos) { case RectPos::Left: - aPos.X() = rRect.GetItalicLeft() - GetItalicRightSpace() - - GetWidth(); + aPos.setX( rRect.GetItalicLeft() - GetItalicRightSpace() + - GetWidth() ); break; case RectPos::Right: - aPos.X() = rRect.GetItalicRight() + 1 + GetItalicLeftSpace(); + aPos.setX( rRect.GetItalicRight() + 1 + GetItalicLeftSpace() ); break; case RectPos::Top: - aPos.Y() = rRect.GetTop() - GetHeight(); + aPos.setY( rRect.GetTop() - GetHeight() ); break; case RectPos::Bottom: - aPos.Y() = rRect.GetBottom() + 1; + aPos.setY( rRect.GetBottom() + 1 ); break; case RectPos::Attribute: - aPos.X() = rRect.GetItalicCenterX() - GetItalicWidth() / 2 - + GetItalicLeftSpace(); + aPos.setX( rRect.GetItalicCenterX() - GetItalicWidth() / 2 + + GetItalicLeftSpace() ); break; default: assert(false); @@ -364,33 +364,33 @@ const Point SmRect::AlignTo(const SmRect &rRect, RectPos ePos, // correct error in current vertical position switch (eVer) { case RectVerAlign::Top : - aPos.Y() += rRect.GetAlignT() - GetAlignT(); + aPos.AdjustY(rRect.GetAlignT() - GetAlignT() ); break; case RectVerAlign::Mid : - aPos.Y() += rRect.GetAlignM() - GetAlignM(); + aPos.AdjustY(rRect.GetAlignM() - GetAlignM() ); break; case RectVerAlign::Baseline : // align baselines if possible else align mid's if (HasBaseline() && rRect.HasBaseline()) - aPos.Y() += rRect.GetBaseline() - GetBaseline(); + aPos.AdjustY(rRect.GetBaseline() - GetBaseline() ); else - aPos.Y() += rRect.GetAlignM() - GetAlignM(); + aPos.AdjustY(rRect.GetAlignM() - GetAlignM() ); break; case RectVerAlign::Bottom : - aPos.Y() += rRect.GetAlignB() - GetAlignB(); + aPos.AdjustY(rRect.GetAlignB() - GetAlignB() ); break; case RectVerAlign::CenterY : - aPos.Y() += rRect.GetCenterY() - GetCenterY(); + aPos.AdjustY(rRect.GetCenterY() - GetCenterY() ); break; case RectVerAlign::AttributeHi: - aPos.Y() += rRect.GetHiAttrFence() - GetBottom(); + aPos.AdjustY(rRect.GetHiAttrFence() - GetBottom() ); break; case RectVerAlign::AttributeMid : - aPos.Y() += SmFromTo(rRect.GetAlignB(), rRect.GetAlignT(), 0.4) - - GetCenterY(); + aPos.AdjustY(SmFromTo(rRect.GetAlignB(), rRect.GetAlignT(), 0.4) + - GetCenterY() ); break; case RectVerAlign::AttributeLo : - aPos.Y() += rRect.GetLoAttrFence() - GetTop(); + aPos.AdjustY(rRect.GetLoAttrFence() - GetTop() ); break; default : assert(false); @@ -401,13 +401,13 @@ const Point SmRect::AlignTo(const SmRect &rRect, RectPos ePos, // correct error in current horizontal position switch (eHor) { case RectHorAlign::Left: - aPos.X() += rRect.GetItalicLeft() - GetItalicLeft(); + aPos.AdjustX(rRect.GetItalicLeft() - GetItalicLeft() ); break; case RectHorAlign::Center: - aPos.X() += rRect.GetItalicCenterX() - GetItalicCenterX(); + aPos.AdjustX(rRect.GetItalicCenterX() - GetItalicCenterX() ); break; case RectHorAlign::Right: - aPos.X() += rRect.GetItalicRight() - GetItalicRight(); + aPos.AdjustX(rRect.GetItalicRight() - GetItalicRight() ); break; default: assert(false); @@ -562,25 +562,25 @@ long SmRect::OrientedDist(const Point &rPoint) const if (bIsInside) { Point aIC (GetItalicCenterX(), GetCenterY()); - aRef.X() = rPoint.X() >= aIC.X() ? GetItalicRight() : GetItalicLeft(); - aRef.Y() = rPoint.Y() >= aIC.Y() ? GetBottom() : GetTop(); + aRef.setX( rPoint.X() >= aIC.X() ? GetItalicRight() : GetItalicLeft() ); + aRef.setY( rPoint.Y() >= aIC.Y() ? GetBottom() : GetTop() ); } else { // x-coordinate if (rPoint.X() > GetItalicRight()) - aRef.X() = GetItalicRight(); + aRef.setX( GetItalicRight() ); else if (rPoint.X() < GetItalicLeft()) - aRef.X() = GetItalicLeft(); + aRef.setX( GetItalicLeft() ); else - aRef.X() = rPoint.X(); + aRef.setX( rPoint.X() ); // y-coordinate if (rPoint.Y() > GetBottom()) - aRef.Y() = GetBottom(); + aRef.setY( GetBottom() ); else if (rPoint.Y() < GetTop()) - aRef.Y() = GetTop(); + aRef.setY( GetTop() ); else - aRef.Y() = rPoint.Y(); + aRef.setY( rPoint.Y() ); } // build distance vector diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 68527eb52e6b..768071767962 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -490,7 +490,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* if(nVal < 1) throw IllegalArgumentException(); Size aSize = aFormat.GetBaseSize(); - aSize.Height() = SmPtsTo100th_mm(nVal); + aSize.setHeight( SmPtsTo100th_mm(nVal) ); aFormat.SetBaseSize(aSize); // apply base size to fonts @@ -903,15 +903,15 @@ static Size lcl_GuessPaperSize() { // in 100th mm PaperInfo aInfo( PAPER_A4 ); - aRes.Width() = aInfo.getWidth(); - aRes.Height() = aInfo.getHeight(); + aRes.setWidth( aInfo.getWidth() ); + aRes.setHeight( aInfo.getHeight() ); } else { // in 100th mm PaperInfo aInfo( PAPER_LETTER ); - aRes.Width() = aInfo.getWidth(); - aRes.Height() = aInfo.getHeight(); + aRes.setWidth( aInfo.getWidth() ); + aRes.setHeight( aInfo.getHeight() ); } return aRes; } @@ -1021,17 +1021,17 @@ void SAL_CALL SmModel::render( // set minimum top and bottom border if (aPrtPageOffset.Y() < 2000) - OutputRect.Top() += 2000 - aPrtPageOffset.Y(); + OutputRect.AdjustTop(2000 - aPrtPageOffset.Y() ); if ((aPrtPaperSize.Height() - (aPrtPageOffset.Y() + OutputRect.Bottom())) < 2000) - OutputRect.Bottom() -= 2000 - (aPrtPaperSize.Height() - - (aPrtPageOffset.Y() + OutputRect.Bottom())); + OutputRect.AdjustBottom( -(2000 - (aPrtPaperSize.Height() - + (aPrtPageOffset.Y() + OutputRect.Bottom()))) ); // set minimum left and right border if (aPrtPageOffset.X() < 2500) - OutputRect.Left() += 2500 - aPrtPageOffset.X(); + OutputRect.AdjustLeft(2500 - aPrtPageOffset.X() ); if ((aPrtPaperSize.Width() - (aPrtPageOffset.X() + OutputRect.Right())) < 1500) - OutputRect.Right() -= 1500 - (aPrtPaperSize.Width() - - (aPrtPageOffset.X() + OutputRect.Right())); + OutputRect.AdjustRight( -(1500 - (aPrtPaperSize.Width() - + (aPrtPageOffset.X() + OutputRect.Right()))) ); if (!m_pPrintUIOptions) m_pPrintUIOptions.reset(new SmPrintUIOptions); diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx index 670661b7fbe0..05ff9a2d9b5c 100644 --- a/starmath/source/utility.cxx +++ b/starmath/source/utility.cxx @@ -203,7 +203,7 @@ void SmFace::SetSize(const Size& rSize) static int const nMinVal = SmPtsTo100th_mm(2); if (aSize.Height() < nMinVal) - aSize.Height() = nMinVal; + aSize.setHeight( nMinVal ); //! we don't force a maximum value here because this may prevent eg the //! parentheses in "left ( ... right )" from matching up with large diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 34cff7ebedd3..e007b78b0cab 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -312,7 +312,7 @@ void SmGraphicWindow::SetCursor(const SmNode *pNode) // get appropriate rectangle Point aOffset (pNode->GetTopLeft() - pTree->GetTopLeft()), aTLPos (GetFormulaDrawPos() + aOffset); - aTLPos.X() -= pNode->GetItalicLeftSpace(); + aTLPos.AdjustX( -(pNode->GetItalicLeftSpace()) ); Size aSize (pNode->GetItalicSize()); SetCursor(tools::Rectangle(aTLPos, aSize)); @@ -696,10 +696,10 @@ SmViewShell * SmCmdBoxWindow::GetView() void SmCmdBoxWindow::Resize() { tools::Rectangle aRect(Point(0, 0), GetOutputSizePixel()); - aRect.Left() += CMD_BOX_PADDING; - aRect.Top() += CMD_BOX_PADDING_TOP; - aRect.Right() -= CMD_BOX_PADDING; - aRect.Bottom() -= CMD_BOX_PADDING; + aRect.AdjustLeft(CMD_BOX_PADDING ); + aRect.AdjustTop(CMD_BOX_PADDING_TOP ); + aRect.AdjustRight( -(CMD_BOX_PADDING) ); + aRect.AdjustBottom( -(CMD_BOX_PADDING) ); DecorationView aView(this); aRect = aView.DrawFrame(aRect, DrawFrameStyle::In, DrawFrameFlags::NoDraw); @@ -712,10 +712,10 @@ void SmCmdBoxWindow::Resize() void SmCmdBoxWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& /*rRect*/) { tools::Rectangle aRect(Point(0, 0), GetOutputSizePixel()); - aRect.Left() += CMD_BOX_PADDING; - aRect.Top() += CMD_BOX_PADDING_TOP; - aRect.Right() -= CMD_BOX_PADDING; - aRect.Bottom() -= CMD_BOX_PADDING; + aRect.AdjustLeft(CMD_BOX_PADDING ); + aRect.AdjustTop(CMD_BOX_PADDING_TOP ); + aRect.AdjustRight( -(CMD_BOX_PADDING) ); + aRect.AdjustBottom( -(CMD_BOX_PADDING) ); aEdit->SetPosSizePixel(aRect.TopLeft(), aRect.GetSize()); @@ -815,9 +815,9 @@ void SmCmdBoxWindow::AdjustPosition() aRect.Bottom() - GetSizePixel().Height() ) ); Point aPos( GetParent()->OutputToScreenPixel( aTopLeft ) ); if (aPos.X() < 0) - aPos.X() = 0; + aPos.setX( 0 ); if (aPos.Y() < 0) - aPos.Y() = 0; + aPos.setY( 0 ); SetPosPixel( aPos ); } @@ -927,15 +927,15 @@ Size SmViewShell::GetTextLineSize(OutputDevice const & rDevice, const OUString& if (nTabPos) { - aSize.Width() = 0; + aSize.setWidth( 0 ); sal_Int32 nPos = 0; do { if (nPos > 0) - aSize.Width() = ((aSize.Width() / nTabPos) + 1) * nTabPos; + aSize.setWidth( ((aSize.Width() / nTabPos) + 1) * nTabPos ); const OUString aText = rLine.getToken(0, '\t', nPos); - aSize.Width() += rDevice.GetTextWidth(aText); + aSize.AdjustWidth(rDevice.GetTextWidth(aText) ); } while (nPos >= 0); } @@ -982,8 +982,8 @@ Size SmViewShell::GetTextSize(OutputDevice const & rDevice, const OUString& rTex aText = aLine.copy(0, m); aLine = aLine.replaceAt(0, m, ""); aSize = GetTextLineSize(rDevice, aText); - aTextSize.Height() += aSize.Height(); - aTextSize.Width() = std::max(aTextSize.Width(), std::min(aSize.Width(), MaxWidth)); + aTextSize.AdjustHeight(aSize.Height() ); + aTextSize.setWidth( std::max(aTextSize.Width(), std::min(aSize.Width(), MaxWidth)) ); aLine = comphelper::string::stripStart(aLine, ' '); aLine = comphelper::string::stripStart(aLine, '\t'); @@ -993,8 +993,8 @@ Size SmViewShell::GetTextSize(OutputDevice const & rDevice, const OUString& rTex } else { - aTextSize.Height() += aSize.Height(); - aTextSize.Width() = std::max(aTextSize.Width(), aSize.Width()); + aTextSize.AdjustHeight(aSize.Height() ); + aTextSize.setWidth( std::max(aTextSize.Width(), aSize.Width()) ); } } while (nPos >= 0); @@ -1013,11 +1013,11 @@ void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, co do { if (nPos > 0) - aPoint.X() = ((aPoint.X() / nTabPos) + 1) * nTabPos; + aPoint.setX( ((aPoint.X() / nTabPos) + 1) * nTabPos ); OUString aText = rLine.getToken(0, '\t', nPos); rDevice.DrawText(aPoint, aText); - aPoint.X() += rDevice.GetTextWidth(aText); + aPoint.AdjustX(rDevice.GetTextWidth(aText) ); } while ( nPos >= 0 ); } @@ -1064,7 +1064,7 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const aLine = aLine.replaceAt(0, m, ""); DrawTextLine(rDevice, aPoint, aText); - aPoint.Y() += aSize.Height(); + aPoint.AdjustY(aSize.Height() ); aLine = comphelper::string::stripStart(aLine, ' '); aLine = comphelper::string::stripStart(aLine, '\t'); @@ -1076,13 +1076,13 @@ void SmViewShell::DrawText(OutputDevice& rDevice, const Point& rPosition, const if (!aLine.isEmpty()) { DrawTextLine(rDevice, aPoint, aLine); - aPoint.Y() += aSize.Height(); + aPoint.AdjustY(aSize.Height() ); } } else { DrawTextLine(rDevice, aPoint, aLine); - aPoint.Y() += aSize.Height(); + aPoint.AdjustY(aSize.Height() ); } } while ( nPos >= 0 ); @@ -1123,7 +1123,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri if (bIsPrintFrame) rOutDev.DrawRect(tools::Rectangle(aOutRect.TopLeft(), Size(aOutRect.GetWidth(), 100 + aTitleSize.Height() + 200 + aDescSize.Height() + 100))); - aOutRect.Top() += 200; + aOutRect.AdjustTop(200 ); // output title aFont.SetWeight(WEIGHT_BOLD); @@ -1133,17 +1133,17 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri aOutRect.Top()); DrawText(rOutDev, aPoint, GetDoc()->GetTitle(), sal::static_int_cast< sal_uInt16 >(aOutRect.GetWidth() - 200)); - aOutRect.Top() += aTitleSize.Height() + 200; + aOutRect.AdjustTop(aTitleSize.Height() + 200 ); // output description aFont.SetWeight(WEIGHT_NORMAL); aFont.SetFontSize(aSize600); rOutDev.SetFont(aFont); - aPoint.X() = aOutRect.Left() + (aOutRect.GetWidth() - aDescSize.Width()) / 2; - aPoint.Y() = aOutRect.Top(); + aPoint.setX( aOutRect.Left() + (aOutRect.GetWidth() - aDescSize.Width()) / 2 ); + aPoint.setY( aOutRect.Top() ); DrawText(rOutDev, aPoint, GetDoc()->GetComment(), sal::static_int_cast< sal_uInt16 >(aOutRect.GetWidth() - 200)); - aOutRect.Top() += aDescSize.Height() + 300; + aOutRect.AdjustTop(aDescSize.Height() + 300 ); } // output text on bottom @@ -1158,7 +1158,7 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri Size aSize (GetTextSize(rOutDev, GetDoc()->GetText(), aOutRect.GetWidth() - 200)); - aOutRect.Bottom() -= aSize.Height() + 600; + aOutRect.AdjustBottom( -(aSize.Height() + 600) ); if (bIsPrintFrame) rOutDev.DrawRect(tools::Rectangle(aOutRect.BottomLeft(), @@ -1168,16 +1168,16 @@ void SmViewShell::Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPri aOutRect.Bottom() + 300); DrawText(rOutDev, aPoint, GetDoc()->GetText(), sal::static_int_cast< sal_uInt16 >(aOutRect.GetWidth() - 200)); - aOutRect.Bottom() -= 200; + aOutRect.AdjustBottom( -200 ); } if (bIsPrintFrame) rOutDev.DrawRect(aOutRect); - aOutRect.Top() += 100; - aOutRect.Left() += 100; - aOutRect.Bottom() -= 100; - aOutRect.Right() -= 100; + aOutRect.AdjustTop(100 ); + aOutRect.AdjustLeft(100 ); + aOutRect.AdjustBottom( -100 ); + aOutRect.AdjustRight( -100 ); Size aSize (GetDoc()->GetSize()); diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 6e19801f211c..84cde6331f24 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -456,10 +456,10 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode ) // get rectangle and remove borderspace tools::Rectangle aTmp ( pNode->AsRectangle( ) + maPosition - pNode->GetTopLeft( ) ); - aTmp.Left( ) += nTmpBorderWidth; - aTmp.Right( ) -= nTmpBorderWidth; - aTmp.Top( ) += nTmpBorderWidth; - aTmp.Bottom( ) -= nTmpBorderWidth; + aTmp.AdjustLeft(nTmpBorderWidth ); + aTmp.AdjustRight( -sal_Int32(nTmpBorderWidth) ); + aTmp.AdjustTop(nTmpBorderWidth ); + aTmp.AdjustBottom( -sal_Int32(nTmpBorderWidth) ); SAL_WARN_IF( aTmp.GetHeight() == 0 || aTmp.GetWidth() == 0, "starmath", "Empty rectangle" ); @@ -483,7 +483,7 @@ void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode ) aTmpDev.SetFont( pNode->GetFont( ) ); Point aPos ( maPosition ); - aPos.Y( ) += pNode->GetBaselineOffset( ); + aPos.AdjustY(pNode->GetBaselineOffset( ) ); // round to pixel coordinate aPos = mrDev.PixelToLogic( mrDev.LogicToPixel( aPos ) ); -- cgit