summaryrefslogtreecommitdiff
path: root/basic/source/runtime
diff options
context:
space:
mode:
authorAllmann-Rahn <allmann-rahn@ubuntu.ubuntu-domain>2011-08-27 21:37:14 +0200
committerTor Lillqvist <tlillqvist@novell.com>2011-08-31 16:29:43 +0300
commit8b11173f34bcbd5c27c1842e65ef3ab91bb24019 (patch)
tree2caad5d1b7c1f2a6a7eca933b420c0e352be088a /basic/source/runtime
parent930e38e16329e4a81dc2dcf185d44a752fbfbf7f (diff)
Translated German comments, removed redundant ones till cairo (incl.)
Diffstat (limited to 'basic/source/runtime')
-rw-r--r--basic/source/runtime/basrdll.cxx4
-rw-r--r--basic/source/runtime/inputbox.cxx2
-rw-r--r--basic/source/runtime/iosys.cxx19
-rw-r--r--basic/source/runtime/methods.cxx121
-rw-r--r--basic/source/runtime/methods1.cxx105
-rw-r--r--basic/source/runtime/props.cxx8
-rw-r--r--basic/source/runtime/runtime.cxx267
-rw-r--r--basic/source/runtime/stdobj.cxx87
-rw-r--r--basic/source/runtime/stdobj1.cxx9
-rw-r--r--basic/source/runtime/step0.cxx128
-rw-r--r--basic/source/runtime/step1.cxx85
-rw-r--r--basic/source/runtime/step2.cxx242
12 files changed, 495 insertions, 582 deletions
diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx
index 1f05688087f2..cd3c24f1dee7 100644
--- a/basic/source/runtime/basrdll.cxx
+++ b/basic/source/runtime/basrdll.cxx
@@ -79,8 +79,8 @@ void BasicDLL::SetDebugMode( sal_Bool bDebugMode )
void BasicDLL::BasicBreak()
{
- //bJustStopping: Wenn jemand wie wild x-mal STOP drueckt, aber das Basic
- // nicht schnell genug anhaelt, kommt die Box ggf. oefters...
+ // bJustStopping: if there's someone pressing STOP like crazy umpteen times,
+ // but the Basic doesn't stop early enough, the box might appear more often...
static sal_Bool bJustStopping = sal_False;
BasicDLL* pThis = *(BasicDLL**)GetAppData(SHL_BASIC);
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index c14afa075155..86a7578f5d34 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -167,7 +167,7 @@ RTLFUNC(InputBox)
{
String aTitle;
String aDefault;
- sal_Int32 nX = -1, nY = -1; // zentrieren
+ sal_Int32 nX = -1, nY = -1; // center
const String& rPrompt = rPar.Get(1)->GetString();
if ( nArgCount > 2 && !rPar.Get(2)->IsErr() )
aTitle = rPar.Get(2)->GetString();
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 77654904e017..7f4274cba9fc 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -73,7 +73,7 @@ using namespace com::sun::star::bridge;
#include "iosys.hxx"
#include "sbintern.hxx"
-// Der Input-Dialog:
+
class SbiInputDialog : public ModalDialog {
Edit aInput;
@@ -145,7 +145,7 @@ SbiStream::~SbiStream()
delete pStrm;
}
-// Ummappen eines SvStream-Fehlers auf einen StarBASIC-Code
+// map an SvStream-error to StarBASIC-code
void SbiStream::MapError()
{
@@ -560,7 +560,7 @@ void UCBStream::SetSize( sal_uIntPtr nSize )
SetError( ERRCODE_IO_GENERAL );
}
-// Oeffnen eines Streams
+
SbError SbiStream::Open
( short nCh, const ByteString& rName, short nStrmMode, short nFlags, short nL )
{
@@ -706,8 +706,8 @@ SbError SbiStream::Write( const ByteString& rBuf, sal_uInt16 n )
if( IsText() )
{
aLine += rBuf;
- // Raus damit, wenn das Ende ein LF ist, aber CRLF vorher
- // strippen, da der SvStrm ein CRLF anfuegt!
+ // Get it out, if the end is an LF, but strip CRLF before,
+ // because the SvStrm adds a CRLF!
sal_uInt16 nLineLen = aLine.Len();
if( nLineLen && aLine.GetBuffer()[ --nLineLen ] == 0x0A )
{
@@ -730,7 +730,6 @@ SbError SbiStream::Write( const ByteString& rBuf, sal_uInt16 n )
}
-// Zugriff auf das aktuelle I/O-System:
SbiIoSystem* SbGetIoSystem()
{
@@ -776,7 +775,6 @@ void SbiIoSystem::Open
nChan = 0;
}
-// Aktuellen Kanal schliessen
void SbiIoSystem::Close()
{
@@ -793,7 +791,6 @@ void SbiIoSystem::Close()
nChan = 0;
}
-// Shutdown nach Programmlauf
void SbiIoSystem::Shutdown()
{
@@ -809,7 +806,7 @@ void SbiIoSystem::Shutdown()
}
}
nChan = 0;
- // Noch was zu PRINTen?
+ // anything left to PRINT?
if( aOut.Len() )
{
String aOutStr( aOut, gsl_getSystemTextEncoding() );
@@ -823,7 +820,6 @@ void SbiIoSystem::Shutdown()
aOut.Erase();
}
-// Aus aktuellem Kanal lesen
void SbiIoSystem::Read( ByteString& rBuf, short n )
{
@@ -907,7 +903,6 @@ void SbiIoSystem::CloseAll(void)
*
***************************************************************************/
-// Einlesen einer Zeile von der Console
void SbiIoSystem::ReadCon( ByteString& rIn )
{
@@ -920,7 +915,7 @@ void SbiIoSystem::ReadCon( ByteString& rIn )
aPrompt.Erase();
}
-// Ausgabe einer MessageBox, wenn im Console-Puffer ein CR ist
+// output of a MessageBox, if theres a CR in the console-buffer
void SbiIoSystem::WriteCon( const ByteString& rText )
{
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 562b2891afa9..2f110304d5b5 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -141,7 +141,7 @@ static long GetDayDiff( const Date& rDate )
}
else
nDiffDays = (long)(rDate - aRefDate);
- nDiffDays += 2; // Anpassung VisualBasic: 1.Jan.1900 == 2
+ nDiffDays += 2; // adjustment VisualBasic: 1.Jan.1900 == 2
return nDiffDays;
}
@@ -202,9 +202,8 @@ static com::sun::star::uno::Reference< XSimpleFileAccess3 > getFileAccess( void
-// 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.
+// Properties and methods lie down the return value at the Get (bPut = sal_False) in the
+// element 0 of the Argv; the value of element 0 is saved at Put (bPut = sal_True)
// CreateObject( class )
@@ -218,7 +217,7 @@ RTLFUNC(CreateObject)
StarBASIC::Error( SbERR_CANNOT_LOAD );
else
{
- // Convenience: BASIC als Parent eintragen
+ // Convenience: enter BASIC as parent
p->SetParent( pBasic );
rPar.Get( 0 )->PutObject( p );
}
@@ -291,7 +290,6 @@ RTLFUNC(Sin)
}
}
-// Cosinus
RTLFUNC(Cos)
{
@@ -307,7 +305,6 @@ RTLFUNC(Cos)
}
}
-// Atn
RTLFUNC(Atn)
{
@@ -417,10 +414,10 @@ RTLFUNC(CurDir)
(void)pBasic;
(void)bWrite;
- // #57064 Obwohl diese Funktion nicht mit DirEntry arbeitet, ist sie von
- // der Anpassung an virtuelle URLs nich betroffen, da bei Nutzung der
- // DirEntry-Funktionalitaet keine Moeglichkeit besteht, das aktuelle so
- // zu ermitteln, dass eine virtuelle URL geliefert werden koennte.
+ // #57064 Although this function doesn't work with DirEntry, it isn't touched
+ // by the adjustment to virtual URLs, as, using the DirEntry-functionality,
+ // there's no possibility to detect the current one in a way that a virtual URL
+ // could be delivered.
#if defined (WNT)
int nCurDir = 0; // Current dir // JSM
@@ -1208,10 +1205,10 @@ RTLFUNC(Mid)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- // #23178: Funktionalitaet von Mid$ als Anweisung nachbilden, indem
- // als weiterer (4.) Parameter ein Ersetzungsstring aufgenommen wird.
- // Anders als im Original kann in dieser Variante der 3. Parameter
- // nLength nicht weggelassen werden. Ist ueber bWrite schon vorgesehen.
+ // #23178: replicate the functionality of Mid$ as a command
+ // by adding a replacement-string as a fourth parameter.
+ // In contrast to the original the third parameter (nLength)
+ // can't be left out here. That's considered in bWrite already.
if( nArgCount == 4 )
bWrite = sal_True;
@@ -1527,7 +1524,7 @@ RTLFUNC(Str)
// Numbers start with a space
if( pArg->IsNumericRTL() )
{
- // Kommas durch Punkte ersetzen, damit es symmetrisch zu Val ist!
+ // replace commas by points so that it's symmetric to Val!
aStr.SearchAndReplace( ',', '.' );
SbiInstance* pInst = pINST;
@@ -1712,7 +1709,7 @@ RTLFUNC(Val)
}
else
{
- // #57844 Lokalisierte Funktion benutzen
+ // #57844 use localized function
nResult = ::rtl::math::stringToDouble( aStr, '.', ',', NULL, NULL );
checkArithmeticOverflow( nResult );
}
@@ -1725,7 +1722,7 @@ RTLFUNC(Val)
// Helper functions for date conversion
sal_Int16 implGetDateDay( double aDate )
{
- aDate -= 2.0; // normieren: 1.1.1900 => 0.0
+ aDate -= 2.0; // standardize: 1.1.1900 => 0.0
Date aRefDate( 1, 1, 1900 );
if ( aDate >= 0.0 )
{
@@ -1746,7 +1743,7 @@ sal_Int16 implGetDateMonth( double aDate )
{
Date aRefDate( 1,1,1900 );
long nDays = (long)aDate;
- nDays -= 2; // normieren: 1.1.1900 => 0.0
+ nDays -= 2; // standardize: 1.1.1900 => 0.0
aRefDate += nDays;
sal_Int16 nRet = (sal_Int16)( aRefDate.GetMonth() );
return nRet;
@@ -1756,7 +1753,7 @@ sal_Int16 implGetDateYear( double aDate )
{
Date aRefDate( 1,1,1900 );
long nDays = (long) aDate;
- nDays -= 2; // normieren: 1.1.1900 => 0.0
+ nDays -= 2; // standardize: 1.1.1900 => 0.0
aRefDate += nDays;
sal_Int16 nRet = (sal_Int16)( aRefDate.GetYear() );
return nRet;
@@ -1893,7 +1890,7 @@ RTLFUNC(TimeSerial)
}
sal_Int16 nHour = rPar.Get(1)->GetInteger();
if ( nHour == 24 )
- nHour = 0; // Wegen UNO DateTimes, die bis 24 Uhr gehen
+ nHour = 0; // because of UNO DateTimes, which go till 24 o'clock
sal_Int16 nMinute = rPar.Get(2)->GetInteger();
sal_Int16 nSecond = rPar.Get(3)->GetInteger();
if ((nHour < 0 || nHour > 23) ||
@@ -1921,7 +1918,7 @@ RTLFUNC(DateValue)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden
+ // #39629 check pINST, can be called from the URL line
SvNumberFormatter* pFormatter = NULL;
if( pINST )
pFormatter = pINST->GetNumberFormatter();
@@ -1956,7 +1953,7 @@ RTLFUNC(DateValue)
{
if ( nType == NUMBERFORMAT_DATETIME )
{
- // Zeit abschneiden
+ // cut time
if ( fResult > 0.0 )
fResult = floor( fResult );
else
@@ -1967,7 +1964,7 @@ RTLFUNC(DateValue)
else
StarBASIC::Error( SbERR_CONVERSION );
- // #39629 pFormatter kann selbst angefordert sein
+ // #39629 pFormatter can be requested itself
if( !pINST )
delete pFormatter;
}
@@ -1982,13 +1979,12 @@ RTLFUNC(TimeValue)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden
SvNumberFormatter* pFormatter = NULL;
if( pINST )
pFormatter = pINST->GetNumberFormatter();
else
{
- sal_uInt32 n; // Dummy
+ sal_uInt32 n;
SbiInstance::PrepareNumberFormatter( pFormatter, n, n, n );
}
@@ -2000,14 +1996,13 @@ RTLFUNC(TimeValue)
if(bSuccess && (nType==NUMBERFORMAT_TIME||nType==NUMBERFORMAT_DATETIME))
{
if ( nType == NUMBERFORMAT_DATETIME )
- // Tage abschneiden
+ // cut days
fResult = fmod( fResult, 1 );
rPar.Get(0)->PutDate( fResult );
}
else
StarBASIC::Error( SbERR_CONVERSION );
- // #39629 pFormatter kann selbst angefordert sein
if( !pINST )
delete pFormatter;
}
@@ -2194,7 +2189,6 @@ RTLFUNC(Time)
double nDays = (double)nSeconds * ( 1.0 / (24.0*3600.0) );
Color* pCol;
- // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden
SvNumberFormatter* pFormatter = NULL;
sal_uInt32 nIndex;
if( pINST )
@@ -2210,7 +2204,6 @@ RTLFUNC(Time)
pFormatter->GetOutputString( nDays, nIndex, aRes, &pCol );
- // #39629 pFormatter kann selbst angefordert sein
if( !pINST )
delete pFormatter;
}
@@ -2251,7 +2244,6 @@ RTLFUNC(Date)
String aRes;
Color* pCol;
- // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden
SvNumberFormatter* pFormatter = NULL;
sal_uInt32 nIndex;
if( pINST )
@@ -2261,14 +2253,13 @@ RTLFUNC(Date)
}
else
{
- sal_uInt32 n; // Dummy
+ sal_uInt32 n;
SbiInstance::PrepareNumberFormatter( pFormatter, nIndex, n, n );
}
pFormatter->GetOutputString( nDays, nIndex, aRes, &pCol );
pMeth->PutString( aRes );
- // #39629 pFormatter kann selbst angefordert sein
if( !pINST )
delete pFormatter;
}
@@ -2330,7 +2321,7 @@ RTLFUNC(IsDate)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- // #46134 Nur String wird konvertiert, andere Typen ergeben sal_False
+ // #46134 only string is converted, all other types result in sal_False
SbxVariableRef xArg = rPar.Get( 1 );
SbxDataType eType = xArg->GetType();
sal_Bool bDate = sal_False;
@@ -2341,17 +2332,14 @@ RTLFUNC(IsDate)
}
else if( eType == SbxSTRING )
{
- // Error loeschen
SbxError nPrevError = SbxBase::GetError();
SbxBase::ResetError();
- // Konvertierung des Parameters nach SbxDATE erzwingen
+ // force conversion of the parameter to SbxDATE
xArg->SbxValue::GetDate();
- // Bei Fehler ist es kein Date
bDate = !SbxBase::IsError();
- // Error-Situation wiederherstellen
SbxBase::ResetError();
SbxBase::SetError( nPrevError );
}
@@ -2416,8 +2404,8 @@ RTLFUNC(IsNull)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
{
- // #51475 Wegen Uno-Objekten auch true liefern,
- // wenn der pObj-Wert NULL ist
+ // #51475 because of Uno-objects return true
+ // even if the pObj value is NULL
SbxVariableRef pArg = rPar.Get( 1 );
sal_Bool bNull = rPar.Get(1)->IsNull();
if( !bNull && pArg->GetType() == SbxOBJECT )
@@ -2441,7 +2429,7 @@ RTLFUNC(IsNumeric)
rPar.Get( 0 )->PutBool( rPar.Get( 1 )->IsNumericRTL() );
}
-// Das machen wir auf die billige Tour
+
RTLFUNC(IsMissing)
{
@@ -2451,7 +2439,7 @@ RTLFUNC(IsMissing)
if ( rPar.Count() < 2 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
else
- // #57915 Missing wird durch Error angezeigt
+ // #57915 Missing is reported by an error
rPar.Get( 0 )->PutBool( rPar.Get(1)->IsErr() );
}
@@ -2573,8 +2561,8 @@ RTLFUNC(Dir)
{
SbiRTLData* pRTLData = pINST->GetRTLData();
- // #34645: Kann auch von der URL-Zeile ueber 'macro: Dir' aufgerufen werden
- // dann existiert kein pRTLData und die Methode muss verlassen werden
+ // #34645: can also be called from the URL line via 'macro: Dir'
+ // there's no pRTLDate existing in that case and the method must be left
if( !pRTLData )
return;
@@ -2837,7 +2825,7 @@ RTLFUNC(GetAttr)
DirEntry aEntry( rPar.Get(1)->GetString() );
aEntry.ToAbs();
- // #57064 Bei virtuellen URLs den Real-Path extrahieren
+ // #57064 extract the real-path for virtual URLs
ByteString aByteStrFullPath( aEntry.GetFull(), gsl_getSystemTextEncoding() );
DWORD nRealFlags = GetFileAttributes (aByteStrFullPath.GetBuffer());
if (nRealFlags != 0xffffffff)
@@ -2964,7 +2952,6 @@ RTLFUNC(FileDateTime)
Color* pCol;
- // #39629 pINST pruefen, kann aus URL-Zeile gerufen werden
SvNumberFormatter* pFormatter = NULL;
sal_uInt32 nIndex;
if( pINST )
@@ -2974,7 +2961,7 @@ RTLFUNC(FileDateTime)
}
else
{
- sal_uInt32 n; // Dummy
+ sal_uInt32 n;
SbiInstance::PrepareNumberFormatter( pFormatter, n, n, nIndex );
}
@@ -2982,7 +2969,6 @@ RTLFUNC(FileDateTime)
pFormatter->GetOutputString( fSerial, nIndex, aRes, &pCol );
rPar.Get(0)->PutString( aRes );
- // #39629 pFormatter kann selbst angefordert sein
if( !pINST )
delete pFormatter;
}
@@ -3012,13 +2998,13 @@ RTLFUNC(EOF)
if ( pSbStrm->IsText() )
{
char cBla;
- (*pSvStrm) >> cBla; // koennen wir noch ein Zeichen lesen
+ (*pSvStrm) >> cBla; // can we read another character?
bIsEof = pSvStrm->IsEof();
if ( !bIsEof )
pSvStrm->SeekRel( -1 );
}
else
- bIsEof = pSvStrm->IsEof(); // fuer binaerdateien!
+ bIsEof = pSvStrm->IsEof(); // for binary data!
rPar.Get(0)->PutBool( bIsEof );
}
}
@@ -3029,9 +3015,9 @@ RTLFUNC(FileAttr)
(void)bWrite;
// No changes for UCB
- // #57064 Obwohl diese Funktion nicht mit DirEntry arbeitet, ist sie von
- // der Anpassung an virtuelle URLs nich betroffen, da sie nur auf bereits
- // geoeffneten Dateien arbeitet und der Name hier keine Rolle spielt.
+ // #57064 Although this function doesn't operate with DirEntry, it is
+ // not touched by the adjustment to virtual URLs, as it only works on
+ // already opened files and the name doesn't matter there.
if ( rPar.Count() != 3 )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -3078,7 +3064,7 @@ RTLFUNC(Loc)
{
short nBlockLen = pSbStrm->GetBlockLen();
nPos = nBlockLen ? (pSvStrm->Tell() / nBlockLen) : 0;
- nPos++; // Blockpositionen beginnen bei 1
+ nPos++; // block positions starting at 1
}
else if ( pSbStrm->IsText() )
nPos = pSbStrm->GetLine();
@@ -3146,7 +3132,7 @@ RTLFUNC(Seek)
sal_uIntPtr nPos = pStrm->Tell();
if( pSbStrm->IsRandom() )
nPos = nPos / pSbStrm->GetBlockLen();
- nPos++; // Basic zaehlt ab 1
+ nPos++; // Basic counts from 1
rPar.Get(0)->PutLong( (sal_Int32)nPos );
}
else // Seek-Statement
@@ -3157,7 +3143,7 @@ RTLFUNC(Seek)
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- nPos--; // Basic zaehlt ab 1, SvStreams zaehlen ab 0
+ nPos--; // Basic counts from 1, SvStreams count from 0
pSbStrm->SetExpandOnWriteTo( 0 );
if ( pSbStrm->IsRandom() )
nPos *= pSbStrm->GetBlockLen();
@@ -3251,7 +3237,7 @@ RTLFUNC(Shell)
oslProcessOption nOptions = osl_Process_SEARCHPATH | osl_Process_DETACHED;
String aCmdLine = rPar.Get(1)->GetString();
- // Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden
+ // attach additional parameters - everything must be parsed anyway
if( nArgCount >= 4 )
{
aCmdLine.AppendAscii( " " );
@@ -3259,20 +3245,19 @@ RTLFUNC(Shell)
}
else if( !aCmdLine.Len() )
{
- // Spezial-Behandlung (leere Liste) vermeiden
+ // avaoid special treatment (empty list)
aCmdLine.AppendAscii( " " );
}
sal_uInt16 nLen = aCmdLine.Len();
- // #55735 Wenn Parameter dabei sind, muessen die abgetrennt werden
- // #72471 Auch die einzelnen Parameter trennen
+ // #55735 if there are parameters, they have to be seperated
+ // #72471 also seperate the single parameters
std::list<String> aTokenList;
String aToken;
sal_uInt16 i = 0;
sal_Unicode c;
while( i < nLen )
{
- // Spaces weg
for ( ;; ++i )
{
c = aCmdLine.GetBuffer()[ i ];
@@ -3284,7 +3269,6 @@ RTLFUNC(Shell)
{
sal_uInt16 iFoundPos = aCmdLine.Search( c, i + 1 );
- // Wenn nichts gefunden wurde, Rest kopieren
if( iFoundPos == STRING_NOTFOUND )
{
aToken = aCmdLine.Copy( i, STRING_LEN );
@@ -3302,7 +3286,6 @@ RTLFUNC(Shell)
sal_uInt16 iFoundTabPos = aCmdLine.Search( '\t', i );
sal_uInt16 iFoundPos = Min( iFoundSpacePos, iFoundTabPos );
- // Wenn nichts gefunden wurde, Rest kopieren
if( iFoundPos == STRING_NOTFOUND )
{
aToken = aCmdLine.Copy( i, STRING_LEN );
@@ -3315,10 +3298,10 @@ RTLFUNC(Shell)
}
}
- // In die Liste uebernehmen
+ // insert into the list
aTokenList.push_back( aToken );
}
- // #55735 / #72471 Ende
+ // #55735 / #72471 end
sal_Int16 nWinStyle = 0;
if( nArgCount >= 3 )
@@ -3344,7 +3327,7 @@ RTLFUNC(Shell)
nOptions |= osl_Process_WAIT;
}
- // #72471 Parameter aufbereiten
+ // #72471 work parameter(s) up
std::list<String>::const_iterator iter = aTokenList.begin();
const String& rStr = *iter;
::rtl::OUString aOUStrProg( rStr.GetBuffer(), rStr.Len() );
@@ -4031,7 +4014,7 @@ RTLFUNC(Load)
return;
}
- // Diesen Call einfach an das Object weiterreichen
+
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
if ( pObj )
{
@@ -4061,7 +4044,7 @@ RTLFUNC(Unload)
return;
}
- // Diesen Call einfach an das Object weitereichen
+
SbxBase* pObj = (SbxObject*)rPar.Get(1)->GetObject();
if ( pObj )
{
@@ -4172,7 +4155,7 @@ RTLFUNC(MsgBox)
if( nArgCount >= 3 )
nType = (WinBits)rPar.Get(2)->GetInteger();
WinBits nStyle = nType;
- nStyle &= 15; // Bits 4-16 loeschen
+ nStyle &= 15; // delete bits 4-16
if( nStyle > 5 )
nStyle = 0;
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 20191cbdcf00..f54ff7baea4f 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -331,7 +331,7 @@ RTLFUNC(CDbl) // JSM
SbxVariable *pSbxVariable = rPar.Get(1);
if( pSbxVariable->GetType() == SbxSTRING )
{
- // AB #41690 , String holen
+ // #41690
String aScanStr = pSbxVariable->GetString();
SbError Error = SbxValue::ScanNumIntnl( aScanStr, nVal );
if( Error != SbxERR_OK )
@@ -393,7 +393,7 @@ RTLFUNC(CSng) // JSM
SbxVariable *pSbxVariable = rPar.Get(1);
if( pSbxVariable->GetType() == SbxSTRING )
{
- // AB #41690 , String holen
+ // #41690
double dVal = 0.0;
String aScanStr = pSbxVariable->GetString();
SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/sal_True );
@@ -566,7 +566,7 @@ RTLFUNC(Switch)
sal_uInt16 nCount = rPar.Count();
if( !(nCount & 0x0001 ))
- // Anzahl der Argumente muss ungerade sein
+ // number of arguments must be odd
StarBASIC::Error( SbERR_BAD_ARGUMENT );
sal_uInt16 nCurExpr = 1;
while( nCurExpr < (nCount-1) )
@@ -764,7 +764,7 @@ RTLFUNC(Array)
SbxDimArray* pArray = new SbxDimArray( SbxVARIANT );
sal_uInt16 nArraySize = rPar.Count() - 1;
- // Option Base zunaechst ignorieren (kennt leider nur der Compiler)
+ // ignore Option Base so far (unfortunately only known by the compiler)
bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() );
if( nArraySize )
{
@@ -778,7 +778,7 @@ RTLFUNC(Array)
pArray->unoAddDim( 0, -1 );
}
- // Parameter ins Array uebernehmen
+ // insert parameters into the array
// ATTENTION: Using type sal_uInt16 for loop variable is
// mandatory to workaround a problem with the
// Solaris Intel compiler optimizer! See i104354
@@ -793,7 +793,7 @@ RTLFUNC(Array)
pArray->Put( pNew, &index );
}
- // Array zurueckliefern
+ // return array
SbxVariableRef refVar = rPar.Get(0);
sal_uInt16 nFlags = refVar->GetFlags();
refVar->ResetFlag( SBX_FIXED );
@@ -803,13 +803,13 @@ RTLFUNC(Array)
}
-// Featurewunsch #57868
-// Die Funktion liefert ein Variant-Array, wenn keine Parameter angegeben
-// werden, wird ein leeres Array erzeugt (entsprechend dim a(), entspricht
-// einer Sequence der Laenge 0 in Uno).
-// Wenn Parameter angegeben sind, wird fuer jeden eine Dimension erzeugt
-// DimArray( 2, 2, 4 ) entspricht DIM a( 2, 2, 4 )
-// Das Array ist immer vom Typ Variant
+// Featurewish #57868
+// The function returns a variant-array; if there are no parameters passed,
+// an empty array is created (according to dim a(); equal to a sequence of
+// the length 0 in Uno).
+// If there are parameters passed, there's a dimension created for each of
+// them; DimArray( 2, 2, 4 ) is equal to DIM a( 2, 2, 4 )
+// the array is always of the type variant
RTLFUNC(DimArray)
{
(void)pBasic;
@@ -833,7 +833,6 @@ RTLFUNC(DimArray)
else
pArray->unoAddDim( 0, -1 );
- // Array zurueckliefern
SbxVariableRef refVar = rPar.Get(0);
sal_uInt16 nFlags = refVar->GetFlags();
refVar->ResetFlag( SBX_FIXED );
@@ -843,14 +842,14 @@ RTLFUNC(DimArray)
}
/*
- * FindObject und FindPropertyObject ermoeglichen es,
- * Objekte und Properties vom Typ Objekt zur Laufzeit
- * ueber ihren Namen als String-Parameter anzusprechen.
+ * FindObject and FindPropertyObject make it possible to
+ * address objects and properties of the type Object with
+ * their name as string-pararmeters at the runtime.
*
- * Bsp.:
+ * Example:
* MyObj.Prop1.Bla = 5
*
- * entspricht:
+ * is equal to:
* dim ObjVar as Object
* dim ObjProp as Object
* ObjName$ = "MyObj"
@@ -859,56 +858,49 @@ RTLFUNC(DimArray)
* ObjProp = FindPropertyObject( ObjVar, PropName$ )
* ObjProp.Bla = 5
*
- * Dabei koennen die Namen zur Laufzeit dynamisch
- * erzeugt werden und, so dass z.B. ueber Controls
- * "TextEdit1" bis "TextEdit5" in einem Dialog in
- * einer Schleife iteriert werden kann.
+ * The names can be created dynamically at the runtime
+ * so that e. g. via controls "TextEdit1" to "TextEdit5"
+ * can be iterated in a dialog in a loop.
*/
-// Objekt ueber den Namen ansprechen
-// 1. Parameter = Name des Objekts als String
+
+// 1st parameter = the object's name as string
RTLFUNC(FindObject)
{
(void)pBasic;
(void)bWrite;
- // Wir brauchen einen Parameter
if ( rPar.Count() < 2 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- // 1. Parameter ist der Name
String aNameStr = rPar.Get(1)->GetString();
- // Basic-Suchfunktion benutzen
SbxBase* pFind = StarBASIC::FindSBXInCurrentScope( aNameStr );
SbxObject* pFindObj = NULL;
if( pFind )
pFindObj = PTR_CAST(SbxObject,pFind);
- // Objekt zurueckliefern
SbxVariableRef refVar = rPar.Get(0);
refVar->PutObject( pFindObj );
}
-// Objekt-Property in einem Objekt ansprechen
-// 1. Parameter = Objekt
-// 2. Parameter = Name der Property als String
+// address object-property in an object
+// 1st parameter = object
+// 2nd parameter = the property's name as string
RTLFUNC(FindPropertyObject)
{
(void)pBasic;
(void)bWrite;
- // Wir brauchen 2 Parameter
if ( rPar.Count() < 3 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- // 1. Parameter holen, muss Objekt sein
SbxBase* pObjVar = (SbxObject*)rPar.Get(1)->GetObject();
SbxObject* pObj = NULL;
if( pObjVar )
@@ -919,21 +911,18 @@ RTLFUNC(FindPropertyObject)
pObj = PTR_CAST(SbxObject,pObjVarObj);
}
- // 2. Parameter ist der Name
String aNameStr = rPar.Get(2)->GetString();
- // Jetzt muss ein Objekt da sein, sonst Error
SbxObject* pFindObj = NULL;
if( pObj )
{
- // Im Objekt nach Objekt suchen
SbxVariable* pFindVar = pObj->Find( aNameStr, SbxCLASS_OBJECT );
pFindObj = PTR_CAST(SbxObject,pFindVar);
}
else
StarBASIC::Error( SbERR_BAD_PARAMETER );
- // Objekt zurueckliefern
+
SbxVariableRef refVar = rPar.Get(0);
refVar->PutObject( pFindObj );
}
@@ -1008,7 +997,7 @@ sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm,
}
else
{
- // ohne Laengenangabe! ohne Endekennung!
+ // without any length information! without end-identifier!
// What does that mean for Unicode?! Choosing conversion to ByteString...
ByteString aByteStr( rStr, gsl_getSystemTextEncoding() );
*pStrm << (const char*)aByteStr.GetBuffer();
@@ -1166,7 +1155,6 @@ sal_Bool lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm,
void PutGet( SbxArray& rPar, sal_Bool bPut )
{
- // Wir brauchen 3 Parameter
if ( rPar.Count() != 4 )
{
StarBASIC::Error( SbERR_BAD_ARGUMENT );
@@ -1182,10 +1170,10 @@ void PutGet( SbxArray& rPar, sal_Bool bPut )
StarBASIC::Error( SbERR_BAD_ARGUMENT );
return;
}
- nRecordNo--; // wir moegen's ab 0!
+ nRecordNo--;
SbiIoSystem* pIO = pINST->GetIoSystem();
SbiStream* pSbStrm = pIO->GetStream( nFileNo );
- // das File muss Random (feste Record-Laenge) oder Binary sein
+
if ( !pSbStrm || !(pSbStrm->GetMode() & (SBSTRM_BINARY | SBSTRM_RANDOM)) )
{
StarBASIC::Error( SbERR_BAD_CHANNEL );
@@ -1198,11 +1186,9 @@ void PutGet( SbxArray& rPar, sal_Bool bPut )
if( bPut )
{
- // Datei aufplustern, falls jemand uebers Dateiende hinaus geseekt hat
pSbStrm->ExpandFile();
}
- // auf die Startposition seeken
if( bHasRecordNo )
{
sal_uIntPtr nFilePos = bRandom ? (sal_uIntPtr)(nBlockLen*nRecordNo) : (sal_uIntPtr)nRecordNo;
@@ -1267,7 +1253,7 @@ RTLFUNC(Environ)
return;
}
String aResult;
- // sollte ANSI sein, aber unter Win16 in DLL nicht moeglich
+ // should be ANSI but that's not possible under Win16 in the DLL
ByteString aByteStr( rPar.Get(1)->GetString(), gsl_getSystemTextEncoding() );
const char* pEnvStr = getenv( aByteStr.GetBuffer() );
if ( pEnvStr )
@@ -1461,8 +1447,7 @@ RTLFUNC(TypeLen)
}
-// Uno-Struct eines beliebigen Typs erzeugen
-// 1. Parameter == Klassename, weitere Parameter zur Initialisierung
+// 1st parameter == class name, other parameters for initialisation
RTLFUNC(CreateUnoStruct)
{
(void)pBasic;
@@ -1471,8 +1456,8 @@ RTLFUNC(CreateUnoStruct)
RTL_Impl_CreateUnoStruct( pBasic, rPar, bWrite );
}
-// Uno-Service erzeugen
-// 1. Parameter == Service-Name
+
+// 1st parameter == service-name
RTLFUNC(CreateUnoService)
{
(void)pBasic;
@@ -1499,7 +1484,7 @@ RTLFUNC(CreateUnoValue)
}
-// ServiceManager liefern (keine Parameter)
+// no parameters
RTLFUNC(GetProcessServiceManager)
{
(void)pBasic;
@@ -1508,8 +1493,8 @@ RTLFUNC(GetProcessServiceManager)
RTL_Impl_GetProcessServiceManager( pBasic, rPar, bWrite );
}
-// PropertySet erzeugen
-// 1. Parameter == Sequence<PropertyValue>
+
+// 1st parameter == Sequence<PropertyValue>
RTLFUNC(CreatePropertySet)
{
(void)pBasic;
@@ -1518,8 +1503,8 @@ RTLFUNC(CreatePropertySet)
RTL_Impl_CreatePropertySet( pBasic, rPar, bWrite );
}
-// Abfragen, ob ein Interface unterstuetzt wird
-// Mehrere Interface-Namen als Parameter
+
+// multiple interface-names as parameters
RTLFUNC(HasUnoInterfaces)
{
(void)pBasic;
@@ -1528,7 +1513,7 @@ RTLFUNC(HasUnoInterfaces)
RTL_Impl_HasInterfaces( pBasic, rPar, bWrite );
}
-// Abfragen, ob ein Basic-Objekt ein Uno-Struct repraesentiert
+
RTLFUNC(IsUnoStruct)
{
(void)pBasic;
@@ -1537,7 +1522,7 @@ RTLFUNC(IsUnoStruct)
RTL_Impl_IsUnoStruct( pBasic, rPar, bWrite );
}
-// Abfragen, ob zwei Uno-Objekte identisch sind
+
RTLFUNC(EqualUnoObjects)
{
(void)pBasic;
@@ -1737,7 +1722,7 @@ RTLFUNC(Split)
SbxDimArray* pArray = new SbxDimArray( SbxVARIANT );
pArray->unoAddDim( 0, nArraySize-1 );
- // Parameter ins Array uebernehmen
+ // insert parameter(s) into the array
for( short i = 0 ; i < nArraySize ; i++ )
{
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
@@ -1745,7 +1730,7 @@ RTLFUNC(Split)
pArray->Put( (SbxVariable*)xVar, &i );
}
- // Array zurueckliefern
+ // return array
SbxVariableRef refVar = rPar.Get(0);
sal_uInt16 nFlags = refVar->GetFlags();
refVar->ResetFlag( SBX_FIXED );
@@ -1863,9 +1848,9 @@ sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 n
if ( aDay != SUNDAY )
nDay = (sal_Int16)aDay + 2;
else
- nDay = 1; // 1==Sonntag
+ nDay = 1; // 1 == Sunday
- // #117253 Optional 2. parameter "firstdayofweek"
+ // #117253 optional 2nd parameter "firstdayofweek"
if( bFirstDayParam )
{
if( nFirstDay < 0 || nFirstDay > 7 )
diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx
index 1c6723904e08..5610e20f420e 100644
--- a/basic/source/runtime/props.cxx
+++ b/basic/source/runtime/props.cxx
@@ -36,9 +36,9 @@
#include "basegfx/numeric/ftools.hxx"
-// Properties und Methoden legen beim Get (bWrite = sal_False) den Returnwert
-// im Element 0 des Argv ab; beim Put (bWrite = sal_True) wird der Wert aus
-// Element 0 gespeichert.
+// Properties and methods lay the return value down at Get (bWrite = sal_False)
+// at the element 0 of the Argv; at Put (bWrite = sal_True) the value from
+// element 0 is stored.
RTLFUNC(Erl)
{
@@ -99,7 +99,7 @@ RTLFUNC(Null)
(void)pBasic;
(void)bWrite;
- // liefert eine leere Objekt-Variable.
+ // returns an empty object-variable
rPar.Get( 0 )->PutNull();
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index b7bcfe38057d..af18d7129ce5 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -87,7 +87,7 @@ struct SbiArgvStack { // Argv stack:
short nArgc; // Argc
};
-SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // Alle Opcodes ohne Operanden
+SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // all opcodes without operands
&SbiRuntime::StepNOP,
&SbiRuntime::StepEXP,
&SbiRuntime::StepMUL,
@@ -113,41 +113,41 @@ SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // Alle Opcodes ohne Operanden
&SbiRuntime::StepLIKE,
&SbiRuntime::StepIS,
- // Laden/speichern
- &SbiRuntime::StepARGC, // neuen Argv einrichten
- &SbiRuntime::StepARGV, // TOS ==> aktueller Argv
+ // load/save
+ &SbiRuntime::StepARGC, // establish new Argv
+ &SbiRuntime::StepARGV, // TOS ==> current Argv
&SbiRuntime::StepINPUT, // Input ==> TOS
&SbiRuntime::StepLINPUT, // Line Input ==> TOS
- &SbiRuntime::StepGET, // TOS anfassen
- &SbiRuntime::StepSET, // Speichern Objekt TOS ==> TOS-1
+ &SbiRuntime::StepGET, // touch TOS
+ &SbiRuntime::StepSET, // save object TOS ==> TOS-1
&SbiRuntime::StepPUT, // TOS ==> TOS-1
- &SbiRuntime::StepPUTC, // TOS ==> TOS-1, dann ReadOnly
+ &SbiRuntime::StepPUTC, // TOS ==> TOS-1, then ReadOnly
&SbiRuntime::StepDIM, // DIM
&SbiRuntime::StepREDIM, // REDIM
&SbiRuntime::StepREDIMP, // REDIM PRESERVE
- &SbiRuntime::StepERASE, // TOS loeschen
- // Verzweigen
- &SbiRuntime::StepSTOP, // Programmende
- &SbiRuntime::StepINITFOR, // FOR-Variable initialisieren
- &SbiRuntime::StepNEXT, // FOR-Variable inkrementieren
- &SbiRuntime::StepCASE, // Anfang CASE
- &SbiRuntime::StepENDCASE, // Ende CASE
- &SbiRuntime::StepSTDERROR, // Standard-Fehlerbehandlung
- &SbiRuntime::StepNOERROR, // keine Fehlerbehandlung
- &SbiRuntime::StepLEAVE, // UP verlassen
+ &SbiRuntime::StepERASE, // delete TOS
+ // branch
+ &SbiRuntime::StepSTOP, // program end
+ &SbiRuntime::StepINITFOR, // intitialize FOR-Variable
+ &SbiRuntime::StepNEXT, // increment FOR-Variable
+ &SbiRuntime::StepCASE, // beginning CASE
+ &SbiRuntime::StepENDCASE, // end CASE
+ &SbiRuntime::StepSTDERROR, // standard error handling
+ &SbiRuntime::StepNOERROR, // no error handling
+ &SbiRuntime::StepLEAVE, // leave UP
// E/A
- &SbiRuntime::StepCHANNEL, // TOS = Kanalnummer
+ &SbiRuntime::StepCHANNEL, // TOS = channel number
&SbiRuntime::StepPRINT, // print TOS
&SbiRuntime::StepPRINTF, // print TOS in field
&SbiRuntime::StepWRITE, // write TOS
&SbiRuntime::StepRENAME, // Rename Tos+1 to Tos
- &SbiRuntime::StepPROMPT, // Input Prompt aus TOS definieren
+ &SbiRuntime::StepPROMPT, // define Input Prompt from TOS
&SbiRuntime::StepRESTART, // Set restart point
- &SbiRuntime::StepCHANNEL0, // E/A-Kanal 0 einstellen
- &SbiRuntime::StepEMPTY, // Leeren Ausdruck auf Stack
- &SbiRuntime::StepERROR, // TOS = Fehlercode
- &SbiRuntime::StepLSET, // Speichern Objekt TOS ==> TOS-1
- &SbiRuntime::StepRSET, // Speichern Objekt TOS ==> TOS-1
+ &SbiRuntime::StepCHANNEL0, // set E/A-channel 0
+ &SbiRuntime::StepEMPTY, // empty expression on stack
+ &SbiRuntime::StepERROR, // TOS = error code
+ &SbiRuntime::StepLSET, // save object TOS ==> TOS-1
+ &SbiRuntime::StepRSET, // save object TOS ==> TOS-1
&SbiRuntime::StepREDIMP_ERASE,// Copy array object for REDIMP
&SbiRuntime::StepINITFOREACH,// Init for each loop
&SbiRuntime::StepVBASET,// vba-like set statement
@@ -156,60 +156,60 @@ SbiRuntime::pStep0 SbiRuntime::aStep0[] = { // Alle Opcodes ohne Operanden
&SbiRuntime::StepBYVAL, // access TOS as array
};
-SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // Alle Opcodes mit einem Operanden
- &SbiRuntime::StepLOADNC, // Laden einer numerischen Konstanten (+ID)
- &SbiRuntime::StepLOADSC, // Laden einer Stringkonstanten (+ID)
+SbiRuntime::pStep1 SbiRuntime::aStep1[] = { // all opcodes with one operand
+ &SbiRuntime::StepLOADNC, // loading a numeric constant (+ID)
+ &SbiRuntime::StepLOADSC, // loading a string constant (+ID)
&SbiRuntime::StepLOADI, // Immediate Load (+Wert)
- &SbiRuntime::StepARGN, // Speichern eines named Args in Argv (+StringID)
- &SbiRuntime::StepPAD, // String auf feste Laenge bringen (+Laenge)
- // Verzweigungen
- &SbiRuntime::StepJUMP, // Sprung (+Target)
- &SbiRuntime::StepJUMPT, // TOS auswerten), bedingter Sprung (+Target)
- &SbiRuntime::StepJUMPF, // TOS auswerten), bedingter Sprung (+Target)
- &SbiRuntime::StepONJUMP, // TOS auswerten), Sprung in JUMP-Tabelle (+MaxVal)
- &SbiRuntime::StepGOSUB, // UP-Aufruf (+Target)
- &SbiRuntime::StepRETURN, // UP-Return (+0 oder Target)
- &SbiRuntime::StepTESTFOR, // FOR-Variable testen), inkrementieren (+Endlabel)
+ &SbiRuntime::StepARGN, // save a named Args in Argv (+StringID)
+ &SbiRuntime::StepPAD, // bring string to a definite length (+length)
+ // branches
+ &SbiRuntime::StepJUMP, // jump (+Target)
+ &SbiRuntime::StepJUMPT, // evaluate TOS, conditional jump (+Target)
+ &SbiRuntime::StepJUMPF, // evaluate TOS, conditional jump (+Target)
+ &SbiRuntime::StepONJUMP, // evaluate TOS, jump into JUMP-table (+MaxVal)
+ &SbiRuntime::StepGOSUB, // UP-call (+Target)
+ &SbiRuntime::StepRETURN, // UP-return (+0 or Target)
+ &SbiRuntime::StepTESTFOR, // check FOR-variable, increment (+Endlabel)
&SbiRuntime::StepCASETO, // Tos+1 <= Case <= Tos), 2xremove (+Target)
- &SbiRuntime::StepERRHDL, // Fehler-Handler (+Offset)
- &SbiRuntime::StepRESUME, // Resume nach Fehlern (+0 or 1 or Label)
+ &SbiRuntime::StepERRHDL, // error handler (+Offset)
+ &SbiRuntime::StepRESUME, // resume after errors (+0 or 1 or Label)
// E/A
- &SbiRuntime::StepCLOSE, // (+Kanal/0)
+ &SbiRuntime::StepCLOSE, // (+channel/0)
&SbiRuntime::StepPRCHAR, // (+char)
- // Verwaltung
- &SbiRuntime::StepSETCLASS, // Set + Klassennamen testen (+StringId)
+ // management
+ &SbiRuntime::StepSETCLASS, // check set + class names (+StringId)
&SbiRuntime::StepTESTCLASS, // Check TOS class (+StringId)
- &SbiRuntime::StepLIB, // Lib fuer Declare-Call (+StringId)
- &SbiRuntime::StepBASED, // TOS wird um BASE erhoeht, BASE davor gepusht
- &SbiRuntime::StepARGTYP, // Letzten Parameter in Argv konvertieren (+Typ)
+ &SbiRuntime::StepLIB, // lib for declare-call (+StringId)
+ &SbiRuntime::StepBASED, // TOS is incremented by BASE, BASE is pushed before
+ &SbiRuntime::StepARGTYP, // convert last parameter in Argv (+Type)
&SbiRuntime::StepVBASETCLASS,// vba-like set statement
};
-SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// Alle Opcodes mit zwei Operanden
- &SbiRuntime::StepRTL, // Laden aus RTL (+StringID+Typ)
- &SbiRuntime::StepFIND, // Laden (+StringID+Typ)
- &SbiRuntime::StepELEM, // Laden Element (+StringID+Typ)
+SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// all opcodes with two operands
+ &SbiRuntime::StepRTL, // load from RTL (+StringID+Typ)
+ &SbiRuntime::StepFIND, // load (+StringID+Typ)
+ &SbiRuntime::StepELEM, // load element (+StringID+Typ)
&SbiRuntime::StepPARAM, // Parameter (+Offset+Typ)
// Verzweigen
&SbiRuntime::StepCALL, // Declare-Call (+StringID+Typ)
&SbiRuntime::StepCALLC, // CDecl-Declare-Call (+StringID+Typ)
&SbiRuntime::StepCASEIS, // Case-Test (+Test-Opcode+False-Target)
// Verwaltung
- &SbiRuntime::StepSTMNT, // Beginn eines Statements (+Line+Col)
+ &SbiRuntime::StepSTMNT, // beginning of a statement (+Line+Col)
// E/A
&SbiRuntime::StepOPEN, // (+SvStreamFlags+Flags)
// Objekte
- &SbiRuntime::StepLOCAL, // Lokale Variable definieren (+StringId+Typ)
- &SbiRuntime::StepPUBLIC, // Modulglobale Variable (+StringID+Typ)
- &SbiRuntime::StepGLOBAL, // Globale Variable definieren (+StringID+Typ)
- &SbiRuntime::StepCREATE, // Objekt kreieren (+StringId+StringId)
- &SbiRuntime::StepSTATIC, // Statische Variable (+StringId+StringId)
- &SbiRuntime::StepTCREATE, // User Defined Objekte (+StringId+StringId)
- &SbiRuntime::StepDCREATE, // Objekt-Array kreieren (+StringID+StringID)
- &SbiRuntime::StepGLOBAL_P, // Globale Variable definieren, die beim Neustart
- // von Basic nicht ueberschrieben wird (+StringID+Typ)
- &SbiRuntime::StepFIND_G, // Sucht globale Variable mit Spezialbehandlung wegen _GLOBAL_P
- &SbiRuntime::StepDCREATE_REDIMP, // Objekt-Array redimensionieren (+StringID+StringID)
+ &SbiRuntime::StepLOCAL, // define local variable (+StringId+Typ)
+ &SbiRuntime::StepPUBLIC, // module global variable (+StringID+Typ)
+ &SbiRuntime::StepGLOBAL, // define global variable (+StringID+Typ)
+ &SbiRuntime::StepCREATE, // create object (+StringId+StringId)
+ &SbiRuntime::StepSTATIC, // static variable (+StringId+StringId)
+ &SbiRuntime::StepTCREATE, // user-defined objects (+StringId+StringId)
+ &SbiRuntime::StepDCREATE, // create object-array (+StringID+StringID)
+ &SbiRuntime::StepGLOBAL_P, // define global variable which is not overwritten
+ // by the Basic on a restart (+StringID+Typ)
+ &SbiRuntime::StepFIND_G, // finds global variable with special treatment because of _GLOBAL_P
+ &SbiRuntime::StepDCREATE_REDIMP, // redimension object array (+StringID+StringID)
&SbiRuntime::StepFIND_CM, // Search inside a class module (CM) to enable global search in time
&SbiRuntime::StepPUBLIC_P, // Search inside a class module (CM) to enable global search in time
&SbiRuntime::StepFIND_STATIC, // Search inside a class module (CM) to enable global search in time
@@ -235,39 +235,38 @@ SbiRTLData::~SbiRTLData()
// SbiInstance //
-// 16.10.96: #31460 Neues Konzept fuer StepInto/Over/Out
-// Die Entscheidung, ob StepPoint aufgerufen werden soll, wird anhand des
-// CallLevels getroffen. Angehalten wird, wenn der aktuelle CallLevel <=
-// nBreakCallLvl ist. Der aktuelle CallLevel kann niemals kleiner als 1
-// sein, da er beim Aufruf einer Methode (auch main) inkrementiert wird.
-// Daher bedeutet ein BreakCallLvl von 0, dass das Programm gar nicht
-// angehalten wird.
-// (siehe auch step2.cxx, SbiRuntime::StepSTMNT() )
+// 16.10.96: #31460 new concept for StepInto/Over/Out
+// The decision whether StepPoint shall be called is done with the help of
+// the CallLevel. It's stopped when the current CallLevel is <= nBreakCallLvl.
+// The current CallLevel can never be smaller than 1, as it's also incremented
+// during the call of a method (also main). Therefore a BreakCallLvl from 0
+// means that the program isn't stopped at all.
+// (also have a look at: step2.cxx, SbiRuntime::StepSTMNT() )
+
-// Hilfsfunktion, um den BreakCallLevel gemaess der der Debug-Flags zu ermitteln
void SbiInstance::CalcBreakCallLevel( sal_uInt16 nFlags )
{
- // Break-Flag wegfiltern
+
nFlags &= ~((sal_uInt16)SbDEBUG_BREAK);
sal_uInt16 nRet;
switch( nFlags )
{
case SbDEBUG_STEPINTO:
- nRet = nCallLvl + 1; // CallLevel+1 wird auch angehalten
+ nRet = nCallLvl + 1; // CallLevel+1 is also stopped
break;
case SbDEBUG_STEPOVER | SbDEBUG_STEPINTO:
- nRet = nCallLvl; // Aktueller CallLevel wird angehalten
+ nRet = nCallLvl; // current CallLevel is stopped
break;
case SbDEBUG_STEPOUT:
- nRet = nCallLvl - 1; // Kleinerer CallLevel wird angehalten
+ nRet = nCallLvl - 1; // smaller CallLevel is stopped
break;
case SbDEBUG_CONTINUE:
- // Basic-IDE liefert 0 statt SbDEBUG_CONTINUE, also auch default=continue
+ // Basic-IDE returns 0 instead of SbDEBUG_CONTINUE, so also default=continue
default:
- nRet = 0; // CallLevel ist immer >0 -> kein StepPoint
+ nRet = 0; // CallLevel is always > 0 -> no StepPoint
}
- nBreakCallLvl = nRet; // Ergebnis uebernehmen
+ nBreakCallLvl = nRet; // take result
}
SbiInstance::SbiInstance( StarBASIC* p )
@@ -328,7 +327,7 @@ SbiDllMgr* SbiInstance::GetDllMgr()
return pDllMgr;
}
-// #39629 NumberFormatter jetzt ueber statische Methode anlegen
+// #39629 create NumberFormatter with the help of a static method now
SvNumberFormatter* SbiInstance::GetNumberFormatter()
{
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
@@ -351,7 +350,7 @@ SvNumberFormatter* SbiInstance::GetNumberFormatter()
return pNumberFormatter;
}
-// #39629 NumberFormatter auch statisch anbieten
+// #39629 offer NumberFormatter static too
void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx,
LanguageType* peFormatterLangType, DateFormat* peFormatterDateFormat )
@@ -379,13 +378,13 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
xub_StrLen nCheckPos = 0; short nType;
rnStdTimeIdx = rpNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eLangType );
- // Standard-Vorlagen des Formatters haben nur zweistellige
- // Jahreszahl. Deshalb eigenes Format registrieren
+ // the formatter's standard templates have only got a two-digit date
+ // -> registering an own format
- // HACK, da der Numberformatter in PutandConvertEntry die Platzhalter
- // fuer Monat, Tag, Jahr nicht entsprechend der Systemeinstellung
- // austauscht. Problem: Print Year(Date) unter engl. BS
- // siehe auch svtools\source\sbx\sbxdate.cxx
+ // HACK, beause the numberformatter doesn't swap the place holders
+ // for month, day and year according to the system setting.
+ // Problem: Print Year(Date) under engl. BS
+ // also have a look at: svtools\source\sbx\sbxdate.cxx
String aDateStr;
switch( eDate )
@@ -408,7 +407,7 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
-// Engine laufenlassen. Falls Flags == SbDEBUG_CONTINUE, Flags uebernehmen
+// Let engine run. If Flags == SbDEBUG_CONTINUE, take Flags over
void SbiInstance::Stop()
{
@@ -479,13 +478,12 @@ void SbiInstance::FatalError( SbError _errCode, const String& _details )
void SbiInstance::Abort()
{
- // Basic suchen, in dem der Fehler auftrat
StarBASIC* pErrBasic = GetCurrentBasic( pBasic );
pErrBasic->RTError( nErr, aErrorMsg, pRun->nLine, pRun->nCol1, pRun->nCol2 );
pBasic->Stop();
}
-// Hilfsfunktion, um aktives Basic zu finden, kann ungleich pRTBasic sein
+// can be unequal to pRTBasic
StarBASIC* GetCurrentBasic( StarBASIC* pRTBasic )
{
StarBASIC* pCurBasic = pRTBasic;
@@ -531,7 +529,7 @@ SbxArray* SbiInstance::GetLocals( SbMethod* pMeth )
// SbiInstance //
-// Achtung: pMeth kann auch NULL sein (beim Aufruf des Init-Codes)
+// Attention: pMeth can also be NULL (on a call of the init-code)
SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart )
: rBasic( *(StarBASIC*)pm->pParent ), pInst( pINST ),
@@ -579,7 +577,7 @@ SbiRuntime::~SbiRuntime()
ClearArgvStack();
ClearForStack();
- // #74254 Items zum Sichern temporaere Referenzen freigeben
+ // #74254 free items for saving temporary references
ClearRefs();
while( pItemStoreList )
{
@@ -601,14 +599,14 @@ void SbiRuntime::SetVBAEnabled(bool bEnabled )
mpExtCaller = 0;
}
-// Aufbau der Parameterliste. Alle ByRef-Parameter werden direkt
-// uebernommen; von ByVal-Parametern werden Kopien angelegt. Falls
-// ein bestimmter Datentyp verlangt wird, wird konvertiert.
+// Construction of the parameter list. All ByRef-parameters are directly
+// taken over; copies of ByVal-parameters are created. If a particular
+// data type is requested, it is converted.
void SbiRuntime::SetParameters( SbxArray* pParams )
{
refParams = new SbxArray;
- // fuer den Returnwert
+ // for the return value
refParams->Put( pMeth, 0 );
SbxInfo* pInfo = pMeth ? pMeth->GetInfo() : NULL;
@@ -642,7 +640,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
}
SbxVariable* v = pParams->Get( i );
- // Methoden sind immer byval!
+ // methods are always byval!
sal_Bool bByVal = v->IsA( TYPE(SbxMethod) );
SbxDataType t = v->GetType();
bool bTargetTypeIsArray = false;
@@ -670,7 +668,6 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
{
if( t != SbxVARIANT && t != ( v->GetType() & 0x0FFF ) )
{
- // Array konvertieren??
if( p && (p->eType & SbxARRAY) )
Error( SbERR_CONVERSION );
else
@@ -701,13 +698,13 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
}
-// Einen P-Code ausfuehren
+// execute a P-Code
sal_Bool SbiRuntime::Step()
{
if( bRun )
{
- // Unbedingt gelegentlich die Kontrolle abgeben!
+ // in any case check casually!
if( !( ++nOps & 0xF ) && pInst->IsReschedule() )
{
sal_uInt32 nTime = osl_getGlobalTimer();
@@ -746,19 +743,19 @@ sal_Bool SbiRuntime::Step()
else
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
- // SBX-Fehler aufgetreten?
+
SbError nSbError = SbxBase::GetError();
- Error( ERRCODE_TOERROR(nSbError) ); // Warnings rausfiltern
+ Error( ERRCODE_TOERROR(nSbError) );
- // AB 13.2.1997, neues Error-Handling:
- // ACHTUNG: Hier kann nError auch dann gesetzt sein, wenn !nSbError,
- // da nError jetzt auch von anderen RT-Instanzen gesetzt werden kann
+ // from 13.2.1997, new error handling:
+ // ATTENTION: nError can be set already even if !nSbError
+ // since nError can now also be set from other RT-instances
if( nError )
SbxBase::ResetError();
- // AB,15.3.96: Fehler nur anzeigen, wenn BASIC noch aktiv
- // (insbesondere nicht nach Compiler-Fehlern zur Laufzeit)
+ // from 15.3.96: display errors only if BASIC is still active
+ // (especially not after compiler errors at the runtime)
if( nError && bRun )
{
SbError err = nError;
@@ -773,7 +770,7 @@ sal_Bool SbiRuntime::Step()
// to handle the error
bool bLetParentHandleThis = false;
- // Im Error Handler? Dann Std-Error
+ // in the error handler? so std-error
if ( !bInError )
{
bInError = sal_True;
@@ -792,15 +789,14 @@ sal_Bool SbiRuntime::Step()
}
if ( bLetParentHandleThis )
{
- // AB 13.2.1997, neues Error-Handling:
- // Uebergeordnete Error-Handler beruecksichtigen
+ // from 13.2.1997, new error handling:
+ // consider superior error handlers
- // Wir haben keinen Error-Handler -> weiter oben suchen
+ // there's no error handler -> find one farther above
SbiRuntime* pRtErrHdl = NULL;
SbiRuntime* pRt = this;
while( NULL != (pRt = pRt->pNext) )
{
- // Gibt es einen Error-Handler?
if( pRt->bError == sal_False || pRt->pError != NULL )
{
pRtErrHdl = pRt;
@@ -808,37 +804,33 @@ sal_Bool SbiRuntime::Step()
}
}
- // Error-Hdl gefunden?
+
if( pRtErrHdl )
{
- // (Neuen) Error-Stack anlegen
SbErrorStack*& rErrStack = GetSbData()->pErrStack;
if( rErrStack )
delete rErrStack;
rErrStack = new SbErrorStack();
- // Alle im Call-Stack darunter stehenden RTs manipulieren
+ // manipulate all the RTs that are below in the call-stack
pRt = this;
do
{
- // Fehler setzen
pRt->nError = err;
if( pRt != pRtErrHdl )
pRt->bRun = sal_False;
- // In Error-Stack eintragen
SbErrorStackEntry *pEntry = new SbErrorStackEntry
( pRt->pMeth, pRt->nLine, pRt->nCol1, pRt->nCol2 );
rErrStack->C40_INSERT(SbErrorStackEntry, pEntry, rErrStack->Count() );
- // Nach RT mit Error-Handler aufhoeren
if( pRt == pRtErrHdl )
break;
pRt = pRt->pNext;
}
while( pRt );
}
- // Kein Error-Hdl gefunden -> altes Vorgehen
+ // no error-hdl found -> old behaviour
else
{
pInst->Abort();
@@ -945,8 +937,8 @@ SbxArray* SbiRuntime::GetParams()
// Stacks
-// Der Expression-Stack steht fuer die laufende Auswertung von Expressions
-// zur Verfuegung.
+// The expression-stack is available for the continous evaluation
+// of expressions.
void SbiRuntime::PushVar( SbxVariable* pVar )
{
@@ -968,7 +960,7 @@ SbxVariableRef SbiRuntime::PopVar()
if ( xVar->GetName().EqualsAscii( "Cells" ) )
OSL_TRACE( "" );
#endif
- // Methods halten im 0.Parameter sich selbst, also weghauen
+ // methods hold themselves in parameter 0
if( xVar->IsA( TYPE(SbxMethod) ) )
xVar->SetParameters(0);
return xVar;
@@ -976,7 +968,7 @@ SbxVariableRef SbiRuntime::PopVar()
sal_Bool SbiRuntime::ClearExprStack()
{
- // Achtung: Clear() reicht nicht, da Methods geloescht werden muessen
+ // Attention: Clear() doesn't suffice as methods must be deleted
while ( nExprLvl )
{
PopVar();
@@ -985,8 +977,8 @@ sal_Bool SbiRuntime::ClearExprStack()
return sal_False;
}
-// Variable auf dem Expression-Stack holen, ohne sie zu entfernen
-// n zaehlt ab 0.
+// Take variable from the expression-stack without removing it
+// n counts from 0
SbxVariable* SbiRuntime::GetTOS( short n )
{
@@ -1001,7 +993,6 @@ SbxVariable* SbiRuntime::GetTOS( short n )
return refExprStk->Get( (sal_uInt16) n );
}
-// Sicherstellen, dass TOS eine temporaere Variable ist
void SbiRuntime::TOSMakeTemp()
{
@@ -1031,7 +1022,7 @@ void SbiRuntime::TOSMakeTemp()
}
}
-// Der GOSUB-Stack nimmt Returnadressen fuer GOSUBs auf
+// the GOSUB-stack collects return-addresses for GOSUBs
void SbiRuntime::PushGosub( const sal_uInt8* pc )
{
if( ++nGosubLvl > MAXRECURSION )
@@ -1057,7 +1048,6 @@ void SbiRuntime::PopGosub()
}
}
-// Entleeren des GOSUB-Stacks
void SbiRuntime::ClearGosubStack()
{
@@ -1067,7 +1057,7 @@ void SbiRuntime::ClearGosubStack()
nGosubLvl = 0;
}
-// Der Argv-Stack nimmt aktuelle Argument-Vektoren auf
+// the Argv-stack collects current argument-vectors
void SbiRuntime::PushArgv()
{
@@ -1092,7 +1082,6 @@ void SbiRuntime::PopArgv()
}
}
-// Entleeren des Argv-Stacks
void SbiRuntime::ClearArgvStack()
{
@@ -1100,8 +1089,8 @@ void SbiRuntime::ClearArgvStack()
PopArgv();
}
-// Push des For-Stacks. Der Stack hat Inkrement, Ende, Beginn und Variable.
-// Nach Aufbau des Stack-Elements ist der Stack leer.
+// Push of the for-stack. The stack has increment, end, begin and variable.
+// After the creation of the stack-element the stack's empty.
void SbiRuntime::PushFor()
{
@@ -1109,7 +1098,7 @@ void SbiRuntime::PushFor()
p->eForType = FOR_TO;
p->pNext = pForStk;
pForStk = p;
- // Der Stack ist wie folgt aufgebaut:
+
p->refInc = PopVar();
p->refEnd = PopVar();
SbxVariableRef xBgn = PopVar();
@@ -1207,7 +1196,6 @@ void SbiRuntime::PushForEach()
nForLvl++;
}
-// Poppen des FOR-Stacks
void SbiRuntime::PopFor()
{
@@ -1220,7 +1208,6 @@ void SbiRuntime::PopFor()
}
}
-// Entleeren des FOR-Stacks
void SbiRuntime::ClearForStack()
{
@@ -1246,14 +1233,14 @@ SbiForStack* SbiRuntime::FindForStackItemForCollection( class BasicCollection* p
//////////////////////////////////////////////////////////////////////////
//
-// DLL-Aufrufe
+// DLL-calls
void SbiRuntime::DllCall
- ( const String& aFuncName, // Funktionsname
- const String& aDLLName, // Name der DLL
- SbxArray* pArgs, // Parameter (ab Index 1, kann NULL sein)
- SbxDataType eResType, // Returnwert
- sal_Bool bCDecl ) // sal_True: nach C-Konventionen
+ ( const String& aFuncName,
+ const String& aDLLName,
+ SbxArray* pArgs, // parameter (from index 1, can be NULL)
+ SbxDataType eResType, // return value
+ sal_Bool bCDecl ) // sal_True: according to C-conventions
{
// No DllCall for "virtual" portal users
if( needSecurityRestrictions() )
@@ -1262,7 +1249,7 @@ void SbiRuntime::DllCall
return;
}
- // MUSS NOCH IMPLEMENTIERT WERDEN
+ // NOT YET IMPLEMENTED
SbxVariable* pRes = new SbxVariable( eResType );
SbiDllMgr* pDllMgr = pInst->GetDllMgr();
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index 53b2ae11c76b..72ec66a88351 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -36,9 +36,9 @@
#include "rtlproto.hxx"
#include "sbintern.hxx"
#include <boost/unordered_map.hpp>
-// Das nArgs-Feld eines Tabelleneintrags ist wie folgt verschluesselt:
-// Zur Zeit wird davon ausgegangen, dass Properties keine Parameter
-// benoetigen!
+// The nArgs-field of a table entry is encrypted as follows:
+// At the moment it is assumed that properties don't need any
+// parameters!
// previously _ARGSMASK was 0x007F ( e.g. up to 127 args ) however 63 should be
// enough, if not we need to increase the size of nArgs member in the Methods
@@ -52,33 +52,33 @@
#define _COMPATONLY 0x0080 // procedure is visible in vba mode only
#define _NORMONLY 0x0040 // procedure is visible in normal mode only
-#define _RWMASK 0x0F00 // Maske fuer R/W-Bits
-#define _TYPEMASK 0xF000 // Maske fuer den Typ des Eintrags
-
-#define _READ 0x0100 // kann gelesen werden
-#define _BWRITE 0x0200 // kann as Lvalue verwendet werden
-#define _LVALUE _BWRITE // kann as Lvalue verwendet werden
-#define _READWRITE 0x0300 // beides
-#define _OPT 0x0400 // Parameter ist optional
-#define _CONST 0x0800 // Property ist const
-#define _METHOD 0x3000 // Masken-Bits fuer eine Methode
-#define _PROPERTY 0x4000 // Masken-Bit fuer eine Property
-#define _OBJECT 0x8000 // Masken-Bit fuer ein Objekt
- // Kombination von oberen Bits:
-#define _FUNCTION 0x1100 // Maske fuer Function
-#define _LFUNCTION 0x1300 // Maske fuer Function, die auch als Lvalue geht
-#define _SUB 0x2100 // Maske fuer Sub
-#define _ROPROP 0x4100 // Maske Read Only-Property
-#define _WOPROP 0x4200 // Maske Write Only-Property
-#define _RWPROP 0x4300 // Maske Read/Write-Property
-#define _CPROP 0x4900 // Maske fuer Konstante
+#define _RWMASK 0x0F00 // mask for R/W-bits
+#define _TYPEMASK 0xF000 // mask for the entry's type
+
+#define _READ 0x0100 // can be read
+#define _BWRITE 0x0200 // can be used as Lvalue
+#define _LVALUE _BWRITE // can be used as Lvalue
+#define _READWRITE 0x0300 // both
+#define _OPT 0x0400 // parameter is optional
+#define _CONST 0x0800 // property is const
+#define _METHOD 0x3000
+#define _PROPERTY 0x4000
+#define _OBJECT 0x8000
+ // combination of bits above:
+#define _FUNCTION 0x1100
+#define _LFUNCTION 0x1300 // mask for function which also works as Lvalue
+#define _SUB 0x2100
+#define _ROPROP 0x4100 // mask Read Only-Property
+#define _WOPROP 0x4200 // mask Write Only-Property
+#define _RWPROP 0x4300 // mask Read/Write-Property
+#define _CPROP 0x4900 // mask for constant
struct Methods {
- const char* pName; // Name des Eintrags
- SbxDataType eType; // Datentyp
- short nArgs; // Argumente und Flags
- RtlCall pFunc; // Function Pointer
- sal_uInt16 nHash; // Hashcode
+ const char* pName;
+ SbxDataType eType;
+ short nArgs;
+ RtlCall pFunc;
+ sal_uInt16 nHash;
};
struct StringHashCode
@@ -722,11 +722,11 @@ static Methods aMethods[] = {
{ "Year", SbxINTEGER, 1 | _FUNCTION, RTLNAME(Year),0 },
{ "Date", SbxDATE, 0,NULL,0 },
-{ NULL, SbxNULL, -1,NULL,0 }}; // Tabellenende
+{ NULL, SbxNULL, -1,NULL,0 }}; // end of the table
SbiStdObject::SbiStdObject( const String& r, StarBASIC* pb ) : SbxObject( r )
{
- // Muessen wir die Hashcodes initialisieren?
+ // do we have to initialize the hashcodes?
Methods* p = aMethods;
if( !p->nHash )
while( p->nArgs != -1 )
@@ -754,21 +754,21 @@ SbiStdObject::~SbiStdObject()
delete pStdFactory;
}
-// Suche nach einem Element:
-// Hier wird linear durch die Methodentabelle gegangen, bis eine
-// passende Methode gefunden wurde. Auf Grund der Bits im nArgs-Feld
-// wird dann die passende Instanz eines SbxObjElement generiert.
-// Wenn die Methode/Property nicht gefunden wurde, nur NULL ohne
-// Fehlercode zurueckliefern, da so auch eine ganze Chain von
-// Objekten nach der Methode/Property befragt werden kann.
+// Finding an element:
+// It runs linearly through the method table here until an
+// adequate method is has been found. Because of the bits in
+// the nArgs-field the adequate instance of an SbxObjElement
+// is created then. If the method/property hasn't been found,
+// return NULL without error code, so that a whole chain of
+// objects can be asked for the method/property.
SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t )
{
- // Bereits eingetragen?
+ // entered already?
SbxVariable* pVar = SbxObject::Find( rName, t );
if( !pVar )
{
- // sonst suchen
+ // else search one
sal_uInt16 nHash_ = SbxVariable::MakeHashCode( rName );
Methods* p = aMethods;
sal_Bool bFound = sal_False;
@@ -802,7 +802,7 @@ SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t )
if( bFound )
{
- // Args-Felder isolieren:
+ // isolate Args-fields:
short nAccess = ( p->nArgs & _RWMASK ) >> 8;
short nType = ( p->nArgs & _TYPEMASK );
if( p->nArgs & _CONST )
@@ -821,12 +821,11 @@ SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t )
return pVar;
}
-// SetModified mu� bei der RTL abgklemmt werden
+// SetModified must be pinched off at the RTL
void SbiStdObject::SetModified( sal_Bool )
{
}
-// Aufruf einer Property oder Methode.
void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
const SfxHint& rHint, const TypeId& rHintType )
@@ -866,8 +865,8 @@ void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
}
}
-// Zusammenbau der Infostruktur fuer einzelne Elemente
-// Falls nIdx = 0, nix erzeugen (sind Std-Props!)
+// building the info-structure for single elements
+// if nIdx = 0, don't create anything (Std-Props!)
SbxInfo* SbiStdObject::GetInfo( short nIdx )
{
diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx
index b8759d7826ae..831b6631392c 100644
--- a/basic/source/runtime/stdobj1.cxx
+++ b/basic/source/runtime/stdobj1.cxx
@@ -148,7 +148,7 @@ SbStdPicture::~SbStdPicture()
SbxVariable* SbStdPicture::Find( const String& rName, SbxClassType t )
{
- // Bereits eingetragen?
+ // entered already?
return SbxObject::Find( rName, t );
}
@@ -258,7 +258,7 @@ SbStdFont::SbStdFont() :
p->SetFlags( SBX_READWRITE | SBX_DONTSTORE );
p->SetUserData( ATTR_IMP_SIZE );
- // Name Property selbst verarbeiten
+ // handle name property yourself
p = Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY );
DBG_ASSERT( p, "Keine Name Property" );
p->SetUserData( ATTR_IMP_NAME );
@@ -271,7 +271,6 @@ SbStdFont::~SbStdFont()
SbxVariable* SbStdFont::Find( const String& rName, SbxClassType t )
{
- // Bereits eingetragen?
return SbxObject::Find( rName, t );
}
@@ -409,12 +408,11 @@ TYPEINIT1( SbStdClipboard, SbxObject );
SbStdClipboard::SbStdClipboard() :
SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("Clipboard") ) )
{
- // Name Property selbst verarbeiten
SbxVariable* p = Find( String( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_PROPERTY );
DBG_ASSERT( p, "Keine Name Property" );
p->SetUserData( ATTR_IMP_NAME );
- //Methoden registrieren
+ // register methods
p = Make( String( RTL_CONSTASCII_USTRINGPARAM("Clear") ), SbxCLASS_METHOD, SbxEMPTY );
p->SetFlag( SBX_DONTSTORE );
p->SetUserData( METH_CLEAR );
@@ -442,7 +440,6 @@ SbStdClipboard::~SbStdClipboard()
SbxVariable* SbStdClipboard::Find( const String& rName, SbxClassType t )
{
- // Bereits eingetragen?
return SbxObject::Find( rName, t );
}
diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx
index bc3aeabf0255..3f3aca86b035 100644
--- a/basic/source/runtime/step0.cxx
+++ b/basic/source/runtime/step0.cxx
@@ -296,7 +296,7 @@ void SbiRuntime::StepLIKE()
PushVar( pRes );
}
-// TOS und TOS-1 sind beides Objektvariable und enthalten den selben Pointer
+// TOS and TOS-1 are both object variables and contain the same pointer
void SbiRuntime::StepIS()
{
@@ -325,7 +325,7 @@ void SbiRuntime::StepIS()
PushVar( pRes );
}
-// Aktualisieren des Wertes von TOS
+// update the value of TOS
void SbiRuntime::StepGET()
{
@@ -333,7 +333,7 @@ void SbiRuntime::StepGET()
p->Broadcast( SBX_HINT_DATAWANTED );
}
-// #67607 Uno-Structs kopieren
+// #67607 copy Uno-Structs
inline void checkUnoStructCopy( SbxVariableRef& refVal, SbxVariableRef& refVar )
{
SbxDataType eVarType = refVar->GetType();
@@ -359,7 +359,7 @@ inline void checkUnoStructCopy( SbxVariableRef& refVal, SbxVariableRef& refVar )
if( aAny.getValueType().getTypeClass() == TypeClass_STRUCT )
{
SbUnoObject* pNewUnoObj = new SbUnoObject( pUnoObj->GetName(), aAny );
- // #70324: ClassName uebernehmen
+ // #70324: adopt ClassName
pNewUnoObj->SetClassName( pUnoObj->GetClassName() );
refVar->PutObject( pNewUnoObj );
}
@@ -368,13 +368,13 @@ inline void checkUnoStructCopy( SbxVariableRef& refVal, SbxVariableRef& refVar )
}
-// Ablage von TOS in TOS-1
+// laying down TOS in TOS-1
void SbiRuntime::StepPUT()
{
SbxVariableRef refVal = PopVar();
SbxVariableRef refVar = PopVar();
- // Store auf die eigene Methode (innerhalb einer Function)?
+ // store on its own method (inside a function)?
sal_Bool bFlagsChanged = sal_False;
sal_uInt16 n = 0;
if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
@@ -458,14 +458,14 @@ void removeDimAsNewRecoverItem( SbxVariable* pVar )
}
-// Speichern Objektvariable
-// Nicht-Objekt-Variable fuehren zu Fehlern
+// saving object variable
+// not-object variables will cause errors
static const char pCollectionStr[] = "Collection";
void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp )
{
- // #67733 Typen mit Array-Flag sind auch ok
+ // #67733 types with array-flag are OK too
// Check var, !object is no error for sure if, only if type is fixed
SbxDataType eVarType = refVar->GetType();
@@ -487,13 +487,12 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
// if they are SbxEMPTY I guess
if ( !bHandleDefaultProp || ( bHandleDefaultProp && eValType == SbxOBJECT ) )
{
- // Auf refVal GetObject fuer Collections ausloesen
+ // activate GetOject for collections on refVal
SbxBase* pObjVarObj = refVal->GetObject();
if( pObjVarObj )
{
SbxVariableRef refObjVal = PTR_CAST(SbxObject,pObjVarObj);
- // #67733 Typen mit Array-Flag sind auch ok
if( refObjVal )
refVal = refObjVal;
else if( !(eValType & SbxARRAY) )
@@ -501,16 +500,15 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
}
}
- // #52896 Wenn Uno-Sequences bzw. allgemein Arrays einer als
- // Object deklarierten Variable zugewiesen werden, kann hier
- // refVal ungueltig sein!
+ // #52896 refVal can be invalid here, if uno-sequences - or more
+ // general arrays - are assigned to variables that are declared
+ // as an object!
if( !refVal )
{
Error( SbERR_INVALID_USAGE_OBJECT );
}
else
{
- // Store auf die eigene Methode (innerhalb einer Function)?
sal_Bool bFlagsChanged = sal_False;
sal_uInt16 n = 0;
if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
@@ -666,7 +664,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
// in this case we do not want to call checkUnoStructCopy 'cause that will
// cause an error also
if ( !bHandleDefaultProp || ( bHandleDefaultProp && ( refVar->GetType() != SbxEMPTY ) ) )
- // #67607 Uno-Structs kopieren
+ // #67607 copy Uno-Structs
checkUnoStructCopy( refVal, refVar );
if( bFlagsChanged )
refVar->SetFlags( n );
@@ -698,7 +696,6 @@ void SbiRuntime::StepLSET()
Error( SbERR_INVALID_USAGE_OBJECT );
else
{
- // Store auf die eigene Methode (innerhalb einer Function)?
sal_uInt16 n = refVar->GetFlags();
if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
refVar->SetFlag( SBX_WRITE );
@@ -733,7 +730,6 @@ void SbiRuntime::StepRSET()
Error( SbERR_INVALID_USAGE_OBJECT );
else
{
- // Store auf die eigene Methode (innerhalb einer Function)?
sal_uInt16 n = refVar->GetFlags();
if( (SbxVariable*) refVar == (SbxVariable*) pMeth )
refVar->SetFlag( SBX_WRITE );
@@ -755,7 +751,7 @@ void SbiRuntime::StepRSET()
}
}
-// Ablage von TOS in TOS-1, dann ReadOnly-Bit setzen
+// laying down TOS in TOS-1, then set ReadOnly-Bit
void SbiRuntime::StepPUTC()
{
@@ -768,7 +764,7 @@ void SbiRuntime::StepPUTC()
}
// DIM
-// TOS = Variable fuer das Array mit Dimensionsangaben als Parameter
+// TOS = variable for the array with dimension information as parameter
void SbiRuntime::StepDIM()
{
@@ -776,7 +772,7 @@ void SbiRuntime::StepDIM()
DimImpl( refVar );
}
-// #56204 DIM-Funktionalitaet in Hilfsmethode auslagern (step0.cxx)
+// #56204 swap out DIM-functionality into a help method (step0.cxx)
void SbiRuntime::DimImpl( SbxVariableRef refVar )
{
// If refDim then this DIM statement is terminating a ReDIM and
@@ -791,15 +787,15 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar )
refRedim = NULL;
}
SbxArray* pDims = refVar->GetParameters();
- // Muss eine gerade Anzahl Argumente haben
- // Man denke daran, dass Arg[0] nicht zaehlt!
+ // must have an even number of arguments
+ // have in mind that Arg[0] does not count!
if( pDims && !( pDims->Count() & 1 ) )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
else
{
SbxDataType eType = refVar->IsFixed() ? refVar->GetType() : SbxVARIANT;
SbxDimArray* pArray = new SbxDimArray( eType );
- // auch Arrays ohne Dimensionsangaben zulassen (VB-komp.)
+ // allow arrays without dimension information, too (VB-compatible)
if( pDims )
{
refVar->ResetFlag( SBX_VAR_TO_DIM );
@@ -817,8 +813,8 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar )
}
else
{
- // #62867 Beim Anlegen eines Arrays der Laenge 0 wie bei
- // Uno-Sequences der Laenge 0 eine Dimension anlegen
+ // #62867 On creating an array of the length 0, create
+ // a dimension (like for Uno-Sequences of the length 0)
pArray->unoAddDim( 0, -1 );
}
sal_uInt16 nSavFlags = refVar->GetFlags();
@@ -830,13 +826,13 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar )
}
// REDIM
-// TOS = Variable fuer das Array
-// argv = Dimensionsangaben
+// TOS = variable for the array
+// argv = dimension information
void SbiRuntime::StepREDIM()
{
- // Im Moment ist es nichts anderes als Dim, da doppeltes Dim
- // bereits vom Compiler erkannt wird.
+ // Nothing different than dim at the moment because
+ // a double dim is already recognized by the compiler.
StepDIM();
}
@@ -864,8 +860,8 @@ void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMa
}
// REDIM PRESERVE
-// TOS = Variable fuer das Array
-// argv = Dimensionsangaben
+// TOS = variable for the array
+// argv = dimension information
void SbiRuntime::StepREDIMP()
{
@@ -997,11 +993,11 @@ void lcl_eraseImpl( SbxVariableRef& refVar, bool bVBAEnabled )
}
}
else
- // Arrays haben bei Erase nach VB ein recht komplexes Verhalten. Hier
- // werden zunaechst nur die Typ-Probleme bei REDIM (#26295) beseitigt:
- // Typ hart auf den Array-Typ setzen, da eine Variable mit Array
- // SbxOBJECT ist. Bei REDIM entsteht dann ein SbxOBJECT-Array und
- // der ursruengliche Typ geht verloren -> Laufzeitfehler
+ // Arrays have on an erase to VB quite a complex behaviour. Here are
+ // only the type problems at REDIM (#26295) removed at first:
+ // Set type hard onto the array-type, because a variable with array is
+ // SbxOBJECT. At REDIM there's an SbxOBJECT-array generated then and
+ // the original type is lost -> runtime error
lcl_clearImpl( refVar, eType );
}
else
@@ -1011,8 +1007,8 @@ void lcl_eraseImpl( SbxVariableRef& refVar, bool bVBAEnabled )
refVar->SetType( SbxEMPTY );
}
-// Variable loeschen
-// TOS = Variable
+// delete variable
+// TOS = variable
void SbiRuntime::StepERASE()
{
@@ -1048,8 +1044,8 @@ void SbiRuntime::StepBYVAL()
PushVar( pCopyVar );
}
-// Einrichten eines Argvs
-// nOp1 bleibt so -> 1. Element ist Returnwert
+// establishing an argv
+// nOp1 stays as it is -> 1st element is the return value
void SbiRuntime::StepARGC()
{
@@ -1058,7 +1054,7 @@ void SbiRuntime::StepARGC()
nArgc = 1;
}
-// Speichern eines Arguments in Argv
+// storing an argument in Argv
void SbiRuntime::StepARGV()
{
@@ -1071,7 +1067,7 @@ void SbiRuntime::StepARGV()
// Before fix of #94916:
if( pVal->ISA(SbxMethod) || pVal->ISA(SbUnoProperty) || pVal->ISA(SbProcedureProperty) )
{
- // Methoden und Properties evaluieren!
+ // evaluate methods and properties!
SbxVariable* pRes = new SbxVariable( *pVal );
pVal = pRes;
}
@@ -1079,8 +1075,8 @@ void SbiRuntime::StepARGV()
}
}
-// Input to Variable. Die Variable ist auf TOS und wird
-// anschliessend entfernt.
+// Input to Variable. The variable is on TOS and is
+// is removed afterwards.
void SbiRuntime::StepINPUT()
{
@@ -1124,8 +1120,8 @@ void SbiRuntime::StepINPUT()
if( !err )
{
SbxVariableRef pVar = GetTOS();
- // Zuerst versuchen, die Variable mit einem numerischen Wert
- // zu fuellen, dann mit einem Stringwert
+ // try to fill the variable with a numeric value first,
+ // then with a string value
if( !pVar->IsFixed() || pVar->IsNumeric() )
{
sal_uInt16 nLen = 0;
@@ -1134,7 +1130,7 @@ void SbiRuntime::StepINPUT()
err = SbxBase::GetError();
SbxBase::ResetError();
}
- // Der Wert muss komplett eingescant werden
+ // the value has to be scanned in completely
else if( nLen != s.Len() && !pVar->PutString( s ) )
{
err = SbxBase::GetError();
@@ -1176,8 +1172,8 @@ void SbiRuntime::StepINPUT()
}
}
-// Line Input to Variable. Die Variable ist auf TOS und wird
-// anschliessend entfernt.
+// Line Input to Variable. The variable is on TOS and is
+// deleted afterwards.
void SbiRuntime::StepLINPUT()
{
@@ -1188,14 +1184,13 @@ void SbiRuntime::StepLINPUT()
p->PutString( String( aInput, gsl_getSystemTextEncoding() ) );
}
-// Programmende
+// end of program
void SbiRuntime::StepSTOP()
{
pInst->Stop();
}
-// FOR-Variable initialisieren
void SbiRuntime::StepINITFOR()
{
@@ -1207,7 +1202,7 @@ void SbiRuntime::StepINITFOREACH()
PushForEach();
}
-// FOR-Variable inkrementieren
+// increment FOR-variable
void SbiRuntime::StepNEXT()
{
@@ -1220,7 +1215,7 @@ void SbiRuntime::StepNEXT()
pForStk->refVar->Compute( SbxPLUS, *pForStk->refInc );
}
-// Anfang CASE: TOS in CASE-Stack
+// beginning CASE: TOS in CASE-stack
void SbiRuntime::StepCASE()
{
@@ -1230,7 +1225,7 @@ void SbiRuntime::StepCASE()
refCaseStk->Put( xVar, refCaseStk->Count() );
}
-// Ende CASE: Variable freigeben
+// end CASE: free variable
void SbiRuntime::StepENDCASE()
{
@@ -1240,7 +1235,6 @@ void SbiRuntime::StepENDCASE()
refCaseStk->Remove( refCaseStk->Count() - 1 );
}
-// Standard-Fehlerbehandlung
void SbiRuntime::StepSTDERROR()
{
@@ -1262,7 +1256,7 @@ void SbiRuntime::StepNOERROR()
bError = sal_False;
}
-// UP verlassen
+// leave UP
void SbiRuntime::StepLEAVE()
{
@@ -1272,7 +1266,7 @@ void SbiRuntime::StepLEAVE()
SbxErrObject::getUnoErrObject()->Clear();
}
-void SbiRuntime::StepCHANNEL() // TOS = Kanalnummer
+void SbiRuntime::StepCHANNEL() // TOS = channel number
{
SbxVariableRef pChan = PopVar();
short nChan = pChan->GetInteger();
@@ -1291,7 +1285,7 @@ void SbiRuntime::StepPRINT() // print TOS
String s1 = p->GetString();
String s;
if( p->GetType() >= SbxINTEGER && p->GetType() <= SbxDOUBLE )
- s = ' '; // ein Blank davor
+ s = ' '; // one blank before
s += s1;
ByteString aByteStr( s, gsl_getSystemTextEncoding() );
pIosys->Write( aByteStr );
@@ -1304,7 +1298,7 @@ void SbiRuntime::StepPRINTF() // print TOS in field
String s1 = p->GetString();
String s;
if( p->GetType() >= SbxINTEGER && p->GetType() <= SbxDOUBLE )
- s = ' '; // ein Blank davor
+ s = ' ';
s += s1;
s.Expand( 14, ' ' );
ByteString aByteStr( s, gsl_getSystemTextEncoding() );
@@ -1315,7 +1309,7 @@ void SbiRuntime::StepPRINTF() // print TOS in field
void SbiRuntime::StepWRITE() // write TOS
{
SbxVariableRef p = PopVar();
- // Muss der String gekapselt werden?
+ // Does the string have to be encapsulated?
char ch = 0;
switch (p->GetType() )
{
@@ -1369,20 +1363,20 @@ void SbiRuntime::StepRESTART()
pRestart = pCode;
}
-// Leerer Ausdruck auf Stack fuer fehlenden Parameter
+// empty expression on stack for missing parameter
void SbiRuntime::StepEMPTY()
{
- // #57915 Die Semantik von StepEMPTY() ist die Repraesentation eines fehlenden
- // Arguments. Dies wird in VB durch ein durch den Wert 448 (SbERR_NAMED_NOT_FOUND)
- // vom Typ Error repraesentiert. StepEmpty jetzt muesste besser StepMISSING()
- // heissen, aber der Name wird der Einfachkeit halber beibehalten.
+ // #57915 The semantics of StepEMPTY() is the representation of a missing argument.
+ // This is represented by the value 448 (SbERR_NAMED_NOT_FOUND) of the type error
+ // in VB. StepEmpty should now rather be named StepMISSING() but the name is kept
+ // to simplify matters.
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
xVar->PutErr( 448 );
PushVar( xVar );
}
-// TOS = Fehlercode
+// TOS = error code
void SbiRuntime::StepERROR()
{
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index 74d698974631..7dbf23e2d319 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -41,15 +41,15 @@
bool checkUnoObjectType( SbUnoObject* refVal, const ::rtl::OUString& aClass );
-// Laden einer numerischen Konstanten (+ID)
+// loading a numeric constant (+ID)
void SbiRuntime::StepLOADNC( sal_uInt32 nOp1 )
{
SbxVariable* p = new SbxVariable( SbxDOUBLE );
- // #57844 Lokalisierte Funktion benutzen
+ // #57844 use localized function
String aStr = pImg->GetString( static_cast<short>( nOp1 ) );
- // Auch , zulassen !!!
+ // also allow , !!!
sal_uInt16 iComma = aStr.Search( ',' );
if( iComma != STRING_NOTFOUND )
{
@@ -65,7 +65,7 @@ void SbiRuntime::StepLOADNC( sal_uInt32 nOp1 )
PushVar( p );
}
-// Laden einer Stringkonstanten (+ID)
+// loading a string constant (+ID)
void SbiRuntime::StepLOADSC( sal_uInt32 nOp1 )
{
@@ -83,7 +83,7 @@ void SbiRuntime::StepLOADI( sal_uInt32 nOp1 )
PushVar( p );
}
-// Speichern eines named Arguments in Argv (+Arg-Nr ab 1!)
+// stora a named argument in Argv (+Arg-no. from 1!)
void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
{
@@ -98,7 +98,7 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
// named variables ( that are Any especially properties ) can be empty at this point and need a broadcast
if ( pVal->GetType() == SbxEMPTY )
pVal->Broadcast( SBX_HINT_DATAWANTED );
- // Methoden und Properties evaluieren!
+ // evaluate methods and properties!
SbxVariable* pRes = new SbxVariable( *pVal );
pVal = pRes;
}
@@ -107,7 +107,7 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
}
}
-// Konvertierung des Typs eines Arguments in Argv fuer DECLARE-Fkt. (+Typ)
+// converting the type of an argument in Argv for DECLARE-Fkt. (+type)
void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 )
{
@@ -115,44 +115,44 @@ void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
else
{
- sal_Bool bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL verlangt?
+ sal_Bool bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL requested?
SbxDataType t = (SbxDataType) (nOp1 & 0x7FFF);
- SbxVariable* pVar = refArgv->Get( refArgv->Count() - 1 ); // letztes Arg
+ SbxVariable* pVar = refArgv->Get( refArgv->Count() - 1 ); // last Arg
- // BYVAL pr�fen
- if( pVar->GetRefCount() > 2 ) // 2 ist normal f�r BYVAL
+ // check BYVAL
+ if( pVar->GetRefCount() > 2 ) // 2 is normal for BYVAL
{
- // Parameter ist eine Referenz
+ // parameter is a reference
if( bByVal )
{
- // Call by Value ist verlangt -> Kopie anlegen
+ // Call by Value is requested -> create a copy
pVar = new SbxVariable( *pVar );
pVar->SetFlag( SBX_READWRITE );
refExprStk->Put( pVar, refArgv->Count() - 1 );
}
else
- pVar->SetFlag( SBX_REFERENCE ); // Ref-Flag f�r DllMgr
+ pVar->SetFlag( SBX_REFERENCE ); // Ref-Flag for DllMgr
}
else
{
- // Parameter ist KEINE Referenz
+ // parameter is NO reference
if( bByVal )
- pVar->ResetFlag( SBX_REFERENCE ); // Keine Referenz -> OK
+ pVar->ResetFlag( SBX_REFERENCE ); // no reference -> OK
else
- Error( SbERR_BAD_PARAMETERS ); // Referenz verlangt
+ Error( SbERR_BAD_PARAMETERS ); // reference needed
}
if( pVar->GetType() != t )
{
- // Variant, damit richtige Konvertierung
- // Ausserdem Fehler, wenn SbxBYREF
+ // variant for correct conversion
+ // besides error, if SbxBYREF
pVar->Convert( SbxVARIANT );
pVar->Convert( t );
}
}
}
-// String auf feste Laenge bringen (+Laenge)
+// bring string to a definite length (+length)
void SbiRuntime::StepPAD( sal_uInt32 nOp1 )
{
@@ -164,7 +164,7 @@ void SbiRuntime::StepPAD( sal_uInt32 nOp1 )
s.Expand( static_cast<xub_StrLen>( nOp1 ), ' ' );
}
-// Sprung (+Target)
+// jump (+target)
void SbiRuntime::StepJUMP( sal_uInt32 nOp1 )
{
@@ -177,7 +177,7 @@ void SbiRuntime::StepJUMP( sal_uInt32 nOp1 )
pCode = (const sal_uInt8*) pImg->GetCode() + nOp1;
}
-// TOS auswerten, bedingter Sprung (+Target)
+// evaluate TOS, conditional jump (+target)
void SbiRuntime::StepJUMPT( sal_uInt32 nOp1 )
{
@@ -186,7 +186,7 @@ void SbiRuntime::StepJUMPT( sal_uInt32 nOp1 )
StepJUMP( nOp1 );
}
-// TOS auswerten, bedingter Sprung (+Target)
+// evaluate TOS, conditional jump (+target)
void SbiRuntime::StepJUMPF( sal_uInt32 nOp1 )
{
@@ -197,13 +197,13 @@ void SbiRuntime::StepJUMPF( sal_uInt32 nOp1 )
StepJUMP( nOp1 );
}
-// TOS auswerten, Sprung in JUMP-Tabelle (+MaxVal)
-// Sieht so aus:
+// evaluate TOS, jump into JUMP-table (+MaxVal)
+// looks like this:
// ONJUMP 2
// JUMP target1
// JUMP target2
// ...
-//Falls im Operanden 0x8000 gesetzt ist, Returnadresse pushen (ON..GOSUB)
+// if 0x8000 is set in the operand, push the return address (ON..GOSUB)
void SbiRuntime::StepONJUMP( sal_uInt32 nOp1 )
{
@@ -220,7 +220,7 @@ void SbiRuntime::StepONJUMP( sal_uInt32 nOp1 )
StepJUMP( nOp1 );
}
-// UP-Aufruf (+Target)
+// UP-call (+target)
void SbiRuntime::StepGOSUB( sal_uInt32 nOp1 )
{
@@ -230,7 +230,7 @@ void SbiRuntime::StepGOSUB( sal_uInt32 nOp1 )
pCode = (const sal_uInt8*) pImg->GetCode() + nOp1;
}
-// UP-Return (+0 oder Target)
+// UP-return (+0 or target)
void SbiRuntime::StepRETURN( sal_uInt32 nOp1 )
{
@@ -239,7 +239,7 @@ void SbiRuntime::StepRETURN( sal_uInt32 nOp1 )
StepJUMP( nOp1 );
}
-// FOR-Variable testen (+Endlabel)
+// check FOR-variable (+Endlabel)
void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 )
{
@@ -357,7 +357,6 @@ void SbiRuntime::StepCASETO( sal_uInt32 nOp1 )
}
}
-// Fehler-Handler
void SbiRuntime::StepERRHDL( sal_uInt32 nOp1 )
{
@@ -372,11 +371,11 @@ void SbiRuntime::StepERRHDL( sal_uInt32 nOp1 )
SbxErrObject::getUnoErrObject()->Clear();
}
-// Resume nach Fehlern (+0=statement, 1=next or Label)
+// Resume after errors (+0=statement, 1=next or Label)
void SbiRuntime::StepRESUME( sal_uInt32 nOp1 )
{
- // #32714 Resume ohne Error? -> Fehler
+ // #32714 Resume without error? -> error
if( !bInError )
{
Error( SbERR_BAD_RESUME );
@@ -384,7 +383,7 @@ void SbiRuntime::StepRESUME( sal_uInt32 nOp1 )
}
if( nOp1 )
{
- // Code-Zeiger auf naechstes Statement setzen
+ // set Code-pointer to the next statement
sal_uInt16 n1, n2;
pCode = pMod->FindNextStmnt( pErrCode, n1, n2, sal_True, pImg );
}
@@ -401,13 +400,13 @@ void SbiRuntime::StepRESUME( sal_uInt32 nOp1 )
nError = 0;
bInError = sal_False;
- // Error-Stack loeschen
+
SbErrorStack*& rErrStack = GetSbData()->pErrStack;
delete rErrStack;
rErrStack = NULL;
}
-// Kanal schliessen (+Kanal, 0=Alle)
+// close channel (+channel, 0=all)
void SbiRuntime::StepCLOSE( sal_uInt32 nOp1 )
{
SbError err;
@@ -425,7 +424,7 @@ void SbiRuntime::StepCLOSE( sal_uInt32 nOp1 )
Error( err );
}
-// Zeichen ausgeben (+char)
+// output character (+char)
void SbiRuntime::StepPRCHAR( sal_uInt32 nOp1 )
{
@@ -434,7 +433,7 @@ void SbiRuntime::StepPRCHAR( sal_uInt32 nOp1 )
Error( pIosys->GetError() );
}
-// Check, ob TOS eine bestimmte Objektklasse ist (+StringID)
+// check whether TOS is a certain object class (+StringID)
bool SbiRuntime::implIsClass( SbxObject* pObj, const ::rtl::OUString& aClass )
{
@@ -551,16 +550,16 @@ void SbiRuntime::StepTESTCLASS( sal_uInt32 nOp1 )
PushVar( pRet );
}
-// Library fuer anschliessenden Declare-Call definieren
+// define library for following declare-call
void SbiRuntime::StepLIB( sal_uInt32 nOp1 )
{
aLibName = pImg->GetString( static_cast<short>( nOp1 ) );
}
-// TOS wird um BASE erhoeht, BASE davor gepusht (+BASE)
-// Dieser Opcode wird vor DIM/REDIM-Anweisungen gepusht,
-// wenn nur ein Index angegeben wurde.
+// TOS is incremented by BASE, BASE is pushed before (+BASE)
+// This opcode is pushed before DIM/REDIM-commands,
+// if there's been only one index named.
void SbiRuntime::StepBASED( sal_uInt32 nOp1 )
{
@@ -573,8 +572,8 @@ void SbiRuntime::StepBASED( sal_uInt32 nOp1 )
p1->PutInteger( uBase );
if( !bCompatible )
x2->Compute( SbxPLUS, *p1 );
- PushVar( x2 ); // erst die Expr
- PushVar( p1 ); // dann die Base
+ PushVar( x2 ); // first the Expr
+ PushVar( p1 ); // then the Base
}
diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx
index 89c369a95adf..3220ae97a433 100644
--- a/basic/source/runtime/step2.cxx
+++ b/basic/source/runtime/step2.cxx
@@ -52,9 +52,9 @@ using com::sun::star::uno::Reference;
SbxVariable* getVBAConstant( const String& rName );
-// Suchen eines Elements
-// Die Bits im String-ID:
-// 0x8000 - Argv ist belegt
+
+// the bits in the String-ID:
+// 0x8000 - Argv is reserved
SbxVariable* SbiRuntime::FindElement
( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError nNotFound, sal_Bool bLocal, sal_Bool bStatic )
@@ -106,7 +106,6 @@ SbxVariable* SbiRuntime::FindElement
}
if( !pElem )
{
- // Die RTL brauchen wir nicht mehr zu durchsuchen!
sal_Bool bSave = rBasic.bNoRtl;
rBasic.bNoRtl = sal_True;
pElem = pObj->Find( aName, SbxCLASS_DONTCARE );
@@ -125,7 +124,7 @@ SbxVariable* SbiRuntime::FindElement
}
rBasic.bNoRtl = bSave;
- // Ist es ein globaler Uno-Bezeichner?
+ // is it a global uno-identifier?
if( bLocal && !pElem )
{
bool bSetName = true; // preserve normal behaviour
@@ -144,8 +143,8 @@ SbxVariable* SbiRuntime::FindElement
if( !pElem )
{
- // #72382 VORSICHT! Liefert jetzt wegen unbekannten
- // Modulen IMMER ein Ergebnis!
+ // #72382 ATTENTION! ALWAYS returns a result now
+ // because of unknown modules!
SbUnoClass* pUnoClass = findUnoClass( aName );
if( pUnoClass )
{
@@ -156,18 +155,18 @@ SbxVariable* SbiRuntime::FindElement
}
}
- // #62939 Wenn eine Uno-Klasse gefunden wurde, muss
- // das Wrapper-Objekt gehalten werden, da sonst auch
- // die Uno-Klasse, z.B. "stardiv" immer wieder neu
- // aus der Registry gelesen werden muss
+ // #62939 If an uno-class has been found, the wrapper
+ // object has to be held, because the uno-class, e. g.
+ // "stardiv", has to be read out of the registry
+ // every time again otherwise
if( pElem )
{
- // #63774 Darf nicht mit gespeichert werden!!!
+ // #63774 May not be saved too!!!
pElem->SetFlag( SBX_DONTSTORE );
pElem->SetFlag( SBX_NO_MODIFY);
- // #72382 Lokal speichern, sonst werden alle implizit
- // deklarierten Vars automatisch global !
+ // #72382 save locally, all variables that have been declared
+ // implicit would become global automatically otherwise!
if ( bSetName )
pElem->SetName( aName );
refLocals->Put( pElem, refLocals->Count() );
@@ -176,32 +175,30 @@ SbxVariable* SbiRuntime::FindElement
if( !pElem )
{
- // Nicht da und nicht im Objekt?
- // Hat das Ding Parameter, nicht einrichten!
+ // not there and not in the object?
+ // don't establish if that thing has parameters!
if( nOp1 & 0x8000 )
bFatalError = sal_True;
- // Sonst, falls keine Parameter sind, anderen Error Code verwenden
+ // else, if there are parameters, use different error code
if( !bLocal || pImg->GetFlag( SBIMG_EXPLICIT ) )
{
- // #39108 Bei explizit und als ELEM immer ein Fatal Error
+ // #39108 if explicit and as ELEM always a fatal error
bFatalError = sal_True;
- // Falls keine Parameter sind, anderen Error Code verwenden
+
if( !( nOp1 & 0x8000 ) && nNotFound == SbERR_PROC_UNDEFINED )
nNotFound = SbERR_VAR_UNDEFINED;
}
if( bFatalError )
{
- // #39108 Statt FatalError zu setzen, Dummy-Variable liefern
+ // #39108 use dummy variable instead of fatal error
if( !xDummyVar.Is() )
xDummyVar = new SbxVariable( SbxVARIANT );
pElem = xDummyVar;
- // Parameter von Hand loeschen
ClearArgvStack();
- // Normalen Error setzen
Error( nNotFound, aName );
}
else
@@ -210,7 +207,6 @@ SbxVariable* SbiRuntime::FindElement
pElem = StepSTATIC_Impl( aName, t );
if ( !pElem )
{
- // Sonst Variable neu anlegen
pElem = new SbxVariable( t );
if( t != SbxVARIANT )
pElem->SetFlag( SBX_FIXED );
@@ -220,15 +216,14 @@ SbxVariable* SbiRuntime::FindElement
}
}
}
- // #39108 Args koennen schon geloescht sein!
+ // #39108 Args can already be deleted!
if( !bFatalError )
SetupArgs( pElem, nOp1 );
- // Ein bestimmter Call-Type wurde gewuenscht, daher muessen
- // wir hier den Typ setzen und das Ding anfassen, um den
- // korrekten Returnwert zu erhalten!
+
+ // because a particular call-type is requested
if( pElem->IsA( TYPE(SbxMethod) ) )
{
- // Soll der Typ konvertiert werden?
+ // shall the type be converted?
SbxDataType t2 = pElem->GetType();
sal_Bool bSet = sal_False;
if( !( pElem->GetFlags() & SBX_FIXED ) )
@@ -237,75 +232,70 @@ SbxVariable* SbiRuntime::FindElement
t >= SbxINTEGER && t <= SbxSTRING )
pElem->SetType( t ), bSet = sal_True;
}
- // pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen
+ // assign pElem to a Ref, to delete a temp-var if applicable
SbxVariableRef refTemp = pElem;
- // Moegliche Reste vom letzten Aufruf der SbxMethod beseitigen
- // Vorher Schreiben freigeben, damit kein Error gesetzt wird.
+ // remove potential rests of the last call of the SbxMethod
+ // free Write before, so that there's no error
sal_uInt16 nSavFlags = pElem->GetFlags();
pElem->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST );
pElem->SbxValue::Clear();
pElem->SetFlags( nSavFlags );
- // Erst nach dem Setzen anfassen, da z.B. LEFT()
- // den Unterschied zwischen Left$() und Left() kennen muss
+ // don't touch before setting, as e. g. LEFT()
+ // has to know the difference between Left$() and Left()
- // Da in PopVar() die Parameter von Methoden weggehauen
- // werden, muessen wir hier explizit eine neue SbxMethod anlegen
- SbxVariable* pNew = new SbxMethod( *((SbxMethod*)pElem) ); // das ist der Call!
- //ALT: SbxVariable* pNew = new SbxVariable( *pElem ); // das ist der Call!
+ // because the methods' parameters are cut away in PopVar()
+ SbxVariable* pNew = new SbxMethod( *((SbxMethod*)pElem) );
+ //OLD: SbxVariable* pNew = new SbxVariable( *pElem );
- pElem->SetParameters(0); // sonst bleibt Ref auf sich selbst
+ pElem->SetParameters(0);
pNew->SetFlag( SBX_READWRITE );
- // den Datentypen zuruecksetzen?
if( bSet )
pElem->SetType( t2 );
pElem = pNew;
}
- // Index-Access bei UnoObjekten beruecksichtigen
+ // consider index-access for UnoObjects
// definitely we want this for VBA where properties are often
// collections ( which need index access ), but lets only do
// this if we actually have params following
else if( bVBAEnabled && pElem->ISA(SbUnoProperty) && pElem->GetParameters() )
{
- // pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen
SbxVariableRef refTemp = pElem;
- // Variable kopieren und dabei den Notify aufloesen
- SbxVariable* pNew = new SbxVariable( *((SbxVariable*)pElem) ); // das ist der Call!
- pElem->SetParameters( NULL ); // sonst bleibt Ref auf sich selbst
+ // dissolve the notify while copying variable
+ SbxVariable* pNew = new SbxVariable( *((SbxVariable*)pElem) );
+ pElem->SetParameters( NULL );
pElem = pNew;
}
}
return CheckArray( pElem );
}
-// Find-Funktion ueber Name fuer aktuellen Scope (z.B. Abfrage aus BASIC-IDE)
+// for current scope (e. g. query from BASIC-IDE)
SbxBase* SbiRuntime::FindElementExtern( const String& rName )
{
- // Hinweis zu: Es darf nicht davon ausgegangen werden, dass
- // pMeth != null, da im RunInit noch keine gesetzt ist.
+ // don't expect pMeth to be != 0, as there are none set
+ // in the RunInit yet
SbxVariable* pElem = NULL;
if( !pMod || !rName.Len() )
return NULL;
- // Lokal suchen
if( refLocals )
pElem = refLocals->Find( rName, SbxCLASS_DONTCARE );
- // In Statics suchen
if ( !pElem && pMeth )
{
- // Bei Statics, Name der Methode davor setzen
+ // for statics, set the method's name in front
String aMethName = pMeth->GetName();
aMethName += ':';
aMethName += rName;
pElem = pMod->Find(aMethName, SbxCLASS_DONTCARE);
}
- // In Parameter-Liste suchen
+ // search in parameter list
if( !pElem && pMeth )
{
SbxInfo* pInfo = pMeth->GetInfo();
@@ -335,10 +325,9 @@ SbxBase* SbiRuntime::FindElementExtern( const String& rName )
}
}
- // Im Modul suchen
+ // search in module
if( !pElem )
{
- // RTL nicht durchsuchen!
sal_Bool bSave = rBasic.bNoRtl;
rBasic.bNoRtl = sal_True;
pElem = pMod->Find( rName, SbxCLASS_DONTCARE );
@@ -348,9 +337,6 @@ SbxBase* SbiRuntime::FindElementExtern( const String& rName )
}
-// Argumente eines Elements setzen
-// Dabei auch die Argumente umsetzen, falls benannte Parameter
-// verwendet wurden
void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
{
@@ -370,9 +356,6 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
}
if( bHasNamed )
{
- // Wir haben mindestens einen benannten Parameter!
- // Wir muessen also umsortieren
- // Gibt es Parameter-Infos?
SbxInfo* pInfo = p->GetInfo();
if( !pInfo )
{
@@ -449,7 +432,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
const String& rName = refArgv->GetAlias( i );
if( rName.Len() )
{
- // nCurPar wird auf den gefundenen Parameter gesetzt
+ // nCurPar is set to the found parameter
sal_uInt16 j = 1;
const SbxParamInfo* pParam = pInfo->GetParam( j );
while( pParam )
@@ -471,7 +454,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
refArgv = pArg;
}
}
- // Eigene Var als Parameter 0
+ // own var as parameter 0
refArgv->Put( p, 0 );
p->SetParameters( refArgv );
PopArgv();
@@ -480,11 +463,10 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
p->SetParameters( NULL );
}
-// Holen eines Array-Elements
+// getting an array element
SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
{
- // Falls wir ein Array haben, wollen wir bitte das Array-Element!
SbxArray* pPar;
if( ( pElem->GetType() & SbxARRAY ) && (SbxVariable*)refRedim != pElem )
{
@@ -493,8 +475,8 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
pPar = pElem->GetParameters();
if( pDimArray )
{
- // Die Parameter koennen fehlen, wenn ein Array als
- // Argument uebergeben wird.
+ // parameters may be missing, if an array is
+ // passed as an argument
if( pPar )
pElem = pDimArray->Get( pPar );
}
@@ -513,17 +495,17 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
}
- // #42940, 0.Parameter zu NULL setzen, damit sich Var nicht selbst haelt
+ // #42940, set parameter 0 to NULL so that var doesn't contain itself
if( pPar )
pPar->Put( NULL, 0 );
}
- // Index-Access bei UnoObjekten beruecksichtigen
+ // consider index-access for UnoObjects
else if( pElem->GetType() == SbxOBJECT && !pElem->ISA(SbxMethod) && ( !bVBAEnabled || ( bVBAEnabled && !pElem->ISA(SbxProperty) ) ) )
{
pPar = pElem->GetParameters();
if ( pPar )
{
- // Ist es ein Uno-Objekt?
+ // is it an uno-object?
SbxBaseRef pObj = (SbxBase*)pElem->GetObject();
if( pObj )
{
@@ -538,7 +520,6 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
Reference< XIndexAccess > xIndexAccess( x, UNO_QUERY );
if ( !bVBAEnabled )
{
- // Haben wir Index-Access?
if( xIndexAccess.is() )
{
sal_uInt32 nParamCount = (sal_uInt32)pPar->Count() - 1;
@@ -548,7 +529,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
return pElem;
}
- // Index holen
+ // get index
sal_Int32 nIndex = pPar->Get( 1 )->GetLong();
Reference< XInterface > xRet;
try
@@ -560,18 +541,18 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
catch (const IndexOutOfBoundsException&)
{
- // Bei Exception erstmal immer von Konvertierungs-Problem ausgehen
+ // usually expect converting problem
StarBASIC::Error( SbERR_OUT_OF_RANGE );
}
- // #57847 Immer neue Variable anlegen, sonst Fehler
- // durch PutObject(NULL) bei ReadOnly-Properties.
+ // #57847 always create a new variable, else error
+ // due to PutObject(NULL) at ReadOnly-properties
pElem = new SbxVariable( SbxVARIANT );
if( xRet.is() )
{
aAny <<= xRet;
- // #67173 Kein Namen angeben, damit echter Klassen-Namen eintragen wird
+ // #67173 don't specify a name so that the real class name is entered
String aName;
SbxObjectRef xWrapper = (SbxObject*)new SbUnoObject( aName, aAny );
pElem->PutObject( xWrapper );
@@ -607,7 +588,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
}
- // #42940, 0.Parameter zu NULL setzen, damit sich Var nicht selbst haelt
+ // #42940, set parameter 0 to NULL so that var doesn't contain itself
pPar->Put( NULL, 0 );
}
else if( pObj->ISA(BasicCollection) )
@@ -630,7 +611,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
return pElem;
}
-// Laden eines Elements aus der Runtime-Library (+StringID+Typ)
+// loading an element from the runtime-library (+StringID+type)
void SbiRuntime::StepRTL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -644,7 +625,7 @@ SbiRuntime::StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, Sb
refLocals = new SbxArray;
PushVar( FindElement( pObj, nOp1, nOp2, nNotFound, bLocal, bStatic ) );
}
-// Laden einer lokalen/globalen Variablen (+StringID+Typ)
+// loading a local/global variable (+StringID+type)
void SbiRuntime::StepFIND( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -670,12 +651,11 @@ void SbiRuntime::StepFIND_STATIC( sal_uInt32 nOp1, sal_uInt32 nOp2 )
StepFIND_Impl( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, sal_True, sal_True );
}
-// Laden eines Objekt-Elements (+StringID+Typ)
-// Das Objekt liegt auf TOS
+// loading an object-element (+StringID+type)
+// the object lies on TOS
void SbiRuntime::StepELEM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
- // Liegt auf dem TOS ein Objekt?
SbxVariableRef pObjVar = PopVar();
SbxObject* pObj = PTR_CAST(SbxObject,(SbxVariable*) pObjVar);
@@ -685,20 +665,20 @@ void SbiRuntime::StepELEM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
pObj = PTR_CAST(SbxObject,pObjVarObj);
}
- // #56368 Bei StepElem Referenz sichern, sonst koennen Objekte
- // in Qualifizierungsketten wie ActiveComponent.Selection(0).Text
- // zu fueh die Referenz verlieren
- // #74254 Jetzt per Liste
+ // #56368 save reference at StepElem, otherwise objects could
+ // lose their reference too early in qualification chains like
+ // ActiveComponent.Selection(0).Text
+ // #74254 now per list
if( pObj )
SaveRef( (SbxVariable*)pObj );
PushVar( FindElement( pObj, nOp1, nOp2, SbERR_NO_METHOD, sal_False ) );
}
-// Laden eines Parameters (+Offset+Typ)
-// Wenn der Datentyp nicht stimmen sollte, eine Kopie anlegen
-// Der Datentyp SbxEMPTY zeigt an, daa kein Parameter angegeben ist.
-// Get( 0 ) darf EMPTY sein
+// loading a parameter (+offset+type)
+// If the data type is wrong, create a copy.
+// The data type SbxEMPTY shows that no parameters are given.
+// Get( 0 ) may be EMPTY
void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -706,7 +686,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
SbxDataType t = (SbxDataType) nOp2;
SbxVariable* p;
- // #57915 Missing sauberer loesen
+ // #57915 solve missing in a cleaner way
sal_uInt16 nParamCount = refParams->Count();
if( i >= nParamCount )
{
@@ -724,7 +704,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
p->PutString( String() );
}
else
- p->PutErr( 448 ); // Wie in VB: Error-Code 448 (SbERR_NAMED_NOT_FOUND)
+ p->PutErr( 448 ); // like in VB: Error-Code 448 (SbERR_NAMED_NOT_FOUND)
refParams->Put( p, iLoop );
iLoop--;
@@ -734,7 +714,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
if( p->GetType() == SbxERROR && ( i ) )
{
- // Wenn ein Parameter fehlt, kann er OPTIONAL sein
+ // if there's a parameter missing, it can be OPTIONAL
sal_Bool bOpt = sal_False;
if( pMeth )
{
@@ -789,8 +769,8 @@ void SbiRuntime::StepCASEIS( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
}
-// Aufruf einer DLL-Prozedur (+StringID+Typ)
-// Auch hier zeigt das MSB des StringIDs an, dass Argv belegt ist
+// call of a DLL-procedure (+StringID+type)
+// the StringID's MSB shows that Argv is occupied
void SbiRuntime::StepCALL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -804,8 +784,7 @@ void SbiRuntime::StepCALL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
PopArgv();
}
-// Aufruf einer DLL-Prozedur nach CDecl (+StringID+Typ)
-// Auch hier zeigt das MSB des StringIDs an, dass Argv belegt ist
+// call of a DLL-procedure after CDecl (+StringID+type)
void SbiRuntime::StepCALLC( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -820,12 +799,12 @@ void SbiRuntime::StepCALLC( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
-// Beginn eines Statements (+Line+Col)
+// beginning of a statement (+Line+Col)
void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
- // Wenn der Expr-Stack am Anfang einen Statements eine Variable enthaelt,
- // hat ein Trottel X als Funktion aufgerufen, obwohl es eine Variable ist!
+ // If the Expr-Stack at the beginning of a statement constains a variable,
+ // some fool has called X as a function, although it's a variable!
sal_Bool bFatalExpr = sal_False;
String sUnknownMethodName;
if( nExprLvl > 1 )
@@ -840,13 +819,13 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
bFatalExpr = sal_True;
}
}
- // Der Expr-Stack ist nun nicht mehr notwendig
+
ClearExprStack();
ClearRefs();
- // Wir muessen hier hart abbrechen, da sonst Zeile und Spalte nicht mehr
- // stimmen!
+ // We have to cancel hard here because line and column
+ // would be wrong later otherwise!
if( bFatalExpr)
{
StarBASIC::FatalError( SbERR_NO_METHOD, sUnknownMethodName );
@@ -856,13 +835,11 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
sal_uInt16 nOld = nLine;
nLine = static_cast<short>( nOp1 );
- // #29955 & 0xFF, um for-Schleifen-Ebene wegzufiltern
+ // #29955 & 0xFF, to filter out for-loop-level
nCol1 = static_cast<short>( nOp2 & 0xFF );
- // Suchen des naechsten STMNT-Befehls,
- // um die End-Spalte dieses Statements zu setzen
- // Searches of the next STMNT instruction,
- // around the final column of this statement to set
+ // find the next STMNT-command to set the final column
+ // of this statement
nCol2 = 0xffff;
sal_uInt16 n1, n2;
@@ -871,37 +848,36 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
if( n1 == nOp1 )
{
- // #29955 & 0xFF, um for-Schleifen-Ebene wegzufiltern
+ // #29955 & 0xFF, to filter out for-loop-level
nCol2 = (n2 & 0xFF) - 1;
}
}
- // #29955 for-Schleifen-Ebene korrigieren, #67452 NICHT im Error-Handler sonst Chaos
+ // #29955 correct for-loop-level, #67452 NOT in the error-handler
if( !bInError )
{
- // (Bei Spr�ngen aus Schleifen tritt hier eine Differenz auf)
+ // (there's a difference here in case of a jump out of a loop)
sal_uInt16 nExspectedForLevel = static_cast<sal_uInt16>( nOp2 / 0x100 );
if( pGosubStk )
nExspectedForLevel = nExspectedForLevel + pGosubStk->nStartForLvl;
- // Wenn der tatsaechliche For-Level zu klein ist, wurde aus
- // einer Schleife heraus gesprungen -> korrigieren
+ // if the actual for-level is too small it'd jump out
+ // of a loop -> corrected
while( nForLvl > nExspectedForLevel )
PopFor();
}
- // 16.10.96: #31460 Neues Konzept fuer StepInto/Over/Out
- // Erkl�rung siehe bei _ImplGetBreakCallLevel.
+ // 16.10.96: #31460 new concept for StepInto/Over/Out
+ // see explanation at _ImplGetBreakCallLevel
if( pInst->nCallLvl <= pInst->nBreakCallLvl )
{
StarBASIC* pStepBasic = GetCurrentBasic( &rBasic );
sal_uInt16 nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 );
- // Neuen BreakCallLevel ermitteln
pInst->CalcBreakCallLevel( nNewFlags );
}
- // Breakpoints nur bei STMNT-Befehlen in neuer Zeile!
+ // break points only at STMNT-commands in a new line!
else if( ( nOp1 != nOld )
&& ( nFlags & SbDEBUG_BREAK )
&& pMod->IsBP( static_cast<sal_uInt16>( nOp1 ) ) )
@@ -909,15 +885,14 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
StarBASIC* pBreakBasic = GetCurrentBasic( &rBasic );
sal_uInt16 nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 );
- // Neuen BreakCallLevel ermitteln
pInst->CalcBreakCallLevel( nNewFlags );
}
}
// (+SvStreamFlags+Flags)
-// Stack: Blocklaenge
-// Kanalnummer
-// Dateiname
+// Stack: block length
+// channel number
+// file name
void SbiRuntime::StepOPEN( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -932,7 +907,7 @@ void SbiRuntime::StepOPEN( sal_uInt32 nOp1, sal_uInt32 nOp2 )
Error( pIosys->GetError() );
}
-// Objekt kreieren (+StringID+StringID)
+// create object (+StringID+StringID)
void SbiRuntime::StepCREATE( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -944,7 +919,7 @@ void SbiRuntime::StepCREATE( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );
pObj->SetName( aName );
- // Das Objekt muss BASIC rufen koennen
+ // the object must be able to call the BASIC
pObj->SetParent( &rBasic );
SbxVariable* pNew = new SbxVariable;
pNew->PutObject( pObj );
@@ -983,14 +958,14 @@ void implCopyDimArray_DCREATE( SbxDimArray* pNewArray, SbxDimArray* pOldArray, s
}
}
-// #56204 Objekt-Array kreieren (+StringID+StringID), DCREATE == Dim-Create
+// #56204 create object array (+StringID+StringID), DCREATE == Dim-Create
void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
SbxVariableRef refVar = PopVar();
DimImpl( refVar );
- // Das Array mit Instanzen der geforderten Klasse fuellen
+ // fill the array with instances of the requested class
SbxBaseRef xObj = (SbxBase*)refVar->GetObject();
if( !xObj )
{
@@ -1004,11 +979,10 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
SbxBase* pObj = (SbxBase*)xObj;
pArray = (SbxDimArray*)pObj;
- // Dimensionen auswerten
short nDims = pArray->GetDims();
sal_Int32 nTotalSize = 0;
- // es muss ein eindimensionales Array sein
+ // must be a one-dimensional array
sal_Int32 nLower, nUpper, nSize;
sal_Int32 i;
for( i = 0 ; i < nDims ; i++ )
@@ -1021,7 +995,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
nTotalSize *= nSize;
}
- // Objekte anlegen und ins Array eintragen
+ // create objects and insert them into the array
String aClass( pImg->GetString( static_cast<short>( nOp2 ) ) );
for( i = 0 ; i < nTotalSize ; i++ )
{
@@ -1035,7 +1009,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );
pClassObj->SetName( aName );
- // Das Objekt muss BASIC rufen koennen
+ // the object must be able to call the basic
pClassObj->SetParent( &rBasic );
pArray->SbxArray::Put32( pClassObj, i );
}
@@ -1095,7 +1069,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
}
-// Objekt aus User-Type kreieren (+StringID+StringID)
+// create object from user-type (+StringID+StringID)
SbxObject* createUserTypeImpl( const String& rClassName ); // sb.cxx
@@ -1137,7 +1111,7 @@ void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, sal_uInt3
pVar->SetFlag( SBX_VAR_TO_DIM );
}
-// Einrichten einer lokalen Variablen (+StringID+Typ)
+// establishing a local variable (+StringID+type)
void SbiRuntime::StepLOCAL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -1154,7 +1128,7 @@ void SbiRuntime::StepLOCAL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
}
-// Einrichten einer modulglobalen Variablen (+StringID+Typ)
+// establishing a module-global variable (+StringID+type)
void SbiRuntime::StepPUBLIC_Impl( sal_uInt32 nOp1, sal_uInt32 nOp2, bool bUsedForClassModule )
{
@@ -1173,7 +1147,7 @@ void SbiRuntime::StepPUBLIC_Impl( sal_uInt32 nOp1, sal_uInt32 nOp2, bool bUsedFo
if( pProp )
{
pProp->SetFlag( SBX_DONTSTORE );
- // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden'
+ // from 2.7.1996: HACK because of 'reference can't be saved'
pProp->SetFlag( SBX_NO_MODIFY);
implHandleSbxFlags( pProp, t, nOp2 );
@@ -1196,7 +1170,7 @@ void SbiRuntime::StepPUBLIC_P( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
}
-// Einrichten einer globalen Variablen (+StringID+Typ)
+// establishing a global variable (+StringID+type)
void SbiRuntime::StepGLOBAL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
@@ -1227,7 +1201,7 @@ void SbiRuntime::StepGLOBAL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
if( p )
{
p->SetFlag( SBX_DONTSTORE );
- // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden'
+ // from 2.7.1996: HACK because of 'reference can't be saved'
p->SetFlag( SBX_NO_MODIFY);
}
}
@@ -1285,7 +1259,7 @@ SbxVariable* SbiRuntime::StepSTATIC_Impl( String& aName, SbxDataType& t )
}
return p;
}
-// Einrichten einer statischen Variablen (+StringID+Typ)
+// establishing a static variable (+StringID+type)
void SbiRuntime::StepSTATIC( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
String aName( pImg->GetString( static_cast<short>( nOp1 ) ) );