diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2012-01-17 15:28:11 +0100 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2012-01-17 17:01:26 +0100 |
commit | 804e86170ff2570fd3826b4ac26d1c927e751ac3 (patch) | |
tree | 0c24d6df02314b38dc17650030da80419a94b6b2 /tools | |
parent | 3c8478e26bde41c35c75557d985f5734d8d1a2bd (diff) |
remove unused methods
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/datetime.hxx | 1 | ||||
-rw-r--r-- | tools/inc/tools/line.hxx | 4 | ||||
-rw-r--r-- | tools/source/datetime/datetime.cxx | 17 | ||||
-rw-r--r-- | tools/source/generic/line.cxx | 147 |
4 files changed, 0 insertions, 169 deletions
diff --git a/tools/inc/tools/datetime.hxx b/tools/inc/tools/datetime.hxx index 3f3ba3831d84..cf053e52d8cd 100644 --- a/tools/inc/tools/datetime.hxx +++ b/tools/inc/tools/datetime.hxx @@ -82,7 +82,6 @@ public: sal_Bool operator <=( const DateTime& rDateTime ) const; long GetSecFromDateTime( const Date& rDate ) const; - void MakeDateTimeFromSec( const Date& rDate, sal_uIntPtr nSec ); void ConvertToUTC() { *this -= Time::GetUTCOffset(); } void ConvertToLocalTime() { *this += Time::GetUTCOffset(); } diff --git a/tools/inc/tools/line.hxx b/tools/inc/tools/line.hxx index ffe1ceec69b1..6257f8d4236b 100644 --- a/tools/inc/tools/line.hxx +++ b/tools/inc/tools/line.hxx @@ -67,10 +67,6 @@ public: double GetDistance( const double& rPtX, const double& rPtY ) const; double GetDistance( const Point& rPoint ) const { return( GetDistance( rPoint.X(), rPoint.Y() ) ); } - - Point NearestPoint( const Point& rPoint ) const; - - void Enum( const Link& rEnumLink ); }; #endif // _SV_LINE_HXX diff --git a/tools/source/datetime/datetime.cxx b/tools/source/datetime/datetime.cxx index e58646d332d4..3936389f4dbc 100644 --- a/tools/source/datetime/datetime.cxx +++ b/tools/source/datetime/datetime.cxx @@ -128,23 +128,6 @@ long DateTime::GetSecFromDateTime( const Date& rDate ) const /************************************************************************* |* -|* DateTime::GetSecFromDateTime() -|* -*************************************************************************/ - -void DateTime::MakeDateTimeFromSec( const Date& rDate, sal_uIntPtr nSec ) -{ - long nDays = nSec / (24UL*60*60); - ((Date*)this)->operator=( rDate ); - nSec -= nDays * (24UL*60*60); - sal_uInt16 nMin = (sal_uInt16)(nSec / 60); - nSec -= nMin * 60; - ((Time*)this)->operator=( Time( 0, nMin, (sal_uInt16)nSec ) ); - operator+=( nDays ); -} - -/************************************************************************* -|* |* DateTime::operator +=() |* *************************************************************************/ diff --git a/tools/source/generic/line.cxx b/tools/source/generic/line.cxx index fad9ec123c94..32c81e8d231b 100644 --- a/tools/source/generic/line.cxx +++ b/tools/source/generic/line.cxx @@ -177,36 +177,6 @@ sal_Bool Line::Intersection( const Rectangle& rRect, Line& rIntersection ) const // ------------------------------------------------------------------------ -Point Line::NearestPoint( const Point& rPoint ) const -{ - Point aRetPt; - - if ( maStart != maEnd ) - { - const double fDistX = maEnd.X() - maStart.X(); - const double fDistY = maStart.Y() - maEnd.Y(); - const double fTau = ( ( maStart.Y() - rPoint.Y() ) * fDistY - - ( maStart.X() - rPoint.X() ) * fDistX ) / - ( fDistX * fDistX + fDistY * fDistY ); - - if( fTau < 0.0 ) - aRetPt = maStart; - else if( fTau <= 1.0 ) - { - aRetPt.X() = FRound( maStart.X() + fTau * fDistX ); - aRetPt.Y() = FRound( maStart.Y() - fTau * fDistY ); - } - else - aRetPt = maEnd; - } - else - aRetPt = maStart; - - return aRetPt; -} - -// ------------------------------------------------------------------------ - double Line::GetDistance( const double& rPtX, const double& rPtY ) const { double fDist; @@ -244,121 +214,4 @@ double Line::GetDistance( const double& rPtX, const double& rPtY ) const return fDist; } -// ------------------------------------------------------------------------ - -void Line::Enum( const Link& rEnumLink ) -{ - DBG_ASSERT( rEnumLink.IsSet(), "This call doesn't make any sense with !rEnumLink.IsSet()" ); - - Point aEnum; - long nX; - long nY; - - if( maStart.X() == maEnd.X() ) - { - const long nEndY = maEnd.Y(); - - nX = maStart.X(); - nY = maStart.Y(); - - if( nEndY > nY ) - { - while( nY <= nEndY ) - { - aEnum.X() = nX; - aEnum.Y() = nY++; - rEnumLink.Call( &aEnum ); - } - } - else - { - while( nY >= nEndY ) - { - aEnum.X() = nX; - aEnum.Y() = nY--; - rEnumLink.Call( &aEnum ); - } - } - } - else if( maStart.Y() == maEnd.Y() ) - { - const long nEndX = maEnd.X(); - - nX = maStart.X(); - nY = maStart.Y(); - - if( nEndX > nX ) - { - while( nX <= nEndX ) - { - aEnum.X() = nX++; - aEnum.Y() = nY; - rEnumLink.Call( &aEnum ); - } - } - else - { - while( nX >= nEndX ) - { - aEnum.X() = nX--; - aEnum.Y() = nY; - rEnumLink.Call( &aEnum ); - } - } - } - else - { - const long nDX = labs( maEnd.X() - maStart.X() ); - const long nDY = labs( maEnd.Y() - maStart.Y() ); - const long nStartX = maStart.X(); - const long nStartY = maStart.Y(); - const long nEndX = maEnd.X(); - const long nEndY = maEnd.Y(); - const long nXInc = ( nStartX < nEndX ) ? 1L : -1L; - const long nYInc = ( nStartY < nEndY ) ? 1L : -1L; - - if( nDX >= nDY ) - { - const long nDYX = ( nDY - nDX ) << 1; - const long nDY2 = nDY << 1; - long nD = nDY2 - nDX; - - for( nX = nStartX, nY = nStartY; nX != nEndX; nX += nXInc ) - { - aEnum.X() = nX; - aEnum.Y() = nY; - rEnumLink.Call( &aEnum ); - - if( nD < 0L ) - nD += nDY2; - else - nD += nDYX, nY += nYInc; - } - } - else - { - const long nDYX = ( nDX - nDY ) << 1; - const long nDY2 = nDX << 1; - long nD = nDY2 - nDY; - - for( nX = nStartX, nY = nStartY; nY != nEndY; nY += nYInc ) - { - aEnum.X() = nX; - aEnum.Y() = nY; - rEnumLink.Call( &aEnum ); - - if( nD < 0L ) - nD += nDY2; - else - nD += nDYX, nX += nXInc; - } - } - - // last point - aEnum.X() = nEndX; - aEnum.Y() = nEndY; - rEnumLink.Call( &aEnum ); - } -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |