89 for (sal_uInt32
i = 0;
i <
p->Count();
i++)
92 if( rRef->IsBroadcaster() )
97 if( rRef->GetRefCount() > 1 )
99 rRef->SetParent(
nullptr );
100 SAL_INFO_IF(rRef->IsBroadcaster() && rRef->GetBroadcaster().GetListenerCount(),
"basic.sbx",
"Object element with dangling parent");
147 bool bRead = (
nId == SfxHintId::BasicDataWanted );
148 bool bWrite = (
nId == SfxHintId::BasicDataChanged );
150 if( !(bRead || bWrite) )
153 OUString aVarName( pVar->
GetName() );
179 return aClassName.equalsIgnoreAsciiCase( rName );
186 static const char* pCls[] = {
"DontCare",
"Array",
"Value",
"Variable",
"Method",
"Property",
"Object" };
189 "search" << std::setw(nLvl) <<
" "
191 ? pCls[
static_cast<int>(
t) - 1] :
"Unknown class")
207 pRes =
pObjs->Find( rName,
t );
219 default:
SAL_WARN(
"basic.sbx",
"Invalid SBX-Class" );
break;
223 pRes = pArray->
Find( rName,
t );
229 pRes =
pObjs->Find( rName,
t );
234 while( !pRes && pCur->
pParent )
252 "found" << std::setw(nLvl) <<
" " << rName <<
" in "
265 if(
dynamic_cast<const SbxMethod*
>( pMeth) )
275 pMeth->
Broadcast( SfxHintId::BasicDataWanted );
320 default:
SAL_WARN(
"basic.sbx",
"Invalid SBX-Class" );
break;
325 nArrayIdx = pArray->
Count();
331 for (sal_uInt32
i = 0;
i < pArray->
Count();
i++)
334 if( rRef.
get() == pOld )
336 nArrayIdx =
i;
break;
357 default:
SAL_WARN(
"basic.sbx",
"Invalid SBX-Class" );
break;
380 pVar =
new SbxMethod( rName, dt, bIsRuntimeFunction );
388 pVar->SetParent(
this );
392 StartListening(pVar->GetBroadcaster(), DuplicateHandling::Prevent);
404 if (nIdx < pArray->
Count())
410 nIdx = pArray->
Count();
431 pArray->
Put(pVar, nIdx);
438 static const char* pCls[] =
439 {
"DontCare",
"Array",
"Value",
"Variable",
"Method",
"Property",
"Object" };
440 OUString aVarName( pVar->
GetName() );
441 if (
const SbxObject *pSbxObj = aVarName.isEmpty() ?
dynamic_cast<const SbxObject*
>(pVar) :
nullptr)
443 aVarName = pSbxObj->GetClassName();
450 ? pCls[
static_cast<int>(pVar->
GetClass()) - 1] :
"Unknown class")
468 default:
SAL_WARN(
"basic.sbx",
"Invalid SBX-Class" );
break;
482 static const char* pCls[] =
483 {
"DontCare",
"Array",
"Value",
"Variable",
"Method",
"Property",
"Object" };
484 OUString aVarName( pVar->
GetName() );
485 if (
const SbxObject *pSbxObj = aVarName.isEmpty() ?
dynamic_cast<const SbxObject*
>(pVar) :
nullptr)
487 aVarName = pSbxObj->GetClassName();
494 ? pCls[
static_cast<int>(pVar->
GetClass()) - 1] :
"Unknown class")
508 if (!(pArray && nIdx < pArray->
Count()))
512 OUString aVarName( pVar->
GetName() );
513 if (
const SbxObject *pSbxObj = aVarName.isEmpty() ?
dynamic_cast<const SbxObject*
>(pVar) :
nullptr)
515 aVarName = pSbxObj->GetClassName();
522 if( pVar_->IsBroadcaster() )
531 if( pVar_->GetParent() ==
this )
533 pVar_->SetParent(
nullptr );
545 for (sal_uInt32
i = 0;
i <
p->Count();
i++)
588 if(
nPos != nNewPos )
599 if( !aDfltProp.isEmpty() )
652 if( !aAttrs.isEmpty() )
656 aAttrs +=
"ExtSearch";
658 if( !
p->IsVisible() )
660 if( !aAttrs.isEmpty() )
664 aAttrs +=
"Invisible";
668 if( !aAttrs.isEmpty() )
672 aAttrs +=
"DontStore";
674 if( !aAttrs.isEmpty() )
676 rRes =
" (" + aAttrs +
")";
689 static sal_uInt16 nLevel = 0;
696 OUString aIndent(
"");
697 for ( sal_uInt16
n = 1;
n < nLevel; ++
n )
748 if(
dynamic_cast<const SbxMethod *
>(pVar) ==
nullptr )
750 aLine +=
" !! Not a Method !!";
773 for (sal_uInt32
i = 0;
i <
pProps->Count();
i++)
785 if(
dynamic_cast<const SbxProperty *
>(pVar) == nullptr )
787 aLine +=
" !! Not a Property !!";
811 for (sal_uInt32
i = 0;
i <
pObjs->Count();
i++)
820 pSbxObj->Dump(
rStrm, bFill);
836 , mbIsRuntimeFunction(bIsRuntimeFunction)
837 , mbRuntimeFunctionReturnType(
t)
845 , mbIsRuntimeFunction(r.IsRuntimeFunction())
846 , mbRuntimeFunctionReturnType(r.GetRuntimeFunctionReturnType())
874 bool bParentProp = (
GetUserData() & 0xFFFF) == 5345;
SbxVariable * Find(const OUString &, SbxClassType)
SbxVariableRef & GetRef(sal_uInt32)
SbxVariable * Get(sal_uInt32)
void Put(SbxVariable *, sal_uInt32)
static void SetError(ErrCode)
void SetFlags(SbxFlagBits n)
bool IsSet(SbxFlagBits n) const
SbxFlagBits GetFlags() const
static SbxObjectRef CreateObject(const OUString &)
static SbxBaseRef Load(SvStream &)
void ResetFlag(SbxFlagBits n)
virtual SbxClassType GetClass() const override
virtual ~SbxMethod() override
SbxMethod(const OUString &r, SbxDataType t, bool bIsRuntimeFunction=false)
virtual void Clear() override
void Dump(SvStream &, bool bDumpAll)
virtual void Clear() override
SbxProperty * GetDfltProperty()
virtual void Insert(SbxVariable *)
virtual SbxClassType GetClass() const override
virtual SbxVariable * Find(const OUString &, SbxClassType)
virtual bool Call(const OUString &, SbxArray *=nullptr)
virtual ~SbxObject() override
SbxVariable * FindQualified(const OUString &, SbxClassType)
virtual SbxDataType GetType() const override
void Remove(const OUString &, SbxClassType)
virtual bool LoadData(SvStream &, sal_uInt16) override
SbxVariable * Make(const OUString &, SbxClassType, SbxDataType, bool bIsRuntimeFunction=false)
void QuickInsert(SbxVariable *)
BASIC_DLLPRIVATE SbxArray * FindVar(SbxVariable const *, sal_uInt32 &)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
SbxObject(const OUString &rClassname)
virtual bool IsClass(const OUString &) const
SbxObject & operator=(const SbxObject &)
void SetDfltProperty(const OUString &r)
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
virtual SbxClassType GetClass() const override
SbxProperty(const OUString &r, SbxDataType t)
virtual ~SbxProperty() override
OUString GetOUString() const
bool PutString(const OUString &)
virtual bool IsFixed() const override
const SbxValues & GetValues_Impl() const
bool PutObject(SbxBase *)
virtual void Clear() override
SbxVariable & operator=(const SbxVariable &)
const SbxObject * GetParent() const
virtual SbxClassType GetClass() const
virtual bool LoadData(SvStream &, sal_uInt16) override
SfxBroadcaster & GetBroadcaster()
void SetName(const OUString &)
virtual void Broadcast(SfxHintId nHintId) override
void SetParameters(SbxArray *p)
void Dump(SvStream &, bool bDumpAll)
const OUString & GetName(SbxNameType=SbxNameType::NONE) const
sal_uInt32 GetUserData() const
static constexpr sal_uInt16 MakeHashCode(std::u16string_view aName)
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
virtual void SetParent(SbxObject *)
virtual void SetModified(bool) override
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
unsigned int GetRefCount() const
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
#define DBG_ASSERT(sCon, aError)
#define SAL_INFO_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
constexpr OUStringLiteral first
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
#define ERRCODE_BASIC_NO_METHOD
void releaseDecimalPtr(SbxDecimal *&rpDecimal)
static bool LoadArray(SvStream &rStrm, SbxObject *pThis, SbxArray *pArray)
static OUString pParentProp
static void CheckParentsOnDelete(SbxObject *pObj, SbxArray *p)
static sal_uInt16 nParentHash
static sal_uInt16 nNameHash
static OUString pNameProp
static bool CollectAttrs(const SbxBase *p, OUString &rRes)
OUString GetSbxRes(StringId nId)
OUString read_uInt16_lenPrefixed_uInt8s_ToOUString(SvStream &rStrm, rtl_TextEncoding eEnc)
TOOLS_DLLPUBLIC SvStream & endl(SvStream &rStr)
std::size_t write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream &rStrm, std::u16string_view rStr, rtl_TextEncoding eEnc)
void clear(SbxDataType type)