Kaydet (Commit) cfa6f852 authored tarafından Takeshi Abe's avatar Takeshi Abe

sal_Bool to bool

Change-Id: Iebed1c159606ab695b049032da5a3509e468fb91
üst 1146b889
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
sal_Bool IspChar() const { return sal_Bool( GetType() == SbxLPSTR ); } sal_Bool IspChar() const { return sal_Bool( GetType() == SbxLPSTR ); }
sal_Bool IsNumeric() const; sal_Bool IsNumeric() const;
sal_Bool IsNumericRTL() const; // #41692 Interface for Basic sal_Bool IsNumericRTL() const; // #41692 Interface for Basic
sal_Bool ImpIsNumeric( sal_Bool bOnlyIntntl ) const; // Implementation sal_Bool ImpIsNumeric( bool bOnlyIntntl ) const; // Implementation
virtual SbxClassType GetClass() const; virtual SbxClassType GetClass() const;
virtual SbxDataType GetType() const; virtual SbxDataType GetType() const;
...@@ -194,7 +194,7 @@ public: ...@@ -194,7 +194,7 @@ public:
sal_Bool fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); sal_Bool fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec );
sal_Bool PutCurrency( const sal_Int64& ); sal_Bool PutCurrency( const sal_Int64& );
// Interface for CDbl in Basic // Interface for CDbl in Basic
static SbxError ScanNumIntnl( const String& rSrc, double& nVal, sal_Bool bSingle = sal_False ); static SbxError ScanNumIntnl( const String& rSrc, double& nVal, bool bSingle = false );
sal_Bool PutObject( SbxBase* ); sal_Bool PutObject( SbxBase* );
......
...@@ -384,7 +384,7 @@ RTLFUNC(CSng) // JSM ...@@ -384,7 +384,7 @@ RTLFUNC(CSng) // JSM
// #41690 // #41690
double dVal = 0.0; double dVal = 0.0;
String aScanStr = pSbxVariable->GetString(); String aScanStr = pSbxVariable->GetString();
SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/sal_True ); SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/true );
if( SbxBase::GetError() == SbxERR_OK && Error != SbxERR_OK ) if( SbxBase::GetError() == SbxERR_OK && Error != SbxERR_OK )
StarBASIC::Error( Error ); StarBASIC::Error( Error );
nVal = (float)dVal; nVal = (float)dVal;
......
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
class SbxArray; class SbxArray;
// SBXSCAN.CXX // SBXSCAN.CXX
extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, sal_Bool bCoreString=sal_False ); extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, bool bCoreString=false );
extern SbxError ImpScan extern SbxError ImpScan
( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, sal_uInt16* pLen, ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, sal_uInt16* pLen,
sal_Bool bAllowIntntl=sal_False, sal_Bool bOnlyIntntl=sal_False ); bool bAllowIntntl=false, bool bOnlyIntntl=false );
// with advanced evaluation (International, "TRUE"/"FALSE") // with advanced evaluation (International, "TRUE"/"FALSE")
extern sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ); extern bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType );
void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ); void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep );
...@@ -64,7 +64,7 @@ void ImpPutSingle( SbxValues*, float ); ...@@ -64,7 +64,7 @@ void ImpPutSingle( SbxValues*, float );
// SBXDBL.CXX // SBXDBL.CXX
double ImpGetDouble( const SbxValues* ); double ImpGetDouble( const SbxValues* );
void ImpPutDouble( SbxValues*, double, sal_Bool bCoreString=sal_False ); void ImpPutDouble( SbxValues*, double, bool bCoreString=false );
// SBXCURR.CXX // SBXCURR.CXX
......
...@@ -134,7 +134,7 @@ double ImpGetDouble( const SbxValues* p ) ...@@ -134,7 +134,7 @@ double ImpGetDouble( const SbxValues* p )
return nRes; return nRes;
} }
void ImpPutDouble( SbxValues* p, double n, sal_Bool bCoreString ) void ImpPutDouble( SbxValues* p, double n, bool bCoreString )
{ {
SbxValues aTmp; SbxValues aTmp;
start: start:
......
...@@ -59,7 +59,7 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ) ...@@ -59,7 +59,7 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
// conversion error if data type is fixed and it doesn't fit // conversion error if data type is fixed and it doesn't fit
SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType, SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType,
sal_uInt16* pLen, sal_Bool bAllowIntntl, sal_Bool bOnlyIntntl ) sal_uInt16* pLen, bool bAllowIntntl, bool bOnlyIntntl )
{ {
::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) ); ::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) );
...@@ -228,12 +228,12 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType ...@@ -228,12 +228,12 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType
} }
// port for CDbl in the Basic // port for CDbl in the Basic
SbxError SbxValue::ScanNumIntnl( const String& rSrc, double& nVal, sal_Bool bSingle ) SbxError SbxValue::ScanNumIntnl( const String& rSrc, double& nVal, bool bSingle )
{ {
SbxDataType t; SbxDataType t;
sal_uInt16 nLen = 0; sal_uInt16 nLen = 0;
SbxError nRetError = ImpScan( rSrc, nVal, t, &nLen, SbxError nRetError = ImpScan( rSrc, nVal, t, &nLen,
/*bAllowIntntl*/sal_False, /*bOnlyIntntl*/sal_True ); /*bAllowIntntl*/false, /*bOnlyIntntl*/true );
// read completely? // read completely?
if( nRetError == SbxERR_OK && nLen != rSrc.Len() ) if( nRetError == SbxERR_OK && nLen != rSrc.Len() )
nRetError = SbxERR_CONVERSION; nRetError = SbxERR_CONVERSION;
...@@ -373,7 +373,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth, ...@@ -373,7 +373,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
#pragma warning(disable: 4748) // "... because optimizations are disabled ..." #pragma warning(disable: 4748) // "... because optimizations are disabled ..."
#endif #endif
void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, sal_Bool bCoreString ) void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, bool bCoreString )
{ {
char *q; char *q;
char cBuf[ 40 ], *p = cBuf; char cBuf[ 40 ], *p = cBuf;
...@@ -404,9 +404,9 @@ void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, sal_Bool bCoreS ...@@ -404,9 +404,9 @@ void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, sal_Bool bCoreS
#pragma optimize( "", on ) #pragma optimize( "", on )
#endif #endif
sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType )
{ {
sal_Bool bChanged = sal_False; bool bChanged = false;
::rtl::OUString aNewString; ::rtl::OUString aNewString;
// only special cases are handled, nothing on default // only special cases are handled, nothing on default
...@@ -430,7 +430,7 @@ sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) ...@@ -430,7 +430,7 @@ sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType )
{ {
sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr(); sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr();
pStr[nPos] = (sal_Unicode)'.'; pStr[nPos] = (sal_Unicode)'.';
bChanged = sal_True; bChanged = true;
} }
} }
break; break;
...@@ -442,13 +442,13 @@ sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) ...@@ -442,13 +442,13 @@ sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType )
if( rSrc.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) ) if( rSrc.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) )
{ {
aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE ); aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE );
bChanged = sal_True; bChanged = true;
} }
else else
if( rSrc.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("false")) ) if( rSrc.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("false")) )
{ {
aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE ); aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE );
bChanged = sal_True; bChanged = true;
} }
break; break;
} }
...@@ -478,9 +478,9 @@ static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rW ...@@ -478,9 +478,9 @@ static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rW
short nWidth = 0; // number range completely short nWidth = 0; // number range completely
short nLen; // length of converted number short nLen; // length of converted number
bool bPoint = false; // true: with 1000 seperators bool bPoint = false; // true: with 1000 seperators
sal_Bool bTrail = sal_False; // sal_True, if following minus bool bTrail = false; // true, if following minus
sal_Bool bSign = sal_False; // sal_True: always with leading sign bool bSign = false; // true: always with leading sign
sal_Bool bNeg = sal_False; // sal_True: number is negative bool bNeg = false; // true: number is negative
char cBuf [1024]; // number buffer char cBuf [1024]; // number buffer
char * p; char * p;
const char* pFmt = rFmt; const char* pFmt = rFmt;
...@@ -496,7 +496,7 @@ static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rW ...@@ -496,7 +496,7 @@ static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rW
case 0: case 0:
break; break;
case '+': case '+':
bSign = sal_True; nWidth++; break; bSign = true; nWidth++; break;
case '*': case '*':
nWidth++; cFill = '*'; nWidth++; cFill = '*';
if( *pFmt == '$' ) nWidth++, pFmt++, cPre = '$'; if( *pFmt == '$' ) nWidth++, pFmt++, cPre = '$';
...@@ -529,11 +529,11 @@ static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rW ...@@ -529,11 +529,11 @@ static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rW
pFmt++, nExpDig++, nWidth++; pFmt++, nExpDig++, nWidth++;
// following minus // following minus
if( !bSign && *pFmt == '-' ) if( !bSign && *pFmt == '-' )
pFmt++, bTrail = sal_True; pFmt++, bTrail = true;
// convert number // convert number
if( nPrec > 15 ) nPrec = 15; if( nPrec > 15 ) nPrec = 15;
if( nNum < 0.0 ) nNum = -nNum, bNeg = sal_True; if( nNum < 0.0 ) nNum = -nNum, bNeg = true;
p = cBuf; p = cBuf;
if( bSign ) *p++ = bNeg ? '-' : '+'; if( bSign ) *p++ = bNeg ? '-' : '+';
myftoa( nNum, p, nPrec, nExpDig, bPoint, false ); myftoa( nNum, p, nPrec, nExpDig, bPoint, false );
...@@ -922,7 +922,7 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const ...@@ -922,7 +922,7 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
// #45355 converting if numeric // #45355 converting if numeric
if( IsNumericRTL() ) if( IsNumericRTL() )
{ {
ScanNumIntnl( GetString(), d, /*bSingle*/sal_False ); ScanNumIntnl( GetString(), d, /*bSingle*/false );
goto cvt2; goto cvt2;
} }
else else
......
...@@ -138,9 +138,9 @@ ...@@ -138,9 +138,9 @@
aTmp.eType = SbxSTRING; aTmp.eType = SbxSTRING;
aTmp.pOUString = &aRes; aTmp.pOUString = &aRes;
if( p->eType == SbxDOUBLE ) if( p->eType == SbxDOUBLE )
ImpPutDouble( &aTmp, p->nDouble, sal_True ); // true = bCoreString ImpPutDouble( &aTmp, p->nDouble, true ); // true = bCoreString
else else
ImpPutDouble( &aTmp, *p->pDouble, sal_True ); // true = bCoreString ImpPutDouble( &aTmp, *p->pDouble, true ); // true = bCoreString
return aRes; return aRes;
} }
else else
......
...@@ -724,15 +724,15 @@ sal_Bool SbxValue::IsFixed() const ...@@ -724,15 +724,15 @@ sal_Bool SbxValue::IsFixed() const
// #41692, implement it for RTL and Basic-Core seperably // #41692, implement it for RTL and Basic-Core seperably
sal_Bool SbxValue::IsNumeric() const sal_Bool SbxValue::IsNumeric() const
{ {
return ImpIsNumeric( /*bOnlyIntntl*/sal_False ); return ImpIsNumeric( /*bOnlyIntntl*/false );
} }
sal_Bool SbxValue::IsNumericRTL() const sal_Bool SbxValue::IsNumericRTL() const
{ {
return ImpIsNumeric( /*bOnlyIntntl*/sal_True ); return ImpIsNumeric( /*bOnlyIntntl*/true );
} }
sal_Bool SbxValue::ImpIsNumeric( sal_Bool bOnlyIntntl ) const sal_Bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const
{ {
if( !CanRead() ) if( !CanRead() )
...@@ -751,7 +751,7 @@ sal_Bool SbxValue::ImpIsNumeric( sal_Bool bOnlyIntntl ) const ...@@ -751,7 +751,7 @@ sal_Bool SbxValue::ImpIsNumeric( sal_Bool bOnlyIntntl ) const
double n; double n;
SbxDataType t2; SbxDataType t2;
sal_uInt16 nLen = 0; sal_uInt16 nLen = 0;
if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/sal_False, bOnlyIntntl ) == SbxERR_OK ) if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/false, bOnlyIntntl ) == SbxERR_OK )
return sal_Bool( nLen == s.getLength() ); return sal_Bool( nLen == s.getLength() );
} }
return sal_False; return sal_False;
......
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