20#include <config_features.h>
162 SAL_INFO(
"basic.sbx",
"Not at Parent-Prop - otherwise CyclicRef");
164 bool bParentProp = pThisVar && (pThisVar->
GetUserData() & 0xFFFF) == 5345;
218 if( bObjInObjError && !pDflt &&
222#if !HAVE_FEATURE_SCRIPTING
223 const bool bSuccess =
false;
251 p = pDimArray->
Get( pPar );
289 p->Broadcast( SfxHintId::BasicDataWanted );
306 rRes.
nUShort = sal::static_int_cast< sal_uInt16 >(
326 rRes.
pObj =
p->aData.pObj;
334 if(
p->aData.eType == rRes.
eType )
401 else if( rVal.
eType & 0xF000 )
413 else if(
p->IsFixed() ||
p->SetType(
static_cast<SbxDataType>( rVal.
eType & 0x0FFF ) ) )
414 switch( rVal.
eType & 0x0FFF )
449 p->SbxValue::Clear();
452 p->aData.pObj = rVal.
pObj;
455 if(
p->aData.pObj &&
p->aData.pObj !=
p )
459 OSL_FAIL(
"TheRealValue" );
461 SAL_INFO(
"basic.sbx",
"Not at Parent-Prop - otherwise CyclicRef");
463 bool bParentProp = pThisVar && (pThisVar->
GetUserData() & 0xFFFF) == 5345;
465 p->aData.pObj->AddFirstRef();
472 if(
p->aData.eType == rVal.
eType )
483 p->SetModified(
true );
484 p->Broadcast( SfxHintId::BasicDataChanged );
518 aRes.
pOUString =
const_cast<OUString*
>(&r);
533 const bool bRet =
Put(aRes);
575 ( css::bridge::oleautomation::Decimal& rAutomationDec )
const
578 if( pDecimal !=
nullptr )
588 aRes.
pOUString =
const_cast<OUString*
>(&r);
593#define PUT( p, e, t, m ) \
594bool SbxValue::p( t n ) \
595{ SbxValues aRes(e); aRes.m = n; return Put(aRes); }
646 if(
auto pSbxVar =
dynamic_cast<const SbxVariable*
>(
this) )
658 return nLen == s.getLength();
676 DBG_ASSERT( !(
t & 0xF000 ),
"SetType of BYREF|ARRAY is forbidden!" );
710 SAL_WARN(
"basic.sbx",
"Not at Parent-Prop - otherwise CyclicRef");
712 sal_uInt32 nSlotId = pThisVar
716 "SID_PARENTOBJECT is not named 'Parent'" );
717 bool bParentProp = nSlotId == 5345;
776#if !HAVE_FEATURE_SCRIPTING
777 const bool bVBAInterop =
false;
796 bool bDecimal =
false;
822 catch (
const std::bad_alloc&) {
858 if(
Get( aL ) )
switch( eOp )
940 aL.
nLong = ~aL.nLong;
943 aL.
nLong = ~aL.nLong;
954 if( rOp.
Get( aR ) &&
Get( aL ) )
998 if(
Get( aL ) )
switch( eOp )
1012 dTest =
static_cast<double>(aL.
nInt64) *
static_cast<double>(aR.
nInt64);
1033 double dTest =
static_cast<double>(aL.
nInt64) /
static_cast<double>(aR.
nInt64);
1044 aL.
nInt64 =
static_cast<sal_Int64
>(dTest /
static_cast<double>(aR.
nInt64));
1147#if !HAVE_FEATURE_SCRIPTING
1148 const bool bVBAInterop =
false;
1164 bRes = !bVBAInterop || ( eOp ==
SbxEQ );
1187 if(
Get( aL ) && rOp.
Get( aR ) )
switch( eOp )
1210 if(
Get( aL ) && rOp.
Get( aR ) )
1266 bool bGetL =
Get( aL );
1267 bool bGetR = rOp.
Get( aR );
1268 if( bGetL && bGetR )
1289 else if ( bGetR || bGetL )
1327 RTL_TEXTENCODING_ASCII_US);
1343 RTL_TEXTENCODING_ASCII_US);
1360 sal_uInt32 tmpHi = 0;
1361 sal_uInt32 tmpLo = 0;
1363 aData.
nInt64 = (
static_cast<sal_Int64
>(tmpHi) << 32);
1370 RTL_TEXTENCODING_ASCII_US);
1371 if( !aVal.isEmpty() )
1420 if(
n > SAL_TYPES_SIZEOFINT )
1437 if(
n > SAL_TYPES_SIZEOFINT )
1463 SAL_WARN(
"basic.sbx",
"Loaded a non-supported data type" );
1474 switch(
nType & 0x0FFF )
1498 sal_Int32 tmpHi = ( (
aData.
nInt64 >> 32) & 0xFFFFFFFF );
1499 sal_Int32 tmpLo =
static_cast<sal_Int32
>(
aData.
nInt64);
1533 char c = sal::static_int_cast< char >(
aData.
nChar);
1563 SAL_WARN(
"basic.sbx",
"Saving a non-supported data type" );
1564 return {
false, 0 };
static bool isVBAEnabled()
SbxVariable * Get(sal_uInt32)
static void SetError(ErrCode)
void SetFlags(SbxFlagBits n)
static ErrCode const & GetError()
void SetFlag(SbxFlagBits n)
SbxFlagBits GetFlags() const
virtual void SetModified(bool)
std::pair< bool, sal_uInt32 > Store(SvStream &)
static SbxBaseRef Load(SvStream &)
virtual SbxDataType GetType() const
void ResetFlag(SbxFlagBits n)
void fillAutomationDecimal(css::bridge::oleautomation::Decimal &rAutomationDec)
SbxVariable * Get(SbxArray *)
SbxProperty * GetDfltProperty()
OUString GetOUString() const
bool Compute(SbxOperator, const SbxValue &)
bool Compare(SbxOperator, const SbxValue &) const
bool PutString(const OUString &)
SbxBase * GetObject() const
void fillAutomationDecimal(css::bridge::oleautomation::Decimal &rAutomationDec) const
const OUString & GetCoreString() const
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
virtual bool IsFixed() const override
bool ImpIsNumeric(bool bOnlyIntntl) const
SbxValue & operator=(const SbxValue &)
void PutDecimal(css::bridge::oleautomation::Decimal const &rAutomationDec)
virtual bool LoadData(SvStream &, sal_uInt16) override
SbxDecimal * GetDecimal() const
BASIC_DLLPRIVATE SbxValue * TheRealValue(bool bObjInObjError) const
bool PutObject(SbxBase *)
bool Convert(SbxDataType)
sal_Int16 GetInteger() const
bool SetType(SbxDataType)
bool Get(SbxValues &) const
bool IsNumericRTL() const
virtual void Broadcast(SfxHintId)
bool Put(const SbxValues &)
virtual ~SbxValue() override
void PutStringExt(const OUString &)
virtual SbxDataType GetType() const override
virtual void Clear() override
SbxArray * GetParameters() const
const OUString & GetName(SbxNameType=SbxNameType::NONE) const
sal_uInt32 GetUserData() const
SvStream & ReadUInt64(sal_uInt64 &rUInt64)
SvStream & WriteInt32(sal_Int32 nInt32)
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & WriteInt16(sal_Int16 nInt16)
SvStream & WriteUChar(unsigned char nChar)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteUInt64(sal_uInt64 nuInt64)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
SvStream & ReadChar(char &rChar)
SvStream & WriteChar(char nChar)
SvStream & ReadInt32(sal_Int32 &rInt32)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
SvStream & ReadInt64(sal_Int64 &rInt64)
SvStream & ReadUChar(unsigned char &rChar)
#define DBG_ASSERT(sCon, aError)
#define suppress_fun_call_w_exception(expr)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
constexpr OUStringLiteral aData
constexpr std::enable_if_t< std::is_floating_point_v< F > &&std::is_integral_v< I >, bool > convertsToAtLeast(F value, I min)
constexpr std::enable_if_t< std::is_floating_point_v< F > &&std::is_integral_v< I >, bool > convertsToAtMost(F value, I max)
bool LibreOffice6FloatingPointMode()
#define ERRCODE_BASIC_BAD_PROP_VALUE
#define ERRCODE_BASIC_PROP_WRITEONLY
#define ERRCODE_BASIC_NO_OBJECT
#define ERRCODE_BASIC_PROP_READONLY
#define ERRCODE_BASIC_MATH_OVERFLOW
#define ERRCODE_BASIC_CONVERSION
#define ERRCODE_BASIC_BAD_ARGUMENT
#define ERRCODE_BASIC_ZERODIV
bool handleToStringForCOMObjects(SbxObject *pObj, SbxValue *pVal)
enum SbxBOOL ImpGetBool(const SbxValues *p)
void ImpPutBool(SbxValues *p, sal_Int16 n)
void ImpPutByte(SbxValues *p, sal_uInt8 n)
sal_uInt8 ImpGetByte(const SbxValues *p)
sal_Unicode ImpGetChar(const SbxValues *p)
void ImpPutChar(SbxValues *p, sal_Unicode n)
void ImpPutDecimal(SbxValues *p, SbxDecimal *pDec)
void ImpPutLong(SbxValues *, sal_Int32)
void ImpPutInt64(SbxValues *, sal_Int64)
sal_Int16 ImpGetInteger(const SbxValues *)
void ImpPutUInt64(SbxValues *, sal_uInt64)
void ImpPutCurrency(SbxValues *, const sal_Int64)
sal_Int64 ImpGetInt64(const SbxValues *)
double ImpGetDouble(const SbxValues *)
sal_uInt32 ImpGetULong(const SbxValues *)
void ImpPutSingle(SbxValues *, float)
void ImpPutDouble(SbxValues *, double, bool bCoreString=false)
sal_uInt64 ImpGetUInt64(const SbxValues *)
void ImpPutInteger(SbxValues *, sal_Int16)
void ImpPutULong(SbxValues *, sal_uInt32)
SbxArray * StringToByteArray(const OUString &rStr)
sal_uInt16 ImpGetUShort(const SbxValues *)
double ImpGetDate(const SbxValues *)
sal_Int32 ImpGetLong(const SbxValues *)
OUString ImpGetString(const SbxValues *)
void ImpPutString(SbxValues *, const OUString *)
float ImpGetSingle(const SbxValues *)
OUString ImpGetCoreString(const SbxValues *)
OUString ByteArrayToString(SbxArray *pArr)
sal_Int64 ImpGetCurrency(const SbxValues *)
bool ImpConvStringExt(OUString &rSrc, SbxDataType eTargetType)
void ImpPutDate(SbxValues *, double)
ErrCode ImpScan(const OUString &rSrc, double &nVal, SbxDataType &rType, sal_uInt16 *pLen, bool bOnlyIntntl)
void ImpPutUShort(SbxValues *, sal_uInt16)
SbxDecimal * ImpGetDecimal(const SbxValues *p)
SbxDecimal::CmpResult compare(SAL_UNUSED_PARAMETER const SbxDecimal &, SAL_UNUSED_PARAMETER const SbxDecimal &)
void releaseDecimalPtr(SbxDecimal *&rpDecimal)
constexpr auto SbxMINCURR
constexpr auto SbxMAXCURR
constexpr auto CURRENCY_FACTOR_SQUARE
constexpr auto CURRENCY_FACTOR
OUString read_uInt16_lenPrefixed_uInt8s_ToOUString(SvStream &rStrm, rtl_TextEncoding eEnc)
std::size_t write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream &rStrm, std::u16string_view rStr, rtl_TextEncoding eEnc)
void clear(SbxDataType type)