28#include <com/sun/star/script/provider/ScriptFrameworkErrorException.hpp>
29#include <com/sun/star/script/provider/ScriptFrameworkErrorType.hpp>
32#include <com/sun/star/beans/PropertyAttribute.hpp>
47#define BASSCRIPT_PROPERTY_ID_CALLER 1
50#define BASSCRIPT_DEFAULT_ATTRIBS() PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT
60 ,OPropertyContainer( GetBroadcastHelper() )
62 ,m_funcName(
std::move( funcName ))
63 ,m_documentBasicManager( nullptr )
64 ,m_xDocumentScriptContext()
72 ,OPropertyContainer( GetBroadcastHelper() )
74 ,m_funcName(
std::move( funcName ))
75 ,m_documentBasicManager( &documentBasicManager )
76 ,m_xDocumentScriptContext( documentScriptContext )
98 OSL_ENSURE(
false,
"BasicScriptImpl::Notify: where does this come from?" );
102 if ( rHint.
GetId() == SfxHintId::Dying )
127 return *getArrayHelper();
136 Sequence< Property > aProps;
138 return new ::cppu::OPropertyArrayHelper( aProps );
147 Reference< XPropertySetInfo > xInfo( createPropertySetInfo(
getInfoHelper() ) );
172 sal_Int32 nParamsCount = aParams.getLength();
176 sal_Int32 nSbxOptional = 0;
178 for (
const SbxParamInfo* pParamInfo = pInfo->GetParam(
n ); pParamInfo; pParamInfo = pInfo->GetParam( ++
n ) )
180 if ( pParamInfo->nFlags & SbxFlagBits::Optional )
185 sal_Int32 nSbxCount =
n - 1;
186 if ( nParamsCount < nSbxCount - nSbxOptional )
188 throw provider::ScriptFrameworkErrorException(
189 "wrong number of parameters!",
190 Reference< XInterface >(),
193 provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT );
199 if ( nParamsCount > 0 )
202 const Any* pParams = aParams.getConstArray();
203 for ( sal_Int32
i = 0;
i < nParamsCount; ++
i )
207 xSbxParams->Put(xSbxVar.
get(),
static_cast<sal_uInt32
>(
i) + 1);
211 if (
auto*
p = pInfo->GetParam(
static_cast<sal_uInt16
>(
i) + 1))
219 sal_Int32 val = xSbxVar->GetLong();
220 if (val >= -16777216 && val <= 16777215)
231 xSbxVar->SetFlag(SbxFlagBits::Fixed);
236 if ( xSbxParams.
is() )
244 Any aOldThisComponent;
266 if ( xSbxParams.
is() )
274 assert(
nCount <= std::numeric_limits<sal_uInt16>::max());
275 const SbxParamInfo* pParamInfo = pInfo_->GetParam( sal::static_int_cast<sal_uInt16>(
n) );
286 sal_Int32 nOutParamCount = aOutParamMap.size();
287 aOutParamIndex.realloc( nOutParamCount );
288 aOutParam.realloc( nOutParamCount );
289 sal_Int16* pOutParamIndex = aOutParamIndex.getArray();
290 Any* pOutParam = aOutParam.getArray();
291 for (
const auto& rEntry : aOutParamMap )
293 *pOutParamIndex = rEntry.first;
295 *pOutParam = rEntry.second;
#define BASSCRIPT_PROPERTY_ID_CALLER
#define BASSCRIPT_DEFAULT_ATTRIBS()
void SetGlobalUNOConstant(const OUString &rName, const css::uno::Any &_rValue, css::uno::Any *pOldValue=nullptr)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
BasicManager * m_documentBasicManager
css::uno::Reference< css::document::XScriptInvocationContext > m_xDocumentScriptContext
virtual ~BasicScriptImpl() override
css::uno::Sequence< css::uno::Any > m_caller
BasicScriptImpl(OUString funcName, SbMethodRef xMethod)
virtual css::uno::Any SAL_CALL invoke(const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Sequence< sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam) override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
void describeProperties(css::uno::Sequence< css::beans::Property > &_rProps) const
void registerProperty(const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
::cppu::WeakImplHelper< css::script::provider::XScript > BasicScriptImpl_BASE
constexpr OUStringLiteral BASSCRIPT_PROPERTY_CALLER
::std::map< sal_Int16, Any > OutParamMap
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
void unoToSbxValue(SbxVariable *pVar, const Any &aValue)
Any sbxToUnoValue(const SbxValue *pVar)