summaryrefslogtreecommitdiff
path: root/basic/source/runtime/methods.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/runtime/methods.cxx')
-rw-r--r--basic/source/runtime/methods.cxx436
1 files changed, 218 insertions, 218 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index cfd84567644a..1d1f1c641547 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -154,7 +154,7 @@ static CharClass& GetCharClass( void )
return aCharClass;
}
-static inline BOOL isFolder( FileStatus::Type aType )
+static inline sal_Bool isFolder( FileStatus::Type aType )
{
return ( aType == FileStatus::Directory || aType == FileStatus::Volume );
}
@@ -220,8 +220,8 @@ static com::sun::star::uno::Reference< XSimpleFileAccess3 > getFileAccess( void
-// Properties und Methoden legen beim Get (bPut = FALSE) den Returnwert
-// im Element 0 des Argv ab; beim Put (bPut = TRUE) wird der Wert aus
+// Properties und Methoden legen beim Get (bPut = sal_False) den Returnwert
+// im Element 0 des Argv ab; beim Put (bPut = sal_True) wird der Wert aus
// Element 0 gespeichert.
// CreateObject( class )
@@ -254,7 +254,7 @@ RTLFUNC(Error)
{
String aErrorMsg;
SbError nErr = 0L;
- INT32 nCode = 0;
+ sal_Int32 nCode = 0;
if( rPar.Count() == 1 )
{
nErr = StarBASIC::GetErrBasic();
@@ -266,7 +266,7 @@ RTLFUNC(Error)
if( nCode > 65535L )
StarBASIC::Error( SbERR_CONVERSION );
else
- nErr = StarBASIC::GetSfxFromVBError( (USHORT)nCode );
+ nErr = StarBASIC::GetSfxFromVBError( (sal_uInt16)nCode );
}
bool bVBA = SbiRuntime::isVBAEnabled();
@@ -452,7 +452,7 @@ RTLFUNC(CurDir)
int nSize = _PATH_INCR;
char* pMem;
- while( TRUE )
+ while( sal_True )
{
pMem = new char[nSize];
if( !pMem )
@@ -489,17 +489,17 @@ RTLFUNC(ChDir) // JSM
{
#ifdef _ENABLE_CUR_DIR
String aPath = rPar.Get(1)->GetString();
- BOOL bError = FALSE;
+ sal_Bool bError = sal_False;
#ifdef WNT
// #55997 Laut MI hilft es bei File-URLs einen DirEntry zwischenzuschalten
// #40996 Harmoniert bei Verwendung der WIN32-Funktion nicht mit getdir
DirEntry aEntry( aPath );
ByteString aFullPath( aEntry.GetFull(), gsl_getSystemTextEncoding() );
if( chdir( aFullPath.GetBuffer()) )
- bError = TRUE;
+ bError = sal_True;
#else
if (!DirEntry(aPath).SetCWD())
- bError = TRUE;
+ bError = sal_True;
#endif
if( bError )
StarBASIC::Error( SbERR_PATH_NOT_FOUND );
@@ -880,7 +880,7 @@ RTLFUNC(FileLen)
{
SbxVariableRef pArg = rPar.Get( 1 );
String aStr( pArg->GetString() );
- INT32 nLen = 0;
+ sal_Int32 nLen = 0;
// <-- UCB
if( hasUno() )
{
@@ -908,7 +908,7 @@ RTLFUNC(FileLen)
FileBase::RC nRet = DirectoryItem::get( getFullPathUNC( aStr ), aItem );
FileStatus aFileStatus( FileStatusMask_FileSize );
nRet = aItem.getFileStatus( aFileStatus );
- nLen = (INT32)aFileStatus.getFileSize();
+ nLen = (sal_Int32)aFileStatus.getFileSize();
#endif
}
rPar.Get(0)->PutLong( (long)nLen );
@@ -942,23 +942,23 @@ RTLFUNC(InStr)
(void)pBasic;
(void)bWrite;
- ULONG nArgCount = rPar.Count()-1;
+ sal_uIntPtr nArgCount = rPar.Count()-1;
if ( nArgCount < 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- USHORT nStartPos = 1;
+ sal_uInt16 nStartPos = 1;
- USHORT nFirstStringPos = 1;
+ sal_uInt16 nFirstStringPos = 1;
if ( nArgCount >= 3 )
{
- INT32 lStartPos = rPar.Get(1)->GetLong();
+ sal_Int32 lStartPos = rPar.Get(1)->GetLong();
if( lStartPos <= 0 || lStartPos > 0xffff )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
lStartPos = 1;
}
- nStartPos = (USHORT)lStartPos;
+ nStartPos = (sal_uInt16)lStartPos;
nFirstStringPos++;
}
@@ -968,7 +968,7 @@ RTLFUNC(InStr)
if( bCompatibility )
{
SbiRuntime* pRT = pInst ? pInst->pRun : NULL;
- bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE;
+ bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False;
}
else
{
@@ -977,7 +977,7 @@ RTLFUNC(InStr)
if ( nArgCount == 4 )
bTextMode = rPar.Get(4)->GetInteger();
- USHORT nPos;
+ sal_uInt16 nPos;
const String& rToken = rPar.Get(nFirstStringPos+1)->GetString();
// #97545 Always find empty string
@@ -1024,7 +1024,7 @@ RTLFUNC(InStrRev)
(void)pBasic;
(void)bWrite;
- ULONG nArgCount = rPar.Count()-1;
+ sal_uIntPtr nArgCount = rPar.Count()-1;
if ( nArgCount < 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
@@ -1032,7 +1032,7 @@ RTLFUNC(InStrRev)
String aStr1 = rPar.Get(1)->GetString();
String aToken = rPar.Get(2)->GetString();
- INT32 lStartPos = -1;
+ sal_Int32 lStartPos = -1;
if ( nArgCount >= 3 )
{
lStartPos = rPar.Get(3)->GetLong();
@@ -1049,7 +1049,7 @@ RTLFUNC(InStrRev)
if( bCompatibility )
{
SbiRuntime* pRT = pInst ? pInst->pRun : NULL;
- bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE;
+ bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False;
}
else
{
@@ -1058,13 +1058,13 @@ RTLFUNC(InStrRev)
if ( nArgCount == 4 )
bTextMode = rPar.Get(4)->GetInteger();
- USHORT nStrLen = aStr1.Len();
- USHORT nStartPos = lStartPos == -1 ? nStrLen : (USHORT)lStartPos;
+ sal_uInt16 nStrLen = aStr1.Len();
+ sal_uInt16 nStartPos = lStartPos == -1 ? nStrLen : (sal_uInt16)lStartPos;
- USHORT nPos = 0;
+ sal_uInt16 nPos = 0;
if( nStartPos <= nStrLen )
{
- USHORT nTokenLen = aToken.Len();
+ sal_uInt16 nTokenLen = aToken.Len();
if( !nTokenLen )
{
// Always find empty string
@@ -1080,7 +1080,7 @@ RTLFUNC(InStrRev)
if( nRet == -1 )
nPos = 0;
else
- nPos = (USHORT)nRet + 1;
+ nPos = (sal_uInt16)nRet + 1;
}
else
{
@@ -1094,7 +1094,7 @@ RTLFUNC(InStrRev)
if( nRet == -1 )
nPos = 0;
else
- nPos = (USHORT)nRet + 1;
+ nPos = (sal_uInt16)nRet + 1;
}
}
}
@@ -1178,7 +1178,7 @@ RTLFUNC(Left)
else
{
String aStr( rPar.Get(1)->GetString() );
- INT32 lResultLen = rPar.Get(2)->GetLong();
+ sal_Int32 lResultLen = rPar.Get(2)->GetLong();
if( lResultLen > 0xffff )
{
lResultLen = 0xffff;
@@ -1188,7 +1188,7 @@ RTLFUNC(Left)
lResultLen = 0;
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
- aStr.Erase( (USHORT)lResultLen );
+ aStr.Erase( (sal_uInt16)lResultLen );
rPar.Get(0)->PutString( aStr );
}
}
@@ -1237,7 +1237,7 @@ RTLFUNC(Mid)
(void)pBasic;
(void)bWrite;
- ULONG nArgCount = rPar.Count()-1;
+ sal_uIntPtr nArgCount = rPar.Count()-1;
if ( nArgCount < 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
@@ -1247,23 +1247,23 @@ RTLFUNC(Mid)
// Anders als im Original kann in dieser Variante der 3. Parameter
// nLength nicht weggelassen werden. Ist ueber bWrite schon vorgesehen.
if( nArgCount == 4 )
- bWrite = TRUE;
+ bWrite = sal_True;
String aArgStr = rPar.Get(1)->GetString();
- USHORT nStartPos = (USHORT)(rPar.Get(2)->GetLong() );
+ sal_uInt16 nStartPos = (sal_uInt16)(rPar.Get(2)->GetLong() );
if ( nStartPos == 0 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
nStartPos--;
- USHORT nLen = 0xffff;
+ sal_uInt16 nLen = 0xffff;
bool bWriteNoLenParam = false;
if ( nArgCount == 3 || bWrite )
{
- INT32 n = rPar.Get(3)->GetLong();
+ sal_Int32 n = rPar.Get(3)->GetLong();
if( bWrite && n == -1 )
bWriteNoLenParam = true;
- nLen = (USHORT)n;
+ nLen = (sal_uInt16)n;
}
String aResultStr;
if ( bWrite )
@@ -1272,7 +1272,7 @@ RTLFUNC(Mid)
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
if( bCompatibility )
{
- USHORT nArgLen = aArgStr.Len();
+ sal_uInt16 nArgLen = aArgStr.Len();
if( nStartPos + 1 > nArgLen )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -1280,8 +1280,8 @@ RTLFUNC(Mid)
}
String aReplaceStr = rPar.Get(4)->GetString();
- USHORT nReplaceStrLen = aReplaceStr.Len();
- USHORT nReplaceLen;
+ sal_uInt16 nReplaceStrLen = aReplaceStr.Len();
+ sal_uInt16 nReplaceLen;
if( bWriteNoLenParam )
{
nReplaceLen = nReplaceStrLen;
@@ -1293,12 +1293,12 @@ RTLFUNC(Mid)
nReplaceLen = nReplaceStrLen;
}
- USHORT nReplaceEndPos = nStartPos + nReplaceLen;
+ sal_uInt16 nReplaceEndPos = nStartPos + nReplaceLen;
if( nReplaceEndPos > nArgLen )
nReplaceLen -= (nReplaceEndPos - nArgLen);
aResultStr = aArgStr;
- USHORT nErase = nReplaceLen;
+ sal_uInt16 nErase = nReplaceLen;
aResultStr.Erase( nStartPos, nErase );
aResultStr.Insert( aReplaceStr, 0, nReplaceLen, nStartPos );
}
@@ -1346,7 +1346,7 @@ RTLFUNC(Replace)
(void)pBasic;
(void)bWrite;
- ULONG nArgCount = rPar.Count()-1;
+ sal_uIntPtr nArgCount = rPar.Count()-1;
if ( nArgCount < 3 || nArgCount > 6 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
@@ -1355,7 +1355,7 @@ RTLFUNC(Replace)
String aFindStr = rPar.Get(2)->GetString();
String aReplaceStr = rPar.Get(3)->GetString();
- INT32 lStartPos = 1;
+ sal_Int32 lStartPos = 1;
if ( nArgCount >= 4 )
{
if( rPar.Get(4)->GetType() != SbxEMPTY )
@@ -1367,7 +1367,7 @@ RTLFUNC(Replace)
}
}
- INT32 lCount = -1;
+ sal_Int32 lCount = -1;
if( nArgCount >=5 )
{
if( rPar.Get(5)->GetType() != SbxEMPTY )
@@ -1385,7 +1385,7 @@ RTLFUNC(Replace)
if( bCompatibility )
{
SbiRuntime* pRT = pInst ? pInst->pRun : NULL;
- bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE;
+ bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False;
}
else
{
@@ -1394,14 +1394,14 @@ RTLFUNC(Replace)
if ( nArgCount == 6 )
bTextMode = rPar.Get(6)->GetInteger();
- USHORT nExpStrLen = aExpStr.Len();
- USHORT nFindStrLen = aFindStr.Len();
- USHORT nReplaceStrLen = aReplaceStr.Len();
+ sal_uInt16 nExpStrLen = aExpStr.Len();
+ sal_uInt16 nFindStrLen = aFindStr.Len();
+ sal_uInt16 nReplaceStrLen = aReplaceStr.Len();
if( lStartPos <= nExpStrLen )
{
- USHORT nPos = static_cast<USHORT>( lStartPos - 1 );
- USHORT nCounts = 0;
+ sal_uInt16 nPos = static_cast<sal_uInt16>( lStartPos - 1 );
+ sal_uInt16 nCounts = 0;
while( lCount == -1 || lCount > nCounts )
{
String aSrcStr( aExpStr );
@@ -1423,7 +1423,7 @@ RTLFUNC(Replace)
}
}
}
- rPar.Get(0)->PutString( aExpStr.Copy( static_cast<USHORT>(lStartPos - 1) ) );
+ rPar.Get(0)->PutString( aExpStr.Copy( static_cast<sal_uInt16>(lStartPos - 1) ) );
}
}
@@ -1437,7 +1437,7 @@ RTLFUNC(Right)
else
{
const String& rStr = rPar.Get(1)->GetString();
- INT32 lResultLen = rPar.Get(2)->GetLong();
+ sal_Int32 lResultLen = rPar.Get(2)->GetLong();
if( lResultLen > 0xffff )
{
lResultLen = 0xffff;
@@ -1447,8 +1447,8 @@ RTLFUNC(Right)
lResultLen = 0;
StarBASIC::Error( SbERR_BAD_ARGUMENT );
}
- USHORT nResultLen = (USHORT)lResultLen;
- USHORT nStrLen = rStr.Len();
+ sal_uInt16 nResultLen = (sal_uInt16)lResultLen;
+ sal_uInt16 nStrLen = rStr.Len();
if ( nResultLen > nStrLen )
nResultLen = nStrLen;
String aResultStr = rStr.Copy( nStrLen-nResultLen );
@@ -1489,7 +1489,7 @@ RTLFUNC(Sgn)
else
{
double aDouble = rPar.Get(1)->GetDouble();
- INT16 nResult = 0;
+ sal_Int16 nResult = 0;
if ( aDouble > 0 )
nResult = 1;
else if ( aDouble < 0 )
@@ -1508,7 +1508,7 @@ RTLFUNC(Space)
else
{
String aStr;
- aStr.Fill( (USHORT)(rPar.Get(1)->GetLong() ));
+ aStr.Fill( (sal_uInt16)(rPar.Get(1)->GetLong() ));
rPar.Get(0)->PutString( aStr );
}
}
@@ -1523,7 +1523,7 @@ RTLFUNC(Spc)
else
{
String aStr;
- aStr.Fill( (USHORT)(rPar.Get(1)->GetLong() ));
+ aStr.Fill( (sal_uInt16)(rPar.Get(1)->GetLong() ));
rPar.Get(0)->PutString( aStr );
}
}
@@ -1573,11 +1573,11 @@ RTLFUNC(Str)
const sal_Unicode* pBuf = aStr.GetBuffer();
bool bNeg = ( pBuf[0] == '-' );
- USHORT iZeroSearch = 0;
+ sal_uInt16 iZeroSearch = 0;
if( bNeg )
iZeroSearch++;
- USHORT iNext = iZeroSearch + 1;
+ sal_uInt16 iNext = iZeroSearch + 1;
if( pBuf[iZeroSearch] == '0' && nLen > iNext && pBuf[iNext] == '.' )
{
aStr.Erase( iZeroSearch, 1 );
@@ -1608,16 +1608,16 @@ RTLFUNC(StrComp)
const String& rStr2 = rPar.Get(2)->GetString();
SbiInstance* pInst = pINST;
- INT16 nTextCompare;
+ sal_Int16 nTextCompare;
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
if( bCompatibility )
{
SbiRuntime* pRT = pInst ? pInst->pRun : NULL;
- nTextCompare = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE;
+ nTextCompare = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False;
}
else
{
- nTextCompare = TRUE;
+ nTextCompare = sal_True;
}
if ( rPar.Count() == 4 )
nTextCompare = rPar.Get(3)->GetInteger();
@@ -1653,7 +1653,7 @@ RTLFUNC(StrComp)
nRetValue = 1;
}
- rPar.Get(0)->PutInteger( sal::static_int_cast< INT16 >( nRetValue ) );
+ rPar.Get(0)->PutInteger( sal::static_int_cast< sal_Int16 >( nRetValue ) );
}
RTLFUNC(String)
@@ -1667,10 +1667,10 @@ RTLFUNC(String)
{
String aStr;
sal_Unicode aFiller;
- INT32 lCount = rPar.Get(1)->GetLong();
+ sal_Int32 lCount = rPar.Get(1)->GetLong();
if( lCount < 0 || lCount > 0xffff )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- USHORT nCount = (USHORT)lCount;
+ sal_uInt16 nCount = (sal_uInt16)lCount;
if( rPar.Get(2)->GetType() == SbxINTEGER )
aFiller = (sal_Unicode)rPar.Get(2)->GetInteger();
else
@@ -1728,7 +1728,7 @@ RTLFUNC(Val)
String aStr( rPar.Get(1)->GetString() );
// lt. Mikkysoft bei Kommas abbrechen!
-// for( USHORT n=0; n < aStr.Len(); n++ )
+// for( sal_uInt16 n=0; n < aStr.Len(); n++ )
// if( aStr[n] == ',' ) aStr[n] = '.';
FilterWhiteSpace( aStr );
@@ -1743,7 +1743,7 @@ RTLFUNC(Val)
if ( nRadix != 10 )
{
ByteString aByteStr( aStr, gsl_getSystemTextEncoding() );
- INT16 nlResult = (INT16)strtol( aByteStr.GetBuffer()+2, &pEndPtr, nRadix);
+ sal_Int16 nlResult = (sal_Int16)strtol( aByteStr.GetBuffer()+2, &pEndPtr, nRadix);
nResult = (double)nlResult;
}
}
@@ -1761,46 +1761,46 @@ RTLFUNC(Val)
// Helper functions for date conversion
-INT16 implGetDateDay( double aDate )
+sal_Int16 implGetDateDay( double aDate )
{
aDate -= 2.0; // normieren: 1.1.1900 => 0.0
Date aRefDate( 1, 1, 1900 );
if ( aDate >= 0.0 )
{
aDate = floor( aDate );
- aRefDate += (ULONG)aDate;
+ aRefDate += (sal_uIntPtr)aDate;
}
else
{
aDate = ceil( aDate );
- aRefDate -= (ULONG)(-1.0 * aDate);
+ aRefDate -= (sal_uIntPtr)(-1.0 * aDate);
}
- INT16 nRet = (INT16)( aRefDate.GetDay() );
+ sal_Int16 nRet = (sal_Int16)( aRefDate.GetDay() );
return nRet;
}
-INT16 implGetDateMonth( double aDate )
+sal_Int16 implGetDateMonth( double aDate )
{
Date aRefDate( 1,1,1900 );
long nDays = (long)aDate;
nDays -= 2; // normieren: 1.1.1900 => 0.0
aRefDate += nDays;
- INT16 nRet = (INT16)( aRefDate.GetMonth() );
+ sal_Int16 nRet = (sal_Int16)( aRefDate.GetMonth() );
return nRet;
}
-INT16 implGetDateYear( double aDate )
+sal_Int16 implGetDateYear( double aDate )
{
Date aRefDate( 1,1,1900 );
long nDays = (long) aDate;
nDays -= 2; // normieren: 1.1.1900 => 0.0
aRefDate += nDays;
- INT16 nRet = (INT16)( aRefDate.GetYear() );
+ sal_Int16 nRet = (sal_Int16)( aRefDate.GetYear() );
return nRet;
}
-BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
+sal_Bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet )
{
if ( nYear < 30 && SbiRuntime::isVBAEnabled() )
nYear += 2000;
@@ -1810,7 +1810,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
if ((nYear < 100 || nYear > 9999) )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- return FALSE;
+ return sal_False;
}
if ( !SbiRuntime::isVBAEnabled() )
{
@@ -1818,7 +1818,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
(nDay < 1 || nDay > 31 ) )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- return FALSE;
+ return sal_False;
}
}
else
@@ -1833,7 +1833,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
{
// inacurrate around leap year, don't use days to calculate,
// just modify the months directory
- INT16 nYearAdj = ( nMonth /12 ); // default to positive months inputed
+ sal_Int16 nYearAdj = ( nMonth /12 ); // default to positive months inputed
if ( nMonth <=0 )
nYearAdj = ( ( nMonth -12 ) / 12 );
aCurDate.SetYear( aCurDate.GetYear() + nYearAdj );
@@ -1850,7 +1850,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet )
long nDiffDays = GetDayDiff( aCurDate );
rdRet = (double)nDiffDays;
- return TRUE;
+ return sal_True;
}
// Function to convert date to ISO 8601 date format
@@ -1884,14 +1884,14 @@ RTLFUNC(CDateFromIso)
if ( rPar.Count() == 2 )
{
String aStr = rPar.Get(1)->GetString();
- INT16 iMonthStart = aStr.Len() - 4;
+ sal_Int16 iMonthStart = aStr.Len() - 4;
String aYearStr = aStr.Copy( 0, iMonthStart );
String aMonthStr = aStr.Copy( iMonthStart, 2 );
String aDayStr = aStr.Copy( iMonthStart+2, 2 );
double dDate;
- if( implDateSerial( (INT16)aYearStr.ToInt32(),
- (INT16)aMonthStr.ToInt32(), (INT16)aDayStr.ToInt32(), dDate ) )
+ if( implDateSerial( (sal_Int16)aYearStr.ToInt32(),
+ (sal_Int16)aMonthStr.ToInt32(), (sal_Int16)aDayStr.ToInt32(), dDate ) )
{
rPar.Get(0)->PutDate( dDate );
}
@@ -1910,9 +1910,9 @@ RTLFUNC(DateSerial)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT16 nYear = rPar.Get(1)->GetInteger();
- INT16 nMonth = rPar.Get(2)->GetInteger();
- INT16 nDay = rPar.Get(3)->GetInteger();
+ sal_Int16 nYear = rPar.Get(1)->GetInteger();
+ sal_Int16 nMonth = rPar.Get(2)->GetInteger();
+ sal_Int16 nDay = rPar.Get(3)->GetInteger();
double dDate;
if( implDateSerial( nYear, nMonth, nDay, dDate ) )
@@ -1929,11 +1929,11 @@ RTLFUNC(TimeSerial)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT16 nHour = rPar.Get(1)->GetInteger();
+ sal_Int16 nHour = rPar.Get(1)->GetInteger();
if ( nHour == 24 )
nHour = 0; // Wegen UNO DateTimes, die bis 24 Uhr gehen
- INT16 nMinute = rPar.Get(2)->GetInteger();
- INT16 nSecond = rPar.Get(3)->GetInteger();
+ sal_Int16 nMinute = rPar.Get(2)->GetInteger();
+ sal_Int16 nSecond = rPar.Get(3)->GetInteger();
if ((nHour < 0 || nHour > 23) ||
(nMinute < 0 || nMinute > 59 ) ||
(nSecond < 0 || nSecond > 59 ))
@@ -1942,7 +1942,7 @@ RTLFUNC(TimeSerial)
return;
}
- INT32 nSeconds = nHour;
+ sal_Int32 nSeconds = nHour;
nSeconds *= 3600;
nSeconds += nMinute * 60;
nSeconds += nSecond;
@@ -1972,7 +1972,7 @@ RTLFUNC(DateValue)
sal_uInt32 nIndex;
double fResult;
String aStr( rPar.Get(1)->GetString() );
- BOOL bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
+ sal_Bool bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
short nType = pFormatter->GetType( nIndex );
// DateValue("February 12, 1969") raises error if the system locale is not en_US
@@ -2033,7 +2033,7 @@ RTLFUNC(TimeValue)
sal_uInt32 nIndex;
double fResult;
- BOOL bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetString(),
+ sal_Bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetString(),
nIndex, fResult );
short nType = pFormatter->GetType(nIndex);
if(bSuccess && (nType==NUMBERFORMAT_TIME||nType==NUMBERFORMAT_DATETIME))
@@ -2064,7 +2064,7 @@ RTLFUNC(Day)
SbxVariableRef pArg = rPar.Get( 1 );
double aDate = pArg->GetDate();
- INT16 nDay = implGetDateDay( aDate );
+ sal_Int16 nDay = implGetDateDay( aDate );
rPar.Get(0)->PutInteger( nDay );
}
}
@@ -2078,19 +2078,19 @@ RTLFUNC(Year)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- INT16 nYear = implGetDateYear( rPar.Get(1)->GetDate() );
+ sal_Int16 nYear = implGetDateYear( rPar.Get(1)->GetDate() );
rPar.Get(0)->PutInteger( nYear );
}
}
-INT16 implGetHour( double dDate )
+sal_Int16 implGetHour( double dDate )
{
if( dDate < 0.0 )
dDate *= -1.0;
double nFrac = dDate - floor( dDate );
nFrac *= 86400.0;
- INT32 nSeconds = (INT32)(nFrac + 0.5);
- INT16 nHour = (INT16)(nSeconds / 3600);
+ sal_Int32 nSeconds = (sal_Int32)(nFrac + 0.5);
+ sal_Int16 nHour = (sal_Int16)(nSeconds / 3600);
return nHour;
}
@@ -2104,20 +2104,20 @@ RTLFUNC(Hour)
else
{
double nArg = rPar.Get(1)->GetDate();
- INT16 nHour = implGetHour( nArg );
+ sal_Int16 nHour = implGetHour( nArg );
rPar.Get(0)->PutInteger( nHour );
}
}
-INT16 implGetMinute( double dDate )
+sal_Int16 implGetMinute( double dDate )
{
if( dDate < 0.0 )
dDate *= -1.0;
double nFrac = dDate - floor( dDate );
nFrac *= 86400.0;
- INT32 nSeconds = (INT32)(nFrac + 0.5);
- INT16 nTemp = (INT16)(nSeconds % 3600);
- INT16 nMin = nTemp / 60;
+ sal_Int32 nSeconds = (sal_Int32)(nFrac + 0.5);
+ sal_Int16 nTemp = (sal_Int16)(nSeconds % 3600);
+ sal_Int16 nMin = nTemp / 60;
return nMin;
}
@@ -2131,7 +2131,7 @@ RTLFUNC(Minute)
else
{
double nArg = rPar.Get(1)->GetDate();
- INT16 nMin = implGetMinute( nArg );
+ sal_Int16 nMin = implGetMinute( nArg );
rPar.Get(0)->PutInteger( nMin );
}
}
@@ -2145,24 +2145,24 @@ RTLFUNC(Month)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- INT16 nMonth = implGetDateMonth( rPar.Get(1)->GetDate() );
+ sal_Int16 nMonth = implGetDateMonth( rPar.Get(1)->GetDate() );
rPar.Get(0)->PutInteger( nMonth );
}
}
-INT16 implGetSecond( double dDate )
+sal_Int16 implGetSecond( double dDate )
{
if( dDate < 0.0 )
dDate *= -1.0;
double nFrac = dDate - floor( dDate );
nFrac *= 86400.0;
- INT32 nSeconds = (INT32)(nFrac + 0.5);
- INT16 nTemp = (INT16)(nSeconds / 3600);
+ sal_Int32 nSeconds = (sal_Int32)(nFrac + 0.5);
+ sal_Int16 nTemp = (sal_Int16)(nSeconds / 3600);
nSeconds -= nTemp * 3600;
- nTemp = (INT16)(nSeconds / 60);
+ nTemp = (sal_Int16)(nSeconds / 60);
nSeconds -= nTemp * 60;
- INT16 nRet = (INT16)nSeconds;
+ sal_Int16 nRet = (sal_Int16)nSeconds;
return nRet;
}
@@ -2176,7 +2176,7 @@ RTLFUNC(Second)
else
{
double nArg = rPar.Get(1)->GetDate();
- INT16 nSecond = implGetSecond( nArg );
+ sal_Int16 nSecond = implGetSecond( nArg );
rPar.Get(0)->PutInteger( nSecond );
}
}
@@ -2328,7 +2328,7 @@ RTLFUNC(IsArray)
if ( rPar.Count() < 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
- rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) ? TRUE : FALSE );
+ rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) ? sal_True : sal_False );
}
RTLFUNC(IsObject)
@@ -2347,7 +2347,7 @@ RTLFUNC(IsObject)
SbxBase::ResetError();
SbUnoClass* pUnoClass;
- BOOL bObject;
+ sal_Bool bObject;
if( pObj && NULL != ( pUnoClass=PTR_CAST(SbUnoClass,pObj) ) )
{
bObject = pUnoClass->getUnoClass().is();
@@ -2369,14 +2369,14 @@ RTLFUNC(IsDate)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- // #46134 Nur String wird konvertiert, andere Typen ergeben FALSE
+ // #46134 Nur String wird konvertiert, andere Typen ergeben sal_False
SbxVariableRef xArg = rPar.Get( 1 );
SbxDataType eType = xArg->GetType();
- BOOL bDate = FALSE;
+ sal_Bool bDate = sal_False;
if( eType == SbxDATE )
{
- bDate = TRUE;
+ bDate = sal_True;
}
else if( eType == SbxSTRING )
{
@@ -2432,12 +2432,12 @@ RTLFUNC(IsNull)
// #51475 Wegen Uno-Objekten auch true liefern,
// wenn der pObj-Wert NULL ist
SbxVariableRef pArg = rPar.Get( 1 );
- BOOL bNull = rPar.Get(1)->IsNull();
+ sal_Bool bNull = rPar.Get(1)->IsNull();
if( !bNull && pArg->GetType() == SbxOBJECT )
{
SbxBase* pObj = pArg->GetObject();
if( !pObj )
- bNull = TRUE;
+ bNull = sal_True;
}
rPar.Get( 0 )->PutBool( bNull );
}
@@ -2577,7 +2577,7 @@ inline sal_Bool implCheckWildcard( const String& rName, SbiRTLData* pRTLData )
bool isRootDir( String aDirURLStr )
{
INetURLObject aDirURLObj( aDirURLStr );
- BOOL bRoot = FALSE;
+ sal_Bool bRoot = sal_False;
// Check if it's a root directory
sal_Int32 nCount = aDirURLObj.getSegmentCount();
@@ -2585,22 +2585,22 @@ bool isRootDir( String aDirURLStr )
// No segment means Unix root directory "file:///"
if( nCount == 0 )
{
- bRoot = TRUE;
+ bRoot = sal_True;
}
// Exactly one segment needs further checking, because it
// can be Unix "file:///foo/" -> no root
// or Windows "file:///c:/" -> root
else if( nCount == 1 )
{
- ::rtl::OUString aSeg1 = aDirURLObj.getName( 0, TRUE,
+ ::rtl::OUString aSeg1 = aDirURLObj.getName( 0, sal_True,
INetURLObject::DECODE_WITH_CHARSET );
if( aSeg1.getStr()[1] == (sal_Unicode)':' )
{
- bRoot = TRUE;
+ bRoot = sal_True;
}
}
// More than one segments can never be root
- // so bRoot remains FALSE
+ // so bRoot remains sal_False
return bRoot;
}
@@ -2612,7 +2612,7 @@ RTLFUNC(Dir)
String aPath;
- USHORT nParCount = rPar.Count();
+ sal_uInt16 nParCount = rPar.Count();
if( nParCount > 3 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
@@ -2667,7 +2667,7 @@ RTLFUNC(Dir)
rPar.Get(0)->PutString( aEmptyStr );
}
- USHORT nFlags = 0;
+ sal_uInt16 nFlags = 0;
if ( nParCount > 2 )
pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger();
else
@@ -2681,7 +2681,7 @@ RTLFUNC(Dir)
// #78651 Add "." and ".." directories for VB compatibility
if( bIncludeFolders )
{
- BOOL bRoot = isRootDir( aDirURLStr );
+ sal_Bool bRoot = isRootDir( aDirURLStr );
// If it's no root directory we flag the need for
// the "." and ".." directories by the value -2
@@ -2751,7 +2751,7 @@ RTLFUNC(Dir)
}
INetURLObject aURL( aFile );
- aPath = aURL.getName( INetURLObject::LAST_SEGMENT, TRUE,
+ aPath = aURL.getName( INetURLObject::LAST_SEGMENT, sal_True,
INetURLObject::DECODE_WITH_CHARSET );
}
@@ -2782,7 +2782,7 @@ RTLFUNC(Dir)
rPar.Get(0)->PutString( aEntry.GetName() );
return;
}
- USHORT nFlags = 0;
+ sal_uInt16 nFlags = 0;
if ( nParCount > 2 )
pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger();
else
@@ -2794,7 +2794,7 @@ RTLFUNC(Dir)
else
{
// Die richtige Auswahl treffen
- USHORT nMode = FSYS_KIND_FILE;
+ sal_uInt16 nMode = FSYS_KIND_FILE;
if( nFlags & Sb_ATTR_DIRECTORY )
nMode |= FSYS_KIND_DIR;
if( nFlags == Sb_ATTR_DIRECTORY )
@@ -2829,7 +2829,7 @@ RTLFUNC(Dir)
String aDirURL = implSetupWildcard( aFileParam, pRTLData );
- USHORT nFlags = 0;
+ sal_uInt16 nFlags = 0;
if ( nParCount > 2 )
pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger();
else
@@ -2851,7 +2851,7 @@ RTLFUNC(Dir)
pRTLData->nCurDirPos = 0;
if( bIncludeFolders )
{
- BOOL bRoot = isRootDir( aDirURL );
+ sal_Bool bRoot = isRootDir( aDirURL );
// If it's no root directory we flag the need for
// the "." and ".." directories by the value -2
@@ -2931,7 +2931,7 @@ RTLFUNC(GetAttr)
if ( rPar.Count() == 2 )
{
- INT16 nFlags = 0;
+ sal_Int16 nFlags = 0;
// In Windows, We want to use Windows API to get the file attributes
// for VBA interoperability.
@@ -2948,7 +2948,7 @@ RTLFUNC(GetAttr)
{
if (nRealFlags == FILE_ATTRIBUTE_NORMAL)
nRealFlags = 0;
- nFlags = (INT16) (nRealFlags);
+ nFlags = (sal_Int16) (nRealFlags);
}
else
StarBASIC::Error( SbERR_FILE_NOT_FOUND );
@@ -3114,7 +3114,7 @@ RTLFUNC(EOF)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
// nChannel--; // macht MD beim Oeffnen auch nicht
SbiIoSystem* pIO = pINST->GetIoSystem();
SbiStream* pSbStrm = pIO->GetStream( nChannel );
@@ -3123,7 +3123,7 @@ RTLFUNC(EOF)
StarBASIC::Error( SbERR_BAD_CHANNEL );
return;
}
- BOOL bIsEof;
+ sal_Bool bIsEof;
SvStream* pSvStrm = pSbStrm->GetStrm();
if ( pSbStrm->IsText() )
{
@@ -3154,7 +3154,7 @@ RTLFUNC(FileAttr)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
// nChannel--;
SbiIoSystem* pIO = pINST->GetIoSystem();
SbiStream* pSbStrm = pIO->GetStream( nChannel );
@@ -3163,9 +3163,9 @@ RTLFUNC(FileAttr)
StarBASIC::Error( SbERR_BAD_CHANNEL );
return;
}
- INT16 nRet;
+ sal_Int16 nRet;
if ( rPar.Get(2)->GetInteger() == 1 )
- nRet = (INT16)(pSbStrm->GetMode());
+ nRet = (sal_Int16)(pSbStrm->GetMode());
else
nRet = 0; // System file handle not supported
@@ -3182,7 +3182,7 @@ RTLFUNC(Loc)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
SbiIoSystem* pIO = pINST->GetIoSystem();
SbiStream* pSbStrm = pIO->GetStream( nChannel );
if ( !pSbStrm )
@@ -3191,7 +3191,7 @@ RTLFUNC(Loc)
return;
}
SvStream* pSvStrm = pSbStrm->GetStrm();
- ULONG nPos;
+ sal_uIntPtr nPos;
if( pSbStrm->IsRandom())
{
short nBlockLen = pSbStrm->GetBlockLen();
@@ -3206,7 +3206,7 @@ RTLFUNC(Loc)
nPos = ( pSvStrm->Tell()+1 ) / 128;
else
nPos = pSvStrm->Tell();
- rPar.Get(0)->PutLong( (INT32)nPos );
+ rPar.Get(0)->PutLong( (sal_Int32)nPos );
}
}
@@ -3220,7 +3220,7 @@ RTLFUNC(Lof)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
SbiIoSystem* pIO = pINST->GetIoSystem();
SbiStream* pSbStrm = pIO->GetStream( nChannel );
if ( !pSbStrm )
@@ -3229,10 +3229,10 @@ RTLFUNC(Lof)
return;
}
SvStream* pSvStrm = pSbStrm->GetStrm();
- ULONG nOldPos = pSvStrm->Tell();
- ULONG nLen = pSvStrm->Seek( STREAM_SEEK_TO_END );
+ sal_uIntPtr nOldPos = pSvStrm->Tell();
+ sal_uIntPtr nLen = pSvStrm->Seek( STREAM_SEEK_TO_END );
pSvStrm->Seek( nOldPos );
- rPar.Get(0)->PutLong( (INT32)nLen );
+ rPar.Get(0)->PutLong( (sal_Int32)nLen );
}
}
@@ -3249,7 +3249,7 @@ RTLFUNC(Seek)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
// nChannel--;
SbiIoSystem* pIO = pINST->GetIoSystem();
SbiStream* pSbStrm = pIO->GetStream( nChannel );
@@ -3262,15 +3262,15 @@ RTLFUNC(Seek)
if ( nArgs == 2 ) // Seek-Function
{
- ULONG nPos = pStrm->Tell();
+ sal_uIntPtr nPos = pStrm->Tell();
if( pSbStrm->IsRandom() )
nPos = nPos / pSbStrm->GetBlockLen();
nPos++; // Basic zaehlt ab 1
- rPar.Get(0)->PutLong( (INT32)nPos );
+ rPar.Get(0)->PutLong( (sal_Int32)nPos );
}
else // Seek-Statement
{
- INT32 nPos = rPar.Get(2)->GetLong();
+ sal_Int32 nPos = rPar.Get(2)->GetLong();
if ( nPos < 1 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -3280,7 +3280,7 @@ RTLFUNC(Seek)
pSbStrm->SetExpandOnWriteTo( 0 );
if ( pSbStrm->IsRandom() )
nPos *= pSbStrm->GetBlockLen();
- pStrm->Seek( (ULONG)nPos );
+ pStrm->Seek( (sal_uIntPtr)nPos );
pSbStrm->SetExpandOnWriteTo( nPos );
}
}
@@ -3290,7 +3290,7 @@ RTLFUNC(Format)
(void)pBasic;
(void)bWrite;
- USHORT nArgCount = (USHORT)rPar.Count();
+ sal_uInt16 nArgCount = (sal_uInt16)rPar.Count();
if ( nArgCount < 2 || nArgCount > 3 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
@@ -3314,11 +3314,11 @@ RTLFUNC(Randomize)
if ( rPar.Count() > 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
- INT16 nSeed;
+ sal_Int16 nSeed;
if( rPar.Count() == 2 )
- nSeed = (INT16)rPar.Get(1)->GetInteger();
+ nSeed = (sal_Int16)rPar.Get(1)->GetInteger();
else
- nSeed = (INT16)rand();
+ nSeed = (sal_Int16)rand();
srand( nSeed );
}
@@ -3339,7 +3339,7 @@ RTLFUNC(Rnd)
//
-// Syntax: Shell("Path",[ Window-Style,[ "Params", [ bSync = FALSE ]]])
+// Syntax: Shell("Path",[ Window-Style,[ "Params", [ bSync = sal_False ]]])
//
// WindowStyles (VBA-kompatibel):
// 2 == Minimized
@@ -3363,7 +3363,7 @@ RTLFUNC(Shell)
return;
}
- ULONG nArgCount = rPar.Count();
+ sal_uIntPtr nArgCount = rPar.Count();
if ( nArgCount < 2 || nArgCount > 5 )
{
rPar.Get(0)->PutLong(0);
@@ -3371,7 +3371,7 @@ RTLFUNC(Shell)
}
else
{
- USHORT nOptions = vos::OProcess::TOption_SearchPath|
+ sal_uInt16 nOptions = vos::OProcess::TOption_SearchPath|
vos::OProcess::TOption_Detached;
String aCmdLine = rPar.Get(1)->GetString();
// Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden
@@ -3385,13 +3385,13 @@ RTLFUNC(Shell)
// Spezial-Behandlung (leere Liste) vermeiden
aCmdLine.AppendAscii( " " );
}
- USHORT nLen = aCmdLine.Len();
+ sal_uInt16 nLen = aCmdLine.Len();
// #55735 Wenn Parameter dabei sind, muessen die abgetrennt werden
// #72471 Auch die einzelnen Parameter trennen
std::list<String> aTokenList;
String aToken;
- USHORT i = 0;
+ sal_uInt16 i = 0;
sal_Unicode c;
while( i < nLen )
{
@@ -3405,7 +3405,7 @@ RTLFUNC(Shell)
if( c == '\"' || c == '\'' )
{
- USHORT iFoundPos = aCmdLine.Search( c, i + 1 );
+ sal_uInt16 iFoundPos = aCmdLine.Search( c, i + 1 );
// Wenn nichts gefunden wurde, Rest kopieren
if( iFoundPos == STRING_NOTFOUND )
@@ -3421,9 +3421,9 @@ RTLFUNC(Shell)
}
else
{
- USHORT iFoundSpacePos = aCmdLine.Search( ' ', i );
- USHORT iFoundTabPos = aCmdLine.Search( '\t', i );
- USHORT iFoundPos = Min( iFoundSpacePos, iFoundTabPos );
+ sal_uInt16 iFoundSpacePos = aCmdLine.Search( ' ', i );
+ sal_uInt16 iFoundTabPos = aCmdLine.Search( '\t', i );
+ sal_uInt16 iFoundPos = Min( iFoundSpacePos, iFoundTabPos );
// Wenn nichts gefunden wurde, Rest kopieren
if( iFoundPos == STRING_NOTFOUND )
@@ -3443,7 +3443,7 @@ RTLFUNC(Shell)
}
// #55735 / #72471 Ende
- INT16 nWinStyle = 0;
+ sal_Int16 nWinStyle = 0;
if( nArgCount >= 3 )
{
nWinStyle = rPar.Get(2)->GetInteger();
@@ -3460,7 +3460,7 @@ RTLFUNC(Shell)
break;
}
- BOOL bSync = FALSE;
+ sal_Bool bSync = sal_False;
if( nArgCount >= 5 )
bSync = rPar.Get(4)->GetBool();
if( bSync )
@@ -3478,7 +3478,7 @@ RTLFUNC(Shell)
iter++;
- USHORT nParamCount = sal::static_int_cast< USHORT >(
+ sal_uInt16 nParamCount = sal::static_int_cast< sal_uInt16 >(
aTokenList.size() - 1 );
::rtl::OUString* pArgumentList = NULL;
//const char** pParamList = NULL;
@@ -3486,7 +3486,7 @@ RTLFUNC(Shell)
{
pArgumentList = new ::rtl::OUString[ nParamCount ];
//pParamList = new const char*[ nParamCount ];
- USHORT iList = 0;
+ sal_uInt16 iList = 0;
while( iter != aTokenList.end() )
{
const String& rParamStr = (*iter);
@@ -3499,7 +3499,7 @@ RTLFUNC(Shell)
//const char* pParams = aParams.Len() ? aParams.GetStr() : 0;
vos::OProcess* pApp;
pApp = new vos::OProcess( aOUStrProgUNC );
- BOOL bSucc;
+ sal_Bool bSucc;
if( nParamCount == 0 )
{
bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None;
@@ -3515,7 +3515,7 @@ RTLFUNC(Shell)
pApp = new vos::OProcess( pProg );
else
pApp = new vos::OProcess( pProg, pParamList, nParamCount );
- BOOL bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None;
+ sal_Bool bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None;
*/
delete pApp;
@@ -3537,7 +3537,7 @@ RTLFUNC(VarType)
else
{
SbxDataType eType = rPar.Get(1)->GetType();
- rPar.Get(0)->PutInteger( (INT16)eType );
+ rPar.Get(0)->PutInteger( (sal_Int16)eType );
}
}
@@ -3587,7 +3587,7 @@ String getBasicTypeName( SbxDataType eType )
};
int nPos = ((int)eType) & 0x0FFF;
- USHORT nTypeNameCount = sizeof( pTypeNames ) / sizeof( char* );
+ sal_uInt16 nTypeNameCount = sizeof( pTypeNames ) / sizeof( char* );
if ( nPos < 0 || nPos >= nTypeNameCount )
nPos = nTypeNameCount - 1;
String aRetStr = String::CreateFromAscii( pTypeNames[nPos] );
@@ -3604,7 +3604,7 @@ RTLFUNC(TypeName)
else
{
SbxDataType eType = rPar.Get(1)->GetType();
- BOOL bIsArray = ( ( eType & SbxARRAY ) != 0 );
+ sal_Bool bIsArray = ( ( eType & SbxARRAY ) != 0 );
String aRetStr = getBasicTypeName( eType );
if( bIsArray )
aRetStr.AppendAscii( "()" );
@@ -3622,7 +3622,7 @@ RTLFUNC(Len)
else
{
const String& rStr = rPar.Get(1)->GetString();
- rPar.Get(0)->PutLong( (INT32)rStr.Len() );
+ rPar.Get(0)->PutLong( (sal_Int32)rStr.Len() );
}
}
@@ -3648,7 +3648,7 @@ RTLFUNC(DDEInitiate)
const String& rTopic = rPar.Get(2)->GetString();
SbiDdeControl* pDDE = pINST->GetDdeControl();
- INT16 nChannel;
+ sal_Int16 nChannel;
SbError nDdeErr = pDDE->Initiate( rApp, rTopic, nChannel );
if( nDdeErr )
StarBASIC::Error( nDdeErr );
@@ -3675,7 +3675,7 @@ RTLFUNC(DDETerminate)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
SbiDdeControl* pDDE = pINST->GetDdeControl();
SbError nDdeErr = pDDE->Terminate( nChannel );
if( nDdeErr )
@@ -3727,7 +3727,7 @@ RTLFUNC(DDERequest)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
const String& rItem = rPar.Get(2)->GetString();
SbiDdeControl* pDDE = pINST->GetDdeControl();
String aResult;
@@ -3757,7 +3757,7 @@ RTLFUNC(DDEExecute)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
const String& rCommand = rPar.Get(2)->GetString();
SbiDdeControl* pDDE = pINST->GetDdeControl();
SbError nDdeErr = pDDE->Execute( nChannel, rCommand );
@@ -3784,7 +3784,7 @@ RTLFUNC(DDEPoke)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT16 nChannel = rPar.Get(1)->GetInteger();
+ sal_Int16 nChannel = rPar.Get(1)->GetInteger();
const String& rItem = rPar.Get(2)->GetString();
const String& rData = rPar.Get(3)->GetString();
SbiDdeControl* pDDE = pINST->GetDdeControl();
@@ -3824,7 +3824,7 @@ RTLFUNC(LBound)
(void)pBasic;
(void)bWrite;
- USHORT nParCount = rPar.Count();
+ sal_uInt16 nParCount = rPar.Count();
if ( nParCount != 3 && nParCount != 2 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -3834,7 +3834,7 @@ RTLFUNC(LBound)
SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
if( pArr )
{
- INT32 nLower, nUpper;
+ sal_Int32 nLower, nUpper;
short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1;
if( !pArr->GetDim32( nDim, nLower, nUpper ) )
StarBASIC::Error( SbERR_OUT_OF_RANGE );
@@ -3850,7 +3850,7 @@ RTLFUNC(UBound)
(void)pBasic;
(void)bWrite;
- USHORT nParCount = rPar.Count();
+ sal_uInt16 nParCount = rPar.Count();
if ( nParCount != 3 && nParCount != 2 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -3861,7 +3861,7 @@ RTLFUNC(UBound)
SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj);
if( pArr )
{
- INT32 nLower, nUpper;
+ sal_Int32 nLower, nUpper;
short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1;
if( !pArr->GetDim32( nDim, nLower, nUpper ) )
StarBASIC::Error( SbERR_OUT_OF_RANGE );
@@ -3883,10 +3883,10 @@ RTLFUNC(RGB)
return;
}
- ULONG nRed = rPar.Get(1)->GetInteger() & 0xFF;
- ULONG nGreen = rPar.Get(2)->GetInteger() & 0xFF;
- ULONG nBlue = rPar.Get(3)->GetInteger() & 0xFF;
- ULONG nRGB;
+ sal_uIntPtr nRed = rPar.Get(1)->GetInteger() & 0xFF;
+ sal_uIntPtr nGreen = rPar.Get(2)->GetInteger() & 0xFF;
+ sal_uIntPtr nBlue = rPar.Get(3)->GetInteger() & 0xFF;
+ sal_uIntPtr nRGB;
SbiInstance* pInst = pINST;
bool bCompatibility = ( pInst && pInst->IsCompatibility() );
@@ -3906,7 +3906,7 @@ RTLFUNC(QBColor)
(void)pBasic;
(void)bWrite;
- static const INT32 pRGB[] =
+ static const sal_Int32 pRGB[] =
{
0x000000,
0x800000,
@@ -3932,13 +3932,13 @@ RTLFUNC(QBColor)
return;
}
- INT16 nCol = rPar.Get(1)->GetInteger();
+ sal_Int16 nCol = rPar.Get(1)->GetInteger();
if( nCol < 0 || nCol > 15 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- INT32 nRGB = pRGB[ nCol ];
+ sal_Int32 nRGB = pRGB[ nCol ];
rPar.Get(0)->PutLong( nRGB );
}
@@ -3948,7 +3948,7 @@ RTLFUNC(StrConv)
(void)pBasic;
(void)bWrite;
- ULONG nArgCount = rPar.Count()-1;
+ sal_uIntPtr nArgCount = rPar.Count()-1;
if( nArgCount < 2 || nArgCount > 3 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -3956,16 +3956,16 @@ RTLFUNC(StrConv)
}
String aOldStr = rPar.Get(1)->GetString();
- INT32 nConversion = rPar.Get(2)->GetLong();
+ sal_Int32 nConversion = rPar.Get(2)->GetLong();
- USHORT nLanguage = LANGUAGE_SYSTEM;
+ sal_uInt16 nLanguage = LANGUAGE_SYSTEM;
if( nArgCount == 3 )
{
// LCID not supported now
//nLanguage = rPar.Get(3)->GetInteger();
}
- USHORT nOldLen = aOldStr.Len();
+ sal_uInt16 nOldLen = aOldStr.Len();
if( nOldLen == 0 )
{
// null string,return
@@ -3973,7 +3973,7 @@ RTLFUNC(StrConv)
return;
}
- INT32 nType = 0;
+ sal_Int32 nType = 0;
if ( (nConversion & 0x03) == 3 ) // vbProperCase
{
CharClass& rCharClass = GetCharClass();
@@ -4007,10 +4007,10 @@ RTLFUNC(StrConv)
if ( (nConversion & 0x40) == 64 ) // vbUnicode
{
// convert the string to byte string, preserving unicode (2 bytes per character)
- USHORT nSize = aNewStr.Len()*2;
+ sal_uInt16 nSize = aNewStr.Len()*2;
const sal_Unicode* pSrc = aNewStr.GetBuffer();
sal_Char* pChar = new sal_Char[nSize+1];
- for( USHORT i=0; i < nSize; i++ )
+ for( sal_uInt16 i=0; i < nSize; i++ )
{
pChar[i] = static_cast< sal_Char >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
if( i%2 )
@@ -4031,7 +4031,7 @@ RTLFUNC(StrConv)
// there is no concept about default codepage in unix. so it is incorrectly in unix
::rtl::OString aOStr = ::rtl::OUStringToOString(aNewStr,osl_getThreadTextEncoding());
const sal_Char* pChar = aOStr.getStr();
- USHORT nArraySize = static_cast< USHORT >( aOStr.getLength() );
+ sal_uInt16 nArraySize = static_cast< sal_uInt16 >( aOStr.getLength() );
SbxDimArray* pArray = new SbxDimArray(SbxBYTE);
bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
if(nArraySize)
@@ -4046,7 +4046,7 @@ RTLFUNC(StrConv)
pArray->unoAddDim( 0, -1 );
}
- for( USHORT i=0; i< nArraySize; i++)
+ for( sal_uInt16 i=0; i< nArraySize; i++)
{
SbxVariable* pNew = new SbxVariable( SbxBYTE );
pNew->PutByte(*pChar);
@@ -4059,7 +4059,7 @@ RTLFUNC(StrConv)
}
SbxVariableRef refVar = rPar.Get(0);
- USHORT nFlags = refVar->GetFlags();
+ sal_uInt16 nFlags = refVar->GetFlags();
refVar->ResetFlag( SBX_FIXED );
refVar->PutObject( pArray );
refVar->SetFlags( nFlags );
@@ -4215,17 +4215,17 @@ RTLFUNC(MsgBox)
WB_YES_NO, // MB_YESNO
WB_RETRY_CANCEL // MB_RETRYCANCEL
};
- static const INT16 nButtonMap[] =
+ static const sal_Int16 nButtonMap[] =
{
- 2, // #define RET_CANCEL FALSE
- 1, // #define RET_OK TRUE
+ 2, // #define RET_CANCEL sal_False
+ 1, // #define RET_OK sal_True
6, // #define RET_YES 2
7, // #define RET_NO 3
4 // #define RET_RETRY 4
};
- USHORT nArgCount = (USHORT)rPar.Count();
+ sal_uInt16 nArgCount = (sal_uInt16)rPar.Count();
if( nArgCount < 2 || nArgCount > 6 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -4292,11 +4292,11 @@ RTLFUNC(MsgBox)
pBox = new MessBox( pParent, nWinBits, aTitle, aMsg );
}
pBox->SetText( aTitle );
- USHORT nRet = (USHORT)pBox->Execute();
- if( nRet == TRUE )
+ sal_uInt16 nRet = (sal_uInt16)pBox->Execute();
+ if( nRet == sal_True )
nRet = 1;
- INT16 nMappedRet;
+ sal_Int16 nMappedRet;
if( nStyle == 2 )
{
nMappedRet = nRet;
@@ -4319,7 +4319,7 @@ RTLFUNC(SetAttr) // JSM
if ( rPar.Count() == 3 )
{
String aStr = rPar.Get(1)->GetString();
- INT16 nFlags = rPar.Get(2)->GetInteger();
+ sal_Int16 nFlags = rPar.Get(2)->GetInteger();
// <-- UCB
if( hasUno() )
@@ -4395,7 +4395,7 @@ RTLFUNC(DumpAllObjects)
(void)pBasic;
(void)bWrite;
- USHORT nArgCount = (USHORT)rPar.Count();
+ sal_uInt16 nArgCount = (sal_uInt16)rPar.Count();
if( nArgCount < 2 || nArgCount > 3 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else if( !pBasic )
@@ -4423,7 +4423,7 @@ RTLFUNC(FileExists)
if ( rPar.Count() == 2 )
{
String aStr = rPar.Get(1)->GetString();
- BOOL bExists = FALSE;
+ sal_Bool bExists = sal_False;
// <-- UCB
if( hasUno() )
@@ -4470,10 +4470,10 @@ RTLFUNC(Partition)
return;
}
- INT32 nNumber = rPar.Get(1)->GetLong();
- INT32 nStart = rPar.Get(2)->GetLong();
- INT32 nStop = rPar.Get(3)->GetLong();
- INT32 nInterval = rPar.Get(4)->GetLong();
+ sal_Int32 nNumber = rPar.Get(1)->GetLong();
+ sal_Int32 nStart = rPar.Get(2)->GetLong();
+ sal_Int32 nStop = rPar.Get(3)->GetLong();
+ sal_Int32 nInterval = rPar.Get(4)->GetLong();
if( nStart < 0 || nStop <= nStart || nInterval < 1 )
{
@@ -4490,9 +4490,9 @@ RTLFUNC(Partition)
// calculate the maximun number of characters before lowervalue and uppervalue
::rtl::OUString aBeforeStart = ::rtl::OUString::valueOf( nStart - 1 );
::rtl::OUString aAfterStop = ::rtl::OUString::valueOf( nStop + 1 );
- INT32 nLen1 = aBeforeStart.getLength();
- INT32 nLen2 = aAfterStop.getLength();
- INT32 nLen = nLen1 >= nLen2 ? nLen1:nLen2;
+ sal_Int32 nLen1 = aBeforeStart.getLength();
+ sal_Int32 nLen2 = aAfterStop.getLength();
+ sal_Int32 nLen = nLen1 >= nLen2 ? nLen1:nLen2;
::rtl::OUStringBuffer aRetStr( nLen * 2 + 1);
::rtl::OUString aLowerValue;
@@ -4507,8 +4507,8 @@ RTLFUNC(Partition)
}
else
{
- INT32 nLowerValue = nNumber;
- INT32 nUpperValue = nLowerValue;
+ sal_Int32 nLowerValue = nNumber;
+ sal_Int32 nUpperValue = nLowerValue;
if( nInterval > 1 )
{
nLowerValue = ((( nNumber - nStart ) / nInterval ) * nInterval ) + nStart;
@@ -4525,14 +4525,14 @@ RTLFUNC(Partition)
if( nLen > nLen1 )
{
// appending the leading spaces for the lowervalue
- for ( INT32 i= (nLen - nLen1) ; i > 0; --i )
+ for ( sal_Int32 i= (nLen - nLen1) ; i > 0; --i )
aRetStr.appendAscii(" ");
}
aRetStr.append( aLowerValue ).appendAscii(":");
if( nLen > nLen2 )
{
// appending the leading spaces for the uppervalue
- for ( INT32 i= (nLen - nLen2) ; i > 0; --i )
+ for ( sal_Int32 i= (nLen - nLen2) ; i > 0; --i )
aRetStr.appendAscii(" ");
}
aRetStr.append( aUpperValue );