diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-06-24 15:04:27 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-06-24 15:04:27 +0000 |
commit | d2181ac39c0d4808c0ae568a60e19e0e5370f67d (patch) | |
tree | db9fe5ffffaabbb56080262e6607b4d6f6812c41 /basic | |
parent | 4edcde8a0e9580425bbdd2a5e34b2efbe5da680e (diff) |
INTEGRATION: CWS obo30 (1.36.24); FILE MERGED
2008/06/06 07:01:37 obo 1.36.24.2: #i90100# EOL missing
2008/05/30 09:44:47 obo 1.36.24.1: #i90100# ambigous Reference during ENABLE_PCH build
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/methods1.cxx | 201 |
1 files changed, 101 insertions, 100 deletions
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index f86c74e136..72ab7d8823 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -1,13 +1,13 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: methods1.cxx,v $ - * $Revision: 1.36 $ + * $Revision: 1.37 $ * * This file is part of OpenOffice.org. * @@ -95,7 +95,7 @@ static Reference< XCalendar > getLocaleCalendar( void ) if( xSMgr.is() ) { xCalendar = Reference< XCalendar >( xSMgr->createInstance - ( OUString::createFromAscii( "com.sun.star.i18n.LocaleCalendar" ) ), UNO_QUERY ); + ( ::rtl::OUString::createFromAscii( "com.sun.star.i18n.LocaleCalendar" ) ), UNO_QUERY ); } } @@ -127,7 +127,7 @@ RTLFUNC(CBool) // JSM { (void)pBasic; (void)bWrite; - + BOOL bVal = FALSE; if ( rPar.Count() == 2 ) { @@ -144,7 +144,7 @@ RTLFUNC(CByte) // JSM { (void)pBasic; (void)bWrite; - + BYTE nByte = 0; if ( rPar.Count() == 2 ) { @@ -161,7 +161,7 @@ RTLFUNC(CCur) // JSM { (void)pBasic; (void)bWrite; - + SbxINT64 nCur; if ( rPar.Count() == 2 ) { @@ -178,7 +178,7 @@ RTLFUNC(CDec) // JSM { (void)pBasic; (void)bWrite; - + #ifdef WNT SbxDecimal* pDec = NULL; if ( rPar.Count() == 2 ) @@ -200,7 +200,7 @@ RTLFUNC(CDate) // JSM { (void)pBasic; (void)bWrite; - + double nVal = 0.0; if ( rPar.Count() == 2 ) { @@ -217,7 +217,7 @@ RTLFUNC(CDbl) // JSM { (void)pBasic; (void)bWrite; - + double nVal = 0.0; if ( rPar.Count() == 2 ) { @@ -245,7 +245,7 @@ RTLFUNC(CInt) // JSM { (void)pBasic; (void)bWrite; - + INT16 nVal = 0; if ( rPar.Count() == 2 ) { @@ -262,7 +262,7 @@ RTLFUNC(CLng) // JSM { (void)pBasic; (void)bWrite; - + INT32 nVal = 0; if ( rPar.Count() == 2 ) { @@ -279,7 +279,7 @@ RTLFUNC(CSng) // JSM { (void)pBasic; (void)bWrite; - + float nVal = (float)0.0; if ( rPar.Count() == 2 ) { @@ -309,7 +309,7 @@ RTLFUNC(CStr) // JSM { (void)pBasic; (void)bWrite; - + String aString; if ( rPar.Count() == 2 ) { @@ -326,7 +326,7 @@ RTLFUNC(CVar) // JSM { (void)pBasic; (void)bWrite; - + SbxValues aVals( SbxVARIANT ); if ( rPar.Count() == 2 ) { @@ -343,7 +343,7 @@ RTLFUNC(CVErr) { (void)pBasic; (void)bWrite; - + INT16 nErrCode = 0; if ( rPar.Count() == 2 ) { @@ -360,7 +360,7 @@ RTLFUNC(Iif) // JSM { (void)pBasic; (void)bWrite; - + if ( rPar.Count() == 4 ) { if (rPar.Get(1)->GetBool()) @@ -376,7 +376,7 @@ RTLFUNC(GetSystemType) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 1 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -388,7 +388,7 @@ RTLFUNC(GetGUIType) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 1 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -410,7 +410,7 @@ RTLFUNC(Red) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -426,7 +426,7 @@ RTLFUNC(Green) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -442,7 +442,7 @@ RTLFUNC(Blue) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -458,7 +458,7 @@ RTLFUNC(Switch) { (void)pBasic; (void)bWrite; - + USHORT nCount = rPar.Count(); if( !(nCount & 0x0001 )) // Anzahl der Argumente muss ungerade sein @@ -529,7 +529,7 @@ RTLFUNC(GetGUIVersion) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 1 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -543,7 +543,7 @@ RTLFUNC(Choose) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); INT16 nIndex = rPar.Get(1)->GetInteger(); @@ -562,7 +562,7 @@ RTLFUNC(Trim) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -578,7 +578,7 @@ RTLFUNC(GetSolarVersion) { (void)pBasic; (void)bWrite; - + rPar.Get(0)->PutLong( (INT32)SUPD ); } @@ -586,7 +586,7 @@ RTLFUNC(TwipsPerPixelX) { (void)pBasic; (void)bWrite; - + INT32 nResult = 0; Size aSize( 100,0 ); MapMode aMap( MAP_TWIP ); @@ -603,7 +603,7 @@ RTLFUNC(TwipsPerPixelY) { (void)pBasic; (void)bWrite; - + INT32 nResult = 0; Size aSize( 0,100 ); MapMode aMap( MAP_TWIP ); @@ -621,7 +621,7 @@ RTLFUNC(FreeLibrary) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); ByteString aByteDLLName( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() ); @@ -635,7 +635,7 @@ bool IsBaseIndexOne() USHORT res = pINST->pRun->GetBase(); if ( res ) result = true; - } + } return result; } @@ -643,7 +643,7 @@ RTLFUNC(Array) { (void)pBasic; (void)bWrite; - + SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); USHORT nArraySize = rPar.Count() - 1; @@ -651,7 +651,7 @@ RTLFUNC(Array) bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); if( nArraySize ) { - if ( bIncIndex ) + if ( bIncIndex ) pArray->AddDim( 1, nArraySize ); else pArray->AddDim( 0, nArraySize-1 ); @@ -669,7 +669,7 @@ RTLFUNC(Array) pNew->SetFlag( SBX_WRITE ); short index = i; if ( bIncIndex ) - ++index; + ++index; pArray->Put( pNew, &index ); } @@ -694,7 +694,7 @@ RTLFUNC(DimArray) { (void)pBasic; (void)bWrite; - + SbxDimArray * pArray = new SbxDimArray( SbxVARIANT ); USHORT nArrayDims = rPar.Count() - 1; if( nArrayDims > 0 ) @@ -751,7 +751,7 @@ RTLFUNC(FindObject) { (void)pBasic; (void)bWrite; - + // Wir brauchen einen Parameter if ( rPar.Count() < 2 ) { @@ -787,7 +787,7 @@ RTLFUNC(FindPropertyObject) { (void)pBasic; (void)bWrite; - + // Wir brauchen 2 Parameter if ( rPar.Count() < 3 ) { @@ -924,7 +924,7 @@ BOOL lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, { (void)bBinary; (void)bIsArray; - + double aDouble; ULONG nFPos = pStrm->Tell(); @@ -1127,7 +1127,7 @@ RTLFUNC(Put) { (void)pBasic; (void)bWrite; - + PutGet( rPar, TRUE ); } @@ -1135,7 +1135,7 @@ RTLFUNC(Get) { (void)pBasic; (void)bWrite; - + PutGet( rPar, FALSE ); } @@ -1143,7 +1143,7 @@ RTLFUNC(Environ) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1217,7 +1217,7 @@ RTLFUNC(GetDialogZoomFactorX) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1230,7 +1230,7 @@ RTLFUNC(GetDialogZoomFactorY) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1244,7 +1244,7 @@ RTLFUNC(EnableReschedule) { (void)pBasic; (void)bWrite; - + rPar.Get(0)->PutEmpty(); if ( rPar.Count() != 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1256,7 +1256,7 @@ RTLFUNC(GetSystemTicks) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 1 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1269,7 +1269,7 @@ RTLFUNC(GetPathSeparator) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 1 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1282,7 +1282,7 @@ RTLFUNC(ResolvePath) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() == 2 ) { String aStr = rPar.Get(1)->GetString(); @@ -1299,7 +1299,7 @@ RTLFUNC(TypeLen) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -1377,7 +1377,7 @@ RTLFUNC(CreateUnoStruct) { (void)pBasic; (void)bWrite; - + RTL_Impl_CreateUnoStruct( pBasic, rPar, bWrite ); } @@ -1387,7 +1387,7 @@ RTLFUNC(CreateUnoService) { (void)pBasic; (void)bWrite; - + RTL_Impl_CreateUnoService( pBasic, rPar, bWrite ); } @@ -1395,7 +1395,7 @@ RTLFUNC(CreateUnoValue) { (void)pBasic; (void)bWrite; - + RTL_Impl_CreateUnoValue( pBasic, rPar, bWrite ); } @@ -1405,7 +1405,7 @@ RTLFUNC(GetProcessServiceManager) { (void)pBasic; (void)bWrite; - + RTL_Impl_GetProcessServiceManager( pBasic, rPar, bWrite ); } @@ -1415,7 +1415,7 @@ RTLFUNC(CreatePropertySet) { (void)pBasic; (void)bWrite; - + RTL_Impl_CreatePropertySet( pBasic, rPar, bWrite ); } @@ -1425,7 +1425,7 @@ RTLFUNC(HasUnoInterfaces) { (void)pBasic; (void)bWrite; - + RTL_Impl_HasInterfaces( pBasic, rPar, bWrite ); } @@ -1434,7 +1434,7 @@ RTLFUNC(IsUnoStruct) { (void)pBasic; (void)bWrite; - + RTL_Impl_IsUnoStruct( pBasic, rPar, bWrite ); } @@ -1443,7 +1443,7 @@ RTLFUNC(EqualUnoObjects) { (void)pBasic; (void)bWrite; - + RTL_Impl_EqualUnoObjects( pBasic, rPar, bWrite ); } @@ -1456,7 +1456,7 @@ RTLFUNC(CreateUnoDialog) { (void)pBasic; (void)bWrite; - + RTL_Impl_CreateUnoDialog( pBasic, rPar, bWrite ); } @@ -1465,7 +1465,7 @@ RTLFUNC(GlobalScope) { (void)pBasic; (void)bWrite; - + SbxObject* p = pBasic; while( p->GetParent() ) p = p->GetParent(); @@ -1479,12 +1479,12 @@ RTLFUNC(ConvertToUrl) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() == 2 ) { String aStr = rPar.Get(1)->GetString(); INetURLObject aURLObj( aStr, INET_PROT_FILE ); - OUString aFileURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE ); + ::rtl::OUString aFileURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE ); if( !aFileURL.getLength() ) ::osl::File::getFileURLFromSystemPath( aFileURL, aFileURL ); if( !aFileURL.getLength() ) @@ -1499,11 +1499,11 @@ RTLFUNC(ConvertFromUrl) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() == 2 ) { String aStr = rPar.Get(1)->GetString(); - OUString aSysPath; + ::rtl::OUString aSysPath; ::osl::File::getSystemPathFromFileURL( aStr, aSysPath ); if( !aSysPath.getLength() ) aSysPath = aStr; @@ -1519,7 +1519,7 @@ RTLFUNC(GetDefaultContext) { (void)pBasic; (void)bWrite; - + RTL_Impl_GetDefaultContext( pBasic, rPar, bWrite ); } @@ -1528,7 +1528,7 @@ RTLFUNC(Join) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if ( nParCount != 3 && nParCount != 2 ) { @@ -1571,7 +1571,7 @@ RTLFUNC(Split) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if ( nParCount < 2 ) { @@ -1597,7 +1597,7 @@ RTLFUNC(Split) xub_StrLen nDelimLen = aDelim.Len(); if( nDelimLen ) { - xub_StrLen iSearch = STRING_NOTFOUND; + xub_StrLen iSearch = STRING_NOTFOUND; xub_StrLen iStart = 0; do { @@ -1656,7 +1656,7 @@ RTLFUNC(MonthName) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if( nParCount != 2 && nParCount != 3 ) { @@ -1687,7 +1687,7 @@ RTLFUNC(MonthName) const CalendarItem* pCalendarItems = aMonthSeq.getConstArray(); const CalendarItem& rItem = pCalendarItems[nVal - 1]; - OUString aRetStr = ( bAbbreviate ? rItem.AbbrevName : rItem.FullName ); + ::rtl::OUString aRetStr = ( bAbbreviate ? rItem.AbbrevName : rItem.FullName ); rPar.Get(0)->PutString( String(aRetStr) ); } @@ -1696,7 +1696,7 @@ RTLFUNC(WeekdayName) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if( nParCount < 2 || nParCount > 4 ) { @@ -1745,7 +1745,7 @@ RTLFUNC(WeekdayName) const CalendarItem* pCalendarItems = aDaySeq.getConstArray(); const CalendarItem& rItem = pCalendarItems[nDay - 1]; - OUString aRetStr = ( bAbbreviate ? rItem.AbbrevName : rItem.FullName ); + ::rtl::OUString aRetStr = ( bAbbreviate ? rItem.AbbrevName : rItem.FullName ); rPar.Get(0)->PutString( String(aRetStr) ); } @@ -1789,7 +1789,7 @@ RTLFUNC(Weekday) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if ( nParCount < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1838,20 +1838,20 @@ struct IntervalInfo , mdValue( dValue ) , mbSimple( bSimple ) {} -}; +}; static IntervalInfo pIntervalTable[] = { - IntervalInfo( INTERVAL_YYYY, "yyyy", 0.0, false ), // Year - IntervalInfo( INTERVAL_Q, "q", 0.0, false ), // Quarter - IntervalInfo( INTERVAL_M, "m", 0.0, false ), // Month - IntervalInfo( INTERVAL_Y, "y", 1.0, true ), // Day of year - IntervalInfo( INTERVAL_D, "d", 1.0, true ), // Day - IntervalInfo( INTERVAL_W, "w", 1.0, true ), // Weekday - IntervalInfo( INTERVAL_WW, "ww", 7.0, true ), // Week - IntervalInfo( INTERVAL_H, "h", (1.0 / 24.0), true ), // Hour - IntervalInfo( INTERVAL_N, "n", (1.0 / 1440.0), true), // Minute - IntervalInfo( INTERVAL_S, "s", (1.0 / 86400.0), true ), // Second + IntervalInfo( INTERVAL_YYYY, "yyyy", 0.0, false ), // Year + IntervalInfo( INTERVAL_Q, "q", 0.0, false ), // Quarter + IntervalInfo( INTERVAL_M, "m", 0.0, false ), // Month + IntervalInfo( INTERVAL_Y, "y", 1.0, true ), // Day of year + IntervalInfo( INTERVAL_D, "d", 1.0, true ), // Day + IntervalInfo( INTERVAL_W, "w", 1.0, true ), // Weekday + IntervalInfo( INTERVAL_WW, "ww", 7.0, true ), // Week + IntervalInfo( INTERVAL_H, "h", (1.0 / 24.0), true ), // Hour + IntervalInfo( INTERVAL_N, "n", (1.0 / 1440.0), true), // Minute + IntervalInfo( INTERVAL_S, "s", (1.0 / 86400.0), true ), // Second IntervalInfo( INTERVAL_NONE, NULL, 0.0, false ) }; @@ -1899,7 +1899,7 @@ RTLFUNC(DateAdd) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if( nParCount != 4 ) { @@ -2022,7 +2022,7 @@ RTLFUNC(DateDiff) { (void)pBasic; (void)bWrite; - + // DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) USHORT nParCount = rPar.Count(); @@ -2222,7 +2222,7 @@ RTLFUNC(DatePart) { (void)pBasic; (void)bWrite; - + // DatePart(interval, date[,firstdayofweek[, firstweekofyear]]) USHORT nParCount = rPar.Count(); @@ -2345,7 +2345,7 @@ RTLFUNC(FormatDateTime) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if( nParCount < 2 || nParCount > 3 ) { @@ -2376,9 +2376,9 @@ RTLFUNC(FormatDateTime) SbxVariableRef pSbxVar = new SbxVariable( SbxSTRING ); switch( nNamedFormat ) { - // GeneralDate: - // Display a date and/or time. If there is a date part, - // display it as a short date. If there is a time part, + // GeneralDate: + // Display a date and/or time. If there is a date part, + // display it as a short date. If there is a time part, // display it as a long time. If present, both parts are displayed. // 12/21/2004 11:24:50 AM @@ -2388,8 +2388,8 @@ RTLFUNC(FormatDateTime) aRetStr = pSbxVar->GetString(); break; - // LongDate: Display a date using the long date format specified - // in your computer's regional settings. + // LongDate: Display a date using the long date format specified + // in your computer's regional settings. // Tuesday, December 21, 2004 // Dienstag, 21. December 2004 case 1: @@ -2414,8 +2414,8 @@ RTLFUNC(FormatDateTime) break; } - // ShortDate: Display a date using the short date format specified - // in your computer's regional settings. + // ShortDate: Display a date using the short date format specified + // in your computer's regional settings. // 12/21/2004 // 21.12.2004 case 2: @@ -2423,12 +2423,12 @@ RTLFUNC(FormatDateTime) aRetStr = pSbxVar->GetString(); break; - // LongTime: Display a time using the time format specified - // in your computer's regional settings. + // LongTime: Display a time using the time format specified + // in your computer's regional settings. // 11:24:50 AM // 12:13:51 case 3: - // ShortTime: Display a time using the 24-hour format (hh:mm). + // ShortTime: Display a time using the 24-hour format (hh:mm). // 11:24 case 4: double n; @@ -2448,7 +2448,7 @@ RTLFUNC(Round) { (void)pBasic; (void)bWrite; - + USHORT nParCount = rPar.Count(); if( nParCount != 2 && nParCount != 3 ) { @@ -2501,7 +2501,7 @@ RTLFUNC(StrReverse) { (void)pBasic; (void)bWrite; - + if ( rPar.Count() != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -2524,7 +2524,7 @@ RTLFUNC(CompatibilityMode) { (void)pBasic; (void)bWrite; - + bool bEnabled = false; USHORT nCount = rPar.Count(); if ( nCount != 1 && nCount != 2 ) @@ -2545,7 +2545,7 @@ RTLFUNC(Input) { (void)pBasic; (void)bWrite; - + // 2 parameters needed if ( rPar.Count() < 3 ) { @@ -2582,7 +2582,7 @@ RTLFUNC(Me) { (void)pBasic; (void)bWrite; - + SbModule* pActiveModule = pINST->GetActiveModule(); SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pActiveModule); if( pClassModuleObject == NULL ) @@ -2595,3 +2595,4 @@ RTLFUNC(Me) refVar->PutObject( pClassModuleObject ); } } + |