From fda8ac2d174f8465beb68af34004fa8f23818c14 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 23 Apr 2014 11:21:34 +0200 Subject: scaddins: sal_Bool->bool Change-Id: I8cea3bb0c407eba7928cb44d9ce00016ff890a41 --- scaddins/source/analysis/analysis.cxx | 32 ++--- scaddins/source/analysis/analysishelper.cxx | 178 ++++++++++++++-------------- scaddins/source/analysis/analysishelper.hxx | 132 ++++++++++----------- scaddins/source/analysis/financial.cxx | 4 +- scaddins/source/datefunc/datefunc.cxx | 16 +-- scaddins/source/datefunc/datefunc.hxx | 16 +-- scaddins/source/pricing/pricing.cxx | 4 +- scaddins/source/pricing/pricing.hxx | 16 +-- 8 files changed, 199 insertions(+), 199 deletions(-) (limited to 'scaddins/source') diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 0a9f95fe5db2..8d2470555740 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -82,7 +82,7 @@ class AnalysisResourcePublisher : public Resource { public: AnalysisResourcePublisher( const AnalysisResId& rId ) : Resource( rId ) {} - sal_Bool IsAvailableRes( const ResId& rId ) const { return Resource::IsAvailableRes( rId ); } + bool IsAvailableRes( const ResId& rId ) const { return Resource::IsAvailableRes( rId ); } void FreeResource() { Resource::FreeResource(); } }; @@ -192,7 +192,7 @@ double AnalysisAddIn::FactDouble( sal_Int32 nNum ) throw( uno::RuntimeException, pFactDoubles[ 1 ] = fOdd; pFactDoubles[ 2 ] = fEven; - sal_Bool bOdd = sal_True; + bool bOdd = true; for( sal_uInt16 nCnt = 3 ; nCnt <= MAXFACTDOUBLE ; nCnt++ ) { @@ -457,7 +457,7 @@ sal_Int32 SAL_CALL AnalysisAddIn::getWorkday( const uno::Reference< beans::XProp SortedIndividualInt32List aSrtLst; - aSrtLst.InsertHolidayList( aAnyConv, xOptions, aHDay, nNullDate, sal_False ); + aSrtLst.InsertHolidayList( aAnyConv, xOptions, aHDay, nNullDate, false ); sal_Int32 nActDate = nDate + nNullDate; @@ -565,7 +565,7 @@ sal_Int32 SAL_CALL AnalysisAddIn::getNetworkdays( const uno::Reference< beans::X SortedIndividualInt32List aSrtLst; - aSrtLst.InsertHolidayList( aAnyConv, xOpt, aHDay, nNullDate, sal_False ); + aSrtLst.InsertHolidayList( aAnyConv, xOpt, aHDay, nNullDate, false ); sal_Int32 nActDate = nStartDate + nNullDate; sal_Int32 nStopDate = nEndDate + nNullDate; @@ -797,7 +797,7 @@ OUString SAL_CALL AnalysisAddIn::getBin2Oct( const uno::Reference< beans::XPrope { double fVal = ConvertToDec( aNum, 2, SCA_MAXPLACES ); sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( fVal, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces ); } @@ -811,7 +811,7 @@ OUString SAL_CALL AnalysisAddIn::getBin2Hex( const uno::Reference< beans::XPrope { double fVal = ConvertToDec( aNum, 2, SCA_MAXPLACES ); sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( fVal, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces ); } @@ -819,7 +819,7 @@ OUString SAL_CALL AnalysisAddIn::getOct2Bin( const uno::Reference< beans::XPrope { double fVal = ConvertToDec( aNum, 8, SCA_MAXPLACES ); sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( fVal, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces ); } @@ -833,28 +833,28 @@ OUString SAL_CALL AnalysisAddIn::getOct2Hex( const uno::Reference< beans::XPrope { double fVal = ConvertToDec( aNum, 8, SCA_MAXPLACES ); sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( fVal, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces ); } OUString SAL_CALL AnalysisAddIn::getDec2Bin( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception ) { sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( nNum, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces ); } OUString SAL_CALL AnalysisAddIn::getDec2Oct( const uno::Reference< beans::XPropertySet >& xOpt, sal_Int32 nNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception ) { sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( nNum, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces ); } OUString SAL_CALL AnalysisAddIn::getDec2Hex( const uno::Reference< beans::XPropertySet >& xOpt, double fNum, const uno::Any& rPlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception ) { sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( fNum, SCA_MIN16, SCA_MAX16, 16, nPlaces, SCA_MAXPLACES, bUsePlaces ); } @@ -862,7 +862,7 @@ OUString SAL_CALL AnalysisAddIn::getHex2Bin( const uno::Reference< beans::XPrope { double fVal = ConvertToDec( aNum, 16, SCA_MAXPLACES ); sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( fVal, SCA_MIN2, SCA_MAX2, 2, nPlaces, SCA_MAXPLACES, bUsePlaces ); } @@ -876,7 +876,7 @@ OUString SAL_CALL AnalysisAddIn::getHex2Oct( const uno::Reference< beans::XPrope { double fVal = ConvertToDec( aNum, 16, SCA_MAXPLACES ); sal_Int32 nPlaces = 0; - sal_Bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); + bool bUsePlaces = aAnyConv.getInt32( nPlaces, xOpt, rPlaces ); return ConvertFromDec( fVal, SCA_MIN8, SCA_MAX8, 8, nPlaces, SCA_MAXPLACES, bUsePlaces ); } @@ -888,7 +888,7 @@ sal_Int32 SAL_CALL AnalysisAddIn::getDelta( const uno::Reference< beans::XProper double SAL_CALL AnalysisAddIn::getErf( const uno::Reference< beans::XPropertySet >& xOpt, double fLL, const uno::Any& rUL ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception ) { double fUL, fRet; - sal_Bool bContainsValue = aAnyConv.getDouble( fUL, xOpt, rUL ); + bool bContainsValue = aAnyConv.getDouble( fUL, xOpt, rUL ); fRet = bContainsValue ? (Erf( fUL ) - Erf( fLL )) : Erf( fLL ); RETURN_FINITE( fRet ); @@ -1142,12 +1142,12 @@ OUString SAL_CALL AnalysisAddIn::getImcsch( const OUString& aNum ) throw( uno::R OUString SAL_CALL AnalysisAddIn::getComplex( double fR, double fI, const uno::Any& rSuff ) throw( uno::RuntimeException, lang::IllegalArgumentException, std::exception ) { - sal_Bool bi; + bool bi; switch( rSuff.getValueTypeClass() ) { case uno::TypeClass_VOID: - bi = sal_True; + bi = true; break; case uno::TypeClass_STRING: { diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 18769681d837..5e8883b1c1ee 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -30,11 +30,11 @@ using namespace ::com::sun::star; -#define UNIQUE sal_False // function name does not exist in Calc -#define DOUBLE sal_True // function name exists in Calc +#define UNIQUE false // function name does not exist in Calc +#define DOUBLE true // function name exists in Calc -#define STDPAR sal_False // all parameters are described -#define INTPAR sal_True // first parameter is internal +#define STDPAR false // all parameters are described +#define INTPAR true // first parameter is internal #define FUNCDATA( FUNCNAME, DBL, OPT, NUMOFPAR, CAT ) \ { "get" #FUNCNAME, ANALYSIS_FUNCNAME_##FUNCNAME, ANALYSIS_##FUNCNAME, DBL, OPT, ANALYSIS_DEFFUNCNAME_##FUNCNAME, NUMOFPAR, CAT } @@ -198,7 +198,7 @@ void DaysToDate( sal_Int32 nDays, sal_uInt16& rDay, sal_uInt16& rMonth, sal_uInt sal_Int32 nTempDays; sal_Int32 i = 0; - sal_Bool bCalc; + bool bCalc; do { @@ -206,11 +206,11 @@ void DaysToDate( sal_Int32 nDays, sal_uInt16& rDay, sal_uInt16& rMonth, sal_uInt rYear = (sal_uInt16)((nTempDays / 365) - i); nTempDays -= ((sal_Int32) 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 { @@ -219,7 +219,7 @@ void DaysToDate( sal_Int32 nDays, sal_uInt16& rDay, sal_uInt16& rMonth, sal_uInt if ( (nTempDays != 366) || !IsLeapYear( rYear ) ) { i--; - bCalc = sal_True; + bCalc = true; } } } @@ -267,9 +267,9 @@ sal_Int32 GetNullDate( const uno::Reference< beans::XPropertySet >& xOpt ) throw sal_Int32 GetDiffDate360( - sal_uInt16 nDay1, sal_uInt16 nMonth1, sal_uInt16 nYear1, sal_Bool bLeapYear1, + sal_uInt16 nDay1, sal_uInt16 nMonth1, sal_uInt16 nYear1, bool bLeapYear1, sal_uInt16 nDay2, sal_uInt16 nMonth2, sal_uInt16 nYear2, - sal_Bool bUSAMethod ) + bool bUSAMethod ) { if( nDay1 == 31 ) nDay1--; @@ -297,7 +297,7 @@ sal_Int32 GetDiffDate360( } -sal_Int32 GetDiffDate360( sal_Int32 nNullDate, sal_Int32 nDate1, sal_Int32 nDate2, sal_Bool bUSAMethod ) +sal_Int32 GetDiffDate360( sal_Int32 nNullDate, sal_Int32 nDate1, sal_Int32 nDate2, bool bUSAMethod ) { nDate1 += nNullDate; nDate2 += nNullDate; @@ -333,7 +333,7 @@ sal_Int32 GetDaysInYears( sal_uInt16 nYear1, sal_uInt16 nYear2 ) sal_Int32 GetDiffDate( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEndDate, sal_Int32 nMode, sal_Int32* pOptDaysIn1stYear ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { - sal_Bool bNeg = nStartDate > nEndDate; + bool bNeg = nStartDate > nEndDate; if( bNeg ) { @@ -357,7 +357,7 @@ sal_Int32 GetDiffDate( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEnd DaysToDate( nStartDate, nD1, nM1, nY1 ); DaysToDate( nEndDate, nD2, nM2, nY2 ); - sal_Bool bLeap = IsLeapYear( nY1 ); + bool bLeap = IsLeapYear( nY1 ); sal_Int32 nDays, nMonths; nMonths = nM2 - nM1; @@ -665,7 +665,7 @@ double ConvertToDec( const OUString& aStr, sal_uInt16 nBase, sal_uInt16 nCharLim const sal_Unicode* p = aStr.getStr(); sal_uInt16 nFirstDig = 0; - sal_Bool bFirstDig = sal_True; + bool bFirstDig = true; double fBase = nBase; while ( *p ) @@ -685,7 +685,7 @@ double ConvertToDec( const OUString& aStr, sal_uInt16 nBase, sal_uInt16 nCharLim { if( bFirstDig ) { - bFirstDig = sal_False; + bFirstDig = false; nFirstDig = n; } fVal = fVal * fBase + double( n ); @@ -716,7 +716,7 @@ static inline sal_Char GetMaxChar( sal_uInt16 nBase ) OUString ConvertFromDec( double fNum, double fMin, double fMax, sal_uInt16 nBase, - sal_Int32 nPlaces, sal_Int32 nMaxPlaces, sal_Bool bUsePlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + sal_Int32 nPlaces, sal_Int32 nMaxPlaces, bool bUsePlaces ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { fNum = ::rtl::math::approxFloor( fNum ); fMin = ::rtl::math::approxFloor( fMin ); @@ -726,7 +726,7 @@ OUString ConvertFromDec( double fNum, double fMin, double fMax, sal_uInt16 nBase throw lang::IllegalArgumentException(); sal_Int64 nNum = static_cast< sal_Int64 >( fNum ); - sal_Bool bNeg = nNum < 0; + bool bNeg = nNum < 0; if( bNeg ) nNum = sal_Int64( pow( double( nBase ), double( nMaxPlaces ) ) ) + nNum; @@ -769,25 +769,25 @@ double Erfc( double x ) return ::rtl::math::erfc(x); } -inline sal_Bool IsNum( sal_Unicode c ) +inline bool IsNum( sal_Unicode c ) { return c >= '0' && c <= '9'; } -inline sal_Bool IsComma( sal_Unicode c ) +inline bool IsComma( sal_Unicode c ) { return c == '.' || c == ','; } -inline sal_Bool IsExpStart( sal_Unicode c ) +inline bool IsExpStart( sal_Unicode c ) { return c == 'e' || c == 'E'; } -inline sal_Bool IsImagUnit( sal_Unicode c ) +inline bool IsImagUnit( sal_Unicode c ) { return c == 'i' || c == 'j'; } @@ -799,7 +799,7 @@ inline sal_uInt16 GetVal( sal_Unicode c ) } -sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) +bool ParseDouble( const sal_Unicode*& rp, double& rRet ) { double fInt = 0.0; double fFrac = 0.0; @@ -812,8 +812,8 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) State eS = S_Sign; - sal_Bool bNegNum = sal_False; - sal_Bool bNegExp = sal_False; + bool bNegNum = false; + bool bNegExp = false; const sal_Unicode* p = rp; sal_Unicode c; @@ -832,7 +832,7 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) } else if( c == '-' ) { - bNegNum = sal_True; + bNegNum = true; eS = S_IntStart; } else if( c == '+' ) @@ -840,7 +840,7 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) else if( IsComma( c ) ) eS = S_Frac; else - return sal_False; + return false; break; case S_IntStart: if( IsNum( c ) ) @@ -854,10 +854,10 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) else if( IsImagUnit( c ) ) { rRet = 0.0; - return sal_True; + return true; } else - return sal_False; + return false; break; case S_Int: if( IsNum( c ) ) @@ -914,7 +914,7 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) } else if( c == '-' ) { - bNegExp = sal_True; + bNegExp = true; eS = S_Exp; } else if( c != '+' ) @@ -926,7 +926,7 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) nExp *= 10; nExp += GetVal( c ); if( nExp > nMaxExp ) - return sal_False; + return false; } else eS = S_End; @@ -948,7 +948,7 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) nExp = -nExp; if( nLog10 + nExp > nMaxExp ) - return sal_False; + return false; fInt = ::rtl::math::pow10Exp( fInt, nExp ); @@ -957,11 +957,11 @@ sal_Bool ParseDouble( const sal_Unicode*& rp, double& rRet ) rRet = fInt; - return sal_True; + return true; } -OUString GetString( double f, sal_Bool bLeadingSign, sal_uInt16 nMaxDig ) +OUString GetString( double f, bool bLeadingSign, sal_uInt16 nMaxDig ) { const int nBuff = 256; sal_Char aBuff[ nBuff + 1 ]; @@ -1501,7 +1501,7 @@ void SortedIndividualInt32List::Insert( sal_Int32 nDay ) } -void SortedIndividualInt32List::Insert( sal_Int32 nDay, sal_Int32 nNullDate, sal_Bool bInsertOnWeekend ) +void SortedIndividualInt32List::Insert( sal_Int32 nDay, sal_Int32 nNullDate, bool bInsertOnWeekend ) { if( !nDay ) return; @@ -1513,7 +1513,7 @@ void SortedIndividualInt32List::Insert( sal_Int32 nDay, sal_Int32 nNullDate, sal void SortedIndividualInt32List::Insert( - double fDay, sal_Int32 nNullDate, sal_Bool bInsertOnWeekend ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + double fDay, sal_Int32 nNullDate, bool bInsertOnWeekend ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { if( (fDay < -2147483648.0) || (fDay > 2147483649.0) ) throw lang::IllegalArgumentException(); @@ -1521,12 +1521,12 @@ void SortedIndividualInt32List::Insert( } -sal_Bool SortedIndividualInt32List::Find( sal_Int32 nVal ) const +bool SortedIndividualInt32List::Find( sal_Int32 nVal ) const { sal_uInt32 nE = Count(); if( !nE || nVal < Get( 0 ) || nVal > Get( nE - 1 ) ) - return sal_False; + return false; // linear search @@ -1535,11 +1535,11 @@ sal_Bool SortedIndividualInt32List::Find( sal_Int32 nVal ) const sal_Int32 nRef = Get( n ); if( nRef == nVal ) - return sal_True; + return true; else if( nRef > nVal ) - return sal_False; + return false; } - return sal_False; + return false; } @@ -1547,7 +1547,7 @@ void SortedIndividualInt32List::InsertHolidayList( const ScaAnyConverter& rAnyConv, const uno::Any& rHolAny, sal_Int32 nNullDate, - sal_Bool bInsertOnWeekend ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + bool bInsertOnWeekend ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { double fDay; if( rAnyConv.getDouble( fDay, rHolAny ) ) @@ -1560,7 +1560,7 @@ void SortedIndividualInt32List::InsertHolidayList( const uno::Reference< beans::XPropertySet >& xOptions, const uno::Any& rHolAny, sal_Int32 nNullDate, - sal_Bool bInsertOnWeekend ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + bool bInsertOnWeekend ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { rAnyConv.init( xOptions ); if( rHolAny.getValueTypeClass() == uno::TypeClass_SEQUENCE ) @@ -1617,7 +1617,7 @@ void ScaDoubleList::Append( void ScaDoubleList::Append( const ScaAnyConverter& rAnyConv, const uno::Any& rAny, - sal_Bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { if( rAny.getValueTypeClass() == uno::TypeClass_SEQUENCE ) Append( rAnyConv, *static_cast< const uno::Sequence< uno::Sequence< uno::Any > >* >( rAny.getValue() ), bIgnoreEmpty ); @@ -1635,7 +1635,7 @@ void ScaDoubleList::Append( void ScaDoubleList::Append( const ScaAnyConverter& rAnyConv, const uno::Sequence< uno::Any >& rAnySeq, - sal_Bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { const uno::Any* pArray = rAnySeq.getConstArray(); for( sal_Int32 nIndex = 0; nIndex < rAnySeq.getLength(); nIndex++ ) @@ -1646,7 +1646,7 @@ void ScaDoubleList::Append( void ScaDoubleList::Append( const ScaAnyConverter& rAnyConv, const uno::Sequence< uno::Sequence< uno::Any > >& rAnySeq, - sal_Bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { const uno::Sequence< uno::Any >* pArray = rAnySeq.getConstArray(); for( sal_Int32 nIndex = 0; nIndex < rAnySeq.getLength(); nIndex++ ) @@ -1657,21 +1657,21 @@ void ScaDoubleList::Append( ScaAnyConverter& rAnyConv, const uno::Reference< beans::XPropertySet >& xOpt, const uno::Sequence< uno::Any >& rAnySeq, - sal_Bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) + bool bIgnoreEmpty ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { rAnyConv.init( xOpt ); Append( rAnyConv, rAnySeq, bIgnoreEmpty ); } -sal_Bool ScaDoubleList::CheckInsert( double ) const throw( uno::RuntimeException, lang::IllegalArgumentException ) +bool ScaDoubleList::CheckInsert( double ) const throw( uno::RuntimeException, lang::IllegalArgumentException ) { - return sal_True; + return true; } -sal_Bool ScaDoubleListGT0::CheckInsert( double fValue ) const throw( uno::RuntimeException, lang::IllegalArgumentException ) +bool ScaDoubleListGT0::CheckInsert( double fValue ) const throw( uno::RuntimeException, lang::IllegalArgumentException ) { if( fValue < 0.0 ) throw lang::IllegalArgumentException(); @@ -1680,11 +1680,11 @@ sal_Bool ScaDoubleListGT0::CheckInsert( double fValue ) const throw( uno::Runtim -sal_Bool ScaDoubleListGE0::CheckInsert( double fValue ) const throw( uno::RuntimeException, lang::IllegalArgumentException ) +bool ScaDoubleListGE0::CheckInsert( double fValue ) const throw( uno::RuntimeException, lang::IllegalArgumentException ) { if( fValue < 0.0 ) throw lang::IllegalArgumentException(); - return sal_True; + return true; } @@ -1696,12 +1696,12 @@ Complex::Complex( const OUString& rStr ) throw( uno::RuntimeException, lang::Ill } -inline sal_Bool Complex::IsImagUnit( sal_Unicode c ) +inline bool Complex::IsImagUnit( sal_Unicode c ) { return c == 'i' || c == 'j'; } -sal_Bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) +bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) { rCompl.c = '\0'; // do not force a symbol, if only real part present @@ -1712,13 +1712,13 @@ sal_Bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) rCompl.r = 0.0; rCompl.i = 1.0; rCompl.c = *pStr; - return sal_True; + return true; } double f; if( !ParseDouble( pStr, f ) ) - return sal_False; + return false; switch( *pStr ) { @@ -1733,7 +1733,7 @@ sal_Bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) { rCompl.r = f; rCompl.i = ( *pStr == '+' )? 1.0 : -1.0; - return sal_True; + return true; } } else if( ParseDouble( pStr, f ) && IsImagUnit( *pStr ) ) @@ -1744,7 +1744,7 @@ sal_Bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) { rCompl.r = r; rCompl.i = f; - return sal_True; + return true; } } } @@ -1757,16 +1757,16 @@ sal_Bool Complex::ParseString( const OUString& rStr, Complex& rCompl ) { rCompl.i = f; rCompl.r = 0.0; - return sal_True; + return true; } break; case 0: // only real-part rCompl.r = f; rCompl.i = 0.0; - return sal_True; + return true; } - return sal_False; + return false; } @@ -1922,7 +1922,7 @@ void Complex::Ln( void ) throw( uno::RuntimeException, lang::IllegalArgumentExce throw lang::IllegalArgumentException(); double fAbs = Abs(); - sal_Bool bNegi = i < 0.0; + bool bNegi = i < 0.0; i = acos( r / fAbs ); @@ -2115,8 +2115,8 @@ void ComplexList::Append( const uno::Sequence< uno::Sequence< OUString > >& r, C sal_Int32 n1, n2; sal_Int32 nE1 = r.getLength(); sal_Int32 nE2; - sal_Bool bEmpty0 = eAH == AH_EmpyAs0; - sal_Bool bErrOnEmpty = eAH == AH_EmptyAsErr; + bool bEmpty0 = eAH == AH_EmpyAs0; + bool bErrOnEmpty = eAH == AH_EmptyAsErr; for( n1 = 0 ; n1 < nE1 ; n1++ ) { @@ -2141,8 +2141,8 @@ void ComplexList::Append( const uno::Sequence< uno::Sequence< OUString > >& r, C void ComplexList::Append( const uno::Sequence< uno::Any >& aMultPars, ComplListAppendHandl eAH ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { sal_Int32 nEle = aMultPars.getLength(); - sal_Bool bEmpty0 = eAH == AH_EmpyAs0; - sal_Bool bErrOnEmpty = eAH == AH_EmptyAsErr; + bool bEmpty0 = eAH == AH_EmpyAs0; + bool bErrOnEmpty = eAH == AH_EmptyAsErr; for( sal_Int32 i = 0 ; i < nEle ; i++ ) { @@ -2186,7 +2186,7 @@ void ComplexList::Append( const uno::Sequence< uno::Any >& aMultPars, ComplListA } -ConvertData::ConvertData( const sal_Char p[], double fC, ConvertDataClass e, sal_Bool bPrefSupport ) : aName( p, strlen( p ), RTL_TEXTENCODING_MS_1252 ) +ConvertData::ConvertData( const sal_Char p[], double fC, ConvertDataClass e, bool bPrefSupport ) : aName( p, strlen( p ), RTL_TEXTENCODING_MS_1252 ) { fConst = fC; eClass = e; @@ -2307,8 +2307,8 @@ double ConvertData::Convert( if( Class() != r.Class() ) throw lang::IllegalArgumentException(); - sal_Bool bBinFromLev = ( nLevFrom > 0 && ( nLevFrom % 10 ) == 0 ); - sal_Bool bBinToLev = ( nLevTo > 0 && ( nLevTo % 10 ) == 0 ); + bool bBinFromLev = ( nLevFrom > 0 && ( nLevFrom % 10 ) == 0 ); + bool bBinToLev = ( nLevTo > 0 && ( nLevTo % 10 ) == 0 ); if ( Class() == CDC_Information && ( bBinFromLev || bBinToLev ) ) { @@ -2388,9 +2388,9 @@ double ConvertDataLinear::ConvertFromBase( double f, sal_Int16 n ) const ConvertDataList::ConvertDataList( void ) { #define NEWD(str,unit,cl) maVector.push_back(new ConvertData(str,unit,cl)) -#define NEWDP(str,unit,cl) maVector.push_back(new ConvertData(str,unit,cl,sal_True)) +#define NEWDP(str,unit,cl) maVector.push_back(new ConvertData(str,unit,cl,true)) #define NEWL(str,unit,offs,cl) maVector.push_back(new ConvertDataLinear(str,unit,offs,cl)) -#define NEWLP(str,unit,offs,cl) maVector.push_back(new ConvertDataLinear(str,unit,offs,cl,sal_True)) +#define NEWLP(str,unit,offs,cl) maVector.push_back(new ConvertDataLinear(str,unit,offs,cl,true)) // *** are extra and not standard Excel Analysis Addin! @@ -2576,8 +2576,8 @@ double ConvertDataList::Convert( double fVal, const OUString& rFrom, const OUStr { ConvertData* pFrom = NULL; ConvertData* pTo = NULL; - sal_Bool bSearchFrom = sal_True; - sal_Bool bSearchTo = sal_True; + bool bSearchFrom = true; + bool bSearchTo = true; sal_Int16 nLevelFrom = 0; sal_Int16 nLevelTo = 0; @@ -2598,7 +2598,7 @@ double ConvertDataList::Convert( double fVal, const OUString& rFrom, const OUStr else { // ... but exact match rulz most pFrom = p; - bSearchFrom = sal_False; + bSearchFrom = false; nLevelFrom = n; } } @@ -2617,7 +2617,7 @@ double ConvertDataList::Convert( double fVal, const OUString& rFrom, const OUStr else { // ... but exact match rulz most pTo = p; - bSearchTo = sal_False; + bSearchTo = false; nLevelTo = n; } } @@ -2639,10 +2639,10 @@ ScaDate::ScaDate() : nDay( 1 ), nMonth( 1 ), nYear( 1900 ), - bLastDayMode( sal_True ), - bLastDay( sal_False ), - b30Days( sal_False ), - bUSMode( sal_False ) + bLastDayMode( true ), + bLastDay( false ), + b30Days( false ), + bUSMode( false ) { } @@ -2793,7 +2793,7 @@ sal_Int32 ScaDate::getDiff( const ScaDate& rFrom, const ScaDate& rTo ) throw( la // move aFrom to 1st day of next month nDiff = aFrom.getDaysInMonth() - aFrom.nDay + 1; aFrom.nOrigDay = aFrom.nDay = 1; - aFrom.bLastDay = sal_False; + aFrom.bLastDay = false; aFrom.addMonths( 1 ); if( aFrom.nYear < aTo.nYear ) @@ -2816,7 +2816,7 @@ sal_Int32 ScaDate::getDiff( const ScaDate& rFrom, const ScaDate& rTo ) throw( la return nDiff > 0 ? nDiff : 0; } -sal_Bool ScaDate::operator<( const ScaDate& rCmp ) const +bool ScaDate::operator<( const ScaDate& rCmp ) const { if( nYear != rCmp.nYear ) return nYear < rCmp.nYear; @@ -2845,7 +2845,7 @@ ScaAnyConverter::~ScaAnyConverter() void ScaAnyConverter::init( const uno::Reference< beans::XPropertySet >& xPropSet ) throw( uno::RuntimeException ) { // try to get default number format - bHasValidFormat = sal_False; + bHasValidFormat = false; if( xFormatter.is() ) { // get XFormatsSupplier from outer XPropertySet @@ -2860,7 +2860,7 @@ void ScaAnyConverter::init( const uno::Reference< beans::XPropertySet >& xPropSe lang::Locale eLocale; nDefaultFormat = xFormatTypes->getStandardIndex( eLocale ); xFormatter->attachNumberFormatsSupplier( xFormatsSupp ); - bHasValidFormat = sal_True; + bHasValidFormat = true; } } } @@ -2891,16 +2891,16 @@ double ScaAnyConverter::convertToDouble( const OUString& rString ) const throw( return fValue; } -sal_Bool ScaAnyConverter::getDouble( +bool ScaAnyConverter::getDouble( double& rfResult, const uno::Any& rAny ) const throw( lang::IllegalArgumentException ) { rfResult = 0.0; - sal_Bool bContainsVal = sal_True; + bool bContainsVal = true; switch( rAny.getValueTypeClass() ) { case uno::TypeClass_VOID: - bContainsVal = sal_False; + bContainsVal = false; break; case uno::TypeClass_DOUBLE: rAny >>= rfResult; @@ -2911,7 +2911,7 @@ sal_Bool ScaAnyConverter::getDouble( if( !pString->isEmpty() ) rfResult = convertToDouble( *pString ); else - bContainsVal = sal_False; + bContainsVal = false; } break; default: @@ -2920,7 +2920,7 @@ sal_Bool ScaAnyConverter::getDouble( return bContainsVal; } -sal_Bool ScaAnyConverter::getDouble( +bool ScaAnyConverter::getDouble( double& rfResult, const uno::Reference< beans::XPropertySet >& xPropSet, const uno::Any& rAny ) throw( uno::RuntimeException, lang::IllegalArgumentException ) @@ -2940,13 +2940,13 @@ double ScaAnyConverter::getDouble( return fResult; } -sal_Bool ScaAnyConverter::getInt32( +bool ScaAnyConverter::getInt32( sal_Int32& rnResult, const uno::Reference< beans::XPropertySet >& xPropSet, const uno::Any& rAny ) throw( uno::RuntimeException, lang::IllegalArgumentException ) { double fResult; - sal_Bool bContainsVal = getDouble( fResult, xPropSet, rAny ); + bool bContainsVal = getDouble( fResult, xPropSet, rAny ); if( (fResult <= -2147483649.0) || (fResult >= 2147483648.0) ) throw lang::IllegalArgumentException(); diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index 10c4269e9814..caf511594259 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -48,7 +48,7 @@ class ScaAnyConverter; #define EOE ( ( const sal_Char* ) 2 ) -inline sal_Bool IsLeapYear( sal_uInt16 nYear ); +inline bool IsLeapYear( sal_uInt16 nYear ); #ifdef DISABLE_DYNLOADING @@ -71,11 +71,11 @@ sal_Int32 DateToDays( sal_uInt16 nDay, sal_uInt16 nMonth, sal_uInt16 n void DaysToDate( sal_Int32 nDays, sal_uInt16& rDay, sal_uInt16& rMonth, sal_uInt16& rYear ) throw( css::lang::IllegalArgumentException ); sal_Int32 GetNullDate( const css::uno::Reference< css::beans::XPropertySet >& xOptions ) throw( css::uno::RuntimeException ); sal_Int32 GetDiffDate360( - sal_uInt16 nDay1, sal_uInt16 nMonth1, sal_uInt16 nYear1, sal_Bool bLeapYear1, + sal_uInt16 nDay1, sal_uInt16 nMonth1, sal_uInt16 nYear1, bool bLeapYear1, sal_uInt16 nDay2, sal_uInt16 nMonth2, sal_uInt16 nYear2, - sal_Bool bUSAMethod ); -inline sal_Int32 GetDiffDate360( const css::uno::Reference< css::beans::XPropertySet >& xOpt, sal_Int32 nDate1, sal_Int32 nDate2, sal_Bool bUSAMethod ); -sal_Int32 GetDiffDate360( sal_Int32 nNullDate, sal_Int32 nDate1, sal_Int32 nDate2, sal_Bool bUSAMethod ); + bool bUSAMethod ); +inline sal_Int32 GetDiffDate360( const css::uno::Reference< css::beans::XPropertySet >& xOpt, sal_Int32 nDate1, sal_Int32 nDate2, bool bUSAMethod ); +sal_Int32 GetDiffDate360( sal_Int32 nNullDate, sal_Int32 nDate1, sal_Int32 nDate2, bool bUSAMethod ); sal_Int32 GetDaysInYears( sal_uInt16 nYear1, sal_uInt16 nYear2 ); inline sal_Int16 GetDayOfWeek( sal_Int32 nDate ); @@ -95,11 +95,11 @@ double GetGcd( double f1, double f2 ); double ConvertToDec( const OUString& rFromNum, sal_uInt16 nBaseFrom, sal_uInt16 nCharLim ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); OUString ConvertFromDec( double fNum, double fMin, double fMax, sal_uInt16 nBase, - sal_Int32 nPlaces, sal_Int32 nMaxPlaces, sal_Bool bUsePlaces ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + sal_Int32 nPlaces, sal_Int32 nMaxPlaces, bool bUsePlaces ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); double Erf( double fX ); double Erfc( double fX ); -sal_Bool ParseDouble( const sal_Unicode*& rpDoubleAsString, double& rReturn ); -OUString GetString( double fNumber, sal_Bool bLeadingSign = sal_False, sal_uInt16 nMaxNumOfDigits = 15 ); +bool ParseDouble( const sal_Unicode*& rpDoubleAsString, double& rReturn ); +OUString GetString( double fNumber, bool bLeadingSign = false, sal_uInt16 nMaxNumOfDigits = 15 ); inline double Exp10( sal_Int16 nPower ); // 10 ^ nPower double GetAmordegrc( sal_Int32 nNullDate, double fCost, sal_Int32 nDate, sal_Int32 nFirstPer, @@ -160,8 +160,8 @@ struct FuncDataBase const sal_Char* pIntName; sal_uInt16 nUINameID; // resource ID to UI name sal_uInt16 nDescrID; // resource ID to description, parameter names and ~ description - sal_Bool bDouble; // name already exist in Calc - sal_Bool bWithOpt; // first parameter is internal + bool bDouble; // name already exist in Calc + bool bWithOpt; // first parameter is internal sal_uInt16 nCompListID; // resource ID to list of valid names sal_uInt16 nNumOfParams; // number of named / described parameters FDCategory eCat; // function category @@ -174,8 +174,8 @@ private: OUString aIntName; sal_uInt16 nUINameID; sal_uInt16 nDescrID; // leads also to parameter descriptions! - sal_Bool bDouble; // flag for names that already exist in Calc - sal_Bool bWithOpt; // has internal parameter on first position + bool bDouble; // flag for names that already exist in Calc + bool bWithOpt; // has internal parameter on first position sal_uInt16 nParam; // num of parameters sal_uInt16 nCompID; @@ -187,11 +187,11 @@ public: inline sal_uInt16 GetUINameID( void ) const; inline sal_uInt16 GetDescrID( void ) const; - inline sal_Bool IsDouble( void ) const; - inline sal_Bool HasIntParam( void ) const; + inline bool IsDouble( void ) const; + inline bool HasIntParam( void ) const; sal_uInt16 GetStrIndex( sal_uInt16 nParamNum ) const; - inline sal_Bool Is( const OUString& rCompareTo ) const; + inline bool Is( const OUString& rCompareTo ) const; inline const std::vector & GetCompNameList( void ) const; @@ -249,17 +249,17 @@ private: std::vector maVector; protected: void Insert( sal_Int32 nDay ); - void Insert( sal_Int32 nDay, sal_Int32 nNullDate, sal_Bool bInsertOnWeekend ); - void Insert( double fDay, sal_Int32 nNullDate, sal_Bool bInsertOnWeekend ) + void Insert( sal_Int32 nDay, sal_Int32 nNullDate, bool bInsertOnWeekend ); + void Insert( double fDay, sal_Int32 nNullDate, bool bInsertOnWeekend ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); /** @param rAnyConv must be an initialized ScaAnyConmverter - @param bInsertOnWeekend insertion mode: sal_False = holidays on weekend are omitted */ + @param bInsertOnWeekend insertion mode: false = holidays on weekend are omitted */ void InsertHolidayList( const ScaAnyConverter& rAnyConv, const css::uno::Any& rHolAny, sal_Int32 nNullDate, - sal_Bool bInsertOnWeekend ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + bool bInsertOnWeekend ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); public: SortedIndividualInt32List(); @@ -272,17 +272,17 @@ public: inline sal_Int32 Get( sal_uInt32 n ) const { return maVector[n]; } - /// @return sal_True if nVal (internal date representation) is contained - sal_Bool Find( sal_Int32 nVal ) const; + /// @return true if nVal (internal date representation) is contained + bool Find( sal_Int32 nVal ) const; /** @param rAnyConv is an initialized or uninitialized ScaAnyConverter - @param bInsertOnWeekend insertion mode: sal_False = holidays on weekend are omitted */ + @param bInsertOnWeekend insertion mode: false = holidays on weekend are omitted */ void InsertHolidayList( ScaAnyConverter& rAnyConv, const css::uno::Reference< css::beans::XPropertySet >& xOptions, const css::uno::Any& rHolAny, sal_Int32 nNullDate, - sal_Bool bInsertOnWeekend ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + bool bInsertOnWeekend ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); }; @@ -297,25 +297,25 @@ protected: { if( CheckInsert( fValue ) ) ListAppend( fValue ); } /** @param rAnyConv must be an initialized ScaAnyConmverter - @param bIgnoreEmpty handling of empty Any's/strings: sal_False = inserted as 0.0; sal_True = omitted */ + @param bIgnoreEmpty handling of empty Any's/strings: false = inserted as 0.0; true = omitted */ void Append( const ScaAnyConverter& rAnyConv, const css::uno::Any& rAny, - sal_Bool bIgnoreEmpty ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + bool bIgnoreEmpty ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); /** @param rAnyConv must be an initialized ScaAnyConmverter - @param bIgnoreEmpty handling of empty Any's/strings: sal_False = inserted as 0.0; sal_True = omitted */ + @param bIgnoreEmpty handling of empty Any's/strings: false = inserted as 0.0; true = omitted */ void Append( const ScaAnyConverter& rAnyConv, const css::uno::Sequence< css::uno::Any >& rAnySeq, - sal_Bool bIgnoreEmpty ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + bool bIgnoreEmpty ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); /** @param rAnyConv must be an initialized ScaAnyConmverter - @param bIgnoreEmpty handling of empty Any's/strings: sal_False = inserted as 0.0; sal_True = omitted */ + @param bIgnoreEmpty handling of empty Any's/strings: false = inserted as 0.0; true = omitted */ void Append( const ScaAnyConverter& rAnyConv, const css::uno::Sequence< css::uno::Sequence< css::uno::Any > >& rAnySeq, - sal_Bool bIgnoreEmpty ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + bool bIgnoreEmpty ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); public: virtual ~ScaDoubleList() {} @@ -331,14 +331,14 @@ public: throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); /** @param rAnyConv is an initialized or uninitialized ScaAnyConverter - @param bIgnoreEmpty handling of empty Any's/strings: sal_False = inserted as 0.0; sal_True = omitted */ + @param bIgnoreEmpty handling of empty Any's/strings: false = inserted as 0.0; true = omitted */ void Append( ScaAnyConverter& rAnyConv, const css::uno::Reference< css::beans::XPropertySet >& xOpt, const css::uno::Sequence< css::uno::Any >& rAnySeq, - sal_Bool bIgnoreEmpty = sal_True ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + bool bIgnoreEmpty = true ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); - virtual sal_Bool CheckInsert( double fValue ) const + virtual bool CheckInsert( double fValue ) const throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); }; @@ -347,7 +347,7 @@ public: class ScaDoubleListGT0 : public ScaDoubleList { public: - virtual sal_Bool CheckInsert( double fValue ) const + virtual bool CheckInsert( double fValue ) const throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ) SAL_OVERRIDE; }; @@ -356,7 +356,7 @@ public: class ScaDoubleListGE0 : public ScaDoubleList { public: - virtual sal_Bool CheckInsert( double fValue ) const + virtual bool CheckInsert( double fValue ) const throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ) SAL_OVERRIDE; }; @@ -371,9 +371,9 @@ public: inline Complex( double fReal, double fImag = 0.0, sal_Unicode cC = '\0' ); Complex( const OUString& rComplexAsString ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); - inline static sal_Bool IsImagUnit( sal_Unicode c ); - static sal_Bool ParseString( const OUString& rComplexAsString, Complex& rReturn ); - OUString GetString() const throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); + inline static bool IsImagUnit( sal_Unicode c ); + static bool ParseString( const OUString& rComplexAsString, Complex& rReturn ); + OUString GetString() const throw( css::uno::RuntimeException, css::lang::IllegalArgumentException ); inline double Real( void ) const; inline double Imag( void ) const; @@ -456,13 +456,13 @@ protected: double fConst; OUString aName; ConvertDataClass eClass; - sal_Bool bPrefixSupport; + bool bPrefixSupport; public: ConvertData( const sal_Char pUnitName[], double fConvertConstant, ConvertDataClass eClass, - sal_Bool bPrefSupport = sal_False ); + bool bPrefSupport = false ); virtual ~ConvertData(); @@ -481,7 +481,7 @@ public: virtual double ConvertFromBase( double fVal, sal_Int16 nMatchLevel ) const; inline ConvertDataClass Class( void ) const; - inline sal_Bool IsPrefixSupport( void ) const; + inline bool IsPrefixSupport( void ) const; }; @@ -495,7 +495,7 @@ public: double fConvertConstant, double fConvertOffset, ConvertDataClass eClass, - sal_Bool bPrefSupport = sal_False ); + bool bPrefSupport = false ); virtual ~ConvertDataLinear(); @@ -520,13 +520,13 @@ public: }; -inline sal_Bool IsLeapYear( sal_uInt16 n ) +inline bool IsLeapYear( sal_uInt16 n ) { return ( (( ( n % 4 ) == 0 ) && ( ( n % 100 ) != 0)) || ( ( n % 400 ) == 0 ) ); } -inline sal_Int32 GetDiffDate360( const css::uno::Reference< css::beans::XPropertySet >& xOpt, sal_Int32 nDate1, sal_Int32 nDate2, sal_Bool bUSAMethod ) +inline sal_Int32 GetDiffDate360( const css::uno::Reference< css::beans::XPropertySet >& xOpt, sal_Int32 nDate1, sal_Int32 nDate2, bool bUSAMethod ) { return GetDiffDate360( GetNullDate( xOpt ), nDate1, nDate2, bUSAMethod ); } @@ -565,19 +565,19 @@ inline sal_uInt16 FuncData::GetDescrID( void ) const } -inline sal_Bool FuncData::IsDouble( void ) const +inline bool FuncData::IsDouble( void ) const { return bDouble; } -inline sal_Bool FuncData::HasIntParam( void ) const +inline bool FuncData::HasIntParam( void ) const { return bWithOpt; } -inline sal_Bool FuncData::Is( const OUString& r ) const +inline bool FuncData::Is( const OUString& r ) const { return aIntName == r; } @@ -689,13 +689,13 @@ inline ConvertDataClass ConvertData::Class( void ) const return eClass; } -inline sal_Bool ConvertData::IsPrefixSupport( void ) const +inline bool ConvertData::IsPrefixSupport( void ) const { return bPrefixSupport; } inline ConvertDataLinear::ConvertDataLinear( const sal_Char* p, double fC, double fO, ConvertDataClass e, - sal_Bool bPrefSupport ) : + bool bPrefSupport ) : ConvertData( p, fC, e, bPrefSupport ), fOffs( fO ) { @@ -712,10 +712,10 @@ private: sal_uInt16 nDay; /// is the calculated day depending on the current month/year. sal_uInt16 nMonth; /// is the current month (one-based). sal_uInt16 nYear; /// is the current year. - sal_Bool bLastDayMode : 1; /// if sal_True, recalculate nDay after every calculation. - sal_Bool bLastDay : 1; /// is sal_True, if original date was the last day in month. - sal_Bool b30Days : 1; /// is sal_True, if every month has 30 days in calculations. - sal_Bool bUSMode : 1; /// is sal_True, if the US method of 30-day-calculations is used. + bool bLastDayMode : 1; /// if true, recalculate nDay after every calculation. + bool bLastDay : 1; /// is true, if original date was the last day in month. + bool b30Days : 1; /// is true, if every month has 30 days in calculations. + bool bUSMode : 1; /// is true, if the US method of 30-day-calculations is used. /// Calculates nDay from nOrigDay and current date. void setDay(); @@ -765,10 +765,10 @@ public: /// @return the number of days between the two dates static sal_Int32 getDiff( const ScaDate& rFrom, const ScaDate& rTo ) throw( css::lang::IllegalArgumentException ); - sal_Bool operator<( const ScaDate& rCmp ) const; - inline sal_Bool operator<=( const ScaDate& rCmp ) const { return !(rCmp < *this); } - inline sal_Bool operator>( const ScaDate& rCmp ) const { return rCmp < *this; } - inline sal_Bool operator>=( const ScaDate& rCmp ) const { return !(*this < rCmp); } + bool operator<( const ScaDate& rCmp ) const; + inline bool operator<=( const ScaDate& rCmp ) const { return !(rCmp < *this); } + inline bool operator>( const ScaDate& rCmp ) const { return rCmp < *this; } + inline bool operator>=( const ScaDate& rCmp ) const { return !(*this < rCmp); } }; inline sal_uInt16 ScaDate::getDaysInMonth() const @@ -800,7 +800,7 @@ class ScaAnyConverter private: css::uno::Reference< css::util::XNumberFormatter2 > xFormatter; sal_Int32 nDefaultFormat; - sal_Bool bHasValidFormat; + bool bHasValidFormat; /** Converts a string to double using the number formatter. If the formatter is not valid, ::rtl::math::stringToDouble() with english separators will be used. @@ -825,9 +825,9 @@ public: The Any can be empty or contain a double or string. @throws com::sun::star::lang::IllegalArgumentException on other Any types or on invalid strings. - @return sal_True if the Any contains a double or a non-empty valid string, - sal_False if the Any is empty or the string is empty */ - sal_Bool getDouble( + @return true if the Any contains a double or a non-empty valid string, + false if the Any is empty or the string is empty */ + bool getDouble( double& rfResult, const css::uno::Any& rAny ) const throw( css::lang::IllegalArgumentException ); @@ -836,9 +836,9 @@ public: The Any can be empty or contain a double or string. @throws com::sun::star::lang::IllegalArgumentException on other Any types or on invalid strings. - @return sal_True if the Any contains a double or a non-empty valid string, - sal_False if the Any is empty or the string is empty */ - sal_Bool getDouble( + @return true if the Any contains a double or a non-empty valid string, + false if the Any is empty or the string is empty */ + bool getDouble( double& rfResult, const css::uno::Reference< css::beans::XPropertySet >& xPropSet, const css::uno::Any& rAny ) @@ -859,9 +859,9 @@ public: The Any can be empty or contain a double or string. @throws com::sun::star::lang::IllegalArgumentException on other Any types or on invalid values or strings. - @return sal_True if the Any contains a double or a non-empty valid string, - sal_False if the Any is empty or the string is empty */ - sal_Bool getInt32( + @return true if the Any contains a double or a non-empty valid string, + false if the Any is empty or the string is empty */ + bool getInt32( sal_Int32& rnResult, const css::uno::Reference< css::beans::XPropertySet >& xPropSet, const css::uno::Any& rAny ) diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx index 09b457c54b80..7e79fba7d7d9 100644 --- a/scaddins/source/analysis/financial.cxx +++ b/scaddins/source/analysis/financial.cxx @@ -348,7 +348,7 @@ double SAL_CALL AnalysisAddIn::getTbilleq( const css::uno::Reference< css::beans { nMat++; - sal_Int32 nDiff = GetDiffDate360( xOpt, nSettle, nMat, sal_True ); + sal_Int32 nDiff = GetDiffDate360( xOpt, nSettle, nMat, true ); if( fDisc <= 0.0 || nSettle >= nMat || nDiff > 360 ) throw css::lang::IllegalArgumentException(); @@ -380,7 +380,7 @@ double SAL_CALL AnalysisAddIn::getTbillprice( const css::uno::Reference< css::be double SAL_CALL AnalysisAddIn::getTbillyield( const css::uno::Reference< css::beans::XPropertySet >& xOpt, sal_Int32 nSettle, sal_Int32 nMat, double fPrice ) throw( css::uno::RuntimeException, css::lang::IllegalArgumentException, std::exception ) { - sal_Int32 nDiff = GetDiffDate360( xOpt, nSettle, nMat, sal_True ); + sal_Int32 nDiff = GetDiffDate360( xOpt, nSettle, nMat, true ); nDiff++; if( fPrice <= 0.0 || nSettle >= nMat || nDiff > 360 ) diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index 56464df51797..3af0098100aa 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -74,10 +74,10 @@ ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) : { } -#define UNIQUE sal_False // function name does not exist in Calc +#define UNIQUE false // function name does not exist in Calc -#define STDPAR sal_False // all parameters are described -#define INTPAR sal_True // first parameter is internal +#define STDPAR false // all parameters are described +#define INTPAR true // first parameter is internal #define FUNCDATA( FuncName, ParamCount, Category, Double, IntPar ) \ { "get" #FuncName, DATE_FUNCNAME_##FuncName, DATE_FUNCDESC_##FuncName, DATE_DEFFUNCNAME_##FuncName, ParamCount, Category, Double, IntPar } @@ -469,7 +469,7 @@ uno::Sequence< sheet::LocalizedName > SAL_CALL ScaDateAddIn::getCompatibilityNam namespace { // auxiliary functions -sal_Bool IsLeapYear( sal_uInt16 nYear ) +bool IsLeapYear( sal_uInt16 nYear ) { return ((((nYear % 4) == 0) && ((nYear % 100) != 0)) || ((nYear % 400) == 0)); } @@ -529,7 +529,7 @@ void DaysToDate( sal_Int32 nDays, sal_Int32 nTempDays; sal_Int32 i = 0; - sal_Bool bCalc; + bool bCalc; do { @@ -537,11 +537,11 @@ void DaysToDate( sal_Int32 nDays, rYear = (sal_uInt16)((nTempDays / 365) - i); nTempDays -= ((sal_Int32) 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 { @@ -550,7 +550,7 @@ void DaysToDate( sal_Int32 nDays, if ( (nTempDays != 366) || !IsLeapYear( rYear ) ) { i--; - bCalc = sal_True; + bCalc = true; } } } diff --git a/scaddins/source/datefunc/datefunc.hxx b/scaddins/source/datefunc/datefunc.hxx index aae8127024e6..80af44f6d5b2 100644 --- a/scaddins/source/datefunc/datefunc.hxx +++ b/scaddins/source/datefunc/datefunc.hxx @@ -174,7 +174,7 @@ class ScaResPublisher : public Resource public: inline ScaResPublisher( const ScaResId& rResId ) : Resource( rResId ) {} - inline sal_Bool IsAvailableRes( const ResId& rResId ) const + inline bool IsAvailableRes( const ResId& rResId ) const { return Resource::IsAvailableRes( rResId ); } inline void FreeResource() { Resource::FreeResource(); } @@ -207,8 +207,8 @@ struct ScaFuncDataBase sal_uInt16 nCompListID; // resource ID to list of valid names sal_uInt16 nParamCount; // number of named / described parameters ScaCategory eCat; // function category - sal_Bool bDouble; // name already exist in Calc - sal_Bool bWithOpt; // first parameter is internal + bool bDouble; // name already exist in Calc + bool bWithOpt; // first parameter is internal }; class ScaFuncData @@ -221,8 +221,8 @@ private: sal_uInt16 nParamCount; // num of parameters ScaStringList aCompList; // list of all valid names ScaCategory eCat; // function category - sal_Bool bDouble; // name already exist in Calc - sal_Bool bWithOpt; // first parameter is internal + bool bDouble; // name already exist in Calc + bool bWithOpt; // first parameter is internal public: ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rRscMgr ); @@ -231,11 +231,11 @@ public: inline sal_uInt16 GetUINameID() const { return nUINameID; } inline sal_uInt16 GetDescrID() const { return nDescrID; } inline ScaCategory GetCategory() const { return eCat; } - inline sal_Bool IsDouble() const { return bDouble; } - inline sal_Bool HasIntParam() const { return bWithOpt; } + inline bool IsDouble() const { return bDouble; } + inline bool HasIntParam() const { return bWithOpt; } sal_uInt16 GetStrIndex( sal_uInt16 nParam ) const; - inline sal_Bool Is( const OUString& rCompare ) const + inline bool Is( const OUString& rCompare ) const { return aIntName == rCompare; } inline const ScaStringList& GetCompNameList() const { return aCompList; } diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index b6be6c36be58..772f1e36626a 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -83,9 +83,9 @@ ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) : { } -#define UNIQUE sal_False // function name does not exist in Calc +#define UNIQUE false // function name does not exist in Calc -#define STDPAR sal_False // all parameters are described +#define STDPAR false // all parameters are described #define FUNCDATA( FuncName, ParamCount, Category, Double, IntPar ) \ { "get" #FuncName, PRICING_FUNCNAME_##FuncName, PRICING_FUNCDESC_##FuncName, PRICING_DEFFUNCNAME_##FuncName, ParamCount, Category, Double, IntPar } diff --git a/scaddins/source/pricing/pricing.hxx b/scaddins/source/pricing/pricing.hxx index f3fdbcb7673a..19edf0ecaee4 100644 --- a/scaddins/source/pricing/pricing.hxx +++ b/scaddins/source/pricing/pricing.hxx @@ -186,7 +186,7 @@ class ScaResPublisher : public Resource public: inline ScaResPublisher( const ScaResId& rResId ) : Resource( rResId ) {} - inline sal_Bool IsAvailableRes( const ResId& rResId ) const + inline bool IsAvailableRes( const ResId& rResId ) const { return Resource::IsAvailableRes( rResId ); } inline void FreeResource() { Resource::FreeResource(); } @@ -219,8 +219,8 @@ struct ScaFuncDataBase sal_uInt16 nCompListID; // resource ID to list of valid names sal_uInt16 nParamCount; // number of named / described parameters ScaCategory eCat; // function category - sal_Bool bDouble; // name already exist in Calc - sal_Bool bWithOpt; // first parameter is internal + bool bDouble; // name already exist in Calc + bool bWithOpt; // first parameter is internal }; class ScaFuncData @@ -233,8 +233,8 @@ private: sal_uInt16 nParamCount; // num of parameters ScaStringList aCompList; // list of all valid names ScaCategory eCat; // function category - sal_Bool bDouble; // name already exist in Calc - sal_Bool bWithOpt; // first parameter is internal + bool bDouble; // name already exist in Calc + bool bWithOpt; // first parameter is internal public: ScaFuncData( const ScaFuncDataBase& rBaseData, ResMgr& rRscMgr ); @@ -243,11 +243,11 @@ public: inline sal_uInt16 GetUINameID() const { return nUINameID; } inline sal_uInt16 GetDescrID() const { return nDescrID; } inline ScaCategory GetCategory() const { return eCat; } - inline sal_Bool IsDouble() const { return bDouble; } - inline sal_Bool HasIntParam() const { return bWithOpt; } + inline bool IsDouble() const { return bDouble; } + inline bool HasIntParam() const { return bWithOpt; } sal_uInt16 GetStrIndex( sal_uInt16 nParam ) const; - inline sal_Bool Is( const OUString& rCompare ) const + inline bool Is( const OUString& rCompare ) const { return aIntName == rCompare; } inline const ScaStringList& GetCompNameList() const { return aCompList; } -- cgit