Kaydet (Commit) bea7bbca authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:changetoolsgen in starmath

Change-Id: Iafa99639e1fe2bc45ece2b3ef0744816446f3faf
Reviewed-on: https://gerrit.libreoffice.org/49959Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 24abfc0b
......@@ -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<SmElement>(std::move(pNode), aElementSource, aHelpText));
......
......@@ -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 );
......
......@@ -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()))
{
......
......@@ -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 )
......
......@@ -284,7 +284,7 @@ void SmEditWindow::Resize()
if (pEditView->GetVisArea().Top() > nMaxVisAreaStart)
{
tools::Rectangle aVisArea(pEditView->GetVisArea() );
aVisArea.Top() = std::max<long>(nMaxVisAreaStart, 0);
aVisArea.SetTop( std::max<long>(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;
}
......
......@@ -3078,14 +3078,14 @@ void SmXMLImport::SetViewSettings(const Sequence<PropertyValue>& 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++;
......
This diff is collapsed.
......@@ -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
......
......@@ -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);
......
......@@ -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
......
......@@ -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());
......
......@@ -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 ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment