summaryrefslogtreecommitdiff
path: root/tools/source/datetime
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2013-06-29 23:57:38 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2013-06-30 04:58:49 +0000
commit710f41b7aec8e7d35a0da8be332aa289f98942af (patch)
treeb894ef2d3f06a63a85f423b2713a654ea57f9c69 /tools/source/datetime
parent1ca3beae12a7f222c987481e07a544845fc9fd46 (diff)
Clean String and sal_Bool in tools
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655 Reviewed-on: https://gerrit.libreoffice.org/4627 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'tools/source/datetime')
-rw-r--r--tools/source/datetime/datetime.cxx30
-rw-r--r--tools/source/datetime/tdate.cxx26
-rw-r--r--tools/source/datetime/ttime.cxx2
3 files changed, 29 insertions, 29 deletions
diff --git a/tools/source/datetime/datetime.cxx b/tools/source/datetime/datetime.cxx
index 1bf612730bb0..3056bf89947b 100644
--- a/tools/source/datetime/datetime.cxx
+++ b/tools/source/datetime/datetime.cxx
@@ -19,48 +19,48 @@
#include <tools/datetime.hxx>
#include <rtl/math.hxx>
-sal_Bool DateTime::IsBetween( const DateTime& rFrom, const DateTime& rTo ) const
+bool DateTime::IsBetween( const DateTime& rFrom, const DateTime& rTo ) const
{
if ( (*this >= rFrom) && (*this <= rTo) )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
-sal_Bool DateTime::operator >( const DateTime& rDateTime ) const
+bool DateTime::operator >( const DateTime& rDateTime ) const
{
if ( (Date::operator>( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator>( rDateTime )) )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
-sal_Bool DateTime::operator <( const DateTime& rDateTime ) const
+bool DateTime::operator <( const DateTime& rDateTime ) const
{
if ( (Date::operator<( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator<( rDateTime )) )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
-sal_Bool DateTime::operator >=( const DateTime& rDateTime ) const
+bool DateTime::operator >=( const DateTime& rDateTime ) const
{
if ( (Date::operator>( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator>=( rDateTime )) )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
-sal_Bool DateTime::operator <=( const DateTime& rDateTime ) const
+bool DateTime::operator <=( const DateTime& rDateTime ) const
{
if ( (Date::operator<( rDateTime )) ||
(Date::operator==( rDateTime ) && Time::operator<=( rDateTime )) )
- return sal_True;
+ return true;
else
- return sal_False;
+ return false;
}
long DateTime::GetSecFromDateTime( const Date& rDate ) const
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index a07ee4e9ae31..11f1917c9e8a 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -37,7 +37,7 @@ static sal_uInt16 aDaysInMonth[12] = { 31, 28, 31, 30, 31, 30,
#define MAX_DAYS 3636532
-inline sal_Bool ImpIsLeapYear( sal_uInt16 nYear )
+inline bool ImpIsLeapYear( sal_uInt16 nYear )
{
return ( ( ((nYear % 4) == 0) && ((nYear % 100) != 0) ) ||
( (nYear % 400) == 0 ) );
@@ -87,7 +87,7 @@ static void DaysToDate( long nDays,
{
long nTempDays;
long i = 0;
- sal_Bool bCalc;
+ bool bCalc;
do
{
@@ -95,11 +95,11 @@ static void DaysToDate( long nDays,
rYear = (sal_uInt16)((nTempDays / 365) - i);
nTempDays -= ((sal_uIntPtr)rYear-1) * 365;
nTempDays -= ((rYear-1) / 4) - ((rYear-1) / 100) + ((rYear-1) / 400);
- bCalc = sal_False;
+ bCalc = false;
if ( nTempDays < 1 )
{
i++;
- bCalc = sal_True;
+ bCalc = true;
}
else
{
@@ -108,7 +108,7 @@ static void DaysToDate( long nDays,
if ( (nTempDays != 366) || !ImpIsLeapYear( rYear ) )
{
i--;
- bCalc = sal_True;
+ bCalc = true;
}
}
}
@@ -293,33 +293,33 @@ sal_uInt16 Date::GetDaysInMonth() const
return ImplDaysInMonth( nMonth, nYear );
}
-sal_Bool Date::IsLeapYear() const
+bool Date::IsLeapYear() const
{
sal_uInt16 nYear = GetYear();
return ImpIsLeapYear( nYear );
}
-sal_Bool Date::IsValidAndGregorian() const
+bool Date::IsValidAndGregorian() const
{
sal_uInt16 nDay = GetDay();
sal_uInt16 nMonth = GetMonth();
sal_uInt16 nYear = GetYear();
if ( !nMonth || (nMonth > 12) )
- return sal_False;
+ return false;
if ( !nDay || (nDay > ImplDaysInMonth( nMonth, nYear )) )
- return sal_False;
+ return false;
else if ( nYear <= 1582 )
{
if ( nYear < 1582 )
- return sal_False;
+ return false;
else if ( nMonth < 10 )
- return sal_False;
+ return false;
else if ( (nMonth == 10) && (nDay < 15) )
- return sal_False;
+ return false;
}
- return sal_True;
+ return true;
}
bool Date::IsValidDate() const
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx
index 8b27d1ffa72d..bf25206c0fbc 100644
--- a/tools/source/datetime/ttime.cxx
+++ b/tools/source/datetime/ttime.cxx
@@ -325,7 +325,7 @@ Time operator -( const Time& rTime1, const Time& rTime2 )
TimeToNanoSec( rTime2 ) );
}
-sal_Bool Time::IsEqualIgnoreNanoSec( const Time& rTime ) const
+bool Time::IsEqualIgnoreNanoSec( const Time& rTime ) const
{
sal_Int32 n1 = (nTime < 0 ? -static_cast<sal_Int32>(GetNanoSec()) : GetNanoSec() );
sal_Int32 n2 = (rTime.nTime < 0 ? -static_cast<sal_Int32>(rTime.GetNanoSec()) : rTime.GetNanoSec() );