diff options
-rw-r--r-- | include/postmac.h | 1 | ||||
-rw-r--r-- | include/premac.h | 1 | ||||
-rw-r--r-- | include/tools/line.hxx | 9 | ||||
-rw-r--r-- | include/vcl/outdev.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 2 | ||||
-rw-r--r-- | tools/source/generic/line.cxx | 7 | ||||
-rw-r--r-- | vcl/source/outdev/hatch.cxx | 14 |
7 files changed, 25 insertions, 15 deletions
diff --git a/include/postmac.h b/include/postmac.h index 0b846a93aec3..5e1342d658c9 100644 --- a/include/postmac.h +++ b/include/postmac.h @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#undef Line #undef Point #undef Size #undef TimeValue diff --git a/include/premac.h b/include/premac.h index 8bcf6833dc12..6b5a3c9909a7 100644 --- a/include/premac.h +++ b/include/premac.h @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#define Line MacOSLine #define Point MacOSPoint #define Size MacOSSize #define TimeValue MacOSTimeValue diff --git a/include/tools/line.hxx b/include/tools/line.hxx index 7508a8fbb468..8a0486adf3fe 100644 --- a/include/tools/line.hxx +++ b/include/tools/line.hxx @@ -22,6 +22,9 @@ #include <tools/toolsdllapi.h> #include <tools/gen.hxx> +namespace tools +{ + class TOOLS_DLLPUBLIC Line { private: @@ -40,13 +43,15 @@ public: double GetLength() const; - bool Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const; - bool Intersection( const Line& rLine, Point& rIntersection ) const; + bool Intersection( const tools::Line& rLine, double& rIntersectionX, double& rIntersectionY ) const; + bool Intersection( const tools::Line& rLine, Point& rIntersection ) const; double GetDistance( const double& rPtX, const double& rPtY ) const; double GetDistance( const Point& rPoint ) const { return( GetDistance( rPoint.X(), rPoint.Y() ) ); } }; +} // namespace tools + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 339c10ab00f6..b1169561e3af 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -80,7 +80,9 @@ class TextRectInfo; class FontMetric; class GDIMetaFile; class GfxLink; -class Line; +namespace tools { + class Line; +} class LineInfo; class AlphaMask; class FontCharMap; @@ -972,7 +974,7 @@ public: private: SAL_DLLPRIVATE void CalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 ); - SAL_DLLPRIVATE void DrawHatchLine( const Line& rLine, const tools::PolyPolygon& rPolyPoly, Point* pPtBuffer, bool bMtf ); + SAL_DLLPRIVATE void DrawHatchLine( const tools::Line& rLine, const tools::PolyPolygon& rPolyPoly, Point* pPtBuffer, bool bMtf ); ///@} diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 04f46aece520..4254ec2e01ff 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -93,7 +93,7 @@ namespace { // Otherwise, compute the distance to the center of the rectangle. if ( !rRect.IsInside( rPoint ) ) { - Line aLine( rPoint, rRect.Center( ) ); + tools::Line aLine( rPoint, rRect.Center( ) ); nDist = aLine.GetLength( ); } diff --git a/tools/source/generic/line.cxx b/tools/source/generic/line.cxx index f84003cb6e00..597b783f3523 100644 --- a/tools/source/generic/line.cxx +++ b/tools/source/generic/line.cxx @@ -24,6 +24,9 @@ #include <cstdlib> #include <math.h> +namespace tools +{ + double Line::GetLength() const { return hypot( maStart.X() - maEnd.X(), maStart.Y() - maEnd.Y() ); @@ -46,7 +49,7 @@ bool Line::Intersection( const Line& rLine, Point& rIntersection ) const return bRet; } -bool Line::Intersection( const Line& rLine, double& rIntersectionX, double& rIntersectionY ) const +bool Line::Intersection( const tools::Line& rLine, double& rIntersectionX, double& rIntersectionY ) const { const double fAx = maEnd.X() - maStart.X(); const double fAy = maEnd.Y() - maStart.Y(); @@ -134,4 +137,6 @@ double Line::GetDistance( const double& rPtX, const double& rPtY ) const return fDist; } +} //namespace tools + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/outdev/hatch.cxx b/vcl/source/outdev/hatch.cxx index 076ff8b46742..484ba61dd3e4 100644 --- a/vcl/source/outdev/hatch.cxx +++ b/vcl/source/outdev/hatch.cxx @@ -178,7 +178,7 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& CalcHatchValues( aRect, nWidth, rHatch.GetAngle(), aPt1, aPt2, aInc, aEndPt1 ); do { - DrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); + DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height(); aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height(); } @@ -190,7 +190,7 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 900, aPt1, aPt2, aInc, aEndPt1 ); do { - DrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); + DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height(); aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height(); } @@ -202,7 +202,7 @@ void OutputDevice::DrawHatch( const tools::PolyPolygon& rPolyPoly, const Hatch& CalcHatchValues( aRect, nWidth, rHatch.GetAngle() + 450, aPt1, aPt2, aInc, aEndPt1 ); do { - DrawHatchLine( Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); + DrawHatchLine( tools::Line( aPt1, aPt2 ), rPolyPoly, pPtBuffer.get(), bMtf ); aPt1.X() += aInc.Width(); aPt1.Y() += aInc.Height(); aPt2.X() += aInc.Width(); aPt2.Y() += aInc.Height(); } @@ -321,7 +321,7 @@ void OutputDevice::CalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt } } -void OutputDevice::DrawHatchLine( const Line& rLine, const tools::PolyPolygon& rPolyPoly, +void OutputDevice::DrawHatchLine( const tools::Line& rLine, const tools::PolyPolygon& rPolyPoly, Point* pPtBuffer, bool bMtf ) { assert(!is_double_buffered_window()); @@ -335,7 +335,7 @@ void OutputDevice::DrawHatchLine( const Line& rLine, const tools::PolyPolygon& r if( rPoly.GetSize() > 1 ) { - Line aCurSegment( rPoly[ 0 ], Point() ); + tools::Line aCurSegment( rPoly[ 0 ], Point() ); for( long i = 1, nCount = rPoly.GetSize(); i <= nCount; i++ ) { @@ -347,7 +347,7 @@ void OutputDevice::DrawHatchLine( const Line& rLine, const tools::PolyPolygon& r if( ( fabs( fX - aCurSegment.GetStart().X() ) <= 0.0000001 ) && ( fabs( fY - aCurSegment.GetStart().Y() ) <= 0.0000001 ) ) { - const Line aPrevSegment( rPoly[ (sal_uInt16)( ( i > 1 ) ? ( i - 2 ) : ( nCount - 1 ) ) ], aCurSegment.GetStart() ); + const tools::Line aPrevSegment( rPoly[ (sal_uInt16)( ( i > 1 ) ? ( i - 2 ) : ( nCount - 1 ) ) ], aCurSegment.GetStart() ); const double fPrevDistance = rLine.GetDistance( aPrevSegment.GetStart() ); const double fCurDistance = rLine.GetDistance( aCurSegment.GetEnd() ); @@ -360,7 +360,7 @@ void OutputDevice::DrawHatchLine( const Line& rLine, const tools::PolyPolygon& r else if( ( fabs( fX - aCurSegment.GetEnd().X() ) <= 0.0000001 ) && ( fabs( fY - aCurSegment.GetEnd().Y() ) <= 0.0000001 ) ) { - const Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (sal_uInt16)( ( i + 1 ) % nCount ) ] ); + const tools::Line aNextSegment( aCurSegment.GetEnd(), rPoly[ (sal_uInt16)( ( i + 1 ) % nCount ) ] ); if( ( fabs( rLine.GetDistance( aNextSegment.GetEnd() ) ) <= 0.0000001 ) && ( rLine.GetDistance( aCurSegment.GetStart() ) > 0.0 ) ) |