SbxArray: drop 16-bit indices

Change-Id: I43b478187636b9bb53fdf7ab938436ae364bd7a7
Reviewed-on: https://gerrit.libreoffice.org/84733
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2019-12-09 14:18:25 +01:00
parent 6303f8ac29
commit 62f3f3d92a
42 changed files with 1332 additions and 1467 deletions
+6 -6
View File
@@ -336,9 +336,9 @@ void ModulWindow::BasicExecute()
const sal_uInt32 nCurMethodStart = aSel.GetStart().GetPara() + 1;
SbMethod* pMethod = nullptr;
// first Macro, else blind "Main" (ExtSearch?)
for ( sal_uInt16 nMacro = 0; nMacro < m_xModule->GetMethods()->Count(); nMacro++ )
for ( sal_uInt32 nMacro = 0; nMacro < m_xModule->GetMethods()->Count32(); nMacro++ )
{
SbMethod* pM = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMacro ));
SbMethod* pM = static_cast<SbMethod*>(m_xModule->GetMethods()->Get32( nMacro ));
assert(pM && "Method?");
pM->GetLineRange( nStart, nEnd );
if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd )
@@ -526,9 +526,9 @@ void ModulWindow::ToggleBreakPoint( sal_uLong nLine )
GetBreakPoints().InsertSorted( BreakPoint( nLine ) );
if ( StarBASIC::IsRunning() )
{
for ( sal_uInt16 nMethod = 0; nMethod < m_xModule->GetMethods()->Count(); nMethod++ )
for ( sal_uInt32 nMethod = 0; nMethod < m_xModule->GetMethods()->Count32(); nMethod++ )
{
SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMethod ));
SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get32( nMethod ));
assert(pMethod && "Method not found! (NULL)");
pMethod->SetDebugFlags( pMethod->GetDebugFlags() | BasicDebugFlags::Break );
}
@@ -1295,9 +1295,9 @@ void ModulWindow::BasicStarted()
{
rList.ResetHitCount();
rList.SetBreakPointsInBasic( m_xModule.get() );
for ( sal_uInt16 nMethod = 0; nMethod < m_xModule->GetMethods()->Count(); nMethod++ )
for ( sal_uInt32 nMethod = 0; nMethod < m_xModule->GetMethods()->Count32(); nMethod++ )
{
SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMethod ));
SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get32( nMethod ));
assert(pMethod && "Method not found! (NULL)");
pMethod->SetDebugFlags( pMethod->GetDebugFlags() | BasicDebugFlags::Break );
}
+30 -29
View File
@@ -1118,9 +1118,9 @@ void EditorWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
OUString EditorWindow::GetActualSubName( sal_uLong nLine )
{
SbxArrayRef pMethods = rModulWindow.GetSbModule()->GetMethods();
for( sal_uInt16 i=0; i < pMethods->Count(); i++ )
for( sal_uInt32 i=0; i < pMethods->Count32(); i++ )
{
SbMethod* pMeth = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
SbMethod* pMeth = dynamic_cast<SbMethod*>( pMethods->Get32( i ) );
if( pMeth )
{
sal_uInt16 l1,l2;
@@ -1682,7 +1682,7 @@ struct WatchItem
SbxDimArrayRef mpArray;
int nDimLevel; // 0 = Root
int nDimCount;
std::vector<short> vIndices;
std::vector<sal_Int32> vIndices;
WatchItem* mpArrayParentItem;
@@ -1914,9 +1914,9 @@ void StackWindow::UpdateCalls()
{
aEntry.append("(");
// 0 is the sub's name...
for ( sal_uInt16 nParam = 1; nParam < pParams->Count(); nParam++ )
for ( sal_uInt32 nParam = 1; nParam < pParams->Count32(); nParam++ )
{
SbxVariable* pVar = pParams->Get( nParam );
SbxVariable* pVar = pParams->Get32( nParam );
assert(pVar && "Parameter?!");
if ( !pVar->GetName().isEmpty() )
{
@@ -1924,7 +1924,8 @@ void StackWindow::UpdateCalls()
}
else if ( pInfo )
{
const SbxParamInfo* pParam = pInfo->GetParam( nParam );
assert(nParam <= std::numeric_limits<sal_uInt16>::max());
const SbxParamInfo* pParam = pInfo->GetParam( sal::static_int_cast<sal_uInt16>(nParam) );
if ( pParam )
{
aEntry.append(pParam->aName);
@@ -1940,7 +1941,7 @@ void StackWindow::UpdateCalls()
{
aEntry.append(pVar->GetOUString());
}
if ( nParam < ( pParams->Count() - 1 ) )
if ( nParam < ( pParams->Count32() - 1 ) )
{
aEntry.append(", ");
}
@@ -2143,19 +2144,19 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent )
{
createAllObjectProperties( pObj );
SbxArray* pProps = pObj->GetProperties();
sal_uInt16 nPropCount = pProps->Count();
sal_uInt32 nPropCount = pProps->Count32();
if ( nPropCount >= 3 &&
pProps->Get( nPropCount -1 )->GetName().equalsIgnoreAsciiCase( "Dbg_Methods" ) &&
pProps->Get( nPropCount -2 )->GetName().equalsIgnoreAsciiCase( "Dbg_Properties" ) &&
pProps->Get( nPropCount -3 )->GetName().equalsIgnoreAsciiCase( "Dbg_SupportedInterfaces" ) )
pProps->Get32( nPropCount -1 )->GetName().equalsIgnoreAsciiCase( "Dbg_Methods" ) &&
pProps->Get32( nPropCount -2 )->GetName().equalsIgnoreAsciiCase( "Dbg_Properties" ) &&
pProps->Get32( nPropCount -3 )->GetName().equalsIgnoreAsciiCase( "Dbg_SupportedInterfaces" ) )
{
nPropCount -= 3;
}
pItem->maMemberList.reserve(nPropCount);
for( sal_uInt16 i = 0 ; i < nPropCount ; ++i )
for( sal_uInt32 i = 0 ; i < nPropCount ; ++i )
{
SbxVariable* pVar = pProps->Get( i );
SbxVariable* pVar = pProps->Get32( i );
pItem->maMemberList.push_back(pVar->GetName());
OUString const& rName = pItem->maMemberList.back();
@@ -2190,10 +2191,10 @@ void WatchTreeListBox::RequestingChildren( SvTreeListEntry * pParent )
sal_Int32 j;
for( j = 0 ; j < nParentLevel ; j++ )
{
short n = pChildItem->vIndices[j] = pItem->vIndices[j];
sal_Int32 n = pChildItem->vIndices[j] = pItem->vIndices[j];
aIndexStr.append(OUString::number( n )).append(",");
}
pChildItem->vIndices[nParentLevel] = sal::static_int_cast<short>( i );
pChildItem->vIndices[nParentLevel] = i;
aIndexStr.append(OUString::number( i )).append(")");
OUString aDisplayName;
@@ -2246,7 +2247,7 @@ SbxBase* WatchTreeListBox::ImplGetSBXForEntry( SvTreeListEntry* pEntry, bool& rb
{
rbArrayElement = true;
if( pParentItem->nDimLevel + 1 == pParentItem->nDimCount )
pSBX = pArray->Get(pItem->vIndices.empty() ? nullptr : &*pItem->vIndices.begin());
pSBX = pArray->Get32(pItem->vIndices.empty() ? nullptr : &*pItem->vIndices.begin());
}
}
else
@@ -2356,8 +2357,8 @@ OUString implCreateTypeStringForDimArray( WatchItem* pItem, SbxDataType eType )
aRetStr += "(";
for( int i = nDimLevel ; i < nDims ; i++ )
{
short nMin, nMax;
pArray->GetDim( sal::static_int_cast<short>( i+1 ), nMin, nMax );
sal_Int32 nMin, nMax;
pArray->GetDim32( sal::static_int_cast<sal_Int32>( i+1 ), nMin, nMax );
aRetStr += OUString::number(nMin) + " to " + OUString::number(nMax);
if( i < nDims - 1 )
aRetStr += ", ";
@@ -2429,21 +2430,21 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
{
// Compare Array dimensions to see if array has changed
// Can be a copy, so comparing pointers does not work
sal_uInt16 nOldDims = pOldArray->GetDims();
sal_uInt16 nNewDims = pNewArray->GetDims();
sal_Int32 nOldDims = pOldArray->GetDims32();
sal_Int32 nNewDims = pNewArray->GetDims32();
if( nOldDims != nNewDims )
{
bArrayChanged = true;
}
else
{
for( int i = 0 ; i < nOldDims ; i++ )
for( sal_Int32 i = 0 ; i < nOldDims ; i++ )
{
short nOldMin, nOldMax;
short nNewMin, nNewMax;
sal_Int32 nOldMin, nOldMax;
sal_Int32 nNewMin, nNewMax;
pOldArray->GetDim( sal::static_int_cast<short>( i+1 ), nOldMin, nOldMax );
pNewArray->GetDim( sal::static_int_cast<short>( i+1 ), nNewMin, nNewMax );
pOldArray->GetDim32( i+1, nOldMin, nOldMax );
pNewArray->GetDim32( i+1, nNewMin, nNewMax );
if( nOldMin != nNewMin || nOldMax != nNewMax )
{
bArrayChanged = true;
@@ -2464,7 +2465,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
implEnableChildren(pEntry, true);
pItem->mpArray = pNewArray;
sal_uInt16 nDims = pNewArray->GetDims();
sal_Int32 nDims = pNewArray->GetDims32();
pItem->nDimLevel = 0;
pItem->nDimCount = nDims;
}
@@ -2487,10 +2488,10 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
{
bool bObjChanged = false; // Check if member list has changed
SbxArray* pProps = pObj->GetProperties();
sal_uInt16 nPropCount = pProps->Count();
for( sal_uInt16 i = 0 ; i < nPropCount - 3 ; i++ )
sal_uInt32 nPropCount = pProps->Count32();
for( sal_uInt32 i = 0 ; i < nPropCount - 3 ; i++ )
{
SbxVariable* pVar_ = pProps->Get( i );
SbxVariable* pVar_ = pProps->Get32( i );
if( pItem->maMemberList[i] != pVar_->GetName() )
{
bObjChanged = true;
+7 -7
View File
@@ -377,20 +377,20 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& rDocument, const OUSt
pMod = xModule.get();
}
sal_uInt16 nCount = pMod->GetMethods()->Count();
sal_uInt16 nRealCount = nCount;
for ( sal_uInt16 i = 0; i < nCount; i++ )
sal_uInt32 nCount = pMod->GetMethods()->Count32();
sal_uInt32 nRealCount = nCount;
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
SbMethod* pMethod = static_cast<SbMethod*>(pMod->GetMethods()->Get( i ));
SbMethod* pMethod = static_cast<SbMethod*>(pMod->GetMethods()->Get32( i ));
if( pMethod->IsHidden() )
--nRealCount;
}
aSeqMethods.realloc( nRealCount );
sal_uInt16 iTarget = 0;
for ( sal_uInt16 i = 0 ; i < nCount; ++i )
sal_uInt32 iTarget = 0;
for ( sal_uInt32 i = 0 ; i < nCount; ++i )
{
SbMethod* pMethod = static_cast<SbMethod*>(pMod->GetMethods()->Get( i ));
SbMethod* pMethod = static_cast<SbMethod*>(pMod->GetMethods()->Get32( i ));
if( pMethod->IsHidden() )
continue;
SAL_WARN_IF( !pMethod, "basctl.basicide","Method not found! (NULL)" );
+1 -1
View File
@@ -71,7 +71,7 @@ SbMethod* CreateMacro( SbModule* pModule, const OUString& rMacroName )
OUString aMacroName( rMacroName );
if ( aMacroName.isEmpty() )
{
if ( !pModule->GetMethods()->Count() )
if ( !pModule->GetMethods()->Count32() )
aMacroName = "Main" ;
else
{
+3 -3
View File
@@ -478,10 +478,10 @@ IMPL_LINK_NOARG(MacroChooser, BasicSelectHdl, weld::TreeView&, void)
m_xMacroBox->freeze();
size_t nMacroCount = pModule->GetMethods()->Count();
for ( size_t iMeth = 0; iMeth < nMacroCount; iMeth++ )
sal_uInt32 nMacroCount = pModule->GetMethods()->Count32();
for ( sal_uInt32 iMeth = 0; iMeth < nMacroCount; iMeth++ )
{
SbMethod* pMethod = static_cast<SbMethod*>(pModule->GetMethods()->Get( iMeth ));
SbMethod* pMethod = static_cast<SbMethod*>(pModule->GetMethods()->Get32( iMeth ));
assert(pMethod && "Method not found!");
if (pMethod->IsHidden())
continue;
+1 -1
View File
@@ -84,7 +84,7 @@ SbxVariableRef MacroSnippet::Run( const css::uno::Sequence< css::uno::Any >& rAr
{
SbxVariable* pVar = new SbxVariable();
unoToSbxValue( pVar, rArgs[ i ] );
aArgs->Put( pVar, i + 1 );
aArgs->Put32( pVar, i + 1 );
}
pMeth->SetParameters( aArgs.get() );
}
+6 -6
View File
@@ -1837,10 +1837,10 @@ sal_Bool DialogContainer_Impl::hasElements()
{
bool bRet = false;
sal_Int16 nCount = mpLib->GetObjects()->Count();
for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ )
sal_Int32 nCount = mpLib->GetObjects()->Count32();
for( sal_Int32 nObj = 0; nObj < nCount ; nObj++ )
{
SbxVariable* pVar = mpLib->GetObjects()->Get( nObj );
SbxVariable* pVar = mpLib->GetObjects()->Get32( nObj );
SbxObject* pObj = dynamic_cast<SbxObject*>(pVar);
if ( pObj && (pObj->GetSbxId() == SBXID_DIALOG ) )
{
@@ -1871,14 +1871,14 @@ uno::Any DialogContainer_Impl::getByName( const OUString& aName )
uno::Sequence< OUString > DialogContainer_Impl::getElementNames()
{
sal_Int16 nCount = mpLib->GetObjects()->Count();
sal_Int32 nCount = mpLib->GetObjects()->Count32();
uno::Sequence< OUString > aRetSeq( nCount );
OUString* pRetSeq = aRetSeq.getArray();
sal_Int32 nDialogCounter = 0;
for( sal_Int16 nObj = 0; nObj < nCount ; nObj++ )
for( sal_Int32 nObj = 0; nObj < nCount ; nObj++ )
{
SbxVariable* pVar = mpLib->GetObjects()->Get( nObj );
SbxVariable* pVar = mpLib->GetObjects()->Get32( nObj );
SbxObject* pObj = dynamic_cast<SbxObject*> (pVar);
if ( pObj && ( pObj->GetSbxId() == SBXID_DIALOG ) )
{
+7 -7
View File
@@ -241,8 +241,8 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
// Be still tolerant and make default search if no search basic exists
if( bSearchLib && xLibSearchBasic.is() )
{
sal_Int16 nCount = xLibSearchBasic->GetObjects()->Count();
for( sal_Int16 nObj = -1; nObj < nCount ; nObj++ )
sal_Int32 nCount = xLibSearchBasic->GetObjects()->Count32();
for( sal_Int32 nObj = -1; nObj < nCount ; nObj++ )
{
StarBASIC* pBasic;
if( nObj == -1 )
@@ -251,7 +251,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
}
else
{
SbxVariable* pVar = xLibSearchBasic->GetObjects()->Get( nObj );
SbxVariable* pVar = xLibSearchBasic->GetObjects()->Get32( nObj );
pBasic = dynamic_cast<StarBASIC*>( pVar );
}
if( pBasic )
@@ -291,7 +291,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any
{
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( xVar.get(), pArgs[i] );
xArray->Put( xVar.get(), sal::static_int_cast< sal_uInt16 >(i+1) );
xArray->Put32( xVar.get(), sal::static_int_cast< sal_uInt32 >(i+1) );
}
}
@@ -409,14 +409,14 @@ void RTL_Impl_CreateUnoDialog( SbxArray& rPar )
Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
// We need at least 1 parameter
if ( rPar.Count() < 2 )
if ( rPar.Count32() < 2 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// Get dialog
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
SbxBaseRef pObj = rPar.Get32( 1 )->GetObject();
if( !(pObj.is() && dynamic_cast<const SbUnoObject*>( pObj.get() ) != nullptr) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -540,7 +540,7 @@ void RTL_Impl_CreateUnoDialog( SbxArray& rPar )
// Return dialog
Any aRetVal;
aRetVal <<= xCntrl;
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
unoToSbxValue( refVar.get(), aRetVal );
}
+14 -12
View File
@@ -311,7 +311,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
}
}
pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() );
pTypeMembers->Insert32( pTypeElem, pTypeMembers->Count32() );
}
@@ -442,27 +442,29 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
// User defined types
if ( rTypes.is() )
{
sal_uInt16 nTypes = rTypes->Count();
sal_uInt32 nTypes = rTypes->Count32();
assert(nTypes <= std::numeric_limits<sal_uInt16>::max());
if (nTypes > 0 )
{
nPos = SbiOpenRecord( r, FileOffset::UserTypes, nTypes );
nPos = SbiOpenRecord( r, FileOffset::UserTypes, sal::static_int_cast<sal_uInt16>(nTypes) );
for (sal_uInt16 i = 0; i < nTypes; i++)
for (sal_uInt32 i = 0; i < nTypes; i++)
{
SbxObject* pType = static_cast< SbxObject* > ( rTypes->Get(i) );
SbxObject* pType = static_cast< SbxObject* > ( rTypes->Get32(i) );
OUString aTypeName = pType->GetClassName();
r.WriteUniOrByteString( aTypeName, eCharSet );
SbxArray *pTypeMembers = pType->GetProperties();
sal_uInt16 nTypeMembers = pTypeMembers->Count();
sal_uInt32 nTypeMembers = pTypeMembers->Count32();
assert(nTypeMembers <= std::numeric_limits<sal_uInt16>::max());
r.WriteInt16(nTypeMembers);
r.WriteInt16(sal::static_int_cast<sal_uInt16>(nTypeMembers));
for (sal_uInt16 j = 0; j < nTypeMembers; j++)
for (sal_uInt32 j = 0; j < nTypeMembers; j++)
{
SbxProperty* pTypeElem = static_cast< SbxProperty* > ( pTypeMembers->Get(j) );
SbxProperty* pTypeElem = static_cast< SbxProperty* > ( pTypeMembers->Get32(j) );
const OUString& aElemName = pTypeElem->GetName();
r.WriteUniOrByteString( aElemName, eCharSet );
@@ -497,7 +499,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
else
r.WriteInt16(0);
sal_Int32 nDims = pArray->GetDims();
sal_Int32 nDims = pArray->GetDims32();
r.WriteInt32(nDims);
for (sal_Int32 d = 0; d < nDims; d++)
@@ -596,7 +598,7 @@ void SbiImage::AddType(SbxObject const * pObject)
rTypes = new SbxArray;
}
SbxObject *pCopyObject = new SbxObject(*pObject);
rTypes->Insert (pCopyObject,rTypes->Count());
rTypes->Insert32 (pCopyObject,rTypes->Count32());
}
void SbiImage::AddEnum(SbxObject* pObject) // Register enum type
@@ -605,7 +607,7 @@ void SbiImage::AddEnum(SbxObject* pObject) // Register enum type
{
rEnums = new SbxArray;
}
rEnums->Insert( pObject, rEnums->Count() );
rEnums->Insert32( pObject, rEnums->Count32() );
}
// Note: IDs start with 1
+3 -3
View File
@@ -155,7 +155,7 @@ void RTL_Impl_CreatePropertySet( SbxArray& rPar )
{
// We need at least one parameter
// TODO: In this case < 2 is not correct ;-)
if ( rPar.Count() < 2 )
if ( rPar.Count32() < 2 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
@@ -165,11 +165,11 @@ void RTL_Impl_CreatePropertySet( SbxArray& rPar )
Reference< XInterface > xInterface = static_cast<OWeakObject*>(new SbPropertyValues());
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
if( xInterface.is() )
{
// Set PropertyValues
Any aArgAsAny = sbxToUnoValue( rPar.Get(1),
Any aArgAsAny = sbxToUnoValue( rPar.Get32(1),
cppu::UnoType<Sequence<PropertyValue>>::get() );
auto pArg = o3tl::doAccess<Sequence<PropertyValue>>(aArgAsAny);
Reference< XPropertyAccess > xPropAcc( xInterface, UNO_QUERY );
+29 -29
View File
@@ -553,11 +553,11 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
pDest->setHasFixedSize( pSource && pSource->hasFixedSize() );
if ( pSource && pSource->GetDims() && pSource->hasFixedSize() )
if ( pSource && pSource->GetDims32() && pSource->hasFixedSize() )
{
sal_Int32 lb = 0;
sal_Int32 ub = 0;
for ( sal_Int32 j = 1 ; j <= pSource->GetDims(); ++j )
for ( sal_Int32 j = 1 ; j <= pSource->GetDims32(); ++j )
{
pSource->GetDim32( j, lb, ub );
pDest->AddDim32( lb, ub );
@@ -565,7 +565,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
}
else
{
pDest->unoAddDim( 0, -1 ); // variant array
pDest->unoAddDim32( 0, -1 ); // variant array
}
SbxFlagBits nSavFlags = pVar->GetFlags();
pNewProp->ResetFlag( SbxFlagBits::Fixed );
@@ -996,10 +996,10 @@ StarBASIC::~StarBASIC()
// #100326 Set Parent NULL in registered listeners
if( xUnoListeners.is() )
{
sal_uInt16 uCount = xUnoListeners->Count();
for( sal_uInt16 i = 0 ; i < uCount ; i++ )
sal_uInt32 uCount = xUnoListeners->Count32();
for( sal_uInt32 i = 0 ; i < uCount ; i++ )
{
SbxVariable* pListenerObj = xUnoListeners->Get( i );
SbxVariable* pListenerObj = xUnoListeners->Get32( i );
pListenerObj->SetParent( nullptr );
}
xUnoListeners = nullptr;
@@ -1018,9 +1018,9 @@ void StarBASIC::implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic )
}
}
for( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
for( sal_uInt32 nObj = 0; nObj < pObjs->Count32(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
SbxVariable* pVar = pObjs->Get32( nObj );
StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
if( pBasic && pBasic != pDeletedBasic )
{
@@ -1225,9 +1225,9 @@ void StarBASIC::InitAllModules( StarBASIC const * pBasicNotToInit )
// Check all objects if they are BASIC,
// if yes initialize
for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
for ( sal_uInt32 nObj = 0; nObj < pObjs->Count32(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
SbxVariable* pVar = pObjs->Get32( nObj );
StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
if( pBasic && pBasic != pBasicNotToInit )
{
@@ -1249,9 +1249,9 @@ void StarBASIC::DeInitAllModules()
}
}
for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ )
for ( sal_uInt32 nObj = 0; nObj < pObjs->Count32(); nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
SbxVariable* pVar = pObjs->Get32( nObj );
StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
if( pBasic )
{
@@ -1793,13 +1793,13 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer )
}
// #95459 Delete dialogs, otherwise endless recursion
// in SbxVarable::GetType() if dialogs are accessed
sal_uInt16 nObjCount = pObjs->Count();
sal_uInt32 nObjCount = pObjs->Count32();
std::unique_ptr<SbxVariable*[]> ppDeleteTab(new SbxVariable*[ nObjCount ]);
sal_uInt16 nObj;
sal_uInt32 nObj;
for( nObj = 0 ; nObj < nObjCount ; nObj++ )
{
SbxVariable* pVar = pObjs->Get( nObj );
SbxVariable* pVar = pObjs->Get32( nObj );
StarBASIC* pBasic = dynamic_cast<StarBASIC*>( pVar );
ppDeleteTab[nObj] = pBasic ? nullptr : pVar;
}
@@ -2103,24 +2103,24 @@ sal_Int32 BasicCollection::implGetIndexForName( const OUString& rName )
void BasicCollection::CollAdd( SbxArray* pPar_ )
{
sal_uInt16 nCount = pPar_->Count();
sal_uInt32 nCount = pPar_->Count32();
if( nCount < 2 || nCount > 5 )
{
SetError( ERRCODE_BASIC_WRONG_ARGS );
return;
}
SbxVariable* pItem = pPar_->Get(1);
SbxVariable* pItem = pPar_->Get32(1);
if( pItem )
{
int nNextIndex;
sal_uInt32 nNextIndex;
if( nCount < 4 )
{
nNextIndex = xItemArray->Count();
nNextIndex = xItemArray->Count32();
}
else
{
SbxVariable* pBefore = pPar_->Get(3);
SbxVariable* pBefore = pPar_->Get32(3);
if( nCount == 5 )
{
if( !( pBefore->IsErr() || ( pBefore->GetType() == SbxEMPTY ) ) )
@@ -2128,14 +2128,14 @@ void BasicCollection::CollAdd( SbxArray* pPar_ )
SetError( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
SbxVariable* pAfter = pPar_->Get(4);
SbxVariable* pAfter = pPar_->Get32(4);
sal_Int32 nAfterIndex = implGetIndex( pAfter );
if( nAfterIndex == -1 )
{
SetError( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
nNextIndex = nAfterIndex + 1;
nNextIndex = sal::static_int_cast<sal_uInt32>(nAfterIndex + 1);
}
else // if( nCount == 4 )
{
@@ -2145,14 +2145,14 @@ void BasicCollection::CollAdd( SbxArray* pPar_ )
SetError( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
nNextIndex = nBeforeIndex;
nNextIndex = sal::static_int_cast<sal_uInt32>(nBeforeIndex);
}
}
auto pNewItem = tools::make_ref<SbxVariable>( *pItem );
if( nCount >= 3 )
{
SbxVariable* pKey = pPar_->Get(2);
SbxVariable* pKey = pPar_->Get32(2);
if( !( pKey->IsErr() || ( pKey->GetType() == SbxEMPTY ) ) )
{
if( pKey->GetType() != SbxSTRING )
@@ -2181,13 +2181,13 @@ void BasicCollection::CollAdd( SbxArray* pPar_ )
void BasicCollection::CollItem( SbxArray* pPar_ )
{
if( pPar_->Count() != 2 )
if( pPar_->Count32() != 2 )
{
SetError( ERRCODE_BASIC_WRONG_ARGS );
return;
}
SbxVariable* pRes = nullptr;
SbxVariable* p = pPar_->Get( 1 );
SbxVariable* p = pPar_->Get32( 1 );
sal_Int32 nIndex = implGetIndex( p );
if( nIndex >= 0 && nIndex < static_cast<sal_Int32>(xItemArray->Count32()) )
{
@@ -2199,19 +2199,19 @@ void BasicCollection::CollItem( SbxArray* pPar_ )
}
else
{
*(pPar_->Get(0)) = *pRes;
*(pPar_->Get32(0)) = *pRes;
}
}
void BasicCollection::CollRemove( SbxArray* pPar_ )
{
if( pPar_ == nullptr || pPar_->Count() != 2 )
if( pPar_ == nullptr || pPar_->Count32() != 2 )
{
SetError( ERRCODE_BASIC_WRONG_ARGS );
return;
}
SbxVariable* p = pPar_->Get( 1 );
SbxVariable* p = pPar_->Get32( 1 );
sal_Int32 nIndex = implGetIndex( p );
if( nIndex >= 0 && nIndex < static_cast<sal_Int32>(xItemArray->Count32()) )
{
+83 -83
View File
@@ -782,7 +782,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
}
else
{
xArray->unoAddDim( 0, -1 );
xArray->unoAddDim32( 0, -1 );
}
// return the Array
@@ -871,7 +871,7 @@ static Type getUnoTypeForSbxValue( const SbxValue* pVal )
if( auto pArray = dynamic_cast<SbxDimArray*>( xObj.get() ) )
{
short nDims = pArray->GetDims();
sal_Int32 nDims = pArray->GetDims32();
Type aElementType = getUnoTypeForSbxBaseType( static_cast<SbxDataType>(pArray->GetType() & 0xfff) );
TypeClass eElementTypeClass = aElementType.getTypeClass();
@@ -948,7 +948,7 @@ static Type getUnoTypeForSbxValue( const SbxValue* pVal )
}
OUStringBuffer aSeqTypeName;
for( short iDim = 0 ; iDim < nDims ; iDim++ )
for(sal_Int32 iDim = 0 ; iDim < nDims ; iDim++ )
{
aSeqTypeName.append(aSeqLevelStr);
}
@@ -1078,7 +1078,7 @@ static Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmall
// Helper function for StepREDIMP
static Any implRekMultiDimArrayToSequence( SbxDimArray* pArray,
const Type& aElemType, short nMaxDimIndex, short nActualDim,
const Type& aElemType, sal_Int32 nMaxDimIndex, sal_Int32 nActualDim,
sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds )
{
sal_Int32 nSeqLevel = nMaxDimIndex - nActualDim + 1;
@@ -1302,7 +1302,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn
SbxBaseRef xObj = pVar->GetObject();
if( auto pArray = dynamic_cast<SbxDimArray*>( xObj.get() ) )
{
short nDims = pArray->GetDims();
sal_Int32 nDims = pArray->GetDims32();
// Normal case: One dimensional array
sal_Int32 nLower, nUpper;
@@ -1380,12 +1380,12 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property const * pUn
std::unique_ptr<sal_Int32[]> pLowerBounds(new sal_Int32[nDims]);
std::unique_ptr<sal_Int32[]> pUpperBounds(new sal_Int32[nDims]);
std::unique_ptr<sal_Int32[]> pActualIndices(new sal_Int32[nDims]);
for( short i = 1 ; i <= nDims ; i++ )
for(sal_Int32 i = 1 ; i <= nDims ; i++ )
{
sal_Int32 lBound, uBound;
pArray->GetDim32( i, lBound, uBound );
short j = i - 1;
sal_Int32 j = i - 1;
pActualIndices[j] = pLowerBounds[j] = lBound;
pUpperBounds[j] = uBound;
}
@@ -1468,9 +1468,9 @@ static void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, s
Any aValAny;
for( i = 0 ; i < nParamCount ; i++ )
{
sal_uInt16 iSbx = static_cast<sal_uInt16>(i+1);
sal_uInt32 iSbx = i + 1;
aValAny = sbxToUnoValueImpl( pParams->Get( iSbx ),
aValAny = sbxToUnoValueImpl( pParams->Get32( iSbx ),
bBlockConversionToSmallestType );
OUString aParamName = pNames[iSbx];
@@ -1491,7 +1491,7 @@ static void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, s
{
for( i = 0 ; i < nParamCount ; i++ )
{
pAnyArgs[i] = sbxToUnoValueImpl( pParams->Get( static_cast<sal_uInt16>(i+1) ),
pAnyArgs[i] = sbxToUnoValueImpl(pParams->Get32(i + 1),
bBlockConversionToSmallestType );
}
}
@@ -1539,7 +1539,7 @@ static Any invokeAutomationMethod( const OUString& Name, Sequence< Any > const &
sal_Int16 iTarget = pIndices[ j ];
if( iTarget >= static_cast<sal_Int16>(nParamCount) )
break;
unoToSbxValue( pParams->Get( static_cast<sal_uInt16>(j+1) ), pNewValues[ j ] );
unoToSbxValue( pParams->Get32(j + 1), pNewValues[ j ] );
}
}
return aRetAny;
@@ -1855,11 +1855,11 @@ static OUString Impl_DumpProperties(SbUnoObject& rUnoObj)
const Property* pUnoProps = props.getConstArray();
SbxArray* pProps = rUnoObj.GetProperties();
sal_uInt16 nPropCount = pProps->Count();
sal_uInt16 nPropsPerLine = 1 + nPropCount / 30;
for( sal_uInt16 i = 0; i < nPropCount; i++ )
sal_uInt32 nPropCount = pProps->Count32();
sal_uInt32 nPropsPerLine = 1 + nPropCount / 30;
for( sal_uInt32 i = 0; i < nPropCount; i++ )
{
SbxVariable* pVar = pProps->Get( i );
SbxVariable* pVar = pProps->Get32( i );
if( pVar )
{
OUStringBuffer aPropStr;
@@ -1931,16 +1931,16 @@ static OUString Impl_DumpMethods(SbUnoObject& rUnoObj)
const Reference< XIdlMethod >* pUnoMethods = methods.getConstArray();
SbxArray* pMethods = rUnoObj.GetMethods();
sal_uInt16 nMethodCount = pMethods->Count();
sal_uInt32 nMethodCount = pMethods->Count32();
if( !nMethodCount )
{
aRet.append( "\nNo methods found\n" );
return aRet.makeStringAndClear();
}
sal_uInt16 nPropsPerLine = 1 + nMethodCount / 30;
for( sal_uInt16 i = 0; i < nMethodCount; i++ )
sal_uInt32 nPropsPerLine = 1 + nMethodCount / 30;
for( sal_uInt32 i = 0; i < nMethodCount; i++ )
{
SbxVariable* pVar = pMethods->Get( i );
SbxVariable* pVar = pMethods->Get32( i );
if( pVar )
{
if( (i % nPropsPerLine) == 0 )
@@ -2086,7 +2086,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
try
{
sal_uInt32 nParamCount = pParams ? (static_cast<sal_uInt32>(pParams->Count()) - 1) : 0;
sal_uInt32 nParamCount = pParams ? (pParams->Count32() - 1) : 0;
bool bCanBeConsideredAMethod = mxInvocation->hasMethod( pProp->GetName() );
Any aRetAny;
if ( bCanBeConsideredAMethod && nParamCount )
@@ -2172,7 +2172,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if( pHint->GetId() == SfxHintId::BasicDataWanted )
{
// number of Parameter -1 because of Param0 == this
sal_uInt32 nParamCount = pParams ? (static_cast<sal_uInt32>(pParams->Count()) - 1) : 0;
sal_uInt32 nParamCount = pParams ? (pParams->Count32() - 1) : 0;
Sequence<Any> args;
bool bOutParams = false;
@@ -2224,7 +2224,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
css::uno::Type aType( rxClass->getTypeClass(), rxClass->getName() );
// ATTENTION: Don't forget for Sbx-Parameter the offset!
pAnyArgs[i] = sbxToUnoValue( pParams->Get( static_cast<sal_uInt16>(i+1) ), aType );
pAnyArgs[i] = sbxToUnoValue( pParams->Get32(i + 1), aType );
// If it is not certain check whether the out-parameter are available.
if( !bOutParams )
@@ -2267,7 +2267,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
const ParamInfo& rInfo = pParamInfos[j];
ParamMode aParamMode = rInfo.aMode;
if( aParamMode != ParamMode_IN )
unoToSbxValue( pParams->Get( static_cast<sal_uInt16>(j+1) ), pAnyArgs[ j ] );
unoToSbxValue( pParams->Get32(j + 1), pAnyArgs[ j ] );
}
}
}
@@ -2922,14 +2922,14 @@ void createAllObjectProperties( SbxObject* pObj )
void RTL_Impl_CreateUnoStruct( SbxArray& rPar )
{
// We need 1 parameter minimum
if ( rPar.Count() < 2 )
if ( rPar.Count32() < 2 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// get the name of the class of the struct
OUString aClassName = rPar.Get(1)->GetOUString();
OUString aClassName = rPar.Get32(1)->GetOUString();
// try to create Struct with the same name
SbUnoObjectRef xUnoObj = Impl_CreateUnoStruct( aClassName );
@@ -2938,21 +2938,21 @@ void RTL_Impl_CreateUnoStruct( SbxArray& rPar )
return;
}
// return the object
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
refVar->PutObject( xUnoObj.get() );
}
void RTL_Impl_CreateUnoService( SbxArray& rPar )
{
// We need 1 Parameter minimum
if ( rPar.Count() < 2 )
if ( rPar.Count32() < 2 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// get the name of the class of the struct
OUString aServiceName = rPar.Get(1)->GetOUString();
OUString aServiceName = rPar.Get32(1)->GetOUString();
// search for the service and instantiate it
Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
@@ -2966,7 +2966,7 @@ void RTL_Impl_CreateUnoService( SbxArray& rPar )
implHandleAnyException( ::cppu::getCaughtException() );
}
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
if( xInterface.is() )
{
// Create a SbUnoObject out of it and return it
@@ -2990,15 +2990,15 @@ void RTL_Impl_CreateUnoService( SbxArray& rPar )
void RTL_Impl_CreateUnoServiceWithArguments( SbxArray& rPar )
{
// We need 2 parameter minimum
if ( rPar.Count() < 3 )
if ( rPar.Count32() < 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// get the name of the class of the struct
OUString aServiceName = rPar.Get(1)->GetOUString();
Any aArgAsAny = sbxToUnoValue( rPar.Get(2),
OUString aServiceName = rPar.Get32(1)->GetOUString();
Any aArgAsAny = sbxToUnoValue( rPar.Get32(2),
cppu::UnoType<Sequence<Any>>::get() );
Sequence< Any > aArgs;
aArgAsAny >>= aArgs;
@@ -3015,7 +3015,7 @@ void RTL_Impl_CreateUnoServiceWithArguments( SbxArray& rPar )
implHandleAnyException( ::cppu::getCaughtException() );
}
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
if( xInterface.is() )
{
// Create a SbUnoObject out of it and return it
@@ -3038,7 +3038,7 @@ void RTL_Impl_CreateUnoServiceWithArguments( SbxArray& rPar )
void RTL_Impl_GetProcessServiceManager( SbxArray& rPar )
{
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
// get the global service manager
Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
@@ -3051,7 +3051,7 @@ void RTL_Impl_GetProcessServiceManager( SbxArray& rPar )
void RTL_Impl_HasInterfaces( SbxArray& rPar )
{
// We need 2 parameter minimum
sal_uInt16 nParCount = rPar.Count();
sal_uInt32 nParCount = rPar.Count32();
if( nParCount < 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -3059,11 +3059,11 @@ void RTL_Impl_HasInterfaces( SbxArray& rPar )
}
// variable for the return value
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
refVar->PutBool( false );
// get the Uno-Object
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
SbxBaseRef pObj = rPar.Get32( 1 )->GetObject();
auto obj = dynamic_cast<SbUnoObject*>( pObj.get() );
if( obj == nullptr )
{
@@ -3082,10 +3082,10 @@ void RTL_Impl_HasInterfaces( SbxArray& rPar )
{
return;
}
for( sal_uInt16 i = 2 ; i < nParCount ; i++ )
for( sal_uInt32 i = 2 ; i < nParCount ; i++ )
{
// get the name of the interface of the struct
OUString aIfaceName = rPar.Get( i )->GetOUString();
OUString aIfaceName = rPar.Get32( i )->GetOUString();
// search for the class
Reference< XIdlClass > xClass = xCoreReflection->forName( aIfaceName );
@@ -3109,23 +3109,23 @@ void RTL_Impl_HasInterfaces( SbxArray& rPar )
void RTL_Impl_IsUnoStruct( SbxArray& rPar )
{
// We need 1 parameter minimum
if ( rPar.Count() < 2 )
if ( rPar.Count32() < 2 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// variable for the return value
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
refVar->PutBool( false );
// get the Uno-Object
SbxVariableRef xParam = rPar.Get( 1 );
SbxVariableRef xParam = rPar.Get32( 1 );
if( !xParam->IsObject() )
{
return;
}
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
SbxBaseRef pObj = xParam->GetObject();
auto obj = dynamic_cast<SbUnoObject*>( pObj.get() );
if( obj == nullptr )
{
@@ -3142,18 +3142,18 @@ void RTL_Impl_IsUnoStruct( SbxArray& rPar )
void RTL_Impl_EqualUnoObjects( SbxArray& rPar )
{
if ( rPar.Count() < 3 )
if ( rPar.Count32() < 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// variable for the return value
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
refVar->PutBool( false );
// get the Uno-Objects
SbxVariableRef xParam1 = rPar.Get( 1 );
SbxVariableRef xParam1 = rPar.Get32( 1 );
if( !xParam1->IsObject() )
{
return;
@@ -3173,7 +3173,7 @@ void RTL_Impl_EqualUnoObjects( SbxArray& rPar )
Reference< XInterface > x1;
aAny1 >>= x1;
SbxVariableRef xParam2 = rPar.Get( 2 );
SbxVariableRef xParam2 = rPar.Get32( 2 );
if( !xParam2->IsObject() )
{
return;
@@ -3540,7 +3540,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if( pUnoCtor && pHint->GetId() == SfxHintId::BasicDataWanted )
{
// Parameter count -1 because of Param0 == this
sal_uInt32 nParamCount = pParams ? (static_cast<sal_uInt32>(pParams->Count()) - 1) : 0;
sal_uInt32 nParamCount = pParams ? (pParams->Count32() - 1) : 0;
Sequence<Any> args;
Reference< XServiceConstructorDescription > xCtor = pUnoCtor->getServiceCtorDesc();
@@ -3564,14 +3564,14 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
// Too many parameters with context as first parameter?
sal_uInt16 nSbxParameterOffset = 1;
sal_uInt16 nParameterOffsetByContext = 0;
sal_uInt32 nSbxParameterOffset = 1;
sal_uInt32 nParameterOffsetByContext = 0;
Reference < XComponentContext > xFirstParamContext;
if( nParamCount > nUnoParamCount )
{
// Check if first parameter is a context and use it
// then in createInstanceWithArgumentsAndContext
Any aArg0 = sbxToUnoValue( pParams->Get( nSbxParameterOffset ) );
Any aArg0 = sbxToUnoValue( pParams->Get32( nSbxParameterOffset ) );
if( (aArg0 >>= xFirstParamContext) && xFirstParamContext.is() )
nParameterOffsetByContext = 1;
}
@@ -3607,7 +3607,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
Any* pAnyArgs = args.getArray();
for( sal_uInt32 i = 0 ; i < nEffectiveParamCount ; i++ )
{
sal_uInt16 iSbx = static_cast<sal_uInt16>(i + nSbxParameterOffset + nParameterOffsetByContext);
sal_uInt32 iSbx = i + nSbxParameterOffset + nParameterOffsetByContext;
// bRestParameterMode allows nEffectiveParamCount > nUnoParamCount
Reference< XParameter > xParam;
@@ -3623,7 +3623,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
css::uno::Type aType( xParamTypeDesc->getTypeClass(), xParamTypeDesc->getName() );
// sbx parameter needs offset 1
pAnyArgs[i] = sbxToUnoValue( pParams->Get( iSbx ), aType );
pAnyArgs[i] = sbxToUnoValue( pParams->Get32( iSbx ), aType );
// Check for out parameter if not already done
if( !bOutParams && xParam->isOut() )
@@ -3631,7 +3631,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
}
else
{
pAnyArgs[i] = sbxToUnoValue( pParams->Get( iSbx ) );
pAnyArgs[i] = sbxToUnoValue( pParams->Get32( iSbx ) );
}
}
}
@@ -3669,7 +3669,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
continue;
if( xParam->isOut() )
unoToSbxValue( pParams->Get( static_cast<sal_uInt16>(j+1) ), pAnyArgs[ j ] );
unoToSbxValue( pParams->Get32(j + 1), pAnyArgs[ j ] );
}
}
}
@@ -3737,7 +3737,7 @@ void SbUnoSingleton::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
SbxVariable* pVar = pHint->GetVar();
SbxArray* pParams = pVar->GetParameters();
sal_uInt32 nParamCount = pParams ? (static_cast<sal_uInt32>(pParams->Count()) - 1) : 0;
sal_uInt32 nParamCount = pParams ? (pParams->Count32() - 1) : 0;
sal_uInt32 nAllowedParamCount = 1;
Reference < XComponentContext > xContextToUse;
@@ -3745,7 +3745,7 @@ void SbUnoSingleton::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
// Check if first parameter is a context and use it then
Reference < XComponentContext > xFirstParamContext;
Any aArg1 = sbxToUnoValue( pParams->Get( 1 ) );
Any aArg1 = sbxToUnoValue( pParams->Get32( 1 ) );
if( (aArg1 >>= xFirstParamContext) && xFirstParamContext.is() )
xContextToUse = xFirstParamContext;
}
@@ -3832,7 +3832,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet
// Convert elements
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( xVar.get(), pArgs[i] );
xSbxArray->Put( xVar.get(), sal::static_int_cast< sal_uInt16 >(i+1) );
xSbxArray->Put32( xVar.get(), i + 1 );
}
pLib->Call( aMethodName, xSbxArray.get() );
@@ -3840,7 +3840,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet
// get the return value from the Param-Array, if requested
if( pRet )
{
SbxVariable* pVar = xSbxArray->Get( 0 );
SbxVariable* pVar = xSbxArray->Get32( 0 );
if( pVar )
{
// #95792 Avoid a second call
@@ -4025,15 +4025,15 @@ sal_Bool SAL_CALL InvocationToAllListenerMapper::hasProperty(const OUString& Nam
void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
{
// We need 2 parameters
if ( rPar.Count() != 3 )
if ( rPar.Count32() != 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// get the name of the class of the struct
OUString aPrefixName = rPar.Get(1)->GetOUString();
OUString aListenerClassName = rPar.Get(2)->GetOUString();
OUString aPrefixName = rPar.Get32(1)->GetOUString();
OUString aListenerClassName = rPar.Get32(2)->GetOUString();
// get the CoreReflection
Reference< XIdlReflection > xCoreReflection = getCoreReflection_Impl();
@@ -4071,10 +4071,10 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
// #100326 Register listener object to set Parent NULL in Dtor
SbxArrayRef xBasicUnoListeners = pBasic->getUnoListeners();
xBasicUnoListeners->Insert( pUnoObj, xBasicUnoListeners->Count() );
xBasicUnoListeners->Insert32( pUnoObj, xBasicUnoListeners->Count32() );
// return the object
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
refVar->PutObject( p->xSbxObj.get() );
}
@@ -4083,7 +4083,7 @@ void SbRtl_CreateUnoListener(StarBASIC * pBasic, SbxArray & rPar, bool)
// in the Basic runtime system.
void RTL_Impl_GetDefaultContext( SbxArray& rPar )
{
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
Any aContextAny( comphelper::getProcessComponentContext() );
@@ -4097,15 +4097,15 @@ void RTL_Impl_GetDefaultContext( SbxArray& rPar )
void RTL_Impl_CreateUnoValue( SbxArray& rPar )
{
// 2 parameters needed
if ( rPar.Count() != 3 )
if ( rPar.Count32() != 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
// get the name of the class of the struct
OUString aTypeName = rPar.Get(1)->GetOUString();
SbxVariable* pVal = rPar.Get(2);
OUString aTypeName = rPar.Get32(1)->GetOUString();
SbxVariable* pVal = rPar.Get32(2);
if( aTypeName == "type" )
{
@@ -4137,7 +4137,7 @@ void RTL_Impl_CreateUnoValue( SbxArray& rPar )
if( bSuccess )
{
Any aTypeAny( aType );
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
SbxObjectRef xUnoAnyObject = new SbUnoAnyObject( aTypeAny );
refVar->PutObject( xUnoAnyObject.get() );
}
@@ -4167,7 +4167,7 @@ void RTL_Impl_CreateUnoValue( SbxArray& rPar )
Any aVal = sbxToUnoValueImpl( pVal );
Any aConvertedVal = convertAny( aVal, aDestType );
SbxVariableRef refVar = rPar.Get(0);
SbxVariableRef refVar = rPar.Get32(0);
SbxObjectRef xUnoAnyObject = new SbUnoAnyObject( aConvertedVal );
refVar->PutObject( xUnoAnyObject.get() );
}
@@ -4244,7 +4244,7 @@ void SAL_CALL ModuleInvocationProxy::setValue(const OUString& rProperty, const A
SbxArrayRef xArray = new SbxArray;
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( xVar.get(), rValue );
xArray->Put( xVar.get(), 1 );
xArray->Put32( xVar.get(), 1 );
// Call property method
SbxVariableRef xValue = new SbxVariable;
@@ -4344,7 +4344,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const OUString& rFunction,
{
SbxVariableRef xVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( xVar.get(), pArgs[i] );
xArray->Put( xVar.get(), sal::static_int_cast< sal_uInt16 >(i+1) );
xArray->Put32( xVar.get(), sal::static_int_cast< sal_uInt16 >(i+1) );
}
}
@@ -4467,7 +4467,7 @@ void registerComListenerVariableForBasic( SbxVariable* pVar, StarBASIC* pBasic )
{
StarBasicDisposeItem* pItem = lcl_getOrCreateItemForBasic( pBasic );
SbxArray* pArray = pItem->m_pRegisteredVariables.get();
pArray->Put( pVar, pArray->Count() );
pArray->Put32( pVar, pArray->Count32() );
}
void disposeComVariablesForBasic( StarBASIC const * pBasic )
@@ -4478,10 +4478,10 @@ void disposeComVariablesForBasic( StarBASIC const * pBasic )
StarBasicDisposeItem* pItem = *it;
SbxArray* pArray = pItem->m_pRegisteredVariables.get();
sal_uInt16 nCount = pArray->Count();
for( sal_uInt16 i = 0 ; i < nCount ; ++i )
sal_uInt32 nCount = pArray->Count32();
for( sal_uInt32 i = 0 ; i < nCount ; ++i )
{
SbxVariable* pVar = pArray->Get( i );
SbxVariable* pVar = pArray->Get32( i );
pVar->ClearComListener();
}
@@ -4519,10 +4519,10 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP
bool bSuccess = false;
SbxArray* pModIfaces = pClassData->mxIfaces.get();
sal_uInt16 nCount = pModIfaces->Count();
for( sal_uInt16 i = 0 ; i < nCount ; ++i )
sal_uInt32 nCount = pModIfaces->Count32();
for( sal_uInt32 i = 0 ; i < nCount ; ++i )
{
SbxVariable* pVar = pModIfaces->Get( i );
SbxVariable* pVar = pModIfaces->Get32( i );
const OUString& aIfaceName = pVar->GetName();
if( !aIfaceName.isEmpty() )
@@ -4775,11 +4775,11 @@ OUString SbUnoStructRefObject::Impl_DumpProperties()
aRet.append("Properties of object ");
aRet.append( getDbgObjectName() );
sal_uInt16 nPropCount = pProps->Count();
sal_uInt16 nPropsPerLine = 1 + nPropCount / 30;
for( sal_uInt16 i = 0; i < nPropCount; i++ )
sal_uInt32 nPropCount = pProps->Count32();
sal_uInt32 nPropsPerLine = 1 + nPropCount / 30;
for( sal_uInt32 i = 0; i < nPropCount; i++ )
{
SbxVariable* pVar = pProps->Get( i );
SbxVariable* pVar = pProps->Get32( i );
if( pVar )
{
OUStringBuffer aPropStr;
+53 -52
View File
@@ -229,7 +229,7 @@ DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >&
{
SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( xSbxVar.get(), pParams[i] );
xSbxParams->Put( xSbxVar.get(), static_cast< sal_uInt16 >( i ) + 1 );
xSbxParams->Put32( xSbxVar.get(), static_cast< sal_uInt32 >( i ) + 1 );
// Enable passing by ref
if ( xSbxVar->GetType() != SbxVARIANT )
@@ -251,12 +251,13 @@ DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >&
if ( pInfo_ )
{
OutParamMap aOutParamMap;
for ( sal_uInt16 n = 1, nCount = xSbxParams->Count(); n < nCount; ++n )
for ( sal_uInt32 n = 1, nCount = xSbxParams->Count32(); n < nCount; ++n )
{
const SbxParamInfo* pParamInfo = pInfo_->GetParam( n );
assert(n <= std::numeric_limits<sal_uInt16>::max());
const SbxParamInfo* pParamInfo = pInfo_->GetParam( sal::static_int_cast<sal_uInt16>(n) );
if ( pParamInfo && ( pParamInfo->eType & SbxBYREF ) != 0 )
{
SbxVariable* pVar = xSbxParams->Get( n );
SbxVariable* pVar = xSbxParams->Get32( n );
if ( pVar )
{
SbxVariableRef xVar = pVar;
@@ -470,16 +471,16 @@ void SbModule::StartDefinitions()
// methods and properties persist, but they are invalid;
// at least are the information under certain conditions clogged
sal_uInt16 i;
for( i = 0; i < pMethods->Count(); i++ )
sal_uInt32 i;
for( i = 0; i < pMethods->Count32(); i++ )
{
SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get32( i ) );
if( p )
p->bInvalid = true;
}
for( i = 0; i < pProps->Count(); )
for( i = 0; i < pProps->Count32(); )
{
SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get( i ) );
SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get32( i ) );
if( p )
pProps->Remove( i );
else
@@ -502,7 +503,7 @@ SbMethod* SbModule::GetMethod( const OUString& rName, SbxDataType t )
pMeth = new SbMethod( rName, t, this );
pMeth->SetParent( this );
pMeth->SetFlags( SbxFlagBits::Read );
pMethods->Put( pMeth, pMethods->Count() );
pMethods->Put32( pMeth, pMethods->Count32() );
StartListening(pMeth->GetBroadcaster(), DuplicateHandling::Prevent);
}
// The method is per default valid, because it could be
@@ -540,7 +541,7 @@ SbProperty* SbModule::GetProperty( const OUString& rName, SbxDataType t )
pProp = new SbProperty( rName, t, this );
pProp->SetFlag( SbxFlagBits::ReadWrite );
pProp->SetParent( this );
pProps->Put( pProp, pProps->Count() );
pProps->Put32( pProp, pProps->Count32() );
StartListening(pProp->GetBroadcaster(), DuplicateHandling::Prevent);
}
return pProp;
@@ -559,7 +560,7 @@ void SbModule::GetProcedureProperty( const OUString& rName, SbxDataType t )
pProp = new SbProcedureProperty( rName, t );
pProp->SetFlag( SbxFlagBits::ReadWrite );
pProp->SetParent( this );
pProps->Put( pProp, pProps->Count() );
pProps->Put32( pProp, pProps->Count32() );
StartListening(pProp->GetBroadcaster(), DuplicateHandling::Prevent);
}
}
@@ -577,7 +578,7 @@ void SbModule::GetIfaceMapperMethod( const OUString& rName, SbMethod* pImplMeth
pMapperMethod = new SbIfaceMapperMethod( rName, pImplMeth );
pMapperMethod->SetParent( this );
pMapperMethod->SetFlags( SbxFlagBits::Read );
pMethods->Put( pMapperMethod, pMethods->Count() );
pMethods->Put32( pMapperMethod, pMethods->Count32() );
}
pMapperMethod->bInvalid = false;
}
@@ -591,9 +592,9 @@ SbIfaceMapperMethod::~SbIfaceMapperMethod()
void SbModule::EndDefinitions( bool bNewState )
{
for( sal_uInt16 i = 0; i < pMethods->Count(); )
for( sal_uInt32 i = 0; i < pMethods->Count32(); )
{
SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get32( i ) );
if( p )
{
if( p->bInvalid )
@@ -699,15 +700,15 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
aVals.eType = SbxVARIANT;
SbxArray* pArg = pVar->GetParameters();
sal_uInt16 nVarParCount = (pArg != nullptr) ? pArg->Count() : 0;
sal_uInt32 nVarParCount = (pArg != nullptr) ? pArg->Count32() : 0;
if( nVarParCount > 1 )
{
auto xMethParameters = tools::make_ref<SbxArray>();
xMethParameters->Put( pMethVar, 0 ); // Method as parameter 0
for( sal_uInt16 i = 1 ; i < nVarParCount ; ++i )
xMethParameters->Put32( pMethVar, 0 ); // Method as parameter 0
for( sal_uInt32 i = 1 ; i < nVarParCount ; ++i )
{
SbxVariable* pPar = pArg->Get( i );
xMethParameters->Put( pPar, i );
SbxVariable* pPar = pArg->Get32( i );
xMethParameters->Put32( pPar, i );
}
pMethVar->SetParameters( xMethParameters.get() );
@@ -746,8 +747,8 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
// Setup parameters
SbxArrayRef xArray = new SbxArray;
xArray->Put( pMethVar, 0 ); // Method as parameter 0
xArray->Put( pVar, 1 );
xArray->Put32( pMethVar, 0 ); // Method as parameter 0
xArray->Put32( pVar, 1 );
pMethVar->SetParameters( xArray.get() );
SbxValues aVals;
@@ -905,9 +906,9 @@ static void SendHint_( SbxObject* pObj, SfxHintId nId, SbMethod* p )
pObj->GetBroadcaster().Broadcast( SbxHint( nId, p ) );
// Then ask for the subobjects
SbxArray* pObjs = pObj->GetObjects();
for( sal_uInt16 i = 0; i < pObjs->Count(); i++ )
for( sal_uInt32 i = 0; i < pObjs->Count32(); i++ )
{
SbxVariable* pVar = pObjs->Get( i );
SbxVariable* pVar = pObjs->Get32( i );
if( dynamic_cast<const SbxObject *>(pVar) != nullptr )
SendHint_( dynamic_cast<SbxObject*>( pVar), nId, p );
}
@@ -950,10 +951,10 @@ static void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic )
}
// Go over all Sub-Basics
SbxArray* pObjs = pBasic->GetObjects();
sal_uInt16 nCount = pObjs->Count();
for( sal_uInt16 i = 0 ; i < nCount ; i++ )
sal_uInt32 nCount = pObjs->Count32();
for( sal_uInt32 i = 0 ; i < nCount ; i++ )
{
SbxVariable* pObjVar = pObjs->Get( i );
SbxVariable* pObjVar = pObjs->Get32( i );
StarBASIC* pSubBasic = dynamic_cast<StarBASIC*>( pObjVar );
if( pSubBasic )
{
@@ -1297,9 +1298,9 @@ void SbModule::RemoveVars()
void SbModule::ClearPrivateVars()
{
for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ )
for( sal_uInt32 i = 0 ; i < pProps->Count32() ; i++ )
{
SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get( i ) );
SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get32( i ) );
if( p )
{
// Delete not the arrays, only their content
@@ -1308,9 +1309,9 @@ void SbModule::ClearPrivateVars()
SbxArray* pArray = dynamic_cast<SbxArray*>( p->GetObject() );
if( pArray )
{
for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ )
for( sal_uInt32 j = 0 ; j < pArray->Count32() ; j++ )
{
SbxVariable* pj = pArray->Get( j );
SbxVariable* pj = pArray->Get32( j );
pj->SbxValue::Clear();
}
}
@@ -1351,9 +1352,9 @@ void SbModule::implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC
void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic )
{
for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ )
for( sal_uInt32 i = 0 ; i < pProps->Count32() ; i++ )
{
SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get( i ) );
SbProperty* p = dynamic_cast<SbProperty*>( pProps->Get32( i ) );
if( p )
{
if( p->GetType() & SbxARRAY )
@@ -1361,9 +1362,9 @@ void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic )
SbxArray* pArray = dynamic_cast<SbxArray*>( p->GetObject() );
if( pArray )
{
for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ )
for( sal_uInt32 j = 0 ; j < pArray->Count32() ; j++ )
{
SbxVariable* pVar = pArray->Get( j );
SbxVariable* pVar = pArray->Get32( j );
implClearIfVarDependsOnDeletedBasic( pVar, pDeletedBasic );
}
}
@@ -1577,9 +1578,9 @@ SbModule::fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg ) const
{
if ( !pImg )
pImg = pImage;
for( sal_uInt32 i = 0; i < pMethods->Count(); i++ )
for( sal_uInt32 i = 0; i < pMethods->Count32(); i++ )
{
SbMethod* pMeth = dynamic_cast<SbMethod*>( pMethods->Get( static_cast<sal_uInt16>(i) ) );
SbMethod* pMeth = dynamic_cast<SbMethod*>( pMethods->Get32(i) );
if( pMeth )
{
//fixup method start positions
@@ -1802,17 +1803,17 @@ void SbModule::LoadBinaryData( SvStream& rStrm )
bool SbModule::LoadCompleted()
{
SbxArray* p = GetMethods().get();
sal_uInt16 i;
for( i = 0; i < p->Count(); i++ )
sal_uInt32 i;
for( i = 0; i < p->Count32(); i++ )
{
SbMethod* q = dynamic_cast<SbMethod*>( p->Get( i ) );
SbMethod* q = dynamic_cast<SbMethod*>( p->Get32( i ) );
if( q )
q->pMod = this;
}
p = GetProperties();
for( i = 0; i < p->Count(); i++ )
for( i = 0; i < p->Count32(); i++ )
{
SbProperty* q = dynamic_cast<SbProperty*>( p->Get( i ) );
SbProperty* q = dynamic_cast<SbProperty*>( p->Get32( i ) );
if( q )
q->pMod = this;
}
@@ -1844,15 +1845,15 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
aVals.eType = SbxVARIANT;
SbxArray* pArg = pVar->GetParameters();
sal_uInt16 nVarParCount = (pArg != nullptr) ? pArg->Count() : 0;
sal_uInt32 nVarParCount = (pArg != nullptr) ? pArg->Count32() : 0;
if( nVarParCount > 1 )
{
SbxArrayRef xMethParameters = new SbxArray;
xMethParameters->Put( pMeth, 0 ); // Method as parameter 0
for( sal_uInt16 i = 1 ; i < nVarParCount ; ++i )
xMethParameters->Put32( pMeth, 0 ); // Method as parameter 0
for( sal_uInt32 i = 1 ; i < nVarParCount ; ++i )
{
SbxVariable* pPar = pArg->Get( i );
xMethParameters->Put( pPar, i );
SbxVariable* pPar = pArg->Get32( i );
xMethParameters->Put32( pPar, i );
}
pMeth->SetParameters( xMethParameters.get() );
@@ -1891,8 +1892,8 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH
{
// Setup parameters
SbxArrayRef xArray = new SbxArray;
xArray->Put( pMeth, 0 ); // Method as parameter 0
xArray->Put( pVar, 1 );
xArray->Put32( pMeth, 0 ); // Method as parameter 0
xArray->Put32( pVar, 1 );
pMeth->SetParameters( xArray.get() );
SbxValues aVals;
@@ -2441,13 +2442,13 @@ void SbUserFormModule::triggerMethod( const OUString& aMethodToRun, Sequence< An
if ( aArguments.hasElements() ) // Setup parameters
{
auto xArray = tools::make_ref<SbxArray>();
xArray->Put( pMeth, 0 ); // Method as parameter 0
xArray->Put32( pMeth, 0 ); // Method as parameter 0
for ( sal_Int32 i = 0; i < aArguments.getLength(); ++i )
{
auto xSbxVar = tools::make_ref<SbxVariable>( SbxVARIANT );
unoToSbxValue( xSbxVar.get(), aArguments[i] );
xArray->Put( xSbxVar.get(), static_cast< sal_uInt16 >( i ) + 1 );
xArray->Put32( xSbxVar.get(), static_cast< sal_uInt32 >( i ) + 1 );
// Enable passing by ref
if ( xSbxVar->GetType() != SbxVARIANT )
@@ -2460,7 +2461,7 @@ void SbUserFormModule::triggerMethod( const OUString& aMethodToRun, Sequence< An
for ( sal_Int32 i = 0; i < aArguments.getLength(); ++i )
{
aArguments[i] = sbxToUnoValue( xArray->Get( static_cast< sal_uInt16 >(i) + 1) );
aArguments[i] = sbxToUnoValue( xArray->Get32( static_cast< sal_uInt32 >(i) + 1) );
}
pMeth->SetParameters( nullptr );
}
+6 -6
View File
@@ -165,7 +165,7 @@ void SbiCodeGen::Save()
SbxVariable* pIfaceVar = new SbxVariable( SbxVARIANT );
pIfaceVar->SetName( rIfaceName );
SbxArray* pIfaces = rMod.pClassData->mxIfaces.get();
pIfaces->Insert( pIfaceVar, pIfaces->Count() );
pIfaces->Insert32( pIfaceVar, pIfaces->Count32() );
}
}
@@ -362,22 +362,22 @@ void SbiCodeGen::Save()
SbiStringPool* pPool = &pParser->aGblStrings;
sal_uInt16 nSize = pPool->GetSize();
p->MakeStrings( nSize );
sal_uInt16 i;
sal_uInt32 i;
for( i = 1; i <= nSize; i++ )
{
p->AddString( pPool->Find( i ) );
}
// Insert types
sal_uInt16 nCount = pParser->rTypeArray->Count();
sal_uInt32 nCount = pParser->rTypeArray->Count32();
for (i = 0; i < nCount; i++)
{
p->AddType(static_cast<SbxObject *>(pParser->rTypeArray->Get(i)));
p->AddType(static_cast<SbxObject *>(pParser->rTypeArray->Get32(i)));
}
// Insert enum objects
nCount = pParser->rEnumArray->Count();
nCount = pParser->rEnumArray->Count32();
for (i = 0; i < nCount; i++)
{
p->AddEnum(static_cast<SbxObject *>(pParser->rEnumArray->Get(i)));
p->AddEnum(static_cast<SbxObject *>(pParser->rEnumArray->Get32(i)));
}
if( !p->IsError() )
{
+5 -5
View File
@@ -641,7 +641,7 @@ void SbiParser::DefType()
pArray->setHasFixedSize( true );
}
else
pArray->unoAddDim( 0, -1 ); // variant array
pArray->unoAddDim32( 0, -1 ); // variant array
SbxFlagBits nSavFlags = pTypeElem->GetFlags();
// need to reset the FIXED flag
// when calling PutObject ( because the type will not match Object )
@@ -664,7 +664,7 @@ void SbiParser::DefType()
}
}
}
pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() );
pTypeMembers->Insert32( pTypeElem, pTypeMembers->Count32() );
}
}
}
@@ -672,7 +672,7 @@ void SbiParser::DefType()
pType->Remove( "Name", SbxClassType::DontCare );
pType->Remove( "Parent", SbxClassType::DontCare );
rTypeArray->Insert (pType,rTypeArray->Count());
rTypeArray->Insert32 (pType,rTypeArray->Count32());
}
@@ -796,14 +796,14 @@ void SbiParser::DefEnum( bool bPrivate )
pEnumElem->PutLong( nCurrentEnumValue );
pEnumElem->ResetFlag( SbxFlagBits::Write );
pEnumElem->SetFlag( SbxFlagBits::Const );
pEnumMembers->Insert( pEnumElem, pEnumMembers->Count() );
pEnumMembers->Insert32( pEnumElem, pEnumMembers->Count32() );
}
}
pEnum->Remove( "Name", SbxClassType::DontCare );
pEnum->Remove( "Parent", SbxClassType::DontCare );
rEnumArray->Insert( pEnum, rEnumArray->Count() );
rEnumArray->Insert32( pEnum, rEnumArray->Count32() );
}
+2 -2
View File
@@ -62,9 +62,9 @@ bool SbModule::Compile()
pBasic->ClearAllModuleVars();
RemoveVars(); // remove 'this' Modules variables
// clear all method statics
for( sal_uInt16 i = 0; i < pMethods->Count(); i++ )
for( sal_uInt32 i = 0; i < pMethods->Count32(); i++ )
{
SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get( i ) );
SbMethod* p = dynamic_cast<SbMethod*>( pMethods->Get32( i ) );
if( p )
p->ClearStatics();
}
+2 -2
View File
@@ -42,9 +42,9 @@ ErrCode returnInt64InOutArg(SbxArray *pArgs, SbxVariable &rRetVal,
{
if (!rRetVal.PutLong(1) && !rRetVal.PutInteger(1))
return ERRCODE_BASIC_BAD_ARGUMENT;
if (!pArgs || pArgs->Count() != 2)
if (!pArgs || pArgs->Count32() != 2)
return ERRCODE_BASIC_BAD_ARGUMENT;
SbxVariable *pOut = pArgs->Get(1);
SbxVariable *pOut = pArgs->Get32(1);
if (!pOut)
return ERRCODE_BASIC_BAD_ARGUMENT;
if (pOut->IsCurrency())
+19 -19
View File
@@ -162,8 +162,8 @@ std::size_t alignment(SbxVariable const * variable) {
SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject());
assert(pobj);
SbxArray* props = pobj->GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
n = std::max(n, alignment(props->Get(i)));
for (sal_uInt32 i = 0; i < props->Count32(); ++i) {
n = std::max(n, alignment(props->Get32(i)));
}
return n;
}
@@ -177,9 +177,9 @@ std::size_t alignment(SbxVariable const * variable) {
} else {
SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
assert(arr);
int dims = arr->GetDims();
sal_Int32 dims = arr->GetDims32();
std::vector< sal_Int32 > low(dims);
for (int i = 0; i < dims; ++i) {
for (sal_Int32 i = 0; i < dims; ++i) {
sal_Int32 up;
arr->GetDim32(i + 1, low[i], up);
}
@@ -215,8 +215,8 @@ ErrCode marshalStruct(
SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject());
assert(pobj);
SbxArray* props = pobj->GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
ErrCode e = marshal(false, props->Get(i), false, blob, offset, data);
for (sal_uInt32 i = 0; i < props->Count32(); ++i) {
ErrCode e = marshal(false, props->Get32(i), false, blob, offset, data);
if (e != ERRCODE_NONE) {
return e;
}
@@ -231,10 +231,10 @@ ErrCode marshalArray(
OSL_ASSERT(variable != nullptr);
SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
assert(arr);
int dims = arr->GetDims();
sal_Int32 dims = arr->GetDims32();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
for (int i = 0; i < dims; ++i) {
for (sal_Int32 i = 0; i < dims; ++i) {
arr->GetDim32(i + 1, low[i], up[i]);
}
for (std::vector< sal_Int32 > idx = low;;) {
@@ -243,7 +243,7 @@ ErrCode marshalArray(
if (e != ERRCODE_NONE) {
return e;
}
int i = dims - 1;
sal_Int32 i = dims - 1;
while (idx[i] == up[i]) {
idx[i] = low[i];
if (i == 0) {
@@ -409,8 +409,8 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject());
assert(pobj);
SbxArray* props = pobj->GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
data = unmarshal(props->Get(i), data);
for (sal_uInt32 i = 0; i < props->Count32(); ++i) {
data = unmarshal(props->Get32(i), data);
}
break;
}
@@ -427,15 +427,15 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
} else {
SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
assert(arr);
int dims = arr->GetDims();
sal_Int32 dims = arr->GetDims32();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
for (int i = 0; i < dims; ++i) {
for (sal_Int32 i = 0; i < dims; ++i) {
arr->GetDim32(i + 1, low[i], up[i]);
}
for (std::vector< sal_Int32 > idx = low;;) {
data = unmarshal(arr->Get32(idx.data()), data);
int i = dims - 1;
sal_Int32 i = dims - 1;
while (idx[i] == up[i]) {
idx[i] = low[i];
if (i == 0) {
@@ -482,7 +482,7 @@ ErrCode call(
OUString const & dll, ProcData const & proc, SbxArray * arguments,
SbxVariable & result)
{
if (arguments && arguments->Count() > 20)
if (arguments && arguments->Count32() > 20)
return ERRCODE_BASIC_NOT_IMPLEMENTED;
std::vector< char > stack;
@@ -495,9 +495,9 @@ ErrCode call(
bool special =
dll.equalsIgnoreAsciiCase("KERNEL32.DLL") &&
(proc.name == OString("GetLogicalDriveStringsA"));
for (int i = 1; i < (arguments == nullptr ? 0 : arguments->Count()); ++i) {
for (sal_uInt32 i = 1; i < (arguments == nullptr ? 0 : arguments->Count32()); ++i) {
ErrCode e = marshal(
true, arguments->Get(i), special && i == 2, stack, stack.size(),
true, arguments->Get32(i), special && i == 2, stack, stack.size(),
data);
if (e != ERRCODE_NONE) {
return e;
@@ -619,8 +619,8 @@ ErrCode call(
OSL_ASSERT(false);
break;
}
for (int i = 1; i < (arguments == nullptr ? 0 : arguments->Count()); ++i) {
arguments->Get(i)->ResetFlag(SbxFlagBits::Reference);
for (sal_uInt32 i = 1; i < (arguments == nullptr ? 0 : arguments->Count32()); ++i) {
arguments->Get32(i)->ResetFlag(SbxFlagBits::Reference);
//TODO: skipped for errors?!?
}
for (auto const& elem : data.unmarshal)
+18 -18
View File
@@ -169,8 +169,8 @@ std::size_t alignment(SbxVariable * variable) {
SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject());
assert(pobj);
SbxArray* props = pobj->GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
n = std::max(n, alignment(props->Get(i)));
for (sal_uInt32 i = 0; i < props->Count32(); ++i) {
n = std::max(n, alignment(props->Get32(i)));
}
return n;
}
@@ -184,9 +184,9 @@ std::size_t alignment(SbxVariable * variable) {
} else {
SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
assert(arr);
int dims = arr->GetDims();
sal_Int32 dims = arr->GetDims32();
std::vector< sal_Int32 > low(dims);
for (int i = 0; i < dims; ++i) {
for (sal_Int32 i = 0; i < dims; ++i) {
sal_Int32 up;
arr->GetDim32(i + 1, low[i], up);
}
@@ -223,8 +223,8 @@ ErrCode marshalStruct(
SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject());
assert(pobj);
SbxArray* props = pobj->GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
ErrCode e = marshal(false, props->Get(i), false, blob, offset, data);
for (sal_uInt32 i = 0; i < props->Count32(); ++i) {
ErrCode e = marshal(false, props->Get32(i), false, blob, offset, data);
if (e != ERRCODE_NONE) {
return e;
}
@@ -239,10 +239,10 @@ ErrCode marshalArray(
OSL_ASSERT(variable != 0);
SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
assert(arr);
int dims = arr->GetDims();
sal_Int32 dims = arr->GetDims32();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
for (int i = 0; i < dims; ++i) {
for (sal_Int32 i = 0; i < dims; ++i) {
arr->GetDim32(i + 1, low[i], up[i]);
}
for (std::vector< sal_Int32 > idx = low;;) {
@@ -251,7 +251,7 @@ ErrCode marshalArray(
if (e != ERRCODE_NONE) {
return e;
}
int i = dims - 1;
sal_Int32 i = dims - 1;
while (idx[i] == up[i]) {
idx[i] = low[i];
if (i == 0) {
@@ -417,8 +417,8 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
SbxObject* pobj = dynamic_cast<SbxObject*>(variable->GetObject());
assert(pobj);
SbxArray* props = pobj->GetProperties();
for (sal_uInt16 i = 0; i < props->Count(); ++i) {
data = unmarshal(props->Get(i), data);
for (sal_uInt32 i = 0; i < props->Count32(); ++i) {
data = unmarshal(props->Get32(i), data);
}
break;
}
@@ -435,15 +435,15 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
} else {
SbxDimArray * arr = dynamic_cast<SbxDimArray*>( variable->GetObject() );
assert(arr);
int dims = arr->GetDims();
sal_Int32 dims = arr->GetDims32();
std::vector< sal_Int32 > low(dims);
std::vector< sal_Int32 > up(dims);
for (int i = 0; i < dims; ++i) {
for (sal_Int32 i = 0; i < dims; ++i) {
arr->GetDim32(i + 1, low[i], up[i]);
}
for (std::vector< sal_Int32 > idx = low;;) {
data = unmarshal(arr->Get32(&idx[0]), data);
int i = dims - 1;
sal_Int32 i = dims - 1;
while (idx[i] == up[i]) {
idx[i] = low[i];
if (i == 0) {
@@ -498,9 +498,9 @@ ErrCode call(
// require similar treatment, too:
bool special = dll.equalsIgnoreAsciiCase("KERNEL32.DLL") &&
(proc.name == OString("GetLogicalDriveStringsA"));
for (sal_uInt16 i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) {
for (sal_uInt32 i = 1; i < (arguments == 0 ? 0 : arguments->Count32()); ++i) {
ErrCode e = marshal(
true, arguments->Get(i), special && i == 2, stack, stack.size(),
true, arguments->Get32(i), special && i == 2, stack, stack.size(),
data);
if (e != ERRCODE_NONE) {
return e;
@@ -559,8 +559,8 @@ ErrCode call(
OSL_ASSERT(false);
break;
}
for (sal_uInt16 i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) {
arguments->Get(i)->ResetFlag(SbxFlagBits::Reference);
for (sal_uInt32 i = 1; i < (arguments == 0 ? 0 : arguments->Count32()); ++i) {
arguments->Get32(i)->ResetFlag(SbxFlagBits::Reference);
//TODO: skipped for errors?!?
}
for (auto& rUnmarshalData : data.unmarshal)
+9 -9
View File
@@ -110,7 +110,7 @@ IMPL_LINK_NOARG( SvRTLInputBox, CancelHdl, weld::Button&, void )
void SbRtl_InputBox(StarBASIC *, SbxArray & rPar, bool)
{
sal_uInt32 nArgCount = rPar.Count();
sal_uInt32 nArgCount = rPar.Count32();
if ( nArgCount < 2 )
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
else
@@ -118,11 +118,11 @@ void SbRtl_InputBox(StarBASIC *, SbxArray & rPar, bool)
OUString aTitle;
OUString aDefault;
sal_Int32 nX = -1, nY = -1; // center
const OUString& rPrompt = rPar.Get(1)->GetOUString();
if ( nArgCount > 2 && !rPar.Get(2)->IsErr() )
aTitle = rPar.Get(2)->GetOUString();
if ( nArgCount > 3 && !rPar.Get(3)->IsErr() )
aDefault = rPar.Get(3)->GetOUString();
const OUString& rPrompt = rPar.Get32(1)->GetOUString();
if ( nArgCount > 2 && !rPar.Get32(2)->IsErr() )
aTitle = rPar.Get32(2)->GetOUString();
if ( nArgCount > 3 && !rPar.Get32(3)->IsErr() )
aDefault = rPar.Get32(3)->GetOUString();
if ( nArgCount > 4 )
{
if ( nArgCount != 6 )
@@ -130,13 +130,13 @@ void SbRtl_InputBox(StarBASIC *, SbxArray & rPar, bool)
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
nX = rPar.Get(4)->GetLong();
nY = rPar.Get(5)->GetLong();
nX = rPar.Get32(4)->GetLong();
nY = rPar.Get32(5)->GetLong();
}
vcl::Window* pParent = Application::GetDefDialogParent();
SvRTLInputBox aDlg(pParent ? pParent->GetFrameWeld() : nullptr,rPrompt,aTitle,aDefault,nX,nY);
aDlg.run();
rPar.Get(0)->PutString(aDlg.GetText());
rPar.Get32(0)->PutString(aDlg.GetText());
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+97 -97
View File
@@ -30,31 +30,31 @@
void SbRtl_Erl(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get( 0 )->PutLong( StarBASIC::GetErl() );
rPar.Get32(0)->PutLong( StarBASIC::GetErl() );
}
void SbRtl_Err(StarBASIC *, SbxArray & rPar, bool bWrite)
{
if( SbiRuntime::isVBAEnabled() )
{
rPar.Get( 0 )->PutObject( SbxErrObject::getErrObject().get() );
rPar.Get32(0)->PutObject( SbxErrObject::getErrObject().get() );
}
else
{
if( bWrite )
{
sal_Int32 nVal = rPar.Get( 0 )->GetLong();
sal_Int32 nVal = rPar.Get32(0)->GetLong();
if( nVal <= 65535 )
StarBASIC::Error( StarBASIC::GetSfxFromVBError( static_cast<sal_uInt16>(nVal) ) );
}
else
rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
rPar.Get32(0)->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
}
}
void SbRtl_False(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutBool( false );
rPar.Get32(0)->PutBool( false );
}
void SbRtl_Empty(StarBASIC *, SbxArray &, bool) {}
@@ -62,386 +62,386 @@ void SbRtl_Empty(StarBASIC *, SbxArray &, bool) {}
void SbRtl_Nothing(StarBASIC *, SbxArray & rPar, bool)
{
// return an empty object
rPar.Get( 0 )->PutObject( nullptr );
rPar.Get32(0)->PutObject( nullptr );
}
void SbRtl_Null(StarBASIC *, SbxArray & rPar, bool)
{
// returns an empty object-variable
rPar.Get( 0 )->PutNull();
rPar.Get32(0)->PutNull();
}
void SbRtl_PI(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get( 0 )->PutDouble( F_PI );
rPar.Get32(0)->PutDouble( F_PI );
}
void SbRtl_True(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get( 0 )->PutBool( true );
rPar.Get32(0)->PutBool( true );
}
void SbRtl_ATTR_NORMAL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_ATTR_READONLY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_ATTR_HIDDEN(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_ATTR_SYSTEM(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(4);
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_ATTR_VOLUME(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(8);
rPar.Get32(0)->PutInteger(8);
}
void SbRtl_ATTR_DIRECTORY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(16);
rPar.Get32(0)->PutInteger(16);
}
void SbRtl_ATTR_ARCHIVE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(32);
rPar.Get32(0)->PutInteger(32);
}
void SbRtl_V_EMPTY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_V_NULL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_V_INTEGER(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_V_LONG(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(3);
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_V_SINGLE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(4);
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_V_DOUBLE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(5);
rPar.Get32(0)->PutInteger(5);
}
void SbRtl_V_CURRENCY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(6);
rPar.Get32(0)->PutInteger(6);
}
void SbRtl_V_DATE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(7);
rPar.Get32(0)->PutInteger(7);
}
void SbRtl_V_STRING(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(8);
rPar.Get32(0)->PutInteger(8);
}
void SbRtl_MB_OK(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_MB_OKCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_MB_ABORTRETRYIGNORE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_MB_YESNOCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(3);
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_MB_YESNO(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(4);
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_MB_RETRYCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(5);
rPar.Get32(0)->PutInteger(5);
}
void SbRtl_MB_ICONSTOP(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(16);
rPar.Get32(0)->PutInteger(16);
}
void SbRtl_MB_ICONQUESTION(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(32);
rPar.Get32(0)->PutInteger(32);
}
void SbRtl_MB_ICONEXCLAMATION(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(48);
rPar.Get32(0)->PutInteger(48);
}
void SbRtl_MB_ICONINFORMATION(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(64);
rPar.Get32(0)->PutInteger(64);
}
void SbRtl_MB_DEFBUTTON1(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_MB_DEFBUTTON2(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(256);
rPar.Get32(0)->PutInteger(256);
}
void SbRtl_MB_DEFBUTTON3(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(512);
rPar.Get32(0)->PutInteger(512);
}
void SbRtl_MB_APPLMODAL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_MB_SYSTEMMODAL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(4096);
rPar.Get32(0)->PutInteger(4096);
}
void SbRtl_IDOK(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_IDCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_IDABORT(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(3);
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_IDRETRY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(4);
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_IDYES(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(6);
rPar.Get32(0)->PutInteger(6);
}
void SbRtl_IDNO(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(7);
rPar.Get32(0)->PutInteger(7);
}
void SbRtl_CF_TEXT(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_CF_BITMAP(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_CF_METAFILEPICT(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(3);
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_TYP_AUTHORFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(7);
rPar.Get32(0)->PutInteger(7);
}
void SbRtl_TYP_CHAPTERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(4);
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_TYP_CONDTXTFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(27);
rPar.Get32(0)->PutInteger(27);
}
void SbRtl_TYP_DATEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_TYP_DBFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(19);
rPar.Get32(0)->PutInteger(19);
}
void SbRtl_TYP_DBNAMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(3);
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_TYP_DBNEXTSETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(24);
rPar.Get32(0)->PutInteger(24);
}
void SbRtl_TYP_DBNUMSETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(25);
rPar.Get32(0)->PutInteger(25);
}
void SbRtl_TYP_DBSETNUMBERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(26);
rPar.Get32(0)->PutInteger(26);
}
void SbRtl_TYP_DDEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(14);
rPar.Get32(0)->PutInteger(14);
}
void SbRtl_TYP_DOCINFOFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(18);
rPar.Get32(0)->PutInteger(18);
}
void SbRtl_TYP_DOCSTATFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(6);
rPar.Get32(0)->PutInteger(6);
}
void SbRtl_TYP_EXTUSERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(30);
rPar.Get32(0)->PutInteger(30);
}
void SbRtl_TYP_FILENAMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_TYP_FIXDATEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(31);
rPar.Get32(0)->PutInteger(31);
}
void SbRtl_TYP_FIXTIMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(32);
rPar.Get32(0)->PutInteger(32);
}
void SbRtl_TYP_FORMELFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(10);
rPar.Get32(0)->PutInteger(10);
}
void SbRtl_TYP_GETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(9);
rPar.Get32(0)->PutInteger(9);
}
void SbRtl_TYP_GETREFFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(13);
rPar.Get32(0)->PutInteger(13);
}
void SbRtl_TYP_HIDDENPARAFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(17);
rPar.Get32(0)->PutInteger(17);
}
void SbRtl_TYP_HIDDENTXTFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(11);
rPar.Get32(0)->PutInteger(11);
}
void SbRtl_TYP_INPUTFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(16);
rPar.Get32(0)->PutInteger(16);
}
void SbRtl_TYP_MACROFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(15);
rPar.Get32(0)->PutInteger(15);
}
void SbRtl_TYP_NEXTPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(28);
rPar.Get32(0)->PutInteger(28);
}
void SbRtl_TYP_PAGENUMBERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(5);
rPar.Get32(0)->PutInteger(5);
}
void SbRtl_TYP_POSTITFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(21);
rPar.Get32(0)->PutInteger(21);
}
void SbRtl_TYP_PREVPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(29);
rPar.Get32(0)->PutInteger(29);
}
void SbRtl_TYP_SEQFLD(StarBASIC * , SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(23);
rPar.Get32(0)->PutInteger(23);
}
void SbRtl_TYP_SETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(8);
rPar.Get32(0)->PutInteger(8);
}
void SbRtl_TYP_SETINPFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(33);
rPar.Get32(0)->PutInteger(33);
}
void SbRtl_TYP_SETREFFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(12);
rPar.Get32(0)->PutInteger(12);
}
void SbRtl_TYP_TEMPLNAMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(22);
rPar.Get32(0)->PutInteger(22);
}
void SbRtl_TYP_TIMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_TYP_USERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(20);
rPar.Get32(0)->PutInteger(20);
}
void SbRtl_TYP_USRINPFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(34);
rPar.Get32(0)->PutInteger(34);
}
void SbRtl_TYP_SETREFPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(35);
rPar.Get32(0)->PutInteger(35);
}
void SbRtl_TYP_GETREFPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(36);
rPar.Get32(0)->PutInteger(36);
}
void SbRtl_TYP_INTERNETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(37);
rPar.Get32(0)->PutInteger(37);
}
void SbRtl_SET_ON(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_SET_OFF(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_TOGGLE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_FRAMEANCHORPAGE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_FRAMEANCHORPARA(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(14);
rPar.Get32(0)->PutInteger(14);
}
void SbRtl_FRAMEANCHORCHAR(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(15);
rPar.Get32(0)->PutInteger(15);
}
void SbRtl_CLEAR_ALLTABS(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(2);
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_CLEAR_TAB(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(1);
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_SET_TAB(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(0);
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_TYP_JUMPEDITFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get(0)->PutInteger(38);
rPar.Get32(0)->PutInteger(38);
}
+86 -84
View File
@@ -629,40 +629,41 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
{
refParams = new SbxArray;
// for the return value
refParams->Put( pMeth, 0 );
refParams->Put32( pMeth, 0 );
SbxInfo* pInfo = pMeth ? pMeth->GetInfo() : nullptr;
sal_uInt16 nParamCount = pParams ? pParams->Count() : 1;
sal_uInt32 nParamCount = pParams ? pParams->Count32() : 1;
assert(nParamCount <= std::numeric_limits<sal_uInt16>::max());
if( nParamCount > 1 )
{
for( sal_uInt16 i = 1 ; i < nParamCount ; i++ )
for( sal_uInt32 i = 1 ; i < nParamCount ; i++ )
{
const SbxParamInfo* p = pInfo ? pInfo->GetParam( i ) : nullptr;
const SbxParamInfo* p = pInfo ? pInfo->GetParam( sal::static_int_cast<sal_uInt16>(i) ) : nullptr;
// #111897 ParamArray
if( p && (p->nUserData & PARAM_INFO_PARAMARRAY) != 0 )
{
SbxDimArray* pArray = new SbxDimArray( SbxVARIANT );
sal_uInt16 nParamArrayParamCount = nParamCount - i;
pArray->unoAddDim( 0, nParamArrayParamCount - 1 );
for (sal_uInt16 j = i; j < nParamCount ; ++j)
sal_uInt32 nParamArrayParamCount = nParamCount - i;
pArray->unoAddDim32( 0, nParamArrayParamCount - 1 );
for (sal_uInt32 j = i; j < nParamCount ; ++j)
{
SbxVariable* v = pParams->Get( j );
short aDimIndex[1];
SbxVariable* v = pParams->Get32( j );
sal_Int32 aDimIndex[1];
aDimIndex[0] = j - i;
pArray->Put(v, aDimIndex);
pArray->Put32(v, aDimIndex);
}
SbxVariable* pArrayVar = new SbxVariable( SbxVARIANT );
pArrayVar->SetFlag( SbxFlagBits::ReadWrite );
pArrayVar->PutObject( pArray );
refParams->Put( pArrayVar, i );
refParams->Put32( pArrayVar, i );
// Block ParamArray for missing parameter
pInfo = nullptr;
break;
}
SbxVariable* v = pParams->Get( i );
SbxVariable* v = pParams->Get32( i );
// methods are always byval!
bool bByVal = dynamic_cast<const SbxMethod *>(v) != nullptr;
SbxDataType t = v->GetType();
@@ -689,7 +690,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
SbxVariable* v2 = new SbxVariable( t );
v2->SetFlag( SbxFlagBits::ReadWrite );
*v2 = *v;
refParams->Put( v2, i );
refParams->Put32( v2, i );
}
else
{
@@ -704,11 +705,11 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
v->Convert( t );
}
}
refParams->Put( v, i );
refParams->Put32( v, i );
}
if( p )
{
refParams->PutAlias( p->aName, i );
refParams->PutAlias32( p->aName, i );
}
}
}
@@ -717,15 +718,15 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
if( pInfo )
{
// #111897 Check first missing parameter for ParamArray
const SbxParamInfo* p = pInfo->GetParam( nParamCount );
const SbxParamInfo* p = pInfo->GetParam(sal::static_int_cast<sal_uInt16>(nParamCount));
if( p && (p->nUserData & PARAM_INFO_PARAMARRAY) != 0 )
{
SbxDimArray* pArray = new SbxDimArray( SbxVARIANT );
pArray->unoAddDim( 0, -1 );
pArray->unoAddDim32( 0, -1 );
SbxVariable* pArrayVar = new SbxVariable( SbxVARIANT );
pArrayVar->SetFlag( SbxFlagBits::ReadWrite );
pArrayVar->PutObject( pArray );
refParams->Put( pArrayVar, nParamCount );
refParams->Put32( pArrayVar, nParamCount );
}
}
}
@@ -961,7 +962,7 @@ void SbiRuntime::PushVar( SbxVariable* pVar )
{
if( pVar )
{
refExprStk->Put( pVar, nExprLvl++ );
refExprStk->Put32( pVar, nExprLvl++ );
}
}
@@ -974,7 +975,7 @@ SbxVariableRef SbiRuntime::PopVar()
return new SbxVariable;
}
#endif
SbxVariableRef xVar = refExprStk->Get( --nExprLvl );
SbxVariableRef xVar = refExprStk->Get32( --nExprLvl );
SAL_INFO_IF( xVar->GetName() == "Cells", "basic", "PopVar: Name equals 'Cells'" );
// methods hold themselves in parameter 0
if( dynamic_cast<const SbxMethod *>(xVar.get()) != nullptr )
@@ -1007,13 +1008,13 @@ SbxVariable* SbiRuntime::GetTOS()
return new SbxVariable;
}
#endif
return refExprStk->Get( static_cast<sal_uInt16>(n) );
return refExprStk->Get32( static_cast<sal_uInt32>(n) );
}
void SbiRuntime::TOSMakeTemp()
{
SbxVariable* p = refExprStk->Get( nExprLvl - 1 );
SbxVariable* p = refExprStk->Get32( nExprLvl - 1 );
if ( p->GetType() == SbxEMPTY )
{
p->Broadcast( SfxHintId::BasicDataWanted );
@@ -1030,13 +1031,13 @@ void SbiRuntime::TOSMakeTemp()
pDflt->SetParent( nullptr );
p = new SbxVariable( *pDflt );
p->SetFlag( SbxFlagBits::ReadWrite );
refExprStk->Put( p, nExprLvl - 1 );
refExprStk->Put32( p, nExprLvl - 1 );
}
else if( p->GetRefCount() != 1 )
{
SbxVariable* pNew = new SbxVariable( *p );
pNew->SetFlag( SbxFlagBits::ReadWrite );
refExprStk->Put( pNew, nExprLvl - 1 );
refExprStk->Put32( pNew, nExprLvl - 1 );
}
}
@@ -1129,12 +1130,12 @@ void SbiRuntime::PushForEach()
p->eForType = ForType::EachArray;
p->refEnd = reinterpret_cast<SbxVariable*>(pArray);
short nDims = pArray->GetDims();
sal_Int32 nDims = pArray->GetDims32();
p->pArrayLowerBounds.reset( new sal_Int32[nDims] );
p->pArrayUpperBounds.reset( new sal_Int32[nDims] );
p->pArrayCurIndices.reset( new sal_Int32[nDims] );
sal_Int32 lBound, uBound;
for( short i = 0 ; i < nDims ; i++ )
for( sal_Int32 i = 0 ; i < nDims ; i++ )
{
pArray->GetDim32( i+1, lBound, uBound );
p->pArrayCurIndices[i] = p->pArrayLowerBounds[i] = lBound;
@@ -2105,7 +2106,7 @@ void SbiRuntime::DimImpl(const SbxVariableRef& refVar)
SbxArray* pDims = refVar->GetParameters();
// must have an even number of arguments
// have in mind that Arg[0] does not count!
if( pDims && !( pDims->Count() & 1 ) )
if( pDims && !( pDims->Count32() & 1 ) )
{
StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
}
@@ -2118,10 +2119,10 @@ void SbiRuntime::DimImpl(const SbxVariableRef& refVar)
{
refVar->ResetFlag( SbxFlagBits::VarToDim );
for( sal_uInt16 i = 1; i < pDims->Count(); )
for( sal_uInt32 i = 1; i < pDims->Count32(); )
{
sal_Int32 lb = pDims->Get( i++ )->GetLong();
sal_Int32 ub = pDims->Get( i++ )->GetLong();
sal_Int32 lb = pDims->Get32( i++ )->GetLong();
sal_Int32 ub = pDims->Get32( i++ )->GetLong();
if( ub < lb )
{
Error( ERRCODE_BASIC_OUT_OF_RANGE );
@@ -2138,7 +2139,7 @@ void SbiRuntime::DimImpl(const SbxVariableRef& refVar)
{
// #62867 On creating an array of the length 0, create
// a dimension (like for Uno-Sequences of the length 0)
pArray->unoAddDim( 0, -1 );
pArray->unoAddDim32( 0, -1 );
}
SbxFlagBits nSavFlags = refVar->GetFlags();
refVar->ResetFlag( SbxFlagBits::Fixed );
@@ -2161,8 +2162,8 @@ void SbiRuntime::StepREDIM()
// Helper function for StepREDIMP and StepDCREATE_IMPL / bRedimp = true
static void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, short nMaxDimIndex,
short nActualDim, sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds )
static void implCopyDimArray( SbxDimArray* pNewArray, SbxDimArray* pOldArray, sal_Int32 nMaxDimIndex,
sal_Int32 nActualDim, sal_Int32* pActualIndices, sal_Int32* pLowerBounds, sal_Int32* pUpperBounds )
{
sal_Int32& ri = pActualIndices[nActualDim];
for( ri = pLowerBounds[nActualDim] ; ri <= pUpperBounds[nActualDim] ; ri++ )
@@ -2190,8 +2191,8 @@ static bool implRestorePreservedArray(SbxDimArray* pNewArray, SbxArrayRef& rrefR
if (rrefRedimpArray)
{
SbxDimArray* pOldArray = static_cast<SbxDimArray*>(rrefRedimpArray.get());
const short nDimsNew = pNewArray->GetDims();
const short nDimsOld = pOldArray->GetDims();
const sal_Int32 nDimsNew = pNewArray->GetDims32();
const sal_Int32 nDimsOld = pOldArray->GetDims32();
if (nDimsOld != nDimsNew)
{
@@ -2208,7 +2209,7 @@ static bool implRestorePreservedArray(SbxDimArray* pNewArray, SbxArrayRef& rrefR
bool bNeedsPreallocation = true;
// Compare bounds
for (short i = 1; i <= nDimsNew; i++)
for (sal_Int32 i = 1; i <= nDimsNew; i++)
{
sal_Int32 lBoundNew, uBoundNew;
sal_Int32 lBoundOld, uBoundOld;
@@ -2216,7 +2217,7 @@ static bool implRestorePreservedArray(SbxDimArray* pNewArray, SbxArrayRef& rrefR
pOldArray->GetDim32(i, lBoundOld, uBoundOld);
lBoundNew = std::max(lBoundNew, lBoundOld);
uBoundNew = std::min(uBoundNew, uBoundOld);
short j = i - 1;
sal_Int32 j = i - 1;
pActualIndices[j] = pLowerBounds[j] = lBoundNew;
pUpperBounds[j] = uBoundNew;
if (lBoundNew > uBoundNew) // No elements in the dimension -> no elements to restore
@@ -2415,7 +2416,7 @@ void SbiRuntime::StepARGV()
SbxVariable* pRes = new SbxVariable( *pVal );
pVal = pRes;
}
refArgv->Put( pVal.get(), nArgc++ );
refArgv->Put32( pVal.get(), nArgc++ );
}
}
@@ -2586,20 +2587,20 @@ void SbiRuntime::StepCASE()
refCaseStk = new SbxArray;
}
SbxVariableRef xVar = PopVar();
refCaseStk->Put( xVar.get(), refCaseStk->Count() );
refCaseStk->Put32( xVar.get(), refCaseStk->Count32() );
}
// end CASE: free variable
void SbiRuntime::StepENDCASE()
{
if( !refCaseStk.is() || !refCaseStk->Count() )
if( !refCaseStk.is() || !refCaseStk->Count32() )
{
StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
}
else
{
refCaseStk->Remove( refCaseStk->Count() - 1 );
refCaseStk->Remove( refCaseStk->Count32() - 1 );
}
}
@@ -2828,8 +2829,8 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
SbxVariable* pRes = new SbxVariable( *pVal );
pVal = pRes;
}
refArgv->Put( pVal.get(), nArgc );
refArgv->PutAlias( aAlias, nArgc++ );
refArgv->Put32( pVal.get(), nArgc );
refArgv->PutAlias32( aAlias, nArgc++ );
}
}
@@ -2843,7 +2844,7 @@ void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 )
{
bool bByVal = (nOp1 & 0x8000) != 0; // Is BYVAL requested?
SbxDataType t = static_cast<SbxDataType>(nOp1 & 0x7FFF);
SbxVariable* pVar = refArgv->Get( refArgv->Count() - 1 ); // last Arg
SbxVariable* pVar = refArgv->Get32( refArgv->Count32() - 1 ); // last Arg
// check BYVAL
if( pVar->GetRefCount() > 2 ) // 2 is normal for BYVAL
@@ -2854,7 +2855,7 @@ void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 )
// Call by Value is requested -> create a copy
pVar = new SbxVariable( *pVar );
pVar->SetFlag( SbxFlagBits::ReadWrite );
refExprStk->Put( pVar, refArgv->Count() - 1 );
refExprStk->Put32( pVar, refArgv->Count32() - 1 );
}
else
pVar->SetFlag( SbxFlagBits::Reference ); // Ref-Flag for DllMgr
@@ -3005,7 +3006,7 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 )
else
{
SbxDimArray* pArray = reinterpret_cast<SbxDimArray*>(p->refEnd.get());
short nDims = pArray->GetDims();
sal_Int32 nDims = pArray->GetDims32();
// Empty array?
if( nDims == 1 && p->pArrayLowerBounds[0] > p->pArrayUpperBounds[0] )
@@ -3017,13 +3018,13 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 )
*(p->refVar) = *pVal;
bool bFoundNext = false;
for( short i = 0 ; i < nDims ; i++ )
for(sal_Int32 i = 0 ; i < nDims ; i++ )
{
if( p->pArrayCurIndices[i] < p->pArrayUpperBounds[i] )
{
bFoundNext = true;
p->pArrayCurIndices[i]++;
for( short j = i - 1 ; j >= 0 ; j-- )
for( sal_Int32 j = i - 1 ; j >= 0 ; j-- )
p->pArrayCurIndices[j] = p->pArrayLowerBounds[j];
break;
}
@@ -3080,13 +3081,13 @@ void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 )
void SbiRuntime::StepCASETO( sal_uInt32 nOp1 )
{
if( !refCaseStk.is() || !refCaseStk->Count() )
if( !refCaseStk.is() || !refCaseStk->Count32() )
StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
else
{
SbxVariableRef xTo = PopVar();
SbxVariableRef xFrom = PopVar();
SbxVariableRef xCase = refCaseStk->Get( refCaseStk->Count() - 1 );
SbxVariableRef xCase = refCaseStk->Get32( refCaseStk->Count32() - 1 );
if( *xCase >= *xFrom && *xCase <= *xTo )
StepJUMP( nOp1 );
}
@@ -3434,7 +3435,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt
{
pElem->SetName( aName );
}
refLocals->Put( pElem, refLocals->Count() );
refLocals->Put32( pElem, refLocals->Count32() );
}
}
@@ -3486,7 +3487,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt
pElem->SetFlag( SbxFlagBits::Fixed );
}
pElem->SetName( aName );
refLocals->Put( pElem, refLocals->Count() );
refLocals->Put32( pElem, refLocals->Count32() );
}
}
}
@@ -3582,7 +3583,8 @@ SbxBase* SbiRuntime::FindElementExtern( const OUString& rName )
SbxInfo* pInfo = pMeth->GetInfo();
if( pInfo && refParams.is() )
{
sal_uInt16 nParamCount = refParams->Count();
sal_uInt32 nParamCount = refParams->Count32();
assert(nParamCount <= std::numeric_limits<sal_uInt16>::max());
sal_uInt16 j = 1;
const SbxParamInfo* pParam = pInfo->GetParam( j );
while( pParam )
@@ -3597,7 +3599,7 @@ SbxBase* SbiRuntime::FindElementExtern( const OUString& rName )
}
else
{
pElem = refParams->Get( j );
pElem = refParams->Get32( j );
}
break;
}
@@ -3627,11 +3629,11 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
}
bool bHasNamed = false;
sal_uInt16 i;
sal_uInt16 nArgCount = refArgv->Count();
sal_uInt32 i;
sal_uInt32 nArgCount = refArgv->Count32();
for( i = 1 ; i < nArgCount ; i++ )
{
if( !refArgv->GetAlias(i).isEmpty() )
if( !refArgv->GetAlias32(i).isEmpty() )
{
bHasNamed = true; break;
}
@@ -3657,19 +3659,19 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
{
bError_ = false;
sal_uInt16 nCurPar = 1;
sal_uInt32 nCurPar = 1;
AutomationNamedArgsSbxArray* pArg =
new AutomationNamedArgsSbxArray( nArgCount );
OUString* pNames = pArg->getNames().getArray();
for( i = 1 ; i < nArgCount ; i++ )
{
SbxVariable* pVar = refArgv->Get( i );
OUString aName = refArgv->GetAlias(i);
SbxVariable* pVar = refArgv->Get32( i );
OUString aName = refArgv->GetAlias32(i);
if (!aName.isEmpty())
{
pNames[i] = aName;
}
pArg->Put( pVar, nCurPar++ );
pArg->Put32( pVar, nCurPar++ );
}
refArgv = pArg;
}
@@ -3714,12 +3716,12 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
}
else
{
sal_uInt16 nCurPar = 1;
sal_uInt32 nCurPar = 1;
SbxArray* pArg = new SbxArray;
for( i = 1 ; i < nArgCount ; i++ )
{
SbxVariable* pVar = refArgv->Get( i );
OUString aName = refArgv->GetAlias(i);
SbxVariable* pVar = refArgv->Get32( i );
OUString aName = refArgv->GetAlias32(i);
if (!aName.isEmpty())
{
// nCurPar is set to the found parameter
@@ -3739,13 +3741,13 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
Error( ERRCODE_BASIC_NAMED_NOT_FOUND ); break;
}
}
pArg->Put( pVar, nCurPar++ );
pArg->Put32( pVar, nCurPar++ );
}
refArgv = pArg;
}
}
// own var as parameter 0
refArgv->Put( p, 0 );
refArgv->Put32( p, 0 );
p->SetParameters( refArgv.get() );
PopArgv();
}
@@ -3784,7 +3786,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
else
{
pElem = pArray->Get( pPar->Get( 1 )->GetInteger() );
pElem = pArray->Get32( pPar->Get32( 1 )->GetInteger() );
}
}
}
@@ -3792,7 +3794,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
// #42940, set parameter 0 to NULL so that var doesn't contain itself
if( pPar )
{
pPar->Put( nullptr, 0 );
pPar->Put32( nullptr, 0 );
}
}
// consider index-access for UnoObjects
@@ -3818,7 +3820,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
{
if( xIndexAccess.is() )
{
sal_uInt32 nParamCount = static_cast<sal_uInt32>(pPar->Count()) - 1;
sal_uInt32 nParamCount = pPar->Count32() - 1;
if( nParamCount != 1 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -3826,7 +3828,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
// get index
sal_Int32 nIndex = pPar->Get( 1 )->GetLong();
sal_Int32 nIndex = pPar->Get32( 1 )->GetLong();
Reference< XInterface > xRet;
try
{
@@ -3910,12 +3912,12 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
}
// #42940, set parameter 0 to NULL so that var doesn't contain itself
pPar->Put( nullptr, 0 );
pPar->Put32( nullptr, 0 );
}
else if (BasicCollection* pCol = dynamic_cast<BasicCollection*>(pObj.get()))
{
pElem = new SbxVariable( SbxVARIANT );
pPar->Put( pElem, 0 );
pPar->Put32( pElem, 0 );
pCol->CollItem( pPar );
}
}
@@ -4015,10 +4017,10 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
SbxVariable* p;
// #57915 solve missing in a cleaner way
sal_uInt16 nParamCount = refParams->Count();
sal_uInt32 nParamCount = refParams->Count32();
if( i >= nParamCount )
{
sal_Int16 iLoop = i;
sal_uInt16 iLoop = i;
while( iLoop >= nParamCount )
{
p = new SbxVariable();
@@ -4039,11 +4041,11 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
p->PutErr( 448 ); // like in VB: Error-Code 448 (ERRCODE_BASIC_NAMED_NOT_FOUND)
}
refParams->Put( p, iLoop );
refParams->Put32( p, iLoop );
iLoop--;
}
}
p = refParams->Get( i );
p = refParams->Get32( i );
if( p->GetType() == SbxERROR && i )
{
@@ -4064,7 +4066,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
OUString aDefaultStr = pImg->GetString( nDefaultId );
p = new SbxVariable(pParam-> eType);
p->PutString( aDefaultStr );
refParams->Put( p, i );
refParams->Put32( p, i );
}
bOpt = true;
}
@@ -4083,7 +4085,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
p = q;
if ( i )
{
refParams->Put( p, i );
refParams->Put32( p, i );
}
}
SetupArgs( p, nOp1 );
@@ -4094,14 +4096,14 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 )
void SbiRuntime::StepCASEIS( sal_uInt32 nOp1, sal_uInt32 nOp2 )
{
if( !refCaseStk.is() || !refCaseStk->Count() )
if( !refCaseStk.is() || !refCaseStk->Count32() )
{
StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
}
else
{
SbxVariableRef xComp = PopVar();
SbxVariableRef xCase = refCaseStk->Get( refCaseStk->Count() - 1 );
SbxVariableRef xCase = refCaseStk->Get32( refCaseStk->Count32() - 1 );
if( xCase->Compare( static_cast<SbxOperator>(nOp2), *xComp ) )
{
StepJUMP( nOp1 );
@@ -4161,7 +4163,7 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
}
else if( nExprLvl )
{
SbxVariable* p = refExprStk->Get( 0 );
SbxVariable* p = refExprStk->Get32( 0 );
if( p->GetRefCount() > 1 &&
refLocals.is() && refLocals->Find( p->GetName(), p->GetClass() ) )
{
@@ -4310,7 +4312,7 @@ void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
if (SbxDimArray* pArray = dynamic_cast<SbxDimArray*>(pObj))
{
const short nDims = pArray->GetDims();
const sal_Int32 nDims = pArray->GetDims32();
sal_Int32 nTotalSize = nDims > 0 ? 1 : 0;
// must be a one-dimensional array
@@ -4418,7 +4420,7 @@ void SbiRuntime::StepLOCAL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
SbxVariable* p = new SbxVariable( t );
p->SetName( aName );
implHandleSbxFlags( p, t, nOp2 );
refLocals->Put( p, refLocals->Count() );
refLocals->Put32( p, refLocals->Count32() );
}
}
@@ -4563,7 +4565,7 @@ SbxVariable* SbiRuntime::StepSTATIC_Impl(
}
p->SetName( aName );
implHandleSbxFlags( p, t, nOp2 );
pStatics->Put( p, pStatics->Count() );
pStatics->Put32( p, pStatics->Count32() );
}
}
return p;
+1 -1
View File
@@ -860,7 +860,7 @@ void SbiStdObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
if( !pPar_ )
{
rPar = pPar_ = new SbxArray;
pPar_->Put( pVar, 0 );
pPar_->Put32( pVar, 0 );
}
p( static_cast<StarBASIC*>(GetParent()), *pPar_, bWrite );
return;
+9 -9
View File
@@ -279,7 +279,7 @@ void SbStdFont::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
void SbStdClipboard::MethClear( SbxArray const * pPar_ )
{
if( pPar_ && (pPar_->Count() > 1) )
if( pPar_ && (pPar_->Count32() > 1) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_NUMBER_OF_ARGS );
return;
@@ -289,13 +289,13 @@ void SbStdClipboard::MethClear( SbxArray const * pPar_ )
void SbStdClipboard::MethGetData( SbxArray* pPar_ )
{
if( !pPar_ || (pPar_->Count() != 2) )
if( !pPar_ || (pPar_->Count32() != 2) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_NUMBER_OF_ARGS );
return;
}
sal_Int16 nFormat = pPar_->Get(1)->GetInteger();
sal_Int16 nFormat = pPar_->Get32(1)->GetInteger();
if( nFormat <= 0 || nFormat > 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -306,13 +306,13 @@ void SbStdClipboard::MethGetData( SbxArray* pPar_ )
void SbStdClipboard::MethGetFormat( SbxVariable* pVar, SbxArray* pPar_ )
{
if( !pPar_ || (pPar_->Count() != 2) )
if( !pPar_ || (pPar_->Count32() != 2) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_NUMBER_OF_ARGS );
return;
}
sal_Int16 nFormat = pPar_->Get(1)->GetInteger();
sal_Int16 nFormat = pPar_->Get32(1)->GetInteger();
if( nFormat <= 0 || nFormat > 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -324,7 +324,7 @@ void SbStdClipboard::MethGetFormat( SbxVariable* pVar, SbxArray* pPar_ )
void SbStdClipboard::MethGetText( SbxVariable* pVar, SbxArray const * pPar_ )
{
if( pPar_ && (pPar_->Count() > 1) )
if( pPar_ && (pPar_->Count32() > 1) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_NUMBER_OF_ARGS );
return;
@@ -335,13 +335,13 @@ void SbStdClipboard::MethGetText( SbxVariable* pVar, SbxArray const * pPar_ )
void SbStdClipboard::MethSetData( SbxArray* pPar_ )
{
if( !pPar_ || (pPar_->Count() != 3) )
if( !pPar_ || (pPar_->Count32() != 3) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_NUMBER_OF_ARGS );
return;
}
sal_Int16 nFormat = pPar_->Get(2)->GetInteger();
sal_Int16 nFormat = pPar_->Get32(2)->GetInteger();
if( nFormat <= 0 || nFormat > 3 )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -352,7 +352,7 @@ void SbStdClipboard::MethSetData( SbxArray* pPar_ )
void SbStdClipboard::MethSetText( SbxArray const * pPar_ )
{
if( !pPar_ || (pPar_->Count() != 2) )
if( !pPar_ || (pPar_->Count32() != 2) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_NUMBER_OF_ARGS );
return;
+16 -141
View File
@@ -89,13 +89,6 @@ sal_uInt32 SbxArray::Count32() const
return mVarEntries.size();
}
sal_uInt16 SbxArray::Count() const
{
sal_uInt32 nCount = mVarEntries.size();
DBG_ASSERT( nCount <= SBX_MAXINDEX, "SBX: Array-Index > SBX_MAXINDEX" );
return static_cast<sal_uInt16>(nCount);
}
SbxVariableRef& SbxArray::GetRef32( sal_uInt32 nIdx )
{
// If necessary extend the array
@@ -112,22 +105,6 @@ SbxVariableRef& SbxArray::GetRef32( sal_uInt32 nIdx )
return mVarEntries[nIdx].mpVar;
}
SbxVariableRef& SbxArray::GetRef( sal_uInt16 nIdx )
{
// If necessary extend the array
DBG_ASSERT( nIdx <= SBX_MAXINDEX, "SBX: Array-Index > SBX_MAXINDEX" );
// Very Hot Fix
if( nIdx > SBX_MAXINDEX )
{
SetError( ERRCODE_BASIC_OUT_OF_RANGE );
nIdx = 0;
}
if ( mVarEntries.size() <= nIdx )
mVarEntries.resize(nIdx+1);
return mVarEntries[nIdx].mpVar;
}
SbxVariable* SbxArray::Get32( sal_uInt32 nIdx )
{
if( !CanRead() )
@@ -143,21 +120,6 @@ SbxVariable* SbxArray::Get32( sal_uInt32 nIdx )
return rRef.get();
}
SbxVariable* SbxArray::Get( sal_uInt16 nIdx )
{
if( !CanRead() )
{
SetError( ERRCODE_BASIC_PROP_WRITEONLY );
return nullptr;
}
SbxVariableRef& rRef = GetRef( nIdx );
if ( !rRef.is() )
rRef = new SbxVariable( eType );
return rRef.get();
}
void SbxArray::Put32( SbxVariable* pVar, sal_uInt32 nIdx )
{
if( !CanWrite() )
@@ -170,30 +132,10 @@ void SbxArray::Put32( SbxVariable* pVar, sal_uInt32 nIdx )
if( eType != SbxOBJECT || pVar->GetClass() != SbxClassType::Object )
pVar->Convert( eType );
SbxVariableRef& rRef = GetRef32( nIdx );
if( rRef.get() != pVar )
{
rRef = pVar;
SetFlag( SbxFlagBits::Modified );
}
}
}
void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx )
{
if( !CanWrite() )
SetError( ERRCODE_BASIC_PROP_READONLY );
else
{
if( pVar )
if( eType != SbxVARIANT )
// Convert no objects
if( eType != SbxOBJECT || pVar->GetClass() != SbxClassType::Object )
pVar->Convert( eType );
SbxVariableRef& rRef = GetRef( nIdx );
// tdf#122250. It is possible that I hold the last reference to myself, so check, otherwise I might
// call SetFlag on myself after I have died.
bool removingMyself = rRef.get() && rRef->GetParameters() == this && GetRefCount() == 1;
if(rRef.get() != pVar )
if( rRef.get() != pVar )
{
rRef = pVar;
if (!removingMyself)
@@ -202,14 +144,14 @@ void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx )
}
}
OUString SbxArray::GetAlias( sal_uInt16 nIdx )
OUString SbxArray::GetAlias32( sal_uInt32 nIdx )
{
if( !CanRead() )
{
SetError( ERRCODE_BASIC_PROP_WRITEONLY );
return OUString();
}
SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>(GetRef( nIdx ));
SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>(GetRef32( nIdx ));
if (!rRef.maAlias)
return OUString();
@@ -217,7 +159,7 @@ OUString SbxArray::GetAlias( sal_uInt16 nIdx )
return *rRef.maAlias;
}
void SbxArray::PutAlias( const OUString& rAlias, sal_uInt16 nIdx )
void SbxArray::PutAlias32( const OUString& rAlias, sal_uInt32 nIdx )
{
if( !CanWrite() )
{
@@ -225,7 +167,7 @@ void SbxArray::PutAlias( const OUString& rAlias, sal_uInt16 nIdx )
}
else
{
SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>( GetRef( nIdx ) );
SbxVarEntry& rRef = reinterpret_cast<SbxVarEntry&>( GetRef32( nIdx ) );
rRef.maAlias = rAlias;
}
}
@@ -259,16 +201,6 @@ void SbxArray::Insert32( SbxVariable* pVar, sal_uInt32 nIdx )
SetFlag( SbxFlagBits::Modified );
}
void SbxArray::Insert( SbxVariable* pVar, sal_uInt16 nIdx )
{
DBG_ASSERT( mVarEntries.size() <= 0x3FF0, "SBX: Array gets too big" );
if( mVarEntries.size() > 0x3FF0 )
{
return;
}
Insert32( pVar, nIdx );
}
void SbxArray::Remove( sal_uInt32 nIdx )
{
if( nIdx < mVarEntries.size() )
@@ -411,7 +343,7 @@ bool SbxArray::LoadData( SvStream& rStrm, sal_uInt16 /*nVer*/ )
SbxVariable* pVar = static_cast<SbxVariable*>(Load( rStrm ));
if( pVar )
{
SbxVariableRef& rRef = GetRef( nIdx );
SbxVariableRef& rRef = GetRef32( nIdx );
rRef = pVar;
}
else
@@ -501,17 +433,6 @@ void SbxDimArray::AddDimImpl32( sal_Int32 lb, sal_Int32 ub, bool bAllowSize0 )
SetError( eRes );
}
void SbxDimArray::AddDim( short lb, short ub )
{
AddDimImpl32( lb, ub, false );
}
void SbxDimArray::unoAddDim( short lb, short ub )
{
AddDimImpl32( lb, ub, true );
}
void SbxDimArray::AddDim32( sal_Int32 lb, sal_Int32 ub )
{
AddDimImpl32( lb, ub, false );
@@ -539,23 +460,6 @@ bool SbxDimArray::GetDim32( sal_Int32 n, sal_Int32& rlb, sal_Int32& rub ) const
return true;
}
bool SbxDimArray::GetDim( short n, short& rlb, short& rub ) const
{
sal_Int32 rlb32, rub32;
bool bRet = GetDim32( n, rlb32, rub32 );
rub = static_cast<short>(rub32);
rlb = static_cast<short>(rlb32);
if( bRet )
{
if( rlb32 < -SBX_MAXINDEX || rub32 > SBX_MAXINDEX )
{
SetError( ERRCODE_BASIC_OUT_OF_RANGE );
return false;
}
}
return bRet;
}
// Element-Ptr with the help of an index list
sal_uInt32 SbxDimArray::Offset32( const sal_Int32* pIdx )
@@ -578,37 +482,6 @@ sal_uInt32 SbxDimArray::Offset32( const sal_Int32* pIdx )
return nPos;
}
sal_uInt16 SbxDimArray::Offset( const short* pIdx )
{
long nPos = 0;
for (auto const& vDimension : m_vDimensions)
{
short nIdx = *pIdx++;
if( nIdx < vDimension.nLbound || nIdx > vDimension.nUbound )
{
nPos = SBX_MAXINDEX + 1;
break;
}
nPos = nPos * vDimension.nSize + nIdx - vDimension.nLbound;
}
if( m_vDimensions.empty() || nPos > SBX_MAXINDEX )
{
SetError( ERRCODE_BASIC_OUT_OF_RANGE );
nPos = 0;
}
return static_cast<sal_uInt16>(nPos);
}
SbxVariable* SbxDimArray::Get( const short* pIdx )
{
return SbxArray::Get( Offset( pIdx ) );
}
void SbxDimArray::Put( SbxVariable* p, const short* pIdx )
{
SbxArray::Put( p, Offset( pIdx ) );
}
SbxVariable* SbxDimArray::Get32( const sal_Int32* pIdx )
{
return SbxArray::Get32( Offset32( pIdx ) );
@@ -624,7 +497,7 @@ sal_uInt32 SbxDimArray::Offset32( SbxArray* pPar )
{
#if HAVE_FEATURE_SCRIPTING
if (m_vDimensions.empty() || !pPar ||
((m_vDimensions.size() != sal::static_int_cast<size_t>(pPar->Count() - 1))
((m_vDimensions.size() != sal::static_int_cast<size_t>(pPar->Count32() - 1))
&& SbiRuntime::isVBAEnabled()))
{
SetError( ERRCODE_BASIC_OUT_OF_RANGE );
@@ -632,10 +505,10 @@ sal_uInt32 SbxDimArray::Offset32( SbxArray* pPar )
}
#endif
sal_uInt32 nPos = 0;
sal_uInt16 nOff = 1; // Non element 0!
sal_uInt32 nOff = 1; // Non element 0!
for (auto const& vDimension : m_vDimensions)
{
sal_Int32 nIdx = pPar->Get( nOff++ )->GetLong();
sal_Int32 nIdx = pPar->Get32( nOff++ )->GetLong();
if( nIdx < vDimension.nLbound || nIdx > vDimension.nUbound )
{
nPos = sal_uInt32(SBX_MAXINDEX32)+1;
@@ -666,19 +539,21 @@ bool SbxDimArray::LoadData( SvStream& rStrm, sal_uInt16 nVer )
{
sal_Int16 lb(0), ub(0);
rStrm.ReadInt16( lb ).ReadInt16( ub );
AddDim( lb, ub );
AddDim32( lb, ub );
}
return SbxArray::LoadData( rStrm, nVer );
}
bool SbxDimArray::StoreData( SvStream& rStrm ) const
{
assert(m_vDimensions.size() <= sal::static_int_cast<size_t>(std::numeric_limits<sal_Int16>::max()));
rStrm.WriteInt16( m_vDimensions.size() );
for( short i = 0; i < static_cast<short>(m_vDimensions.size()); i++ )
for( sal_Int32 i = 1; i <= static_cast<sal_Int32>(m_vDimensions.size()); i++ )
{
short lb, ub;
GetDim( i, lb, ub );
rStrm.WriteInt16( lb ).WriteInt16( ub );
sal_Int32 lb32, ub32;
GetDim32(i, lb32, ub32);
assert(lb32 >= -SBX_MAXINDEX && ub32 <= SBX_MAXINDEX);
rStrm.WriteInt16(lb32).WriteInt16(ub32);
}
return SbxArray::StoreData( rStrm );
}
+12 -12
View File
@@ -120,7 +120,7 @@ void SbxCollection::Notify( SfxBroadcaster& rCst, const SfxHint& rHint )
else if( pVar->GetHashCode() == nCountHash
&& aVarName.equalsIgnoreAsciiCase( pCount ) )
{
pVar->PutLong( pObjs->Count() );
pVar->PutLong( sal::static_int_cast<sal_Int32>(pObjs->Count32()) );
}
else if( pVar->GetHashCode() == nAddHash
&& aVarName.equalsIgnoreAsciiCase( pAdd ) )
@@ -151,13 +151,13 @@ void SbxCollection::Notify( SfxBroadcaster& rCst, const SfxHint& rHint )
void SbxCollection::CollAdd( SbxArray* pPar_ )
{
if( pPar_->Count() != 2 )
if( pPar_->Count32() != 2 )
{
SetError( ERRCODE_BASIC_WRONG_ARGS );
}
else
{
SbxBase* pObj = pPar_->Get( 1 )->GetObject();
SbxBase* pObj = pPar_->Get32( 1 )->GetObject();
if( !pObj || dynamic_cast<const SbxObject*>(pObj) == nullptr )
{
SetError( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -173,14 +173,14 @@ void SbxCollection::CollAdd( SbxArray* pPar_ )
void SbxCollection::CollItem( SbxArray* pPar_ )
{
if( pPar_->Count() != 2 )
if( pPar_->Count32() != 2 )
{
SetError( ERRCODE_BASIC_WRONG_ARGS );
}
else
{
SbxVariable* pRes = nullptr;
SbxVariable* p = pPar_->Get( 1 );
SbxVariable* p = pPar_->Get32( 1 );
if( p->GetType() == SbxSTRING )
{
pRes = Find( p->GetOUString(), SbxClassType::Object );
@@ -188,16 +188,16 @@ void SbxCollection::CollItem( SbxArray* pPar_ )
else
{
short n = p->GetInteger();
if( n >= 1 && n <= static_cast<short>(pObjs->Count()) )
if( n >= 1 && n <= static_cast<sal_Int32>(pObjs->Count32()) )
{
pRes = pObjs->Get( static_cast<sal_uInt16>(n) - 1 );
pRes = pObjs->Get32( static_cast<sal_uInt32>(n) - 1 );
}
}
if( !pRes )
{
SetError( ERRCODE_BASIC_BAD_INDEX );
}
pPar_->Get( 0 )->PutObject( pRes );
pPar_->Get32( 0 )->PutObject( pRes );
}
}
@@ -205,15 +205,15 @@ void SbxCollection::CollItem( SbxArray* pPar_ )
void SbxCollection::CollRemove( SbxArray* pPar_ )
{
if( pPar_->Count() != 2 )
if( pPar_->Count32() != 2 )
SetError( ERRCODE_BASIC_WRONG_ARGS );
else
{
short n = pPar_->Get( 1 )->GetInteger();
if( n < 1 || n > static_cast<short>(pObjs->Count()) )
short n = pPar_->Get32( 1 )->GetInteger();
if( n < 1 || n > static_cast<sal_Int32>(pObjs->Count32()) )
SetError( ERRCODE_BASIC_BAD_INDEX );
else
Remove( pObjs->Get( static_cast<sal_uInt16>(n) - 1 ) );
Remove( pObjs->Get32( static_cast<sal_uInt32>(n) - 1 ) );
}
}
+2 -2
View File
@@ -293,7 +293,7 @@ static SbxVariableRef Element
{
p++;
auto refPar = tools::make_ref<SbxArray>();
sal_uInt16 nArg = 0;
sal_uInt32 nArg = 0;
// We are once relaxed and accept as well
// the line- or command end as delimiter
// Search parameter always global!
@@ -310,7 +310,7 @@ static SbxVariableRef Element
// One copies the parameter, so that
// one have the current status (triggers also
// the call per access)
refPar->Put( new SbxVariable( *refArg ), ++nArg );
refPar->Put32( new SbxVariable( *refArg ), ++nArg );
}
p = SkipWhitespace( p );
if( *p == ',' )
+24 -24
View File
@@ -84,9 +84,9 @@ SbxObject& SbxObject::operator=( const SbxObject& r )
static void CheckParentsOnDelete( SbxObject* pObj, SbxArray* p )
{
for( sal_uInt16 i = 0; i < p->Count(); i++ )
for( sal_uInt32 i = 0; i < p->Count32(); i++ )
{
SbxVariableRef& rRef = p->GetRef( i );
SbxVariableRef& rRef = p->GetRef32( i );
if( rRef->IsBroadcaster() )
{
pObj->EndListening( rRef->GetBroadcaster(), true );
@@ -301,7 +301,7 @@ void SbxObject::SetDfltProperty( const OUString& rName )
// the index will be set, otherwise the Count of the Array will be returned.
// In any case the correct Array will be returned.
SbxArray* SbxObject::FindVar( SbxVariable const * pVar, sal_uInt16& nArrayIdx )
SbxArray* SbxObject::FindVar( SbxVariable const * pVar, sal_uInt32& nArrayIdx )
{
SbxArray* pArray = nullptr;
if( pVar )
@@ -317,15 +317,15 @@ SbxArray* SbxObject::FindVar( SbxVariable const * pVar, sal_uInt16& nArrayIdx )
}
if( pArray )
{
nArrayIdx = pArray->Count();
nArrayIdx = pArray->Count32();
// Is the variable per name available?
pArray->ResetFlag( SbxFlagBits::ExtSearch );
SbxVariable* pOld = pArray->Find( pVar->GetName(), pVar->GetClass() );
if( pOld )
{
for( sal_uInt16 i = 0; i < pArray->Count(); i++ )
for( sal_uInt32 i = 0; i < pArray->Count32(); i++ )
{
SbxVariableRef& rRef = pArray->GetRef( i );
SbxVariableRef& rRef = pArray->GetRef32( i );
if( rRef.get() == pOld )
{
nArrayIdx = i; break;
@@ -381,7 +381,7 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp
break;
}
pVar->SetParent( this );
pArray->Put( pVar, pArray->Count() );
pArray->Put32( pVar, pArray->Count32() );
SetModified( true );
// The object listen always
StartListening(pVar->GetBroadcaster(), DuplicateHandling::Prevent);
@@ -390,22 +390,22 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp
void SbxObject::Insert( SbxVariable* pVar )
{
sal_uInt16 nIdx;
sal_uInt32 nIdx;
SbxArray* pArray = FindVar( pVar, nIdx );
if( pArray )
{
// Into with it. But you should pay attention at the Pointer!
if( nIdx < pArray->Count() )
if( nIdx < pArray->Count32() )
{
// Then this element exists already
// There are objects of the same name allowed at collections
if( pArray == pObjs.get() && dynamic_cast<const SbxCollection*>( this ) != nullptr )
{
nIdx = pArray->Count();
nIdx = pArray->Count32();
}
else
{
SbxVariable* pOld = pArray->Get( nIdx );
SbxVariable* pOld = pArray->Get32( nIdx );
// already inside: overwrite
if( pOld == pVar )
{
@@ -422,7 +422,7 @@ void SbxObject::Insert( SbxVariable* pVar )
}
}
StartListening(pVar->GetBroadcaster(), DuplicateHandling::Prevent);
pArray->Put( pVar, nIdx );
pArray->Put32( pVar, nIdx );
if( pVar->GetParent() != this )
{
pVar->SetParent( this );
@@ -466,7 +466,7 @@ void SbxObject::QuickInsert( SbxVariable* pVar )
if( pArray )
{
StartListening(pVar->GetBroadcaster(), DuplicateHandling::Prevent);
pArray->Put( pVar, pArray->Count() );
pArray->Put32( pVar, pArray->Count32() );
if( pVar->GetParent() != this )
{
pVar->SetParent( this );
@@ -498,9 +498,9 @@ void SbxObject::Remove( const OUString& rName, SbxClassType t )
void SbxObject::Remove( SbxVariable* pVar )
{
sal_uInt16 nIdx;
sal_uInt32 nIdx;
SbxArray* pArray = FindVar( pVar, nIdx );
if( pArray && nIdx < pArray->Count() )
if( pArray && nIdx < pArray->Count32() )
{
#ifdef DBG_UTIL
OUString aVarName( pVar->GetName() );
@@ -512,7 +512,7 @@ void SbxObject::Remove( SbxVariable* pVar )
"basic.sbx",
"remove " << aVarName << " in " << SbxVariable::GetName());
#endif
SbxVariableRef pVar_ = pArray->Get( nIdx );
SbxVariableRef pVar_ = pArray->Get32( nIdx );
if( pVar_->IsBroadcaster() )
{
EndListening( pVar_->GetBroadcaster(), true );
@@ -537,9 +537,9 @@ static bool LoadArray( SvStream& rStrm, SbxObject* pThis, SbxArray* pArray )
{
return false;
}
for( sal_uInt16 i = 0; i < p->Count(); i++ )
for( sal_uInt32 i = 0; i < p->Count32(); i++ )
{
SbxVariableRef& r = p->GetRef( i );
SbxVariableRef& r = p->GetRef32( i );
SbxVariable* pVar = r.get();
if( pVar )
{
@@ -727,9 +727,9 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
// Methods
rStrm.WriteOString( aIndentNameStr ).WriteCharPtr( "- Methods:" ) << endl;
for( sal_uInt16 i = 0; i < pMethods->Count(); i++ )
for( sal_uInt32 i = 0; i < pMethods->Count32(); i++ )
{
SbxVariableRef& r = pMethods->GetRef( i );
SbxVariableRef& r = pMethods->GetRef32( i );
SbxVariable* pVar = r.get();
if( pVar )
{
@@ -764,9 +764,9 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
// Properties
rStrm.WriteOString( aIndentNameStr ).WriteCharPtr( "- Properties:" ) << endl;
{
for( sal_uInt16 i = 0; i < pProps->Count(); i++ )
for( sal_uInt32 i = 0; i < pProps->Count32(); i++ )
{
SbxVariableRef& r = pProps->GetRef( i );
SbxVariableRef& r = pProps->GetRef32( i );
SbxVariable* pVar = r.get();
if( pVar )
{
@@ -802,9 +802,9 @@ void SbxObject::Dump( SvStream& rStrm, bool bFill )
// Objects
rStrm.WriteOString( aIndentNameStr ).WriteCharPtr( "- Objects:" ) << endl;
{
for( sal_uInt16 i = 0; i < pObjs->Count(); i++ )
for( sal_uInt32 i = 0; i < pObjs->Count32(); i++ )
{
SbxVariableRef& r = pObjs->GetRef( i );
SbxVariableRef& r = pObjs->GetRef32( i );
SbxVariable* pVar = r.get();
if ( pVar )
{
+5 -5
View File
@@ -282,7 +282,7 @@ SbxArray* StringToByteArray(const OUString& rStr)
}
else
{
pArray->unoAddDim( 0, -1 );
pArray->unoAddDim32( 0, -1 );
}
for( sal_Int32 i=0; i< nArraySize; i++)
@@ -291,7 +291,7 @@ SbxArray* StringToByteArray(const OUString& rStr)
sal_uInt8 aByte = static_cast< sal_uInt8 >( (i%2) ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
pNew->PutByte( aByte );
pNew->SetFlag( SbxFlagBits::Write );
pArray->Put( pNew, i );
pArray->Put32( pNew, i );
if( i%2 )
pSrc++;
}
@@ -301,12 +301,12 @@ SbxArray* StringToByteArray(const OUString& rStr)
// Convert an array of bytes to string (2bytes per character)
OUString ByteArrayToString(SbxArray* pArr)
{
sal_uInt16 nCount = pArr->Count();
sal_uInt32 nCount = pArr->Count32();
OUStringBuffer aStrBuf;
sal_Unicode aChar = 0;
for( sal_uInt16 i = 0 ; i < nCount ; i++ )
for( sal_uInt32 i = 0 ; i < nCount ; i++ )
{
sal_Unicode aTempChar = pArr->Get(i)->GetByte();
sal_Unicode aTempChar = pArr->Get32(i)->GetByte();
if( i%2 )
{
aChar = (aTempChar << 8 ) | aChar;
+1 -1
View File
@@ -246,7 +246,7 @@ SbxValue* SbxValue::TheRealValue( bool bObjInObjError ) const
if( pDimArray )
p = pDimArray->Get( pPar );
else
p = pArray->Get( pPar->Get( 1 )->GetInteger() );
p = pArray->Get32( pPar->Get32( 1 )->GetInteger() );
break;
}
}
+3 -3
View File
@@ -176,7 +176,7 @@ void SbxVariable::Broadcast( SfxHintId nHintId )
if( mpPar.is() )
{
// Register this as element 0, but don't change over the parent!
mpPar->GetRef( 0 ) = this;
mpPar->GetRef32( 0 ) = this;
}
pSave->Broadcast( SbxHint( nHintId, this ) );
mpBroadcaster = std::move(pSave);
@@ -396,9 +396,9 @@ void SbxVariable::SetParent( SbxObject* p )
SbxArray *pChildren = p->GetObjects();
if ( pChildren )
{
for ( sal_uInt16 nIdx = 0; !bFound && nIdx < pChildren->Count(); ++nIdx )
for ( sal_uInt32 nIdx = 0; !bFound && nIdx < pChildren->Count32(); ++nIdx )
{
bFound = ( this == pChildren->Get(nIdx) );
bFound = ( this == pChildren->Get32(nIdx) );
}
}
SAL_INFO_IF(
+7 -24
View File
@@ -113,25 +113,18 @@ public:
SbxArray( const SbxArray& ) = delete;
SbxArray& operator=( const SbxArray& );
virtual void Clear() override;
sal_uInt16 Count() const;
virtual SbxDataType GetType() const override;
SbxVariableRef& GetRef( sal_uInt16 );
SbxVariable* Get( sal_uInt16 );
void Put( SbxVariable*, sal_uInt16 );
void Insert( SbxVariable*, sal_uInt16 );
void Remove( SbxVariable const * );
void Merge( SbxArray* );
OUString GetAlias( sal_uInt16 );
void PutAlias( const OUString&, sal_uInt16 );
SbxVariable* Find( const OUString&, SbxClassType );
// Additional methods for 32-bit indices
sal_uInt32 Count32() const;
virtual SbxDataType GetType() const override;
SbxVariableRef& GetRef32( sal_uInt32 );
SbxVariable* Get32( sal_uInt32 );
void Put32( SbxVariable*, sal_uInt32 );
void Insert32( SbxVariable*, sal_uInt32 );
void Remove( sal_uInt32 );
void Remove( SbxVariable const * );
void Merge( SbxArray* );
OUString GetAlias32( sal_uInt32 );
void PutAlias32( const OUString&, sal_uInt32 );
SbxVariable* Find( const OUString&, SbxClassType );
};
// SbxDimArray is an array that can dimensioned using BASIC conventions.
@@ -146,7 +139,6 @@ class BASIC_DLLPUBLIC SbxDimArray final : public SbxArray
BASIC_DLLPRIVATE void AddDimImpl32( sal_Int32, sal_Int32, bool bAllowSize0 );
bool mbHasFixedSize;
sal_uInt16 Offset( const short* );
sal_uInt32 Offset32( const sal_Int32* );
sal_uInt32 Offset32( SbxArray* );
virtual bool LoadData( SvStream&, sal_uInt16 ) override;
@@ -158,23 +150,14 @@ public:
SbxDimArray( const SbxDimArray& ) = delete;
SbxDimArray& operator=( const SbxDimArray& );
virtual void Clear() override;
using SbxArray::GetRef;
using SbxArray::Get;
SbxVariable* Get( const short* );
using SbxArray::Put;
void Put( SbxVariable*, const short* );
SbxVariable* Get( SbxArray* );
short GetDims() const { return m_vDimensions.size();}
void AddDim( short, short );
void unoAddDim( short, short );
bool GetDim( short, short&, short& ) const;
using SbxArray::GetRef32;
using SbxArray::Get32;
SbxVariable* Get32( const sal_Int32* );
using SbxArray::Put32;
void Put32( SbxVariable*, const sal_Int32* );
sal_Int32 GetDims32() const { return m_vDimensions.size(); }
void AddDim32( sal_Int32, sal_Int32 );
void unoAddDim32( sal_Int32, sal_Int32 );
bool GetDim32( sal_Int32, sal_Int32&, sal_Int32& ) const;
+1 -1
View File
@@ -29,7 +29,7 @@ class SbxProperty;
class BASIC_DLLPUBLIC SbxObject : public SbxVariable, public SfxListener
{
BASIC_DLLPRIVATE SbxArray* FindVar( SbxVariable const *, sal_uInt16& );
BASIC_DLLPRIVATE SbxArray* FindVar( SbxVariable const *, sal_uInt32& );
protected:
SbxArrayRef pMethods; // Methods
SbxArrayRef pProps; // Properties
+3 -3
View File
@@ -324,13 +324,13 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
aValStr = pCell->GetString().getString();
}
if ( bIsValue )
refPar->Get(1)->PutDouble( nValue );
refPar->Get32(1)->PutDouble( nValue );
else
refPar->Get(1)->PutString( aValStr );
refPar->Get32(1)->PutString( aValStr );
// 2) Position of the cell
OUString aPosStr(rPos.Format(ScRefFlags::VALID | ScRefFlags::TAB_3D, pDocument, pDocument->GetAddressConvention()));
refPar->Get(2)->PutString( aPosStr );
refPar->Get32(2)->PutString( aPosStr );
// use link-update flag to prevent closing the document
// while the macro is running
+3 -3
View File
@@ -3263,9 +3263,9 @@ void ScInterpreter::ScMacro()
SbxArrayRef refPar = new SbxArray;
bool bOk = true;
for( short i = nParamCount; i && bOk ; i-- )
for( sal_uInt32 i = nParamCount; i && bOk ; i-- )
{
SbxVariable* pPar = refPar->Get( static_cast<sal_uInt16>(i) );
SbxVariable* pPar = refPar->Get32(i);
switch( GetStackType() )
{
case svDouble:
@@ -3442,7 +3442,7 @@ void ScInterpreter::ScMacro()
{
SbxBase* pElemObj = refRes->GetObject();
SbxDimArray* pDimArray = dynamic_cast<SbxDimArray*>(pElemObj);
short nDim = pDimArray ? pDimArray->GetDims() : 0;
sal_Int32 nDim = pDimArray ? pDimArray->GetDims32() : 0;
if ( 1 <= nDim && nDim <= 2 )
{
sal_Int32 nCs, nCe, nRs, nRe;
+1 -1
View File
@@ -519,7 +519,7 @@ ScVbaApplication::wait( double time )
SbxArrayRef aArgs = new SbxArray;
SbxVariableRef aRef = new SbxVariable;
aRef->PutDouble( time );
aArgs->Put( aRef.get(), 1 );
aArgs->Put32( aRef.get(), 1 );
SbMethod* pMeth = static_cast<SbMethod*>(pBasic->GetRtl()->Find( "WaitUntil", SbxClassType::Method ));
if ( pMeth )
+6 -6
View File
@@ -81,11 +81,11 @@ namespace basprov
SbxArray* pMethods = m_pModule->GetMethods().get();
if ( pMethods )
{
sal_Int32 nCount = pMethods->Count();
sal_uInt32 nCount = pMethods->Count32();
sal_Int32 nRealCount = 0;
for ( sal_Int32 i = 0; i < nCount; ++i )
for ( sal_uInt32 i = 0; i < nCount; ++i )
{
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< sal_uInt16 >( i ) ) );
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get32( i ) );
if ( pMethod && !pMethod->IsHidden() )
++nRealCount;
}
@@ -93,9 +93,9 @@ namespace basprov
Reference< browse::XBrowseNode >* pChildNodes = aChildNodes.getArray();
sal_Int32 iTarget = 0;
for ( sal_Int32 i = 0; i < nCount; ++i )
for ( sal_uInt32 i = 0; i < nCount; ++i )
{
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get( static_cast< sal_uInt16 >( i ) ) );
SbMethod* pMethod = static_cast< SbMethod* >( pMethods->Get32( i ) );
if ( pMethod && !pMethod->IsHidden() )
pChildNodes[iTarget++] = new BasicMethodNodeImpl(
m_xContext, m_sScriptingContext, pMethod, m_bIsAppScript);
@@ -115,7 +115,7 @@ namespace basprov
if ( m_pModule )
{
SbxArray* pMethods = m_pModule->GetMethods().get();
if ( pMethods && pMethods->Count() > 0 )
if ( pMethods && pMethods->Count32() > 0 )
bReturn = true;
}
+5 -4
View File
@@ -205,7 +205,7 @@ namespace basprov
{
SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( xSbxVar.get(), pParams[i] );
xSbxParams->Put( xSbxVar.get(), static_cast< sal_uInt16 >( i ) + 1 );
xSbxParams->Put32( xSbxVar.get(), static_cast< sal_uInt32 >( i ) + 1 );
// Enable passing by ref
if ( xSbxVar->GetType() != SbxVARIANT )
@@ -248,12 +248,13 @@ namespace basprov
if ( pInfo_ )
{
OutParamMap aOutParamMap;
for ( sal_uInt16 n = 1, nCount = xSbxParams->Count(); n < nCount; ++n )
for ( sal_uInt32 n = 1, nCount = xSbxParams->Count32(); n < nCount; ++n )
{
const SbxParamInfo* pParamInfo = pInfo_->GetParam( n );
assert(nCount <= std::numeric_limits<sal_uInt16>::max());
const SbxParamInfo* pParamInfo = pInfo_->GetParam( sal::static_int_cast<sal_uInt16>(n) );
if ( pParamInfo && ( pParamInfo->eType & SbxBYREF ) != 0 )
{
SbxVariable* pVar = xSbxParams->Get( n );
SbxVariable* pVar = xSbxParams->Get32( n );
if ( pVar )
{
SbxVariableRef xVar = pVar;
+3 -3
View File
@@ -40,15 +40,15 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs )
{
Sequence<Any> *pRet = nullptr;
sal_uInt16 nCount = rArgs.Count();
sal_uInt32 nCount = rArgs.Count32();
if( nCount > 1 )
{
nCount--;
pRet = new Sequence<Any>( nCount );
Any *pUnoArgs = pRet->getArray();
for( sal_uInt16 i=0; i<nCount; i++ )
for( sal_uInt32 i=0; i<nCount; i++ )
{
SbxVariable *pVar = rArgs.Get( i+1 );
SbxVariable *pVar = rArgs.Get32( i+1 );
switch( pVar->GetType() )
{
case SbxSTRING:
+13 -13
View File
@@ -1523,14 +1523,14 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
SbxArrayRef xArgs = new SbxArray;
SbxVariableRef xVar = new SbxVariable;
xVar->PutString( pFlyFormat->GetName() );
xArgs->Put( xVar.get(), 1 );
xArgs->Put32( xVar.get(), 1 );
xVar = new SbxVariable;
if( SvMacroItemId::SwFrmKeyInputAlpha == nEvent )
xVar->PutChar( aCh );
else
xVar->PutUShort( rKeyCode.GetModifier() | rKeyCode.GetCode() );
xArgs->Put( xVar.get(), 2 );
xArgs->Put32( xVar.get(), 2 );
OUString sRet;
rSh.ExecMacro( *pMacro, &sRet, xArgs.get() );
@@ -4036,25 +4036,25 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
m_aRszMvHdlPt != aDocPt )
{
m_aRszMvHdlPt = aDocPt;
sal_uInt16 nPos = 0;
sal_uInt32 nPos = 0;
SbxArrayRef xArgs = new SbxArray;
SbxVariableRef xVar = new SbxVariable;
xVar->PutString( pFlyFormat->GetName() );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
if( SvMacroItemId::SwFrmResize == nEvent )
{
xVar = new SbxVariable;
xVar->PutUShort( static_cast< sal_uInt16 >(g_eSdrMoveHdl) );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
}
xVar = new SbxVariable;
xVar->PutLong( aDocPt.X() - aSttPt.X() );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
xVar = new SbxVariable;
xVar->PutLong( aDocPt.Y() - aSttPt.Y() );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
OUString sRet;
@@ -4495,29 +4495,29 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
{
const Point aSttPt( PixelToLogic( m_aStartPos ) );
m_aRszMvHdlPt = aDocPt;
sal_uInt16 nPos = 0;
sal_uInt32 nPos = 0;
SbxArrayRef xArgs = new SbxArray;
SbxVariableRef xVar = new SbxVariable;
xVar->PutString( pFlyFormat->GetName() );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
if( SvMacroItemId::SwFrmResize == nEvent )
{
xVar = new SbxVariable;
xVar->PutUShort( static_cast< sal_uInt16 >(eOldSdrMoveHdl) );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
}
xVar = new SbxVariable;
xVar->PutLong( aDocPt.X() - aSttPt.X() );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
xVar = new SbxVariable;
xVar->PutLong( aDocPt.Y() - aSttPt.Y() );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
xVar = new SbxVariable;
xVar->PutUShort( 1 );
xArgs->Put( xVar.get(), ++nPos );
xArgs->Put32( xVar.get(), ++nPos );
ReleaseMouse();