47#include <com/sun/star/lang/XServiceInfo.hpp>
48#include <com/sun/star/script/ModuleType.hpp>
49#include <com/sun/star/script/vba/XVBACompatibility.hpp>
50#include <com/sun/star/script/vba/VBAScriptEventId.hpp>
51#include <com/sun/star/beans/XPropertySet.hpp>
52#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
53#include <com/sun/star/document/XDocumentEventListener.hpp>
56#include <sys/resource.h>
59#include <com/sun/star/lang/XMultiServiceFactory.hpp>
63#include <com/sun/star/reflection/ProxyFactory.hpp>
64#include <com/sun/star/uno/XAggregation.hpp>
65#include <com/sun/star/script/XInvocation.hpp>
67#include <com/sun/star/awt/DialogProvider.hpp>
68#include <com/sun/star/awt/XTopWindow.hpp>
69#include <com/sun/star/awt/XWindow.hpp>
70#include <ooo/vba/VbQueryClose.hpp>
102 explicit DocObjectWrapper(
SbModule* pMod );
106 return css::uno::Sequence<sal_Int8>();
112 virtual void SAL_CALL
setValue(
const OUString& aPropertyName,
const Any& aValue )
override;
113 virtual Any SAL_CALL
getValue(
const OUString& aPropertyName )
override;
114 virtual sal_Bool SAL_CALL hasMethod(
const OUString&
aName )
override;
123DocObjectWrapper::DocObjectWrapper(
SbModule* pVar ) : m_pMod( pVar )
141 m_xAggregateTypeProv.set( xIf, UNO_QUERY );
142 m_xAggInv.set( xIf, UNO_QUERY );
152 catch(
const Exception& )
161 osl_atomic_increment( &m_refCount );
171 osl_atomic_decrement( &m_refCount );
176 if ( !m_Types.hasElements() )
179 if ( m_xAggregateTypeProv.is() )
181 sTypes = m_xAggregateTypeProv->getTypes();
190DocObjectWrapper::getIntrospection( )
198 if ( m_xAggInv.is() && m_xAggInv->hasMethod( aFunctionName ) )
199 return m_xAggInv->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam );
202 throw RuntimeException(
"DocObjectWrapper::invoke - Could not get the method reference!");
204 sal_Int32 nParamsCount = aParams.getLength();
205 SbxInfo* pInfo = pMethod->GetInfo();
208 sal_Int32 nSbxOptional = 0;
210 for (
const SbxParamInfo* pParamInfo = pInfo->GetParam( n ); pParamInfo; pParamInfo = pInfo->GetParam( ++n ) )
217 sal_Int32 nSbxCount =
n - 1;
218 if ( nParamsCount < nSbxCount - nSbxOptional )
225 if ( nParamsCount > 0 )
228 const Any* pParams = aParams.getConstArray();
229 for ( sal_Int32 i = 0;
i < nParamsCount; ++
i )
233 xSbxParams->Put(xSbxVar.
get(),
static_cast<sal_uInt32
>(i) + 1);
240 if ( xSbxParams.
is() )
241 pMethod->SetParameters( xSbxParams.
get() );
246 pMethod->Call( xReturn.
get() );
249 if ( xSbxParams.
is() )
251 SbxInfo* pInfo_ = pMethod->GetInfo();
255 for (sal_uInt32 n = 1, nCount = xSbxParams->Count(); n < nCount; ++n)
257 assert(n <= std::numeric_limits<sal_uInt16>::max());
258 const SbxParamInfo* pParamInfo = pInfo_->GetParam( sal::static_int_cast<sal_uInt16>(n) );
269 sal_Int32 nOutParamCount = aOutParamMap.size();
270 aOutParamIndex.realloc( nOutParamCount );
271 aOutParam.realloc( nOutParamCount );
272 sal_Int16* pOutParamIndex = aOutParamIndex.getArray();
273 Any* pOutParam = aOutParam.getArray();
274 for (
auto const& outParam : aOutParamMap)
276 *pOutParamIndex = outParam.first;
277 *pOutParam = outParam.second;
287 pMethod->SetParameters(
nullptr );
293DocObjectWrapper::setValue(
const OUString& aPropertyName,
const Any& aValue )
295 if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) )
296 return m_xAggInv->setValue( aPropertyName, aValue );
299 if ( !pProperty.
is() )
300 throw UnknownPropertyException(aPropertyName);
305DocObjectWrapper::getValue(
const OUString& aPropertyName )
307 if ( m_xAggInv.is() && m_xAggInv->hasProperty( aPropertyName ) )
308 return m_xAggInv->getValue( aPropertyName );
311 if ( !pProperty.
is() )
312 throw UnknownPropertyException(aPropertyName);
316 pProperty->Broadcast( SfxHintId::BasicDataWanted );
323DocObjectWrapper::hasMethod(
const OUString& aName )
325 if ( m_xAggInv.is() && m_xAggInv->hasMethod( aName ) )
327 return getMethod( aName ).is();
331DocObjectWrapper::hasProperty(
const OUString& aName )
334 if ( m_xAggInv.is() && m_xAggInv->hasProperty( aName ) )
340Any SAL_CALL DocObjectWrapper::queryInterface(
const Type& aType )
342 Any aRet = DocObjectWrapper_BASE::queryInterface( aType );
343 if ( aRet.hasValue() )
350SbMethodRef DocObjectWrapper::getMethod(
const OUString& aName )
365SbPropertyRef DocObjectWrapper::getProperty(
const OUString& aName )
383 uno::Reference< frame::XModel >
xModel;
388 xModel.set( aDoc, uno::UNO_QUERY );
393static uno::Reference< vba::XVBACompatibility >
getVBACompatibility(
const uno::Reference< frame::XModel >& rxModel )
395 uno::Reference< vba::XVBACompatibility > xVBACompat;
398 uno::Reference< beans::XPropertySet > xModelProps( rxModel, uno::UNO_QUERY_THROW );
399 xVBACompat.set( xModelProps->getPropertyValue(
"BasicLibraries" ), uno::UNO_QUERY );
401 catch(
const uno::Exception& )
413 return xVBACompat.is() && xVBACompat->getVBACompatibilityMode();
421 pBreaks(nullptr), mbVBASupport(bVBASupport), mbCompat(bVBASupport), bIsProxyModule(false)
444uno::Reference< script::XInvocation >
const &
448 mxWrapper =
new DocObjectWrapper(
this );
461 return pImage ?
pImage->FindType( aTypeName ) :
nullptr;
563 pNewProp->SetParent(
this );
565 StartListening(pNewProp->GetBroadcaster(), DuplicateHandling::Prevent);
573 if(
p && !pMapperMethod )
596 for (sal_uInt32
i = 0;
i <
pMethods->Count();)
607 p->bInvalid = bNewState;
649 OUString aEnumName = pEnumObject->
GetName();
687 if( pHint->
GetId() == SfxHintId::BasicDataWanted )
689 OUString aProcName =
"Property Get "
699 sal_uInt32 nVarParCount = (pArg !=
nullptr) ? pArg->
Count() : 0;
700 if( nVarParCount > 1 )
702 auto xMethParameters = tools::make_ref<SbxArray>();
703 xMethParameters->Put(pMethVar, 0);
704 for( sal_uInt32
i = 1 ;
i < nVarParCount ; ++
i )
707 xMethParameters->
Put(pPar,
i);
711 pMethVar->
Get( aVals );
716 pMethVar->
Get( aVals );
722 else if( pHint->
GetId() == SfxHintId::BasicDataChanged )
726 bool bSet = pProcProperty->
isSet();
729 pProcProperty->
setSet(
false );
731 OUString aProcName =
"Property Set "
737 OUString aProcName =
"Property Let "
746 xArray->Put(pMethVar, 0);
747 xArray->Put(pVar, 1);
751 pMethVar->
Get( aVals );
763 if( pHint->
GetId() == SfxHintId::BasicDataWanted )
784 bool bForwardToSbxObject =
true;
787 if( (
nId == SfxHintId::BasicDataWanted ||
nId == SfxHintId::BasicDataChanged) &&
788 pVar->
GetName().equalsIgnoreAsciiCase(
"name" ) )
790 bForwardToSbxObject =
false;
792 if( bForwardToSbxObject )
811 while( !aTok.
IsEof() )
817 while( !aTok.
IsEof() )
837 eCurTok = aTok.
Next();
845 bool bIsVBA = ( aTok.
GetDbl()== 1 );
857 sal_uInt16 nLine1 = aTok.
GetLine();
860 OUString aName_( aTok.
GetSym() );
879 while( !aTok.
IsEof() )
881 if( aTok.
Next() == eEndTok )
905 for (sal_uInt32
i = 0;
i < pObjs->
Count();
i++)
908 if(
dynamic_cast<const SbxObject *
>(pVar) !=
nullptr )
928 pVar->SbxValue::Clear();
934 pVar->SbxValue::Clear();
940 pVar->SbxValue::Clear();
946 pVar->SbxValue::Clear();
951 for( sal_uInt32
i = 0 ;
i <
nCount ;
i++ )
971 while(
p->GetParent() )
990 xFactory->createInstance(
"ooo.vba.VBAGlobals" );
1002 std::unique_ptr<SbiRuntime> m_xRt;
1007 : m_xRt(new
SbiRuntime(pModule, pMethod, nArg))
1008 , m_pSbData(pSbData)
1009 , m_pOldMod(pSbData->pMod)
1012 m_pSbData->
pMod = pModule;
1017 while (m_xRt->Step()) {}
1019 virtual ~RunInitGuard()
1022 m_pSbData->
pMod = m_pOldMod;
1027 class RunGuard :
public RunInitGuard
1033 : RunInitGuard(pModule, pMethod, nArg, pSbData)
1034 , m_bDelInst(bDelInst)
1037 m_xRt->pNext->block();
1039 virtual ~RunGuard()
override
1042 m_xRt->pNext->unblock();
1074 static sal_uInt16 nMaxCallLevel = 0;
1078 bool bDelInst = pSbData->
pInst ==
nullptr;
1081 uno::Reference< frame::XModel >
xModel;
1082 uno::Reference< script::vba::XVBACompatibility > xVBACompat;
1100 xVBACompat->broadcastVBAScriptEvent( script::vba::VBAScriptEventId::SCRIPT_STARTED,
GetName() );
1102 catch(
const uno::Exception& )
1113 if( pMSOMacroRuntimeLibVar )
1116 if( pMSOMacroRuntimeLib )
1121 pMSOMacroRuntimeLib->
SetFlag( nGblFlag );
1130 if( nMaxCallLevel == 0 )
1134 getrlimit ( RLIMIT_STACK, &rl );
1139 nMaxCallLevel = rl.rlim_cur / 900;
1143 nMaxCallLevel = rl.rlim_cur / 1650;
1145 nMaxCallLevel = 5800;
1172 RunGuard xRuntimeGuard(
this, pMeth, pMeth->
nStart, pSbData, bDelInst);
1177 xRuntimeGuard.run();
1189 delete pSbData->
pInst;
1190 pSbData->
pInst =
nullptr;
1199 if( xVBACompat.is() )
1204 xVBACompat->broadcastVBAScriptEvent( script::vba::VBAScriptEventId::SCRIPT_STOPPED,
GetName() );
1206 catch(
const uno::Exception& )
1231 delete pSbData->
pInst;
1232 pSbData->
pInst =
nullptr;
1257 RunInitGuard(
this,
nullptr, 0, pSbData).run();
1260 pImage->bFirstInit =
false;
1273 if (
aName == rModuleVariableName )
1294 for (sal_uInt32
i = 0;
i <
pProps->Count();
i++)
1305 for (sal_uInt32 j = 0; j < pArray->
Count(); j++)
1308 pj->SbxValue::Clear();
1314 p->SbxValue::Clear();
1326 if( pObj ==
nullptr )
1332 if( pMod !=
nullptr )
1335 while( (
p =
p->GetParent()) !=
nullptr )
1338 if( pBasic !=
nullptr && pBasic == pDeletedBasic )
1340 pVar->SbxValue::Clear();
1348 for (sal_uInt32
i = 0;
i <
pProps->Count();
i++)
1358 for (sal_uInt32 j = 0; j < pArray->
Count(); j++)
1376 for (
const auto& rModule:
pModules)
1379 if( rModule->pImage && rModule->pImage->bInit && !rModule->isProxyModule() &&
dynamic_cast<const SbObjModule*
>( rModule.get()) ==
nullptr )
1380 rModule->ClearPrivateVars();
1421 if( pParentParentBasic )
1435 pBasic =
dynamic_cast<StarBASIC*
>( pParent_ );
1450 bool bFollowJumps,
const SbiImage* pImg )
const
1452 sal_uInt32 nPC =
static_cast<sal_uInt32
>(
p -
pImage->GetCode() );
1453 while( nPC < pImage->GetCodeSize() )
1459 SAL_WARN_IF( !pImg,
"basic",
"FindNextStmnt: pImg==NULL with FollowJumps option" );
1460 sal_uInt32 nOp1 = *
p++; nOp1 |= *
p++ << 8;
1461 nOp1 |= *
p++ << 16; nOp1 |= *
p++ << 24;
1472 nl = *
p++; nl |= *
p++ << 8;
1473 nl |= *
p++ << 16 ; nl |= *
p++ << 24;
1474 nc = *
p++; nc |= *
p++ << 8;
1475 nc |= *
p++ << 16 ; nc |= *
p++ << 24;
1476 nLine =
static_cast<sal_uInt16
>(nl); nCol =
static_cast<sal_uInt16
>(nc);
1511 for(
size_t i = 0;
i <
pBreaks->size();
i++ )
1513 sal_uInt16 b =
pBreaks->operator[](
i );
1530 [&nLine](
const sal_uInt16 b) { return b <= nLine; });
1531 if (it !=
pBreaks->end() && *it == nLine)
1548 [&nLine](
const sal_uInt16 b) { return b <= nLine; });
1549 bRes = (it !=
pBreaks->end()) && (*it == nLine);
1574 for (sal_uInt32
i = 0;
i <
pMethods->Count();
i++)
1601 std::unique_ptr<SbiImage>
p(
new SbiImage);
1602 sal_uInt32 nImgVer = 0;
1604 if( !
p->Load(
rStrm, nImgVer ) )
1612 p->ReleaseLegacyBuffer();
1616 if(
p->GetCodeSize() )
1636 bool bFixup = (
pImage && !
pImage->ExceedsLegacyLimits() );
1641 return {
false, 0 };
1679class ErrorHdlResetter
1685 : mErrHandler(
StarBASIC::GetGlobalErrorHdl())
1697 bool HasError()
const {
return mbError; }
1710 ErrorHdlResetter aErrHdl;
1713 auto pParser = std::make_unique<SbiParser>(
static_cast<StarBASIC*
>(
GetParent()),
this );
1714 pParser->SetCodeCompleting(
true);
1716 while( pParser->Parse() ) {}
1719 for( sal_uInt16
i = 0;
i < pPool->
GetSize(); ++
i )
1724 aCache.InsertGlobalVar( pSymDef->
GetName(), pParser->aGblStrings.Find(pSymDef->
GetTypeId()) );
1727 for(sal_uInt16 j = 0; j < rChildPool.
GetSize(); ++j )
1732 aCache.InsertLocalVar( pSymDef->
GetName(), pChildSymDef->
GetName(), pParser->aGblStrings.Find(pChildSymDef->
GetTypeId()) );
1746 static const unsigned char pEmptyImage[] = { 0x45, 0x0 , 0x0, 0x0, 0x0 };
1751 ErrorHdlResetter aGblErrHdl;
1753 if (aGblErrHdl.HasError())
1758 if (
pImage && (
pImage->GetCodeSize() != 5 || (memcmp(
pImage->GetCode(), pEmptyImage,
pImage->GetCodeSize()) != 0 )))
1774 pImage->aOUSource.clear();
1798 for (
i = 0;
i <
p->Count();
i++)
1805 for (
i = 0;
i <
p->Count();
i++)
1827 if( pHint->
GetId() == SfxHintId::BasicDataWanted )
1829 OUString aProcName =
"Property Get "
1839 sal_uInt32 nVarParCount = (pArg !=
nullptr) ? pArg->
Count() : 0;
1840 if( nVarParCount > 1 )
1843 xMethParameters->Put(pMeth, 0);
1844 for( sal_uInt32
i = 1 ;
i < nVarParCount ; ++
i )
1847 xMethParameters->Put(pPar,
i);
1851 pMeth->
Get( aVals );
1856 pMeth->
Get( aVals );
1862 else if( pHint->
GetId() == SfxHintId::BasicDataChanged )
1866 bool bSet = pProcProperty->
isSet();
1869 pProcProperty->
setSet(
false );
1871 OUString aProcName =
"Property Set "
1877 OUString aProcName =
"Property Let "
1886 xArray->Put(pMeth, 0);
1887 xArray->Put(pVar, 1);
1891 pMeth->
Get( aVals );
1924 return {
false, 0 };
1983 sal_Int16 nTempStart =
static_cast<sal_Int16
>(
nStart);
1991 sal_uInt16 nMult = nFlag & 0x7FFF;
1992 sal_Int16
const nMax = std::numeric_limits<sal_Int16>::max();
1993 nStart = nMult * nMax + nTempStart;
2015 return {
false, 0 };
2018 const sal_uInt32 nMax = std::numeric_limits<sal_Int16>::max();
2021 const sal_Int16 nStartTemp =
nStart % nMax;
2022 sal_uInt16 nDebugFlagsTemp =
static_cast<sal_uInt16
>(
nDebugFlags);
2025 assert(
nStart <= nMax * 0x7FFF);
2026 nDebugFlagsTemp = (
nStart / nMax) | 0x8000;
2058 SAL_INFO(
"basic",
"SbMethod::Call Have been passed a caller 0x" << pCaller );
2071 if(
bInvalid && !pMod_->Compile() )
2098 if( nHintId == SfxHintId::BasicDataWanted )
2101 if( nHintId == SfxHintId::BasicDataChanged )
2109 std::unique_ptr<SfxBroadcaster> pSaveBroadcaster = std::move(
mpBroadcaster);
2115 mpPar->PutDirect( xThisCopy.
get(), 0 );
2126 Put( xThisCopy->GetValues_Impl() );
2144 :
SbModule( rName, bIsVbaCompatible )
2147 if (
mInfo.ModuleType == script::ModuleType::FORM )
2151 else if (
mInfo.ModuleObject.is() )
2165 if ( pUnoObj && pUnoObj->
getUnoAny() == aObj )
2169 css::uno::Reference< css::lang::XServiceInfo > xServiceInfo( aObj, css::uno::UNO_QUERY_THROW );
2170 if( xServiceInfo->supportsService(
"ooo.vba.excel.Worksheet" ) )
2174 else if( xServiceInfo->supportsService(
"ooo.vba.excel.Workbook" ) )
2202typedef ::cppu::WeakImplHelper<
2203 awt::XTopWindowListener,
2204 awt::XWindowListener,
2229 uno::Reference< awt::XTopWindow >(
mxComponent, uno::UNO_QUERY_THROW )->addTopWindowListener(
this );
2231 catch(
const uno::Exception& ) {}
2234 uno::Reference< awt::XWindow >(
mxComponent, uno::UNO_QUERY_THROW )->addWindowListener(
this );
2236 catch(
const uno::Exception& ) {}
2243 uno::Reference< document::XDocumentEventBroadcaster >(
mxModel, uno::UNO_QUERY_THROW )->addDocumentEventListener(
this );
2245 catch(
const uno::Exception& ) {}
2262 uno::Reference< awt::XTopWindow >(
mxComponent, uno::UNO_QUERY_THROW )->removeTopWindowListener(
this );
2264 catch(
const uno::Exception& ) {}
2267 uno::Reference< awt::XWindow >(
mxComponent, uno::UNO_QUERY_THROW )->removeWindowListener(
this );
2269 catch(
const uno::Exception& ) {}
2277 uno::Reference< document::XDocumentEventBroadcaster >(
mxModel, uno::UNO_QUERY_THROW )->removeDocumentEventListener(
this );
2279 catch(
const uno::Exception& ) {}
2302 uno::Reference< awt::XDialog > xDialog( e.Source, uno::UNO_QUERY );
2305 uno::Reference< awt::XControl > xControl( xDialog, uno::UNO_QUERY );
2306 if ( xControl->getPeer().is() )
2308 uno::Reference< document::XVbaMethodParameter > xVbaMethodParameter( xControl->getPeer(), uno::UNO_QUERY );
2309 if ( xVbaMethodParameter.is() )
2312 sal_Int8 nCloseMode = ::ooo::vba::VbQueryClose::vbFormControlMenu;
2316 aParams[0] <<= nCancel;
2317 aParams[1] <<= nCloseMode;
2379 virtual void SAL_CALL
windowShown(
const lang::EventObject& )
override
2400 virtual void SAL_CALL
disposing(
const lang::EventObject& )
override
2423 SAL_INFO(
"basic",
" SbUserFormModule::ResetApiObj( " << (bTriggerTerminateEvent ?
"true )" :
"false )") );
2424 if ( bTriggerTerminateEvent &&
m_xDialog.is() )
2440 SAL_INFO(
"basic",
"trigger " << aMethodToRun);
2448 auto xArray = tools::make_ref<SbxArray>();
2449 xArray->Put(pMeth, 0);
2451 for ( sal_Int32 i = 0;
i <
aArguments.getLength(); ++
i )
2453 auto xSbxVar = tools::make_ref<SbxVariable>(
SbxVARIANT );
2455 xArray->Put(xSbxVar.
get(),
static_cast<sal_uInt32
>(i) + 1);
2464 pMeth->
Get( aVals );
2467 for ( sal_Int32 i = 0;
i <
aArguments.getLength(); ++
i )
2469 pArguments[
i] =
sbxToUnoValue(xArray->Get(
static_cast<sal_uInt32
>(i) + 1));
2476 pMeth->
Get( aVals );
2521 const OUString& rName,
const css::script::ModuleInfo& mInfo,
bool bIsVBACompat )
2523 , m_pParentModule( pParentModule )
2557 aParams[0] >>= nCancel;
2575 SAL_INFO(
"basic",
"Attempting to run the UnloadObjectMethod");
2578 bool bWaitForDispose =
true;
2582 SAL_INFO(
"basic",
"Showing " << bWaitForDispose );
2585 if ( !bWaitForDispose )
2590 SAL_INFO(
"basic",
"UnloadObject completed (we hope)");
2603 xVBACompat->broadcastVBAScriptEvent( script::vba::VBAScriptEventId::INITIALIZE_USERFORM,
GetName() );
2604 uno::Reference< lang::XMultiServiceFactory > xVBAFactory( pGlobs->
getUnoAny(), uno::UNO_QUERY_THROW );
2606 OUString sDialogUrl(
"vnd.sun.star.script:" );
2607 OUString sProjectName(
"Standard" );
2612 uno::Reference< script::vba::XVBACompatibility > xVBAMode( xProps->getPropertyValue(
"BasicLibraries" ), uno::UNO_QUERY_THROW );
2613 sProjectName = xVBAMode->getProjectName();
2617 sDialogUrl += sProjectName +
"." +
GetName() +
"?location=document";
2619 uno::Reference< awt::XDialogProvider > xProvider = awt::DialogProvider::createWithModel( xContext,
m_xModel );
2620 m_xDialog = xProvider->createDialog( sDialogUrl );
2623 uno::Sequence< uno::Any > aArgs
2632 uno::Reference< lang::XComponent > xComponent(
m_xDialog, uno::UNO_QUERY_THROW );
2640 pParentBasic =
dynamic_cast<StarBASIC*
>( pObjParent );
2641 pCurObject = pObjParent;
2643 while( pParentBasic ==
nullptr && pCurObject !=
nullptr );
2645 SAL_WARN_IF( pParentBasic ==
nullptr,
"basic",
"pParentBasic == NULL" );
2656 catch(
const uno::Exception& )
AgileEncryptionInfo & mInfo
Reference< XAggregation > m_xAggProxy
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
static AsyncQuitHandler & instance()
static OUString GetEventName(GlobalEventId nID)
virtual ~SbIfaceMapperMethod() override
virtual ~SbJScriptMethod() override
virtual bool LoadData(SvStream &, sal_uInt16) override
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
virtual SbxInfo * GetInfo() override
virtual ~SbMethod() override
ErrCode Call(SbxValue *pRet, SbxVariable *pCaller=nullptr)
BasicDebugFlags GetDebugFlags() const
friend class SbJScriptMethod
BasicDebugFlags nDebugFlags
void GetLineRange(sal_uInt16 &, sal_uInt16 &)
virtual bool LoadData(SvStream &, sal_uInt16) override
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
virtual void Broadcast(SfxHintId nHintId) override
SAL_DLLPRIVATE SbMethod * GetMethod(const OUString &, SbxDataType)
SAL_DLLPRIVATE bool ExceedsImgVersion12ModuleSize()
virtual SAL_DLLPRIVATE bool LoadCompleted() override
SAL_DLLPRIVATE const sal_uInt8 * FindNextStmnt(const sal_uInt8 *, sal_uInt16 &, sal_uInt16 &) const
SAL_DLLPRIVATE const SbxObject * FindType(const OUString &aTypeName) const
SAL_DLLPRIVATE void GetProcedureProperty(const OUString &, SbxDataType)
SAL_DLLPRIVATE void GlobalRunDeInit()
virtual SAL_DLLPRIVATE std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
void GetCodeCompleteDataFromParse(CodeCompleteDataCache &aCache)
SAL_DLLPRIVATE bool IsBP(sal_uInt16 nLine) const
static OUString GetKeywordCase(std::u16string_view sKeyword)
static BASIC_DLLPRIVATE void implClearIfVarDependsOnDeletedBasic(SbxVariable *pVar, StarBASIC *pDeletedBasic)
const SbxArrayRef & GetMethods() const
virtual SAL_DLLPRIVATE SbxVariable * Find(const OUString &, SbxClassType) override
sal_Int32 GetModuleType() const
virtual SAL_DLLPRIVATE bool LoadData(SvStream &, sal_uInt16) override
virtual SAL_DLLPRIVATE void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
bool SetBP(sal_uInt16 nLine)
SAL_DLLPRIVATE void StartDefinitions()
SAL_DLLPRIVATE void RunInit()
SAL_DLLPRIVATE SbProperty * GetProperty(const OUString &, SbxDataType)
SbMethod * FindMethod(const OUString &, SbxClassType)
std::unique_ptr< SbiImage > pImage
SAL_DLLPRIVATE void fixUpMethodStart(bool bCvtToLegacy, SbiImage *pImg=nullptr) const
SAL_DLLPRIVATE bool HasExeCode()
SAL_DLLPRIVATE void EndDefinitions(bool=false)
bool ClearBP(sal_uInt16 nLine)
SbModule(const SbModule &)=delete
std::vector< OUString > mModuleVariableNames
void SetModuleType(sal_Int32 nType)
SAL_DLLPRIVATE void AddVarName(const OUString &aName)
css::uno::Reference< css::script::XInvocation > mxWrapper
SAL_DLLPRIVATE void ClearVarsDependingOnDeletedBasic(StarBASIC *pDeletedBasic)
SAL_DLLPRIVATE void ClearPrivateVars()
std::unique_ptr< SbClassData > pClassData
SAL_DLLPRIVATE void SetVBASupport(bool bSupport)
SAL_DLLPRIVATE void LoadBinaryData(SvStream &)
SAL_DLLPRIVATE void GetIfaceMapperMethod(const OUString &, SbMethod *)
virtual SAL_DLLPRIVATE void SetParent(SbxObject *) override
SAL_DLLPRIVATE void StoreBinaryData(SvStream &)
virtual ~SbModule() override
SAL_DLLPRIVATE void Run(SbMethod *)
SAL_DLLPRIVATE bool IsBreakable(sal_uInt16 nLine) const
css::uno::Reference< css::script::XInvocation > const & GetUnoModule()
SAL_DLLPRIVATE void handleProcedureProperties(SfxBroadcaster &rBC, const SfxHint &rHint)
SAL_DLLPRIVATE void RemoveVars()
void SetSource32(const OUString &r)
virtual SAL_DLLPRIVATE void Clear() override
bool IsVBASupport() const
SAL_DLLPRIVATE void GlobalRunInit(bool bBasicStart)
SbObjModule(const OUString &rName, const css::script::ModuleInfo &mInfo, bool bIsVbaCompatible)
virtual ~SbObjModule() override
SbxVariable * GetObject()
void SetUnoObject(const css::uno::Any &aObj)
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual SbxVariable * Find(const OUString &rName, SbxClassType t) override
virtual ~SbProcedureProperty() override
virtual ~SbProperty() override
SbProperty(const OUString &, SbxDataType, SbModule *)
css::uno::Any getUnoAny()
bool Save(SvStream &, sal_uInt32)
const sal_uInt8 * GetCode() const
sal_uInt16 CalcLegacyOffset(sal_Int32 nOffset)
sal_uInt32 CalcNewOffset(sal_Int16 nOffset)
void CalcBreakCallLevel(BasicDebugFlags nFlags)
bool IsCompatibility() const
void EnableCompatibility(bool bEnable)
void SetDebugFlags(BasicDebugFlags nFl)
void SetCompatible(bool b)
SbxDataType GetType() const
const OUString & GetSym() const
sal_Int32 GetLine() const
sal_uInt16 GetTypeId() const
SbxDataType GetType() const
const OUString & GetName()
SbiSymDef * Get(sal_uInt16)
sal_uInt16 GetSize() const
static OUString GetKeywordCase(std::u16string_view sKeyword)
SbxVariable * Get(sal_uInt32)
static void SetError(ErrCode)
void SetFlags(SbxFlagBits n)
static ErrCode const & GetError()
bool IsSet(SbxFlagBits n) const
void SetFlag(SbxFlagBits n)
SbxFlagBits GetFlags() const
void ResetFlag(SbxFlagBits n)
SbxVariable * GetVar() const
virtual void Clear() override
SbxArray * GetProperties()
virtual void Clear() override
virtual SbxVariable * Find(const OUString &, SbxClassType)
void SetClassName(const OUString &rNew)
void Remove(const OUString &, SbxClassType)
virtual bool LoadData(SvStream &, sal_uInt16) override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
virtual bool IsClass(const OUString &) const
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
SbxBase * GetObject() const
bool PutObject(SbxBase *)
bool SetType(SbxDataType)
bool Get(SbxValues &) const
bool Put(const SbxValues &)
const SbxObject * GetParent() const
virtual bool LoadData(SvStream &, sal_uInt16) override
SfxBroadcaster & GetBroadcaster()
void SetName(const OUString &)
void SetParameters(SbxArray *p)
virtual SbxDataType GetType() const override
SbxArray * GetParameters() const
const OUString & GetName(SbxNameType=SbxNameType::NONE) const
std::unique_ptr< SfxBroadcaster > mpBroadcaster
virtual std::pair< bool, sal_uInt32 > StoreData(SvStream &) const override
bool IsBroadcaster() const
virtual void SetParent(SbxObject *)
virtual void SetModified(bool) override
void Broadcast(const SfxHint &rHint)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
virtual SbxVariable * Find(const OUString &, SbxClassType) override
static void SetGlobalErrorHdl(const Link< StarBASIC *, bool > &rNewHdl)
bool GetUNOConstant(const OUString &rName, css::uno::Any &aOut)
bool IsQuitApplication() const
static void Error(ErrCode, const OUString &rMsg={})
void InitAllModules(StarBASIC const *pBasicNotToInit=nullptr)
static void FatalError(ErrCode)
void ClearAllModuleVars()
SvStream & ReadCharAsBool(bool &rBool)
SvStream & WriteUniOrByteString(std::u16string_view rStr, rtl_TextEncoding eDestCharSet)
OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet)
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & WriteBool(bool b)
SvStream & WriteInt16(sal_Int16 nInt16)
SvStream & WriteUChar(unsigned char nChar)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
SvStream & ReadUChar(unsigned char &rChar)
css::uno::Type const & get()
#define TOOLS_WARN_EXCEPTION(area, stream)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
Reference< XSingleServiceFactory > xFactory
Sequence< PropertyValue > aArguments
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
def run(arg=None, arg2=-1)
void enableContainerWindowsOfAllDocuments(const uno::Reference< frame::XModel > &rxModel, bool bEnableWindows)
void lockControllersOfAllDocuments(const uno::Reference< frame::XModel > &rxModel, bool bLockControllers)
::std::map< sal_Int16, Any > OutParamMap
bool hasProperty(const OUString &_rName, const Reference< XPropertySet > &_rxSet)
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
Reference< XComponentContext > getProcessComponentContext()
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
css::beans::Optional< css::uno::Any > getValue(std::u16string_view id)
SVX_DLLPUBLIC OUString getProperty(css::uno::Reference< css::beans::XPropertyContainer > const &rxPropertyContainer, OUString const &rName)
def invoke(object, methodname, argTuple)
RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, rtl_uString *keyName, RegValueType valueType, RegValue pData, sal_uInt32 valueSize)
#define ERRCODE_BASIC_BAD_ACTION
#define ERRCODE_BASIC_BAD_PROP_VALUE
#define ERRCODE_BASIC_PROC_UNDEFINED
#define ERRCODE_BASIC_INTERNAL_ERROR
#define ERRCODE_BASIC_STACK_OVERFLOW
std::deque< sal_uInt16 > SbiBreakpoints
void registerComponentToBeDisposedForBasic(const Reference< XComponent > &xComponent, StarBASIC *pBasic)
void clearNativeObjectWrapperVector()
void unoToSbxValue(SbxVariable *pVar, const Any &aValue)
Any sbxToUnoValue(const SbxValue *pVar)
::cppu::WeakImplHelper< XInvocation > DocObjectWrapper_BASE
static void SendHint(SbxObject *pObj, SfxHintId nId, SbMethod *p)
static void ClearUnoObjectsInRTL_Impl(StarBASIC *pBasic)
static uno::Reference< vba::XVBACompatibility > getVBACompatibility(const uno::Reference< frame::XModel > &rxModel)
static bool getDefaultVBAMode(StarBASIC *pb)
::cppu::WeakImplHelper< awt::XTopWindowListener, awt::XWindowListener, document::XDocumentEventListener > FormObjEventListener_BASE
std::map< sal_Int16, Any > OutParamMap
uno::Reference< frame::XModel > getDocumentModel(StarBASIC *pb)
IMPL_LINK(ErrorHdlResetter, BasicErrorHdl, StarBASIC *,, bool)
static void SendHint_(SbxObject *pObj, SfxHintId nId, SbMethod *p)
static void ClearUnoObjectsInRTL_Impl_Rek(StarBASIC *pBasic)
static OUString pNameProp
StarBASIC * pMSOMacroRuntimLib
Reference< XModel > xModel