summaryrefslogtreecommitdiff
path: root/basic/source/sbx/sbxobj.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/sbx/sbxobj.cxx')
-rw-r--r--basic/source/sbx/sbxobj.cxx123
1 files changed, 61 insertions, 62 deletions
diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx
index d4681cd3574e..b7ab4479f104 100644
--- a/basic/source/sbx/sbxobj.cxx
+++ b/basic/source/sbx/sbxobj.cxx
@@ -79,11 +79,11 @@ SbxObject& SbxObject::operator=( const SbxObject& r )
pMethods = new SbxArray;
pProps = new SbxArray;
pObjs = new SbxArray( SbxOBJECT );
- // Die Arrays werden kopiert, die Inhalte uebernommen
+ // The arrays were copied, the content taken over
*pMethods = *r.pMethods;
*pProps = *r.pProps;
*pObjs = *r.pObjs;
- // Da die Variablen uebernommen wurden, ist dies OK
+ // Because the variables were taken over, this is OK
pDfltProp = r.pDfltProp;
SetName( r.GetName() );
SetFlags( r.GetFlags() );
@@ -99,7 +99,7 @@ static void CheckParentsOnDelete( SbxObject* pObj, SbxArray* p )
SbxVariableRef& rRef = p->GetRef( i );
if( rRef->IsBroadcaster() )
pObj->EndListening( rRef->GetBroadcaster(), TRUE );
- // Hat das Element mehr als eine Referenz und noch einen Listener?
+ // Did the element have more then one reference and still a Listener?
if( rRef->GetRefCount() > 1 )
{
rRef->SetParent( NULL );
@@ -189,16 +189,16 @@ SbxVariable* SbxObject::FindUserData( UINT32 nData )
pRes = pProps->FindUserData( nData );
if( !pRes )
pRes = pObjs->FindUserData( nData );
- // Search in den Parents?
+ // Search in the parents?
if( !pRes && IsSet( SBX_GBLSEARCH ) )
{
SbxObject* pCur = this;
while( !pRes && pCur->pParent )
{
- // Ich selbst bin schon durchsucht worden!
+ // I myself was already searched through!
USHORT nOwn = pCur->GetFlags();
pCur->ResetFlag( SBX_EXTSEARCH );
- // Ich suche bereits global!
+ // I search already global!
USHORT nPar = pCur->pParent->GetFlags();
pCur->pParent->ResetFlag( SBX_GBLSEARCH );
pRes = pCur->pParent->FindUserData( nData );
@@ -251,21 +251,21 @@ SbxVariable* SbxObject::Find( const XubString& rName, SbxClassType t )
if( pArray )
pRes = pArray->Find( rName, t );
}
- // Extended Search im Objekt-Array?
- // Fuer Objekte und DontCare ist das Objektarray bereits
- // durchsucht worden
+ // ExtendedsSearch in the Object-Array?
+ // For objects and DontCare is the Objektarray already
+ // searched through
if( !pRes && ( t == SbxCLASS_METHOD || t == SbxCLASS_PROPERTY ) )
pRes = pObjs->Find( rName, t );
- // Search in den Parents?
+ // Search in the parents?
if( !pRes && IsSet( SBX_GBLSEARCH ) )
{
SbxObject* pCur = this;
while( !pRes && pCur->pParent )
{
- // Ich selbst bin schon durchsucht worden!
+ // I myself was already searched through!
USHORT nOwn = pCur->GetFlags();
pCur->ResetFlag( SBX_EXTSEARCH );
- // Ich suche bereits global!
+ // I search already global!
USHORT nPar = pCur->pParent->GetFlags();
pCur->pParent->ResetFlag( SBX_GBLSEARCH );
pRes = pCur->pParent->Find( rName, t );
@@ -287,16 +287,16 @@ SbxVariable* SbxObject::Find( const XubString& rName, SbxClassType t )
return pRes;
}
-// Kurzform: Die Parent-Kette wird durchsucht
-// Das ganze rekursiv, da Call() ueberladen sein kann
-// Qualified Names sind zugelassen
+// Abbreviated version: The parent-string will be searched through
+// The whole thing recursive, because Call() might be overloaded
+// Qualified names are allowed
BOOL SbxObject::Call( const XubString& rName, SbxArray* pParam )
{
SbxVariable* pMeth = FindQualified( rName, SbxCLASS_DONTCARE);
if( pMeth && pMeth->ISA(SbxMethod) )
{
- // FindQualified() koennte schon zugeschlagen haben!
+ // FindQualified() might have been stroked!
if( pParam )
pMeth->SetParameters( pParam );
pMeth->Broadcast( SBX_HINT_DATAWANTED );
@@ -340,9 +340,9 @@ void SbxObject::SetDfltProperty( SbxProperty* p )
SetModified( TRUE );
}
-// Suchen einer bereits vorhandenen Variablen. Falls sie gefunden wurde,
-// wird der Index gesetzt, sonst wird der Count des Arrays geliefert.
-// In jedem Fall wird das korrekte Array geliefert.
+// Search of a already available variable. If she was located,
+// the index will be set, elsewise will be delivered the Count of the Array.
+// In any case it will be delivered the correct Array.
SbxArray* SbxObject::FindVar( SbxVariable* pVar, USHORT& nArrayIdx )
{
@@ -359,7 +359,7 @@ SbxArray* SbxObject::FindVar( SbxVariable* pVar, USHORT& nArrayIdx )
if( pArray )
{
nArrayIdx = pArray->Count();
- // ist die Variable per Name vorhanden?
+ // Is the variable per name available?
pArray->ResetFlag( SBX_EXTSEARCH );
SbxVariable* pOld = pArray->Find( pVar->GetName(), pVar->GetClass() );
if( pOld )
@@ -375,12 +375,12 @@ SbxArray* SbxObject::FindVar( SbxVariable* pVar, USHORT& nArrayIdx )
return pArray;
}
-// Falls ein neues Objekt eingerichtet wird, wird es, falls es bereits
-// eines mit diesem Namen gibt, indiziert.
+// If a new object will be established, this object will be indexed,
+// if an object of this name exists already.
SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataType dt )
{
- // Ist das Objekt bereits vorhanden?
+ // Is the object already available?
SbxArray* pArray = NULL;
switch( ct )
{
@@ -393,13 +393,13 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy
}
if( !pArray )
return NULL;
- // Collections duerfen gleichnamige Objekte enthalten
+ // Collections may contain objects of the same name
if( !( ct == SbxCLASS_OBJECT && ISA(SbxCollection) ) )
{
SbxVariable* pRes = pArray->Find( rName, ct );
if( pRes )
{
-/* Wegen haeufiger Probleme (z.B. #67000) erstmal ganz raus
+/* Due to often problems (e.g. #67000) first of all completly out
#ifdef DBG_UTIL
if( pRes->GetHashCode() != nNameHash
&& pRes->GetHashCode() != nParentHash )
@@ -434,7 +434,7 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy
pVar->SetParent( this );
pArray->Put( pVar, pArray->Count() );
SetModified( TRUE );
- // Das Objekt lauscht immer
+ // The object listen always
StartListening( pVar->GetBroadcaster(), TRUE );
Broadcast( SBX_HINT_OBJECTCHANGED );
return pVar;
@@ -442,13 +442,13 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy
SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClass )
{
- // Ist das Objekt bereits vorhanden?
+ // Is the object already available?
if( !ISA(SbxCollection) )
{
SbxVariable* pRes = pObjs->Find( rName, SbxCLASS_OBJECT );
if( pRes )
{
-/* Wegen haeufiger Probleme (z.B. #67000) erstmal ganz raus
+/* Due to often problems (e.g. #67000) first of all completly out
#ifdef DBG_UTIL
if( pRes->GetHashCode() != nNameHash
&& pRes->GetHashCode() != nParentHash )
@@ -472,7 +472,7 @@ SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClas
pVar->SetParent( this );
pObjs->Put( pVar, pObjs->Count() );
SetModified( TRUE );
- // Das Objekt lauscht immer
+ // The object listen always
StartListening( pVar->GetBroadcaster(), TRUE );
Broadcast( SBX_HINT_OBJECTCHANGED );
}
@@ -485,21 +485,21 @@ void SbxObject::Insert( SbxVariable* pVar )
SbxArray* pArray = FindVar( pVar, nIdx );
if( pArray )
{
- // Hinein damit. Man sollte allerdings auf die Pointer aufpassen!
+ // Into with it. But you should pay attention at the Pointer!
if( nIdx < pArray->Count() )
{
- // dann gibt es dieses Element bereits
- // Bei Collections duerfen gleichnamige Objekte hinein
+ // Then this element exists already
+ // There are objects of the same name allowed at collections
if( pArray == pObjs && ISA(SbxCollection) )
nIdx = pArray->Count();
else
{
SbxVariable* pOld = pArray->Get( nIdx );
- // schon drin: ueberschreiben
+ // already inside: overwrite
if( pOld == pVar )
return;
-/* Wegen haeufiger Probleme (z.B. #67000) erstmal ganz raus
+/* Due to often problems (e.g. #67000) first of all completly out
#ifdef DBG_UTIL
if( pOld->GetHashCode() != nNameHash
&& pOld->GetHashCode() != nParentHash )
@@ -543,8 +543,8 @@ void SbxObject::Insert( SbxVariable* pVar )
}
}
-// AB 23.4.1997, Optimierung, Einfuegen ohne Ueberpruefung auf doppelte
-// Eintraege und ohne Broadcasts, wird nur in SO2/auto.cxx genutzt
+// From 1997-04-23, Optimisation, Insertion without checking about
+// double entry and without broadcasts, will only be used in SO2/auto.cxx
void SbxObject::QuickInsert( SbxVariable* pVar )
{
SbxArray* pArray = NULL;
@@ -583,7 +583,7 @@ void SbxObject::QuickInsert( SbxVariable* pVar )
}
}
-// AB 23.3.1997, Spezial-Methode, gleichnamige Controls zulassen
+// From 1997-03-23, special method, allow controls of the same name
void SbxObject::VCPtrInsert( SbxVariable* pVar )
{
SbxArray* pArray = NULL;
@@ -641,11 +641,11 @@ void SbxObject::Remove( SbxVariable* pVar )
}
}
-// AB 23.3.1997, Loeschen per Pointer fuer Controls (doppelte Namen!)
+// From 1997-03-23, cleanup per Pointer for Controls (double names!)
void SbxObject::VCPtrRemove( SbxVariable* pVar )
{
USHORT nIdx;
- // Neu FindVar-Methode, sonst identisch mit normaler Methode
+ // New FindVar-Method, otherwise identical with the normal method
SbxArray* pArray = VCPtrFindVar( pVar, nIdx );
if( pArray && nIdx < pArray->Count() )
{
@@ -662,7 +662,7 @@ void SbxObject::VCPtrRemove( SbxVariable* pVar )
}
}
-// AB 23.3.1997, Zugehoerige Spezial-Methode, nur ueber Pointer suchen
+// From 1997-03-23, associated special method, search only by Pointer
SbxArray* SbxObject::VCPtrFindVar( SbxVariable* pVar, USHORT& nArrayIdx )
{
SbxArray* pArray = NULL;
@@ -730,19 +730,19 @@ static BOOL LoadArray( SvStream& rStrm, SbxObject* pThis, SbxArray* pArray )
return TRUE;
}
-// Der Load eines Objekts ist additiv!
+// The load of an object is additive!
BOOL SbxObject::LoadData( SvStream& rStrm, USHORT nVer )
{
- // Hilfe fuer das Einlesen alter Objekte: einfach TRUE zurueck,
- // LoadPrivateData() muss Default-Zustand herstellen
+ // Help for the read in of old objects: just TRUE back,
+ // LoadPrivateData() had to set the default status up
if( !nVer )
return TRUE;
pDfltProp = NULL;
if( !SbxVariable::LoadData( rStrm, nVer ) )
return FALSE;
- // Wenn kein fremdes Objekt enthalten ist, uns selbst eintragen
+ // If it contains no alien object, insert ourselves
if( aData.eType == SbxOBJECT && !aData.pObj )
aData.pObj = this;
sal_uInt32 nSize;
@@ -762,7 +762,7 @@ BOOL SbxObject::LoadData( SvStream& rStrm, USHORT nVer )
|| !LoadArray( rStrm, this, pProps )
|| !LoadArray( rStrm, this, pObjs ) )
return FALSE;
- // Properties setzen
+ // Set properties
if( aDfltProp.Len() )
pDfltProp = (SbxProperty*) pProps->Find( aDfltProp, SbxCLASS_PROPERTY );
SetModified( FALSE );
@@ -799,7 +799,7 @@ BOOL SbxObject::StoreData( SvStream& rStrm ) const
XubString SbxObject::GenerateSource( const XubString &rLinePrefix,
const SbxObject* )
{
- // Properties in einem String einsammeln
+ // Collect the properties in a String
XubString aSource;
SbxArrayRef xProps( GetProperties() );
bool bLineFeed = false;
@@ -811,7 +811,7 @@ XubString SbxObject::GenerateSource( const XubString &rLinePrefix,
&& !( xProp->GetHashCode() == nNameHash
&& aPropName.EqualsIgnoreCaseAscii( pNameProp ) ) )
{
- // ausser vor dem ersten Property immer einen Umbruch einfuegen
+ // Insert a break except in front of the first property
if ( bLineFeed )
aSource.AppendAscii( "\n" );
else
@@ -822,17 +822,17 @@ XubString SbxObject::GenerateSource( const XubString &rLinePrefix,
aSource += aPropName;
aSource.AppendAscii( " = " );
- // den Property-Wert textuell darstellen
+ // Display the property value textual
switch ( xProp->GetType() )
{
case SbxEMPTY:
case SbxNULL:
- // kein Wert
+ // no value
break;
case SbxSTRING:
{
- // Strings in Anf"uhrungszeichen
+ // Strings in quotation mark
aSource.AppendAscii( "\"" );
aSource += xProp->GetString();
aSource.AppendAscii( "\"" );
@@ -841,7 +841,7 @@ XubString SbxObject::GenerateSource( const XubString &rLinePrefix,
default:
{
- // sonstiges wie z.B. Zahlen direkt
+ // miscellaneous, such as e.g.numerary directly
aSource += xProp->GetString();
break;
}
@@ -890,7 +890,7 @@ static BOOL CollectAttrs( const SbxBase* p, XubString& rRes )
void SbxObject::Dump( SvStream& rStrm, BOOL bFill )
{
- // Einr"uckung
+ // Shifting
static USHORT nLevel = 0;
if ( nLevel > 10 )
{
@@ -902,11 +902,11 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill )
for ( USHORT n = 1; n < nLevel; ++n )
aIndent.AppendAscii( " " );
- // ggf. Objekt vervollst"andigen
+ // if necessary complete the object
if ( bFill )
GetAll( SbxCLASS_DONTCARE );
- // Daten des Objekts selbst ausgeben
+ // Output the data of the object itself
ByteString aNameStr( (const UniString&)GetName(), RTL_TEXTENCODING_ASCII_US );
ByteString aClassNameStr( (const UniString&)aClassName, RTL_TEXTENCODING_ASCII_US );
rStrm << "Object( "
@@ -955,7 +955,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill )
aLine.AppendAscii( " !! Not a Method !!" );
rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
- // bei Object-Methods auch das Object ausgeben
+ // Output also the object at object-methods
if ( pVar->GetValues_Impl().eType == SbxOBJECT &&
pVar->GetValues_Impl().pObj &&
pVar->GetValues_Impl().pObj != this &&
@@ -988,7 +988,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill )
aLine.AppendAscii( " !! Not a Property !!" );
rStrm.WriteByteString( aLine, RTL_TEXTENCODING_ASCII_US );
- // bei Object-Properties auch das Object ausgeben
+ // output also the object at object properties
if ( pVar->GetValues_Impl().eType == SbxOBJECT &&
pVar->GetValues_Impl().pObj &&
pVar->GetValues_Impl().pObj != this &&
@@ -1051,14 +1051,13 @@ SbxClassType SbxProperty::GetClass() const
void SbxObject::GarbageCollection( ULONG /*nObjects*/ )
-/* [Beschreibung]
+/* [Description]
- Diese statische Methode durchsucht die n"achsten 'nObjects' der zur Zeit
- existierenden <SbxObject>-Instanzen nach zyklischen Referenzen, die sich
- nur noch selbst am Leben erhalten. Ist 'nObjects==0', dann werden
- alle existierenden durchsucht.
+ This statistic method browse the next 'nObjects' of the currently existing
+ <SbxObject>-Instances for cyclic references, which keep only themselfes alive
+ If there is 'nObjects==0', then all existing will be browsed.
- zur Zeit nur implementiert: Object -> Parent-Property -> Parent -> Object
+ currently only implemented: Object -> Parent-Property -> Parent -> Object
*/
{