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

drop old tools/gen methods in reportdesign..xmloff

Change-Id: I398831c526ba51d861557fa6c13c0e2fb44dfbe0
Reviewed-on: https://gerrit.libreoffice.org/50447Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 398d10a5
...@@ -391,7 +391,7 @@ public: ...@@ -391,7 +391,7 @@ public:
void SetGridCoarse(const Size& rSiz) { maGridBig=rSiz; } void SetGridCoarse(const Size& rSiz) { maGridBig=rSiz; }
void SetGridFine(const Size& rSiz) { void SetGridFine(const Size& rSiz) {
maGridFin=rSiz; maGridFin=rSiz;
if (maGridFin.Height()==0) maGridFin.Height()=maGridFin.Width(); if (maGridFin.Height()==0) maGridFin.setHeight(maGridFin.Width());
if (mbGridVisible) InvalidateAllWin(); if (mbGridVisible) InvalidateAllWin();
} }
const Size& GetGridCoarse() const { return maGridBig; } const Size& GetGridCoarse() const { return maGridBig; }
......
...@@ -113,27 +113,27 @@ inline void ResizePoint(Point& rPnt, const Point& rRef, const Fraction& xFract, ...@@ -113,27 +113,27 @@ inline void ResizePoint(Point& rPnt, const Point& rRef, const Fraction& xFract,
{ {
double nxFract = xFract.IsValid() ? static_cast<double>(xFract) : 1.0; double nxFract = xFract.IsValid() ? static_cast<double>(xFract) : 1.0;
double nyFract = yFract.IsValid() ? static_cast<double>(yFract) : 1.0; double nyFract = yFract.IsValid() ? static_cast<double>(yFract) : 1.0;
rPnt.X() = rRef.X() + svx::Round( (rPnt.X() - rRef.X()) * nxFract ); rPnt.setX(rRef.X() + svx::Round( (rPnt.X() - rRef.X()) * nxFract ));
rPnt.Y() = rRef.Y() + svx::Round( (rPnt.Y() - rRef.Y()) * nyFract ); rPnt.setY(rRef.Y() + svx::Round( (rPnt.Y() - rRef.Y()) * nyFract ));
} }
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs) inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs)
{ {
long dx=rPnt.X()-rRef.X(); long dx=rPnt.X()-rRef.X();
long dy=rPnt.Y()-rRef.Y(); long dy=rPnt.Y()-rRef.Y();
rPnt.X()=svx::Round(rRef.X()+dx*cs+dy*sn); rPnt.setX(svx::Round(rRef.X()+dx*cs+dy*sn));
rPnt.Y()=svx::Round(rRef.Y()+dy*cs-dx*sn); rPnt.setY(svx::Round(rRef.Y()+dy*cs-dx*sn));
} }
inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, bool bVShear) inline void ShearPoint(Point& rPnt, const Point& rRef, double tn, bool bVShear)
{ {
if (!bVShear) { // Horizontal if (!bVShear) { // Horizontal
if (rPnt.Y()!=rRef.Y()) { // else not needed if (rPnt.Y()!=rRef.Y()) { // else not needed
rPnt.X()-=svx::Round((rPnt.Y()-rRef.Y())*tn); rPnt.AdjustX(-svx::Round((rPnt.Y()-rRef.Y())*tn));
} }
} else { // or else vertical } else { // or else vertical
if (rPnt.X()!=rRef.X()) { // else not needed if (rPnt.X()!=rRef.X()) { // else not needed
rPnt.Y()-=svx::Round((rPnt.X()-rRef.X())*tn); rPnt.AdjustY(-svx::Round((rPnt.X()-rRef.X())*tn));
} }
} }
} }
...@@ -144,11 +144,11 @@ inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad ...@@ -144,11 +144,11 @@ inline double GetCrookAngle(Point& rPnt, const Point& rCenter, const Point& rRad
if (bVertical) { if (bVertical) {
long dy=rPnt.Y()-rCenter.Y(); long dy=rPnt.Y()-rCenter.Y();
nAngle=static_cast<double>(dy)/static_cast<double>(rRad.Y()); nAngle=static_cast<double>(dy)/static_cast<double>(rRad.Y());
rPnt.Y()=rCenter.Y(); rPnt.setY(rCenter.Y());
} else { } else {
long dx=rCenter.X()-rPnt.X(); long dx=rCenter.X()-rPnt.X();
nAngle=static_cast<double>(dx)/static_cast<double>(rRad.X()); nAngle=static_cast<double>(dx)/static_cast<double>(rRad.X());
rPnt.X()=rCenter.X(); rPnt.setX(rCenter.X());
} }
return nAngle; return nAngle;
} }
......
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
long AdjustY( long nVertMove ) { nB += nVertMove; return nB; } long AdjustY( long nVertMove ) { nB += nVertMove; return nB; }
void RotateAround( long& rX, long& rY, short nOrientation ) const; void RotateAround( long& rX, long& rY, short nOrientation ) const;
void RotateAround( Point&, short nOrientation ) const;
Point& operator += ( const Point& rPoint ); Point& operator += ( const Point& rPoint );
Point& operator -= ( const Point& rPoint ); Point& operator -= ( const Point& rPoint );
......
...@@ -232,7 +232,7 @@ void OSectionWindow::Resize() ...@@ -232,7 +232,7 @@ void OSectionWindow::Resize()
const Point aThumbPos = m_pParent->getView()->getThumbPos(); const Point aThumbPos = m_pParent->getView()->getThumbPos();
aOutputSize.AdjustWidth( -(aThumbPos.X()) ); aOutputSize.AdjustWidth( -(aThumbPos.X()) );
aOutputSize.Height() -= m_aSplitter->GetSizePixel().Height(); aOutputSize.AdjustHeight( -m_aSplitter->GetSizePixel().Height() );
if ( m_aStartMarker->isCollapsed() ) if ( m_aStartMarker->isCollapsed() )
{ {
......
...@@ -770,8 +770,9 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification, ...@@ -770,8 +770,9 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification,
bool bMove = true; bool bMove = true;
::std::function<long&(tools::Rectangle *)> aGetFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Bottom)); auto aGetFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Bottom));
::std::function<long&(tools::Rectangle *)> aRefFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Top)); auto aSetFun = ::std::mem_fn(&tools::Rectangle::SetBottom);
auto aRefFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Top));
TRectangleMap::const_iterator aRectIter = aSortRectangles.begin(); TRectangleMap::const_iterator aRectIter = aSortRectangles.begin();
TRectangleMap::const_iterator aRectEnd = aSortRectangles.end(); TRectangleMap::const_iterator aRectEnd = aSortRectangles.end();
for (;aRectIter != aRectEnd ; ++aRectIter) for (;aRectIter != aRectEnd ; ++aRectIter)
...@@ -790,8 +791,9 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification, ...@@ -790,8 +791,9 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification,
switch(_nControlModification) switch(_nControlModification)
{ {
case ControlModification::TOP : case ControlModification::TOP :
aGetFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Top)); aGetFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Top));
aRefFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Bottom)); aSetFun = ::std::mem_fn(&tools::Rectangle::SetTop);
aRefFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Bottom));
pValue = &nYMov; pValue = &nYMov;
break; break;
case ControlModification::BOTTOM: case ControlModification::BOTTOM:
...@@ -804,16 +806,18 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification, ...@@ -804,16 +806,18 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification,
bMove = false; bMove = false;
break; break;
case ControlModification::RIGHT : case ControlModification::RIGHT :
aGetFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Right)); aGetFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Right));
aRefFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Left)); aSetFun = ::std::mem_fn(&tools::Rectangle::SetRight);
aRefFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Left));
break; break;
case ControlModification::CENTER_HORIZONTAL: case ControlModification::CENTER_HORIZONTAL:
nXMov = aCenter.X() - aObjRect.Center().X(); nXMov = aCenter.X() - aObjRect.Center().X();
bMove = false; bMove = false;
break; break;
case ControlModification::LEFT : case ControlModification::LEFT :
aGetFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Left)); aGetFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Left));
aRefFun = ::std::mem_fn(static_cast<long&(tools::Rectangle:: *)()>(&tools::Rectangle::Right)); aSetFun = ::std::mem_fn(&tools::Rectangle::SetLeft);
aRefFun = ::std::mem_fn(static_cast<long(tools::Rectangle:: *)() const>(&tools::Rectangle::Right));
break; break;
default: default:
bMove = false; bMove = false;
...@@ -822,7 +826,7 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification, ...@@ -822,7 +826,7 @@ void OViewsWindow::alignMarkedObjects(ControlModification _nControlModification,
if ( bMove ) if ( bMove )
{ {
tools::Rectangle aTest = aObjRect; tools::Rectangle aTest = aObjRect;
aGetFun(&aTest) = aGetFun(&aBound); aSetFun(&aTest, aGetFun(&aBound));
TRectangleMap::const_iterator aInterSectRectIter = aSortRectangles.begin(); TRectangleMap::const_iterator aInterSectRectIter = aSortRectangles.begin();
for (; aInterSectRectIter != aRectIter; ++aInterSectRectIter) for (; aInterSectRectIter != aRectIter; ++aInterSectRectIter)
{ {
......
...@@ -78,11 +78,11 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) ...@@ -78,11 +78,11 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
aStartWidth *= m_pParent->GetMapMode().GetScaleX(); aStartWidth *= m_pParent->GetMapMode().GetScaleX();
aOut.AdjustWidth( -static_cast<long>(aStartWidth) ); aOut.AdjustWidth( -static_cast<long>(aStartWidth) );
aOut.Height() = m_pParent->GetOutputSizePixel().Height(); aOut.setHeight( m_pParent->GetOutputSizePixel().Height() );
Point aPos = pScrollWindow->getThumbPos(); Point aPos = pScrollWindow->getThumbPos();
aPos.setX( aPos.X() * 0.5 ); aPos.setX( aPos.X() * 0.5 );
aPos.Y() *= 0.5; aPos.setY( aPos.Y() * 0.5 );
tools::Rectangle aOutRect( aPos, aOut ); tools::Rectangle aOutRect( aPos, aOut );
aOutRect = m_pParent->PixelToLogic( aOutRect ); aOutRect = m_pParent->PixelToLogic( aOutRect );
tools::Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize()); tools::Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize());
......
...@@ -828,7 +828,8 @@ SvBorder SfxWorkWindow::Arrange_Impl() ...@@ -828,7 +828,8 @@ SvBorder SfxWorkWindow::Arrange_Impl()
{ {
aBorder.Left() = aClientArea.Left(); aBorder.Left() = aClientArea.Left();
aBorder.Right() = aClientArea.Right(); aBorder.Right() = aClientArea.Right();
aClientArea.Right() = aClientArea.Left() = aTmp.Left(); aClientArea.SetRight( aTmp.Left() );
aClientArea.SetLeft( aTmp.Left() );
} }
if ( aClientArea.GetHeight() >= aBorder.Top() + aBorder.Bottom() ) if ( aClientArea.GetHeight() >= aBorder.Top() + aBorder.Bottom() )
...@@ -840,7 +841,8 @@ SvBorder SfxWorkWindow::Arrange_Impl() ...@@ -840,7 +841,8 @@ SvBorder SfxWorkWindow::Arrange_Impl()
{ {
aBorder.Top() = aClientArea.Top(); aBorder.Top() = aClientArea.Top();
aBorder.Bottom() = aClientArea.Bottom(); aBorder.Bottom() = aClientArea.Bottom();
aClientArea.Top() = aClientArea.Bottom() = aTmp.Top(); aClientArea.SetTop(aTmp.Top());
aClientArea.SetBottom(aTmp.Top());
} }
return IsDockingAllowed() ? aBorder : SvBorder(); return IsDockingAllowed() ? aBorder : SvBorder();
......
...@@ -116,7 +116,7 @@ public: ...@@ -116,7 +116,7 @@ public:
void SetItalicSpaces(long nLeftSpace, long nRightSpace); void SetItalicSpaces(long nLeftSpace, long nRightSpace);
void SetWidth(sal_uLong nWidth) { aSize.Width() = nWidth; } void SetWidth(sal_uLong nWidth) { aSize.setWidth(nWidth); }
void SetLeft(long nLeft); void SetLeft(long nLeft);
void SetRight(long nRight); void SetRight(long nRight);
......
...@@ -1961,8 +1961,8 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) ...@@ -1961,8 +1961,8 @@ void SmPolyLineNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat)
else else
{ {
OSL_ENSURE(GetToken().eType == TWIDEBACKSLASH, "Sm : unexpected token"); OSL_ENSURE(GetToken().eType == TWIDEBACKSLASH, "Sm : unexpected token");
aPointA.X() = aPointA.setX( nBorderwidth );
aPointA.Y() = nBorderwidth; aPointA.setY( nBorderwidth );
aPointB.setX( maToSize.Width() - nBorderwidth ); aPointB.setX( maToSize.Width() - nBorderwidth );
aPointB.setY( maToSize.Height() - nBorderwidth ); aPointB.setY( maToSize.Height() - nBorderwidth );
} }
......
...@@ -386,7 +386,7 @@ public: ...@@ -386,7 +386,7 @@ public:
const tools::Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* ); const tools::Rectangle& GetEntryBoundRect( SvxIconChoiceCtrlEntry* );
void InvalidateBoundingRect( tools::Rectangle& rRect ) void InvalidateBoundingRect( tools::Rectangle& rRect )
{ {
rRect.Right() = LONG_MAX; rRect.SetRight(LONG_MAX);
bBoundRectsDirty = true; bBoundRectsDirty = true;
} }
static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != LONG_MAX ); } static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != LONG_MAX ); }
......
...@@ -145,13 +145,13 @@ void SvSimpleTable::UpdateViewSize() ...@@ -145,13 +145,13 @@ void SvSimpleTable::UpdateViewSize()
Size HbSize=aHeaderBar->GetSizePixel(); Size HbSize=aHeaderBar->GetSizePixel();
HbSize.setWidth(theWinSize.Width() ); HbSize.setWidth(theWinSize.Width() );
theWinSize.Height()-=HbSize.Height(); theWinSize.AdjustHeight(-HbSize.Height());
Point thePos(0,0); Point thePos(0,0);
aHeaderBar->SetPosPixel(thePos); aHeaderBar->SetPosPixel(thePos);
aHeaderBar->SetSizePixel(HbSize); aHeaderBar->SetSizePixel(HbSize);
thePos.Y()+=HbSize.Height(); thePos.AdjustY(HbSize.Height());
SvHeaderTabListBox::SetPosPixel(thePos); SvHeaderTabListBox::SetPosPixel(thePos);
SvHeaderTabListBox::SetSizePixel(theWinSize); SvHeaderTabListBox::SetSizePixel(theWinSize);
Invalidate(); Invalidate();
......
...@@ -102,7 +102,8 @@ const vcl::Font& SvtScriptedTextHelper_Impl::GetFont( sal_uInt16 _nScript ) cons ...@@ -102,7 +102,8 @@ const vcl::Font& SvtScriptedTextHelper_Impl::GetFont( sal_uInt16 _nScript ) cons
void SvtScriptedTextHelper_Impl::CalculateSizes() void SvtScriptedTextHelper_Impl::CalculateSizes()
{ {
maTextSize.Width() = maTextSize.Height() = 0; maTextSize.setWidth(0);
maTextSize.setHeight(0);
mrOutDevice.Push(PushFlags::FONT | PushFlags::TEXTCOLOR); mrOutDevice.Push(PushFlags::FONT | PushFlags::TEXTCOLOR);
// calculate text portion widths and total width // calculate text portion widths and total width
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
#include <memory> #include <memory>
#define SCALEPOINT(aPT,aFracX,aFracY) (aPT).X()=long((aPT).X()*aFracX); \ #define SCALEPOINT(aPT,aFracX,aFracY) (aPT).setX(long((aPT).X()*aFracX)); \
(aPT).Y()=long((aPT).Y()*aFracY); (aPT).setY(long((aPT).Y()*aFracY));
/******************************************************************************/ /******************************************************************************/
......
...@@ -158,9 +158,15 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic, ...@@ -158,9 +158,15 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
double fWH = static_cast<double>(aSizePix.Width()) / aSizePix.Height(); double fWH = static_cast<double>(aSizePix.Width()) / aSizePix.Height();
if( fWH <= 1.0 ) if( fWH <= 1.0 )
aSizePix.setWidth( FRound( ( aSizePix.Height() = 512 ) * fWH ) ); {
aSizePix.setHeight(512);
aSizePix.setWidth( FRound( ( aSizePix.Height() ) * fWH ) );
}
else else
aSizePix.setHeight( FRound( ( aSizePix.Width() = 512 ) / fWH ) ); {
aSizePix.setWidth(512);
aSizePix.setHeight( FRound( ( aSizePix.Width() ) / fWH ) );
}
} }
if( pVDev->SetOutputSizePixel( aSizePix ) ) if( pVDev->SetOutputSizePixel( aSizePix ) )
......
...@@ -180,9 +180,11 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) ...@@ -180,9 +180,11 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
Point aEnd(aBLPos.X() + nRectWidth * 9 / 10,0); Point aEnd(aBLPos.X() + nRectWidth * 9 / 10,0);
for( sal_uInt16 i = 11; i < 100; i += 33) for( sal_uInt16 i = 11; i < 100; i += 33)
{ {
aStart.Y() = aEnd.Y() = aBLPos.Y() + nRectHeight * i / 100; aStart.setY( aBLPos.Y() + nRectHeight * i / 100 );
aEnd.setY( aStart.Y() );
pVDev->DrawLine(aStart, aEnd); pVDev->DrawLine(aStart, aEnd);
aStart.Y() = aEnd.Y() = aBLPos.Y() + nRectHeight * (i + 11) / 100; aStart.setY( aBLPos.Y() + nRectHeight * (i + 11) / 100 );
aEnd.setY( aStart.Y() );
pVDev->DrawLine(aStart, aEnd); pVDev->DrawLine(aStart, aEnd);
} }
} }
......
...@@ -405,8 +405,8 @@ void XPolygon::Move( long nHorzMove, long nVertMove ) ...@@ -405,8 +405,8 @@ void XPolygon::Move( long nHorzMove, long nVertMove )
for ( sal_uInt16 i = 0; i < nCount; i++ ) for ( sal_uInt16 i = 0; i < nCount; i++ )
{ {
Point* pPt = &(pImpXPolygon->pPointAry[i]); Point* pPt = &(pImpXPolygon->pPointAry[i]);
pPt->X() += nHorzMove; pPt->AdjustX( nHorzMove );
pPt->Y() += nVertMove; pPt->AdjustY( nVertMove );
} }
} }
...@@ -536,28 +536,28 @@ void XPolygon::SubdivideBezier(sal_uInt16 nPos, bool bCalcFirst, double fT) ...@@ -536,28 +536,28 @@ void XPolygon::SubdivideBezier(sal_uInt16 nPos, bool bCalcFirst, double fT)
nPosInc = 1; nPosInc = 1;
nIdxInc = 1; nIdxInc = 1;
} }
pPoints[nPos].X() = static_cast<long>(fU3 * pPoints[nIdx ].X() + pPoints[nPos].setX( static_cast<long>(fU3 * pPoints[nIdx ].X() +
fT * fU2 * pPoints[nIdx+1].X() * 3 + fT * fU2 * pPoints[nIdx+1].X() * 3 +
fT2 * fU * pPoints[nIdx+2].X() * 3 + fT2 * fU * pPoints[nIdx+2].X() * 3 +
fT3 * pPoints[nIdx+3].X()); fT3 * pPoints[nIdx+3].X()) );
pPoints[nPos].Y() = static_cast<long>(fU3 * pPoints[nIdx ].Y() + pPoints[nPos].setY( static_cast<long>(fU3 * pPoints[nIdx ].Y() +
fT * fU2 * pPoints[nIdx+1].Y() * 3 + fT * fU2 * pPoints[nIdx+1].Y() * 3 +
fT2 * fU * pPoints[nIdx+2].Y() * 3 + fT2 * fU * pPoints[nIdx+2].Y() * 3 +
fT3 * pPoints[nIdx+3].Y()); fT3 * pPoints[nIdx+3].Y()) );
nPos = nPos + nPosInc; nPos = nPos + nPosInc;
nIdx = nIdx + nIdxInc; nIdx = nIdx + nIdxInc;
pPoints[nPos].X() = static_cast<long>(fU2 * pPoints[nIdx ].X() + pPoints[nPos].setX( static_cast<long>(fU2 * pPoints[nIdx ].X() +
fT * fU * pPoints[nIdx+1].X() * 2 + fT * fU * pPoints[nIdx+1].X() * 2 +
fT2 * pPoints[nIdx+2].X()); fT2 * pPoints[nIdx+2].X()) );
pPoints[nPos].Y() = static_cast<long>(fU2 * pPoints[nIdx ].Y() + pPoints[nPos].setY( static_cast<long>(fU2 * pPoints[nIdx ].Y() +
fT * fU * pPoints[nIdx+1].Y() * 2 + fT * fU * pPoints[nIdx+1].Y() * 2 +
fT2 * pPoints[nIdx+2].Y()); fT2 * pPoints[nIdx+2].Y()) );
nPos = nPos + nPosInc; nPos = nPos + nPosInc;
nIdx = nIdx + nIdxInc; nIdx = nIdx + nIdxInc;
pPoints[nPos].X() = static_cast<long>(fU * pPoints[nIdx ].X() + pPoints[nPos].setX( static_cast<long>(fU * pPoints[nIdx ].X() +
fT * pPoints[nIdx+1].X()); fT * pPoints[nIdx+1].X()) );
pPoints[nPos].Y() = static_cast<long>(fU * pPoints[nIdx ].Y() + pPoints[nPos].setY( static_cast<long>(fU * pPoints[nIdx ].Y() +
fT * pPoints[nIdx+1].Y()); fT * pPoints[nIdx+1].Y()) );
} }
/// Generate a Bézier arc /// Generate a Bézier arc
...@@ -580,22 +580,26 @@ void XPolygon::GenBezArc(const Point& rCenter, long nRx, long nRy, ...@@ -580,22 +580,26 @@ void XPolygon::GenBezArc(const Point& rCenter, long nRx, long nRy,
if ( nQuad == 0 || nQuad == 2 ) if ( nQuad == 0 || nQuad == 2 )
{ {
pPoints[nFirst].X() += nRx; pPoints[nFirst+3].Y() += nRy; pPoints[nFirst].AdjustX( nRx );
pPoints[nFirst+3].AdjustY( nRy );
} }
else else
{ {
pPoints[nFirst].Y() += nRy; pPoints[nFirst+3].X() += nRx; pPoints[nFirst].AdjustY( nRy );
pPoints[nFirst+3].AdjustX( nRx );
} }
pPoints[nFirst+1] = pPoints[nFirst]; pPoints[nFirst+1] = pPoints[nFirst];
pPoints[nFirst+2] = pPoints[nFirst+3]; pPoints[nFirst+2] = pPoints[nFirst+3];
if ( nQuad == 0 || nQuad == 2 ) if ( nQuad == 0 || nQuad == 2 )
{ {
pPoints[nFirst+1].Y() += nYHdl; pPoints[nFirst+2].X() += nXHdl; pPoints[nFirst+1].AdjustY( nYHdl );
pPoints[nFirst+2].AdjustX( nXHdl );
} }
else else
{ {
pPoints[nFirst+1].X() += nXHdl; pPoints[nFirst+2].Y() += nYHdl; pPoints[nFirst+1].AdjustX( nXHdl );
pPoints[nFirst+2].AdjustY( nYHdl );
} }
if ( nStart > 0 ) if ( nStart > 0 )
SubdivideBezier(nFirst, false, static_cast<double>(nStart) / 900); SubdivideBezier(nFirst, false, static_cast<double>(nStart) / 900);
...@@ -769,8 +773,8 @@ void XPolygon::Scale(double fSx, double fSy) ...@@ -769,8 +773,8 @@ void XPolygon::Scale(double fSx, double fSy)
for (sal_uInt16 i = 0; i < nPntCnt; i++) for (sal_uInt16 i = 0; i < nPntCnt; i++)
{ {
Point& rPnt = pImpXPolygon->pPointAry[i]; Point& rPnt = pImpXPolygon->pPointAry[i];
rPnt.X() = static_cast<long>(fSx * rPnt.X()); rPnt.setX( static_cast<long>(fSx * rPnt.X()) );
rPnt.Y() = static_cast<long>(fSy * rPnt.Y()); rPnt.setY( static_cast<long>(fSy * rPnt.Y()) );
} }
} }
......
...@@ -22,6 +22,16 @@ ...@@ -22,6 +22,16 @@
#include <tools/gen.hxx> #include <tools/gen.hxx>
#include <basegfx/numeric/ftools.hxx> #include <basegfx/numeric/ftools.hxx>
void Point::RotateAround( Point& rPoint,
short nOrientation ) const
{
long nX = rPoint.X();
long nY = rPoint.Y();
RotateAround(nX, nY, nOrientation);
rPoint.setX(nX);
rPoint.setY(nY);
}
void Point::RotateAround( long& rX, long& rY, void Point::RotateAround( long& rX, long& rY,
short nOrientation ) const short nOrientation ) const
{ {
......
This diff is collapsed.
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