1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
21 #include <sal/log.hxx>
25 #include <tools/debug.hxx>
26 #include <tools/stream.hxx>
27 #include <basic/sbx.hxx>
28 #include <basic/sberrors.hxx>
29 #include <basic/sbxmeth.hxx>
30 #include <basic/sbxprop.hxx>
31 #include <svl/SfxBroadcaster.hxx>
35 static OUString pNameProp
; // Name-Property
36 static OUString pParentProp
; // Parent-Property
38 static sal_uInt16 nNameHash
= 0, nParentHash
= 0;
41 SbxObject::SbxObject( const OUString
& rClass
)
42 : SbxVariable( SbxOBJECT
), aClassName( rClass
)
47 pNameProp
= GetSbxRes( StringId::NameProp
);
48 pParentProp
= GetSbxRes( StringId::ParentProp
);
49 nNameHash
= MakeHashCode( pNameProp
);
50 nParentHash
= MakeHashCode( pParentProp
);
53 SbxObject::SetName( rClass
);
56 SbxObject::SbxObject( const SbxObject
& rObj
)
57 : SvRefBase( rObj
), SbxVariable( rObj
.GetType() ),
63 SbxObject
& SbxObject::operator=( const SbxObject
& r
)
67 SbxVariable::operator=( r
);
68 aClassName
= r
.aClassName
;
69 pMethods
= new SbxArray
;
70 pProps
= new SbxArray
;
71 pObjs
= new SbxArray( SbxOBJECT
);
72 // The arrays were copied, the content taken over
73 *pMethods
= *r
.pMethods
;
76 // Because the variables were taken over, this is OK
77 pDfltProp
= r
.pDfltProp
;
78 SetName( r
.GetName() );
79 SetFlags( r
.GetFlags() );
85 static void CheckParentsOnDelete( SbxObject
* pObj
, SbxArray
* p
)
87 for( sal_uInt16 i
= 0; i
< p
->Count(); i
++ )
89 SbxVariableRef
& rRef
= p
->GetRef( i
);
90 if( rRef
->IsBroadcaster() )
92 pObj
->EndListening( rRef
->GetBroadcaster(), true );
94 // does the element have more than one reference and still a Listener?
95 if( rRef
->GetRefCount() > 1 )
97 rRef
->SetParent( nullptr );
98 SAL_INFO_IF(rRef
->IsBroadcaster() && rRef
->GetBroadcaster().GetListenerCount(), "basic.sbx", "Object element with dangling parent");
103 SbxObject::~SbxObject()
105 CheckParentsOnDelete( this, pProps
.get() );
106 CheckParentsOnDelete( this, pMethods
.get() );
107 CheckParentsOnDelete( this, pObjs
.get() );
109 // avoid handling in ~SbxVariable as SbxFlagBits::DimAsNew == SbxFlagBits::GlobalSearch
110 ResetFlag( SbxFlagBits::DimAsNew
);
113 SbxDataType
SbxObject::GetType() const
118 SbxClassType
SbxObject::GetClass() const
120 return SbxClassType::Object
;
123 void SbxObject::Clear()
125 pMethods
= new SbxArray
;
126 pProps
= new SbxArray
;
127 pObjs
= new SbxArray( SbxOBJECT
);
129 p
= Make( pNameProp
, SbxClassType::Property
, SbxSTRING
);
130 p
->SetFlag( SbxFlagBits::DontStore
);
131 p
= Make( pParentProp
, SbxClassType::Property
, SbxOBJECT
);
132 p
->ResetFlag( SbxFlagBits::Write
);
133 p
->SetFlag( SbxFlagBits::DontStore
);
135 SetModified( false );
138 void SbxObject::Notify( SfxBroadcaster
&, const SfxHint
& rHint
)
140 const SbxHint
* p
= dynamic_cast<const SbxHint
*>(&rHint
);
143 const SfxHintId nId
= p
->GetId();
144 bool bRead
= ( nId
== SfxHintId::BasicDataWanted
);
145 bool bWrite
= ( nId
== SfxHintId::BasicDataChanged
);
146 SbxVariable
* pVar
= p
->GetVar();
147 if( bRead
|| bWrite
)
149 OUString
aVarName( pVar
->GetName() );
150 sal_uInt16 nHash_
= MakeHashCode( aVarName
);
151 if( nHash_
== nNameHash
&& aVarName
.equalsIgnoreAsciiCase( pNameProp
) )
155 pVar
->PutString( GetName() );
159 SetName( pVar
->GetOUString() );
162 else if( nHash_
== nParentHash
&& aVarName
.equalsIgnoreAsciiCase( pParentProp
) )
164 SbxObject
* p_
= GetParent();
169 pVar
->PutObject( p_
);
175 bool SbxObject::IsClass( const OUString
& rName
) const
177 return aClassName
.equalsIgnoreAsciiCase( rName
);
180 SbxVariable
* SbxObject::Find( const OUString
& rName
, SbxClassType t
)
184 static const char* pCls
[] = { "DontCare","Array","Value","Variable","Method","Property","Object" };
187 "search" << std::setw(nLvl
) << " "
188 << (t
>= SbxClassType::DontCare
&& t
<= SbxClassType::Object
189 ? pCls
[static_cast<int>(t
) - 1] : "Unknown class")
190 << " " << rName
<< " in " << SbxVariable::GetName());
194 SbxVariable
* pRes
= nullptr;
195 pObjs
->SetFlag( SbxFlagBits::ExtSearch
);
196 if( t
== SbxClassType::DontCare
)
198 pRes
= pMethods
->Find( rName
, SbxClassType::Method
);
201 pRes
= pProps
->Find( rName
, SbxClassType::Property
);
205 pRes
= pObjs
->Find( rName
, t
);
210 SbxArray
* pArray
= nullptr;
213 case SbxClassType::Variable
:
214 case SbxClassType::Property
: pArray
= pProps
.get(); break;
215 case SbxClassType::Method
: pArray
= pMethods
.get(); break;
216 case SbxClassType::Object
: pArray
= pObjs
.get(); break;
217 default: SAL_WARN( "basic.sbx", "Invalid SBX-Class" ); break;
221 pRes
= pArray
->Find( rName
, t
);
224 // Extended Search in the Object-Array?
225 // For objects and DontCare the array of objects has already been searched
226 if( !pRes
&& ( t
== SbxClassType::Method
|| t
== SbxClassType::Property
) )
227 pRes
= pObjs
->Find( rName
, t
);
228 // Search in the parents?
229 if( !pRes
&& IsSet( SbxFlagBits::GlobalSearch
) )
231 SbxObject
* pCur
= this;
232 while( !pRes
&& pCur
->pParent
)
234 // I myself was already searched!
235 SbxFlagBits nOwn
= pCur
->GetFlags();
236 pCur
->ResetFlag( SbxFlagBits::ExtSearch
);
237 // I search already global!
238 SbxFlagBits nPar
= pCur
->pParent
->GetFlags();
239 pCur
->pParent
->ResetFlag( SbxFlagBits::GlobalSearch
);
240 pRes
= pCur
->pParent
->Find( rName
, t
);
241 pCur
->SetFlags( nOwn
);
242 pCur
->pParent
->SetFlags( nPar
);
243 pCur
= pCur
->pParent
;
250 "found" << std::setw(nLvl
) << " " << rName
<< " in "
251 << SbxVariable::GetName());
256 // Abbreviated version: The parent-string will be searched
257 // The whole thing recursive, because Call() might be overridden
258 // Qualified names are allowed
260 bool SbxObject::Call( const OUString
& rName
, SbxArray
* pParam
)
262 SbxVariable
* pMeth
= FindQualified( rName
, SbxClassType::DontCare
);
263 if( dynamic_cast<const SbxMethod
*>( pMeth
) )
265 // FindQualified() might have struck already!
268 pMeth
->SetParameters( pParam
);
270 pMeth
->Broadcast( SfxHintId::BasicDataWanted
);
271 pMeth
->SetParameters( nullptr );
274 SetError( ERRCODE_BASIC_NO_METHOD
);
278 SbxProperty
* SbxObject::GetDfltProperty()
280 if ( !pDfltProp
&& !aDfltPropName
.isEmpty() )
282 pDfltProp
= static_cast<SbxProperty
*>( Find( aDfltPropName
, SbxClassType::Property
) );
285 pDfltProp
= static_cast<SbxProperty
*>( Make( aDfltPropName
, SbxClassType::Property
, SbxVARIANT
) );
290 void SbxObject::SetDfltProperty( const OUString
& rName
)
292 if ( rName
!= aDfltPropName
)
296 aDfltPropName
= rName
;
300 // Search of an already available variable. If it was located,
301 // the index will be set, otherwise the Count of the Array will be returned.
302 // In any case the correct Array will be returned.
304 SbxArray
* SbxObject::FindVar( SbxVariable
const * pVar
, sal_uInt16
& nArrayIdx
)
306 SbxArray
* pArray
= nullptr;
309 switch( pVar
->GetClass() )
311 case SbxClassType::Variable
:
312 case SbxClassType::Property
: pArray
= pProps
.get(); break;
313 case SbxClassType::Method
: pArray
= pMethods
.get(); break;
314 case SbxClassType::Object
: pArray
= pObjs
.get(); break;
315 default: SAL_WARN( "basic.sbx", "Invalid SBX-Class" ); break;
320 nArrayIdx
= pArray
->Count();
321 // Is the variable per name available?
322 pArray
->ResetFlag( SbxFlagBits::ExtSearch
);
323 SbxVariable
* pOld
= pArray
->Find( pVar
->GetName(), pVar
->GetClass() );
326 for( sal_uInt16 i
= 0; i
< pArray
->Count(); i
++ )
328 SbxVariableRef
& rRef
= pArray
->GetRef( i
);
329 if( rRef
.get() == pOld
)
331 nArrayIdx
= i
; break;
339 // If a new object will be established, this object will be indexed,
340 // if an object of this name exists already.
342 SbxVariable
* SbxObject::Make( const OUString
& rName
, SbxClassType ct
, SbxDataType dt
, bool bIsRuntimeFunction
)
344 // Is the object already available?
345 SbxArray
* pArray
= nullptr;
348 case SbxClassType::Variable
:
349 case SbxClassType::Property
: pArray
= pProps
.get(); break;
350 case SbxClassType::Method
: pArray
= pMethods
.get(); break;
351 case SbxClassType::Object
: pArray
= pObjs
.get(); break;
352 default: SAL_WARN( "basic.sbx", "Invalid SBX-Class" ); break;
358 // Collections may contain objects of the same name
359 if( !( ct
== SbxClassType::Object
&& dynamic_cast<const SbxCollection
*>( this ) != nullptr ) )
361 SbxVariable
* pRes
= pArray
->Find( rName
, ct
);
367 SbxVariable
* pVar
= nullptr;
370 case SbxClassType::Variable
:
371 case SbxClassType::Property
:
372 pVar
= new SbxProperty( rName
, dt
);
374 case SbxClassType::Method
:
375 pVar
= new SbxMethod( rName
, dt
, bIsRuntimeFunction
);
377 case SbxClassType::Object
:
378 pVar
= CreateObject( rName
);
383 pVar
->SetParent( this );
384 pArray
->Put( pVar
, pArray
->Count() );
386 // The object listen always
387 StartListening(pVar
->GetBroadcaster(), DuplicateHandling::Prevent
);
391 void SbxObject::Insert( SbxVariable
* pVar
)
394 SbxArray
* pArray
= FindVar( pVar
, nIdx
);
397 // Into with it. But you should pay attention at the Pointer!
398 if( nIdx
< pArray
->Count() )
400 // Then this element exists already
401 // There are objects of the same name allowed at collections
402 if( pArray
== pObjs
.get() && dynamic_cast<const SbxCollection
*>( this ) != nullptr )
404 nIdx
= pArray
->Count();
408 SbxVariable
* pOld
= pArray
->Get( nIdx
);
409 // already inside: overwrite
414 EndListening( pOld
->GetBroadcaster(), true );
415 if( pVar
->GetClass() == SbxClassType::Property
)
417 if( pOld
== pDfltProp
)
419 pDfltProp
= static_cast<SbxProperty
*>(pVar
);
424 StartListening(pVar
->GetBroadcaster(), DuplicateHandling::Prevent
);
425 pArray
->Put( pVar
, nIdx
);
426 if( pVar
->GetParent() != this )
428 pVar
->SetParent( this );
432 static const char* pCls
[] =
433 { "DontCare","Array","Value","Variable","Method","Property","Object" };
434 OUString
aVarName( pVar
->GetName() );
435 if (const SbxObject
*pSbxObj
= aVarName
.isEmpty() ? dynamic_cast<const SbxObject
*>(pVar
) : nullptr)
437 aVarName
= pSbxObj
->GetClassName();
442 << ((pVar
->GetClass() >= SbxClassType::DontCare
443 && pVar
->GetClass() <= SbxClassType::Object
)
444 ? pCls
[static_cast<int>(pVar
->GetClass()) - 1] : "Unknown class")
445 << " " << aVarName
<< " in " << SbxVariable::GetName());
450 // Optimisation, Insertion without checking about
451 // double entry and without broadcasts, will only be used in SO2/auto.cxx
452 void SbxObject::QuickInsert( SbxVariable
* pVar
)
454 SbxArray
* pArray
= nullptr;
457 switch( pVar
->GetClass() )
459 case SbxClassType::Variable
:
460 case SbxClassType::Property
: pArray
= pProps
.get(); break;
461 case SbxClassType::Method
: pArray
= pMethods
.get(); break;
462 case SbxClassType::Object
: pArray
= pObjs
.get(); break;
463 default: SAL_WARN( "basic.sbx", "Invalid SBX-Class" ); break;
468 StartListening(pVar
->GetBroadcaster(), DuplicateHandling::Prevent
);
469 pArray
->Put( pVar
, pArray
->Count() );
470 if( pVar
->GetParent() != this )
472 pVar
->SetParent( this );
476 static const char* pCls
[] =
477 { "DontCare","Array","Value","Variable","Method","Property","Object" };
478 OUString
aVarName( pVar
->GetName() );
479 if (const SbxObject
*pSbxObj
= aVarName
.isEmpty() ? dynamic_cast<const SbxObject
*>(pVar
) : nullptr)
481 aVarName
= pSbxObj
->GetClassName();
486 << ((pVar
->GetClass() >= SbxClassType::DontCare
487 && pVar
->GetClass() <= SbxClassType::Object
)
488 ? pCls
[static_cast<int>(pVar
->GetClass()) - 1] : "Unknown class")
489 << " " << aVarName
<< " in " << SbxVariable::GetName());
494 void SbxObject::Remove( const OUString
& rName
, SbxClassType t
)
496 Remove( SbxObject::Find( rName
, t
) );
499 void SbxObject::Remove( SbxVariable
* pVar
)
502 SbxArray
* pArray
= FindVar( pVar
, nIdx
);
503 if( pArray
&& nIdx
< pArray
->Count() )
506 OUString
aVarName( pVar
->GetName() );
507 if (const SbxObject
*pSbxObj
= aVarName
.isEmpty() ? dynamic_cast<const SbxObject
*>(pVar
) : nullptr)
509 aVarName
= pSbxObj
->GetClassName();
513 "remove " << aVarName
<< " in " << SbxVariable::GetName());
515 SbxVariableRef pVar_
= pArray
->Get( nIdx
);
516 if( pVar_
->IsBroadcaster() )
518 EndListening( pVar_
->GetBroadcaster(), true );
520 if( pVar_
.get() == pDfltProp
)
524 pArray
->Remove( nIdx
);
525 if( pVar_
->GetParent() == this )
527 pVar_
->SetParent( nullptr );
533 static bool LoadArray( SvStream
& rStrm
, SbxObject
* pThis
, SbxArray
* pArray
)
535 SbxArrayRef p
= static_cast<SbxArray
*>( SbxBase::Load( rStrm
) );
540 for( sal_uInt16 i
= 0; i
< p
->Count(); i
++ )
542 SbxVariableRef
& r
= p
->GetRef( i
);
543 SbxVariable
* pVar
= r
.get();
546 pVar
->SetParent( pThis
);
547 pThis
->StartListening(pVar
->GetBroadcaster(), DuplicateHandling::Prevent
);
550 pArray
->Merge( p
.get() );
554 // The load of an object is additive!
556 bool SbxObject::LoadData( SvStream
& rStrm
, sal_uInt16 nVer
)
558 // Help for the read in of old objects: just return TRUE,
559 // LoadPrivateData() has to set the default status up
565 if( !SbxVariable::LoadData( rStrm
, nVer
) )
569 // If it contains no alien object, insert ourselves
570 if( aData
.eType
== SbxOBJECT
&& !aData
.pObj
)
576 aClassName
= read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm
, RTL_TEXTENCODING_ASCII_US
);
577 aDfltProp
= read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm
, RTL_TEXTENCODING_ASCII_US
);
578 sal_uInt64 nPos
= rStrm
.Tell();
579 rStrm
.ReadUInt32( nSize
);
580 sal_uInt64
const nNewPos
= rStrm
.Tell();
582 DBG_ASSERT( nPos
>= nNewPos
, "SBX: Loaded too much data" );
583 if( nPos
!= nNewPos
)
587 if( !LoadArray( rStrm
, this, pMethods
.get() ) ||
588 !LoadArray( rStrm
, this, pProps
.get() ) ||
589 !LoadArray( rStrm
, this, pObjs
.get() ) )
594 if( !aDfltProp
.isEmpty() )
596 pDfltProp
= static_cast<SbxProperty
*>( pProps
->Find( aDfltProp
, SbxClassType::Property
) );
598 SetModified( false );
602 bool SbxObject::StoreData( SvStream
& rStrm
) const
604 if( !SbxVariable::StoreData( rStrm
) )
611 aDfltProp
= pDfltProp
->GetName();
613 write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm
, aClassName
, RTL_TEXTENCODING_ASCII_US
);
614 write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm
, aDfltProp
, RTL_TEXTENCODING_ASCII_US
);
615 sal_uInt64
const nPos
= rStrm
.Tell();
616 rStrm
.WriteUInt32( 0 );
617 sal_uInt64
const nNew
= rStrm
.Tell();
619 rStrm
.WriteUInt32( nNew
- nPos
);
621 if( !pMethods
->Store( rStrm
) )
625 if( !pProps
->Store( rStrm
) )
629 if( !pObjs
->Store( rStrm
) )
633 const_cast<SbxObject
*>(this)->SetModified( false );
637 static bool CollectAttrs( const SbxBase
* p
, OUString
& rRes
)
644 if( p
->IsSet( SbxFlagBits::ExtSearch
) )
646 if( !aAttrs
.isEmpty() )
650 aAttrs
+= "ExtSearch";
652 if( !p
->IsVisible() )
654 if( !aAttrs
.isEmpty() )
658 aAttrs
+= "Invisible";
660 if( p
->IsSet( SbxFlagBits::DontStore
) )
662 if( !aAttrs
.isEmpty() )
666 aAttrs
+= "DontStore";
668 if( !aAttrs
.isEmpty() )
670 rRes
= " (" + aAttrs
+ ")";
680 void SbxObject::Dump( SvStream
& rStrm
, bool bFill
)
683 static sal_uInt16 nLevel
= 0;
686 rStrm
.WriteCharPtr( "<too deep>" ) << endl
;
690 OUString
aIndent("");
691 for ( sal_uInt16 n
= 1; n
< nLevel
; ++n
)
695 // Output the data of the object itself
696 OString
aNameStr(OUStringToOString(GetName(), RTL_TEXTENCODING_ASCII_US
));
697 OString
aClassNameStr(OUStringToOString(aClassName
, RTL_TEXTENCODING_ASCII_US
));
698 rStrm
.WriteCharPtr( "Object( " )
699 .WriteOString( OString::number(reinterpret_cast<sal_Int64
>(this)) ).WriteCharPtr( "=='" )
700 .WriteCharPtr( aNameStr
.isEmpty() ? "<unnamed>" : aNameStr
.getStr() ).WriteCharPtr( "', " )
701 .WriteCharPtr( "of class '" ).WriteOString( aClassNameStr
).WriteCharPtr( "', " )
702 .WriteCharPtr( "counts " )
703 .WriteOString( OString::number(GetRefCount()) )
704 .WriteCharPtr( " refs, " );
707 OString
aParentNameStr(OUStringToOString(GetName(), RTL_TEXTENCODING_ASCII_US
));
708 rStrm
.WriteCharPtr( "in parent " )
709 .WriteOString( OString::number(reinterpret_cast<sal_Int64
>(GetParent())) )
710 .WriteCharPtr( "=='" ).WriteCharPtr( aParentNameStr
.isEmpty() ? "<unnamed>" : aParentNameStr
.getStr() ).WriteCharPtr( "'" );
714 rStrm
.WriteCharPtr( "no parent " );
716 rStrm
.WriteCharPtr( " )" ) << endl
;
717 OString
aIndentNameStr(OUStringToOString(aIndent
, RTL_TEXTENCODING_ASCII_US
));
718 rStrm
.WriteOString( aIndentNameStr
).WriteCharPtr( "{" ) << endl
;
722 if( CollectAttrs( this, aAttrs
) )
724 OString
aAttrStr(OUStringToOString(aAttrs
, RTL_TEXTENCODING_ASCII_US
));
725 rStrm
.WriteOString( aIndentNameStr
).WriteCharPtr( "- Flags: " ).WriteOString( aAttrStr
) << endl
;
729 rStrm
.WriteOString( aIndentNameStr
).WriteCharPtr( "- Methods:" ) << endl
;
730 for( sal_uInt16 i
= 0; i
< pMethods
->Count(); i
++ )
732 SbxVariableRef
& r
= pMethods
->GetRef( i
);
733 SbxVariable
* pVar
= r
.get();
736 OUString aLine
= aIndent
+ " - " + pVar
->GetName( SbxNameType::ShortTypes
);
738 if( CollectAttrs( pVar
, aAttrs2
) )
742 if( dynamic_cast<const SbxMethod
*>(pVar
) == nullptr )
744 aLine
+= " !! Not a Method !!";
746 write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm
, aLine
, RTL_TEXTENCODING_ASCII_US
);
748 // Output also the object at object-methods
749 if ( pVar
->GetValues_Impl().eType
== SbxOBJECT
&&
750 pVar
->GetValues_Impl().pObj
&&
751 pVar
->GetValues_Impl().pObj
!= this &&
752 pVar
->GetValues_Impl().pObj
!= GetParent() )
754 rStrm
.WriteCharPtr( " contains " );
755 static_cast<SbxObject
*>(pVar
->GetValues_Impl().pObj
)->Dump( rStrm
, bFill
);
765 rStrm
.WriteOString( aIndentNameStr
).WriteCharPtr( "- Properties:" ) << endl
;
767 for( sal_uInt16 i
= 0; i
< pProps
->Count(); i
++ )
769 SbxVariableRef
& r
= pProps
->GetRef( i
);
770 SbxVariable
* pVar
= r
.get();
773 OUString aLine
= aIndent
+ " - " + pVar
->GetName( SbxNameType::ShortTypes
);
775 if( CollectAttrs( pVar
, aAttrs3
) )
779 if( dynamic_cast<const SbxProperty
*>(pVar
) == nullptr )
781 aLine
+= " !! Not a Property !!";
783 write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm
, aLine
, RTL_TEXTENCODING_ASCII_US
);
785 // output also the object at object properties
786 if ( pVar
->GetValues_Impl().eType
== SbxOBJECT
&&
787 pVar
->GetValues_Impl().pObj
&&
788 pVar
->GetValues_Impl().pObj
!= this &&
789 pVar
->GetValues_Impl().pObj
!= GetParent() )
791 rStrm
.WriteCharPtr( " contains " );
792 static_cast<SbxObject
*>(pVar
->GetValues_Impl().pObj
)->Dump( rStrm
, bFill
);
803 rStrm
.WriteOString( aIndentNameStr
).WriteCharPtr( "- Objects:" ) << endl
;
805 for( sal_uInt16 i
= 0; i
< pObjs
->Count(); i
++ )
807 SbxVariableRef
& r
= pObjs
->GetRef( i
);
808 SbxVariable
* pVar
= r
.get();
811 rStrm
.WriteOString( aIndentNameStr
).WriteCharPtr( " - Sub" );
812 if (SbxObject
*pSbxObj
= dynamic_cast<SbxObject
*>(pVar
))
814 pSbxObj
->Dump(rStrm
, bFill
);
818 pVar
->Dump(rStrm
, bFill
);
824 rStrm
.WriteOString( aIndentNameStr
).WriteCharPtr( "}" ) << endl
<< endl
;
828 SbxMethod::SbxMethod( const OUString
& r
, SbxDataType t
, bool bIsRuntimeFunction
)
830 , mbIsRuntimeFunction(bIsRuntimeFunction
)
831 , mbRuntimeFunctionReturnType(t
)
836 SbxMethod::SbxMethod( const SbxMethod
& r
)
839 , mbIsRuntimeFunction(r
.IsRuntimeFunction())
840 , mbRuntimeFunctionReturnType(r
.GetRuntimeFunctionReturnType())
844 SbxMethod::~SbxMethod()
848 SbxClassType
SbxMethod::GetClass() const
850 return SbxClassType::Method
;
853 SbxProperty::SbxProperty( const OUString
& r
, SbxDataType t
)
859 SbxProperty::~SbxProperty()
863 SbxClassType
SbxProperty::GetClass() const
865 return SbxClassType::Property
;
868 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */