diff options
42 files changed, 1332 insertions, 1467 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 5cb16f8f1f58..5ac30b14432b 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -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 ); } diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index a5baaed5f100..c29f3e179636 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -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; diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index 9160637a015a..9a9656d0d160 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -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)" ); diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx index acebc2328867..0f7d8d525d01 100644 --- a/basctl/source/basicide/basobj3.cxx +++ b/basctl/source/basicide/basobj3.cxx @@ -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 { diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 97a45c59c03c..98c6e2fffed6 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -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; diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx index 3a22c84e9007..f309cc13f00a 100644 --- a/basic/qa/cppunit/basictest.cxx +++ b/basic/qa/cppunit/basictest.cxx @@ -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() ); } diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 8adc59a9e874..764e5d70150e 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -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 ) ) { diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 35582a0c25be..2a4127159b71 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -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 ); } diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 90cdaa7b7ed9..fc2cbf0b154c 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -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 diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index fbceb81ad7b1..1ec508567197 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -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 ); diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index dac4197c18f6..310bc293dfdb 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -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()) ) { diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index c8d9b7ec16fb..4b84fffe5ba8 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -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; diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index ee0123710e3c..c1e34eb8b7b1 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -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 ); } diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index f36ab61f7cf1..58e0e59c3b3e 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -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() ) { diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 6e6c3e024d67..0689e421e533 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -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() ); } diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index b0cc2840a5d6..bc8db7e3442a 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -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(); } diff --git a/basic/source/runtime/dllmgr-none.cxx b/basic/source/runtime/dllmgr-none.cxx index 5b4c24003b3b..7ca7e5131e3e 100644 --- a/basic/source/runtime/dllmgr-none.cxx +++ b/basic/source/runtime/dllmgr-none.cxx @@ -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()) diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx index d36e7238e20f..00f3984f7216 100644 --- a/basic/source/runtime/dllmgr-x64.cxx +++ b/basic/source/runtime/dllmgr-x64.cxx @@ -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) diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx index 74b470da2e04..a6a9e9609674 100644 --- a/basic/source/runtime/dllmgr-x86.cxx +++ b/basic/source/runtime/dllmgr-x86.cxx @@ -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) diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx index 296063d9534e..1d27b25abf46 100644 --- a/basic/source/runtime/inputbox.cxx +++ b/basic/source/runtime/inputbox.cxx @@ -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()); } } diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 4860ec34376d..93a8e877497c 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -169,7 +169,7 @@ static uno::Reference< ucb::XSimpleFileAccess3 > const & getFileAccess() void SbRtl_CreateObject(StarBASIC * pBasic, SbxArray & rPar, bool) { - OUString aClass( rPar.Get( 1 )->GetOUString() ); + OUString aClass( rPar.Get32(1)->GetOUString() ); SbxObjectRef p = SbxBase::CreateObject( aClass ); if( !p.is() ) StarBASIC::Error( ERRCODE_BASIC_CANNOT_LOAD ); @@ -177,7 +177,7 @@ void SbRtl_CreateObject(StarBASIC * pBasic, SbxArray & rPar, bool) { // Convenience: enter BASIC as parent p->SetParent( pBasic ); - rPar.Get( 0 )->PutObject( p.get() ); + rPar.Get32(0)->PutObject( p.get() ); } } @@ -192,14 +192,14 @@ void SbRtl_Error(StarBASIC * pBasic, SbxArray & rPar, bool) OUString aErrorMsg; ErrCode nErr = ERRCODE_NONE; sal_Int32 nCode = 0; - if( rPar.Count() == 1 ) + if( rPar.Count32() == 1 ) { nErr = StarBASIC::GetErrBasic(); aErrorMsg = StarBASIC::GetErrorMsg(); } else { - nCode = rPar.Get( 1 )->GetLong(); + nCode = rPar.Get32(1)->GetLong(); if( nCode > 65535 ) { StarBASIC::Error( ERRCODE_BASIC_CONVERSION ); @@ -224,7 +224,7 @@ void SbRtl_Error(StarBASIC * pBasic, SbxArray & rPar, bool) // If this rtlfunc 'Error' passed an errcode the same as the active Err Objects's // current err then return the description for the error message if it is set // ( complicated isn't it ? ) - if ( bVBA && rPar.Count() > 1 ) + if ( bVBA && rPar.Count32() > 1 ) { uno::Reference< ooo::vba::XErrObject > xErrObj( SbxErrObject::getUnoErrObject() ); if ( xErrObj.is() && xErrObj->getNumber() == nCode && !xErrObj->getDescription().isEmpty() ) @@ -232,7 +232,7 @@ void SbRtl_Error(StarBASIC * pBasic, SbxArray & rPar, bool) tmpErrMsg = xErrObj->getDescription(); } } - rPar.Get( 0 )->PutString( tmpErrMsg ); + rPar.Get32(0)->PutString( tmpErrMsg ); } } @@ -240,86 +240,86 @@ void SbRtl_Error(StarBASIC * pBasic, SbxArray & rPar, bool) void SbRtl_Sin(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else { - SbxVariableRef pArg = rPar.Get( 1 ); - rPar.Get( 0 )->PutDouble( sin( pArg->GetDouble() ) ); + SbxVariableRef pArg = rPar.Get32(1); + rPar.Get32(0)->PutDouble( sin( pArg->GetDouble() ) ); } } void SbRtl_Cos(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else { - SbxVariableRef pArg = rPar.Get( 1 ); - rPar.Get( 0 )->PutDouble( cos( pArg->GetDouble() ) ); + SbxVariableRef pArg = rPar.Get32(1); + rPar.Get32(0)->PutDouble( cos( pArg->GetDouble() ) ); } } void SbRtl_Atn(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else { - SbxVariableRef pArg = rPar.Get( 1 ); - rPar.Get( 0 )->PutDouble( atan( pArg->GetDouble() ) ); + SbxVariableRef pArg = rPar.Get32(1); + rPar.Get32(0)->PutDouble( atan( pArg->GetDouble() ) ); } } void SbRtl_Abs(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariableRef pArg = rPar.Get( 1 ); - rPar.Get( 0 )->PutDouble( fabs( pArg->GetDouble() ) ); + SbxVariableRef pArg = rPar.Get32(1); + rPar.Get32(0)->PutDouble( fabs( pArg->GetDouble() ) ); } } void SbRtl_Asc(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); OUString aStr( pArg->GetOUString() ); if ( aStr.isEmpty()) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - rPar.Get(0)->PutEmpty(); + rPar.Get32(0)->PutEmpty(); } else { sal_Unicode aCh = aStr[0]; - rPar.Get(0)->PutLong( aCh ); + rPar.Get32(0)->PutLong( aCh ); } } } static void implChr( SbxArray& rPar, bool bChrW ) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); OUString aStr; if( !bChrW && SbiRuntime::isVBAEnabled() ) @@ -332,7 +332,7 @@ static void implChr( SbxArray& rPar, bool bChrW ) sal_Unicode aCh = static_cast<sal_Unicode>(pArg->GetUShort()); aStr = OUString(aCh); } - rPar.Get(0)->PutString( aStr ); + rPar.Get32(0)->PutString( aStr ); } } @@ -377,9 +377,9 @@ void SbRtl_CurDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) #if defined(_WIN32) int nCurDir = 0; // Current dir // JSM - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - OUString aDrive = rPar.Get(1)->GetOUString(); + OUString aDrive = rPar.Get32(1)->GetOUString(); if ( aDrive.getLength() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -402,7 +402,7 @@ void SbRtl_CurDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) _set_thread_local_invalid_parameter_handler(handler); if ( ok ) { - rPar.Get(0)->PutString( o3tl::toU(pBuffer) ); + rPar.Get32(0)->PutString( o3tl::toU(pBuffer) ); } else { @@ -425,7 +425,7 @@ void SbRtl_CurDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) } if( getcwd( pMem.get(), nSize-1 ) != nullptr ) { - rPar.Get(0)->PutString( OUString::createFromAscii(pMem.get()) ); + rPar.Get32(0)->PutString( OUString::createFromAscii(pMem.get()) ); return; } if( errno != ERANGE ) @@ -441,13 +441,13 @@ void SbRtl_CurDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) void SbRtl_ChDir(StarBASIC * pBasic, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if (rPar.Count() == 2) + rPar.Get32(0)->PutEmpty(); + if (rPar.Count32() == 2) { // VBA: track current directory per document type (separately for Writer, Calc, Impress, etc.) if( SbiRuntime::isVBAEnabled() ) { - ::basic::vba::registerCurrentDirectory( getDocumentModel( pBasic ), rPar.Get(1)->GetOUString() ); + ::basic::vba::registerCurrentDirectory( getDocumentModel( pBasic ), rPar.Get32(1)->GetOUString() ); } } else @@ -458,8 +458,8 @@ void SbRtl_ChDir(StarBASIC * pBasic, SbxArray & rPar, bool) void SbRtl_ChDrive(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if (rPar.Count() != 2) + rPar.Get32(0)->PutEmpty(); + if (rPar.Count32() != 2) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -510,11 +510,11 @@ void implStepRenameOSL( const OUString& aSource, const OUString& aDest ) void SbRtl_FileCopy(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if (rPar.Count() == 3) + rPar.Get32(0)->PutEmpty(); + if (rPar.Count32() == 3) { - OUString aSource = rPar.Get(1)->GetOUString(); - OUString aDest = rPar.Get(2)->GetOUString(); + OUString aSource = rPar.Get32(1)->GetOUString(); + OUString aDest = rPar.Get32(2)->GetOUString(); if( hasUno() ) { const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess(); @@ -545,10 +545,10 @@ void SbRtl_FileCopy(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Kill(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if (rPar.Count() == 2) + rPar.Get32(0)->PutEmpty(); + if (rPar.Count32() == 2) { - OUString aFileSpec = rPar.Get(1)->GetOUString(); + OUString aFileSpec = rPar.Get32(1)->GetOUString(); if( hasUno() ) { @@ -584,10 +584,10 @@ void SbRtl_Kill(StarBASIC *, SbxArray & rPar, bool) void SbRtl_MkDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) { - rPar.Get(0)->PutEmpty(); - if (rPar.Count() == 2) + rPar.Get32(0)->PutEmpty(); + if (rPar.Count32() == 2) { - OUString aPath = rPar.Get(1)->GetOUString(); + OUString aPath = rPar.Get32(1)->GetOUString(); if ( SbiRuntime::isVBAEnabled() ) { // In vba if the full path is not specified then @@ -598,12 +598,12 @@ void SbRtl_MkDir(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) SbxArrayRef pPar = new SbxArray(); SbxVariableRef pResult = new SbxVariable(); SbxVariableRef pParam = new SbxVariable(); - pPar->Insert( pResult.get(), pPar->Count() ); - pPar->Insert( pParam.get(), pPar->Count() ); + pPar->Insert32( pResult.get(), pPar->Count32() ); + pPar->Insert32( pParam.get(), pPar->Count32() ); SbRtl_CurDir( pBasic, *pPar, bWrite ); OUString sCurPathURL; - File::getFileURLFromSystemPath( pPar->Get(0)->GetOUString(), sCurPathURL ); + File::getFileURLFromSystemPath( pPar->Get32(0)->GetOUString(), sCurPathURL ); aURLObj.SetURL( sCurPathURL ); aURLObj.Append( aPath ); @@ -703,10 +703,10 @@ static void implRemoveDirRecursive( const OUString& aDirPath ) void SbRtl_RmDir(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if (rPar.Count() == 2) + rPar.Get32(0)->PutEmpty(); + if (rPar.Count32() == 2) { - OUString aPath = rPar.Get(1)->GetOUString(); + OUString aPath = rPar.Get32(1)->GetOUString(); if( hasUno() ) { const uno::Reference< ucb::XSimpleFileAccess3 >& xSFI = getFileAccess(); @@ -752,32 +752,32 @@ void SbRtl_RmDir(StarBASIC *, SbxArray & rPar, bool) void SbRtl_SendKeys(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); + rPar.Get32(0)->PutEmpty(); StarBASIC::Error(ERRCODE_BASIC_NOT_IMPLEMENTED); } void SbRtl_Exp(StarBASIC *, SbxArray & rPar, bool) { - if( rPar.Count() < 2 ) + if( rPar.Count32() < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else { - double aDouble = rPar.Get( 1 )->GetDouble(); + double aDouble = rPar.Get32(1)->GetDouble(); aDouble = exp( aDouble ); checkArithmeticOverflow( aDouble ); - rPar.Get( 0 )->PutDouble( aDouble ); + rPar.Get32(0)->PutDouble( aDouble ); } } void SbRtl_FileLen(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); OUString aStr( pArg->GetOUString() ); sal_Int32 nLen = 0; if( hasUno() ) @@ -803,27 +803,27 @@ void SbRtl_FileLen(StarBASIC *, SbxArray & rPar, bool) (void)aItem.getFileStatus( aFileStatus ); nLen = static_cast<sal_Int32>(aFileStatus.getFileSize()); } - rPar.Get(0)->PutLong( static_cast<long>(nLen) ); + rPar.Get32(0)->PutLong( static_cast<long>(nLen) ); } } void SbRtl_Hex(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); // converting value to unsigned and limit to 2 or 4 byte representation sal_uInt32 nVal = pArg->IsInteger() ? static_cast<sal_uInt16>(pArg->GetInteger()) : static_cast<sal_uInt32>(pArg->GetLong()); OUString aStr(OUString::number( nVal, 16 )); aStr = aStr.toAsciiUpperCase(); - rPar.Get(0)->PutString( aStr ); + rPar.Get32(0)->PutString( aStr ); } } @@ -832,11 +832,11 @@ void SbRtl_FuncCaller(StarBASIC *, SbxArray & rPar, bool) if ( SbiRuntime::isVBAEnabled() && GetSbData()->pInst && GetSbData()->pInst->pRun ) { if ( GetSbData()->pInst->pRun->GetExternalCaller() ) - *rPar.Get(0) = *GetSbData()->pInst->pRun->GetExternalCaller(); + *rPar.Get32(0) = *GetSbData()->pInst->pRun->GetExternalCaller(); else { SbxVariableRef pVar = new SbxVariable(SbxVARIANT); - *rPar.Get(0) = *pVar; + *rPar.Get32(0) = *pVar; } } else @@ -849,7 +849,7 @@ void SbRtl_FuncCaller(StarBASIC *, SbxArray & rPar, bool) void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool) { - std::size_t nArgCount = rPar.Count()-1; + const sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else @@ -859,7 +859,7 @@ void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool) if ( nArgCount >= 3 ) { - nStartPos = rPar.Get(1)->GetLong(); + nStartPos = rPar.Get32(1)->GetLong(); if( nStartPos <= 0 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -882,10 +882,10 @@ void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool) } if ( nArgCount == 4 ) { - bTextMode = rPar.Get(4)->GetInteger(); + bTextMode = rPar.Get32(4)->GetInteger(); } sal_Int32 nPos; - const OUString& rToken = rPar.Get(nFirstStringPos+1)->GetOUString(); + const OUString& rToken = rPar.Get32(nFirstStringPos+1)->GetOUString(); // #97545 Always find empty string if( rToken.isEmpty() ) @@ -896,12 +896,12 @@ void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool) { if( !bTextMode ) { - const OUString& rStr1 = rPar.Get(nFirstStringPos)->GetOUString(); + const OUString& rStr1 = rPar.Get32(nFirstStringPos)->GetOUString(); nPos = rStr1.indexOf( rToken, nStartPos - 1 ) + 1; } else { - OUString aStr1 = rPar.Get(nFirstStringPos)->GetOUString(); + OUString aStr1 = rPar.Get32(nFirstStringPos)->GetOUString(); OUString aToken = rToken; aStr1 = aStr1.toAsciiUpperCase(); @@ -910,7 +910,7 @@ void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool) nPos = aStr1.indexOf( aToken, nStartPos-1 ) + 1; } } - rPar.Get(0)->PutLong( nPos ); + rPar.Get32(0)->PutLong( nPos ); } } @@ -919,20 +919,20 @@ void SbRtl_InStr(StarBASIC *, SbxArray & rPar, bool) void SbRtl_InStrRev(StarBASIC *, SbxArray & rPar, bool) { - std::size_t nArgCount = rPar.Count()-1; + const sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - OUString aStr1 = rPar.Get(1)->GetOUString(); - OUString aToken = rPar.Get(2)->GetOUString(); + OUString aStr1 = rPar.Get32(1)->GetOUString(); + OUString aToken = rPar.Get32(2)->GetOUString(); sal_Int32 nStartPos = -1; if ( nArgCount >= 3 ) { - nStartPos = rPar.Get(3)->GetLong(); + nStartPos = rPar.Get32(3)->GetLong(); if( nStartPos <= 0 && nStartPos != -1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -954,7 +954,7 @@ void SbRtl_InStrRev(StarBASIC *, SbxArray & rPar, bool) } if ( nArgCount == 4 ) { - bTextMode = rPar.Get(4)->GetInteger(); + bTextMode = rPar.Get32(4)->GetInteger(); } sal_Int32 nStrLen = aStr1.getLength(); if( nStartPos == -1 ) @@ -986,7 +986,7 @@ void SbRtl_InStrRev(StarBASIC *, SbxArray & rPar, bool) } } } - rPar.Get(0)->PutLong( nPos ); + rPar.Get32(0)->PutLong( nPos ); } } @@ -1000,64 +1000,64 @@ void SbRtl_InStrRev(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Int(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else { - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); double aDouble= pArg->GetDouble(); /* floor( 2.8 ) = 2.0 floor( -2.8 ) = -3.0 */ aDouble = floor( aDouble ); - rPar.Get(0)->PutDouble( aDouble ); + rPar.Get32(0)->PutDouble( aDouble ); } } void SbRtl_Fix(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else { - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); double aDouble = pArg->GetDouble(); if ( aDouble >= 0.0 ) aDouble = floor( aDouble ); else aDouble = ceil( aDouble ); - rPar.Get(0)->PutDouble( aDouble ); + rPar.Get32(0)->PutDouble( aDouble ); } } void SbRtl_LCase(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { const CharClass& rCharClass = GetCharClass(); - OUString aStr( rPar.Get(1)->GetOUString() ); + OUString aStr( rPar.Get32(1)->GetOUString() ); aStr = rCharClass.lowercase(aStr); - rPar.Get(0)->PutString( aStr ); + rPar.Get32(0)->PutString( aStr ); } } void SbRtl_Left(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 3 ) + if ( rPar.Count32() < 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - OUString aStr( rPar.Get(1)->GetOUString() ); - sal_Int32 nResultLen = rPar.Get(2)->GetLong(); + OUString aStr( rPar.Get32(1)->GetOUString() ); + sal_Int32 nResultLen = rPar.Get32(2)->GetLong(); if( nResultLen < 0 ) { nResultLen = 0; @@ -1068,24 +1068,24 @@ void SbRtl_Left(StarBASIC *, SbxArray & rPar, bool) nResultLen = aStr.getLength(); } aStr = aStr.copy(0, nResultLen ); - rPar.Get(0)->PutString( aStr ); + rPar.Get32(0)->PutString( aStr ); } } void SbRtl_Log(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - double aArg = rPar.Get(1)->GetDouble(); + double aArg = rPar.Get32(1)->GetDouble(); if ( aArg > 0 ) { double d = log( aArg ); checkArithmeticOverflow( d ); - rPar.Get( 0 )->PutDouble( d ); + rPar.Get32(0)->PutDouble( d ); } else { @@ -1096,14 +1096,14 @@ void SbRtl_Log(StarBASIC *, SbxArray & rPar, bool) void SbRtl_LTrim(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - OUString aStr(comphelper::string::stripStart(rPar.Get(1)->GetOUString(), ' ')); - rPar.Get(0)->PutString(aStr); + OUString aStr(comphelper::string::stripStart(rPar.Get32(1)->GetOUString(), ' ')); + rPar.Get32(0)->PutString(aStr); } } @@ -1112,7 +1112,7 @@ void SbRtl_LTrim(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Mid(StarBASIC *, SbxArray & rPar, bool bWrite) { - int nArgCount = rPar.Count()-1; + int nArgCount = rPar.Count32()-1; if ( nArgCount < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1127,8 +1127,8 @@ void SbRtl_Mid(StarBASIC *, SbxArray & rPar, bool bWrite) { bWrite = true; } - OUString aArgStr = rPar.Get(1)->GetOUString(); - sal_Int32 nStartPos = rPar.Get(2)->GetLong(); + OUString aArgStr = rPar.Get32(1)->GetOUString(); + sal_Int32 nStartPos = rPar.Get32(2)->GetLong(); if ( nStartPos < 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1140,7 +1140,7 @@ void SbRtl_Mid(StarBASIC *, SbxArray & rPar, bool bWrite) bool bWriteNoLenParam = false; if ( nArgCount == 3 || bWrite ) { - sal_Int32 n = rPar.Get(3)->GetLong(); + sal_Int32 n = rPar.Get32(3)->GetLong(); if( bWrite && n == -1 ) { bWriteNoLenParam = true; @@ -1162,7 +1162,7 @@ void SbRtl_Mid(StarBASIC *, SbxArray & rPar, bool bWrite) nStartPos = nArgLen; } - OUString aReplaceStr = rPar.Get(4)->GetOUString(); + OUString aReplaceStr = rPar.Get32(4)->GetOUString(); sal_Int32 nReplaceStrLen = aReplaceStr.getLength(); sal_Int32 nReplaceLen; if( bWriteNoLenParam ) @@ -1184,7 +1184,7 @@ void SbRtl_Mid(StarBASIC *, SbxArray & rPar, bool bWrite) aResultStr.insert( nStartPos, aReplaceStr.getStr(), std::min(nReplaceLen, nReplaceStrLen)); - rPar.Get(1)->PutString( aResultStr.makeStringAndClear() ); + rPar.Get32(1)->PutString( aResultStr.makeStringAndClear() ); } else { @@ -1208,7 +1208,7 @@ void SbRtl_Mid(StarBASIC *, SbxArray & rPar, bool bWrite) if (nLen > 0) aResultStr = aArgStr.copy( nStartPos, nLen ); } - rPar.Get(0)->PutString( aResultStr ); + rPar.Get32(0)->PutString( aResultStr ); } } } @@ -1216,14 +1216,14 @@ void SbRtl_Mid(StarBASIC *, SbxArray & rPar, bool bWrite) void SbRtl_Oct(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { char aBuffer[16]; - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); if ( pArg->IsInteger() ) { snprintf( aBuffer, sizeof(aBuffer), "%o", pArg->GetInteger() ); @@ -1232,7 +1232,7 @@ void SbRtl_Oct(StarBASIC *, SbxArray & rPar, bool) { snprintf( aBuffer, sizeof(aBuffer), "%lo", static_cast<long unsigned int>(pArg->GetLong()) ); } - rPar.Get(0)->PutString( OUString::createFromAscii( aBuffer ) ); + rPar.Get32(0)->PutString( OUString::createFromAscii( aBuffer ) ); } } @@ -1240,23 +1240,23 @@ void SbRtl_Oct(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Replace(StarBASIC *, SbxArray & rPar, bool) { - std::size_t nArgCount = rPar.Count()-1; + const sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 || nArgCount > 6 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - OUString aExpStr = rPar.Get(1)->GetOUString(); - OUString aFindStr = rPar.Get(2)->GetOUString(); - OUString aReplaceStr = rPar.Get(3)->GetOUString(); + OUString aExpStr = rPar.Get32(1)->GetOUString(); + OUString aFindStr = rPar.Get32(2)->GetOUString(); + OUString aReplaceStr = rPar.Get32(3)->GetOUString(); sal_Int32 lStartPos = 1; if ( nArgCount >= 4 ) { - if( rPar.Get(4)->GetType() != SbxEMPTY ) + if( rPar.Get32(4)->GetType() != SbxEMPTY ) { - lStartPos = rPar.Get(4)->GetLong(); + lStartPos = rPar.Get32(4)->GetLong(); } if( lStartPos < 1) { @@ -1268,9 +1268,9 @@ void SbRtl_Replace(StarBASIC *, SbxArray & rPar, bool) sal_Int32 lCount = -1; if( nArgCount >=5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) + if( rPar.Get32(5)->GetType() != SbxEMPTY ) { - lCount = rPar.Get(5)->GetLong(); + lCount = rPar.Get32(5)->GetLong(); } if( lCount < -1) { @@ -1293,7 +1293,7 @@ void SbRtl_Replace(StarBASIC *, SbxArray & rPar, bool) } if ( nArgCount == 6 ) { - bTextMode = rPar.Get(6)->GetInteger(); + bTextMode = rPar.Get32(6)->GetInteger(); } sal_Int32 nExpStrLen = aExpStr.getLength(); sal_Int32 nFindStrLen = aFindStr.getLength(); @@ -1324,20 +1324,20 @@ void SbRtl_Replace(StarBASIC *, SbxArray & rPar, bool) } } } - rPar.Get(0)->PutString( aExpStr.copy( lStartPos - 1 ) ); + rPar.Get32(0)->PutString( aExpStr.copy( lStartPos - 1 ) ); } } void SbRtl_Right(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 3 ) + if ( rPar.Count32() < 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - const OUString& rStr = rPar.Get(1)->GetOUString(); - int nResultLen = rPar.Get(2)->GetLong(); + const OUString& rStr = rPar.Get32(1)->GetOUString(); + int nResultLen = rPar.Get32(2)->GetLong(); if( nResultLen < 0 ) { nResultLen = 0; @@ -1349,37 +1349,37 @@ void SbRtl_Right(StarBASIC *, SbxArray & rPar, bool) nResultLen = nStrLen; } OUString aResultStr = rStr.copy( nStrLen - nResultLen ); - rPar.Get(0)->PutString( aResultStr ); + rPar.Get32(0)->PutString( aResultStr ); } } void SbRtl_RTL(StarBASIC * pBasic, SbxArray & rPar, bool) { - rPar.Get( 0 )->PutObject( pBasic->getRTL().get() ); + rPar.Get32(0)->PutObject( pBasic->getRTL().get() ); } void SbRtl_RTrim(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - OUString aStr(comphelper::string::stripEnd(rPar.Get(1)->GetOUString(), ' ')); - rPar.Get(0)->PutString(aStr); + OUString aStr(comphelper::string::stripEnd(rPar.Get32(1)->GetOUString(), ' ')); + rPar.Get32(0)->PutString(aStr); } } void SbRtl_Sgn(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - double aDouble = rPar.Get(1)->GetDouble(); + double aDouble = rPar.Get32(1)->GetDouble(); sal_Int16 nResult = 0; if ( aDouble > 0 ) { @@ -1389,50 +1389,50 @@ void SbRtl_Sgn(StarBASIC *, SbxArray & rPar, bool) { nResult = -1; } - rPar.Get(0)->PutInteger( nResult ); + rPar.Get32(0)->PutInteger( nResult ); } } void SbRtl_Space(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { OUStringBuffer aBuf; - string::padToLength(aBuf, rPar.Get(1)->GetLong(), ' '); - rPar.Get(0)->PutString(aBuf.makeStringAndClear()); + string::padToLength(aBuf, rPar.Get32(1)->GetLong(), ' '); + rPar.Get32(0)->PutString(aBuf.makeStringAndClear()); } } void SbRtl_Spc(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { OUStringBuffer aBuf; - string::padToLength(aBuf, rPar.Get(1)->GetLong(), ' '); - rPar.Get(0)->PutString(aBuf.makeStringAndClear()); + string::padToLength(aBuf, rPar.Get32(1)->GetLong(), ' '); + rPar.Get32(0)->PutString(aBuf.makeStringAndClear()); } } void SbRtl_Sqr(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - double aDouble = rPar.Get(1)->GetDouble(); + double aDouble = rPar.Get32(1)->GetDouble(); if ( aDouble >= 0 ) { - rPar.Get(0)->PutDouble( sqrt( aDouble )); + rPar.Get32(0)->PutDouble( sqrt( aDouble )); } else { @@ -1443,7 +1443,7 @@ void SbRtl_Sqr(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Str(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -1451,7 +1451,7 @@ void SbRtl_Str(StarBASIC *, SbxArray & rPar, bool) { OUString aStr; OUString aStrNew(""); - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); pArg->Format( aStr ); // Numbers start with a space @@ -1498,20 +1498,20 @@ void SbRtl_Str(StarBASIC *, SbxArray & rPar, bool) { aStrNew = aStr; } - rPar.Get(0)->PutString( aStrNew ); + rPar.Get32(0)->PutString( aStrNew ); } } void SbRtl_StrComp(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 3 ) + if ( rPar.Count32() < 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); - rPar.Get(0)->PutEmpty(); + rPar.Get32(0)->PutEmpty(); return; } - const OUString& rStr1 = rPar.Get(1)->GetOUString(); - const OUString& rStr2 = rPar.Get(2)->GetOUString(); + const OUString& rStr1 = rPar.Get32(1)->GetOUString(); + const OUString& rStr2 = rPar.Get32(2)->GetOUString(); SbiInstance* pInst = GetSbData()->pInst; bool bTextCompare; @@ -1525,8 +1525,8 @@ void SbRtl_StrComp(StarBASIC *, SbxArray & rPar, bool) { bTextCompare = true; } - if ( rPar.Count() == 4 ) - bTextCompare = rPar.Get(3)->GetInteger(); + if ( rPar.Count32() == 4 ) + bTextCompare = rPar.Get32(3)->GetInteger(); if( !bCompatibility ) { @@ -1564,75 +1564,75 @@ void SbRtl_StrComp(StarBASIC *, SbxArray & rPar, bool) nRetValue = 1; } } - rPar.Get(0)->PutInteger( sal::static_int_cast< sal_Int16 >( nRetValue ) ); + rPar.Get32(0)->PutInteger( sal::static_int_cast< sal_Int16 >( nRetValue ) ); } void SbRtl_String(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { sal_Unicode aFiller; - sal_Int32 lCount = rPar.Get(1)->GetLong(); + sal_Int32 lCount = rPar.Get32(1)->GetLong(); if( lCount < 0 || lCount > 0xffff ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - if( rPar.Get(2)->GetType() == SbxINTEGER ) + if( rPar.Get32(2)->GetType() == SbxINTEGER ) { - aFiller = static_cast<sal_Unicode>(rPar.Get(2)->GetInteger()); + aFiller = static_cast<sal_Unicode>(rPar.Get32(2)->GetInteger()); } else { - const OUString& rStr = rPar.Get(2)->GetOUString(); + const OUString& rStr = rPar.Get32(2)->GetOUString(); aFiller = rStr[0]; } OUStringBuffer aBuf(lCount); string::padToLength(aBuf, lCount, aFiller); - rPar.Get(0)->PutString(aBuf.makeStringAndClear()); + rPar.Get32(0)->PutString(aBuf.makeStringAndClear()); } } void SbRtl_Tab(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); else { OUStringBuffer aStr; - comphelper::string::padToLength(aStr, rPar.Get(1)->GetLong(), '\t'); - rPar.Get(0)->PutString(aStr.makeStringAndClear()); + comphelper::string::padToLength(aStr, rPar.Get32(1)->GetLong(), '\t'); + rPar.Get32(0)->PutString(aStr.makeStringAndClear()); } } void SbRtl_Tan(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariableRef pArg = rPar.Get( 1 ); - rPar.Get( 0 )->PutDouble( tan( pArg->GetDouble() ) ); + SbxVariableRef pArg = rPar.Get32(1); + rPar.Get32(0)->PutDouble( tan( pArg->GetDouble() ) ); } } void SbRtl_UCase(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { const CharClass& rCharClass = GetCharClass(); - OUString aStr( rPar.Get(1)->GetOUString() ); + OUString aStr( rPar.Get32(1)->GetOUString() ); aStr = rCharClass.uppercase( aStr ); - rPar.Get(0)->PutString( aStr ); + rPar.Get32(0)->PutString( aStr ); } } @@ -1642,7 +1642,7 @@ void SbRtl_Val(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) (void)pBasic; (void)bWrite; - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -1651,7 +1651,7 @@ void SbRtl_Val(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) double nResult = 0.0; char* pEndPtr; - OUString aStr( rPar.Get(1)->GetOUString() ); + OUString aStr( rPar.Get32(1)->GetOUString() ); FilterWhiteSpace( aStr ); if ( aStr.getLength() > 1 && aStr[0] == '&' ) @@ -1691,7 +1691,7 @@ void SbRtl_Val(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) #endif } - rPar.Get(0)->PutDouble( nResult ); + rPar.Get32(0)->PutDouble( nResult ); } } @@ -1742,28 +1742,28 @@ void SbxDateFromUNODate( SbxValue *pVal, const css::util::Date& aUnoDate) // Function to convert date to UNO date (com.sun.star.util.Date) void SbRtl_CDateToUnoDate(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - unoToSbxValue(rPar.Get(0), Any(SbxDateToUNODate(rPar.Get(1)))); + unoToSbxValue(rPar.Get32(0), Any(SbxDateToUNODate(rPar.Get32(1)))); } // Function to convert date from UNO date (com.sun.star.util.Date) void SbRtl_CDateFromUnoDate(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 || rPar.Get(1)->GetType() != SbxOBJECT ) + if ( rPar.Count32() != 2 || rPar.Get32(1)->GetType() != SbxOBJECT ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - Any aAny (sbxToUnoValue(rPar.Get(1), cppu::UnoType<css::util::Date>::get())); + Any aAny (sbxToUnoValue(rPar.Get32(1), cppu::UnoType<css::util::Date>::get())); css::util::Date aUnoDate; if(aAny >>= aUnoDate) - SbxDateFromUNODate(rPar.Get(0), aUnoDate); + SbxDateFromUNODate(rPar.Get32(0), aUnoDate); else SbxBase::SetError( ERRCODE_BASIC_CONVERSION ); } @@ -1789,28 +1789,28 @@ void SbxDateFromUNOTime( SbxValue *pVal, const css::util::Time& aUnoTime) // Function to convert date to UNO time (com.sun.star.util.Time) void SbRtl_CDateToUnoTime(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - unoToSbxValue(rPar.Get(0), Any(SbxDateToUNOTime(rPar.Get(1)))); + unoToSbxValue(rPar.Get32(0), Any(SbxDateToUNOTime(rPar.Get32(1)))); } // Function to convert date from UNO time (com.sun.star.util.Time) void SbRtl_CDateFromUnoTime(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 || rPar.Get(1)->GetType() != SbxOBJECT ) + if ( rPar.Count32() != 2 || rPar.Get32(1)->GetType() != SbxOBJECT ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - Any aAny (sbxToUnoValue(rPar.Get(1), cppu::UnoType<css::util::Time>::get())); + Any aAny (sbxToUnoValue(rPar.Get32(1), cppu::UnoType<css::util::Time>::get())); css::util::Time aUnoTime; if(aAny >>= aUnoTime) - SbxDateFromUNOTime(rPar.Get(0), aUnoTime); + SbxDateFromUNOTime(rPar.Get32(0), aUnoTime); else SbxBase::SetError( ERRCODE_BASIC_CONVERSION ); } @@ -1845,28 +1845,28 @@ void SbxDateFromUNODateTime( SbxValue *pVal, const css::util::DateTime& aUnoDT) // Function to convert date to UNO date (com.sun.star.util.Date) void SbRtl_CDateToUnoDateTime(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - unoToSbxValue(rPar.Get(0), Any(SbxDateToUNODateTime(rPar.Get(1)))); + unoToSbxValue(rPar.Get32(0), Any(SbxDateToUNODateTime(rPar.Get32(1)))); } // Function to convert date from UNO date (com.sun.star.util.Date) void SbRtl_CDateFromUnoDateTime(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 || rPar.Get(1)->GetType() != SbxOBJECT ) + if ( rPar.Count32() != 2 || rPar.Get32(1)->GetType() != SbxOBJECT ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - Any aAny (sbxToUnoValue(rPar.Get(1), cppu::UnoType<css::util::DateTime>::get())); + Any aAny (sbxToUnoValue(rPar.Get32(1), cppu::UnoType<css::util::DateTime>::get())); css::util::DateTime aUnoDT; if(aAny >>= aUnoDT) - SbxDateFromUNODateTime(rPar.Get(0), aUnoDT); + SbxDateFromUNODateTime(rPar.Get32(0), aUnoDT); else SbxBase::SetError( ERRCODE_BASIC_CONVERSION ); } @@ -1874,9 +1874,9 @@ void SbRtl_CDateFromUnoDateTime(StarBASIC *, SbxArray & rPar, bool) // Function to convert date to ISO 8601 date format YYYYMMDD void SbRtl_CDateToIso(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - double aDate = rPar.Get(1)->GetDate(); + double aDate = rPar.Get32(1)->GetDate(); // Date may actually even be -YYYYYMMDD char Buffer[11]; @@ -1886,7 +1886,7 @@ void SbRtl_CDateToIso(StarBASIC *, SbxArray & rPar, bool) static_cast<int>(implGetDateMonth( aDate )), static_cast<int>(implGetDateDay( aDate )) ); OUString aRetStr = OUString::createFromAscii( Buffer ); - rPar.Get(0)->PutString( aRetStr ); + rPar.Get32(0)->PutString( aRetStr ); } else { @@ -1898,11 +1898,11 @@ void SbRtl_CDateToIso(StarBASIC *, SbxArray & rPar, bool) // And even YYMMDD for compatibility, sigh... void SbRtl_CDateFromIso(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { do { - OUString aStr = rPar.Get(1)->GetOUString(); + OUString aStr = rPar.Get32(1)->GetOUString(); if (aStr.isEmpty()) break; @@ -1967,7 +1967,7 @@ void SbRtl_CDateFromIso(StarBASIC *, SbxArray & rPar, bool) bUseTwoDigitYear, SbDateCorrection::None, dDate )) break; - rPar.Get(0)->PutDate( dDate ); + rPar.Get32(0)->PutDate( dDate ); return; } @@ -1983,36 +1983,36 @@ void SbRtl_CDateFromIso(StarBASIC *, SbxArray & rPar, bool) void SbRtl_DateSerial(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 4 ) + if ( rPar.Count32() < 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_Int16 nYear = rPar.Get(1)->GetInteger(); - sal_Int16 nMonth = rPar.Get(2)->GetInteger(); - sal_Int16 nDay = rPar.Get(3)->GetInteger(); + sal_Int16 nYear = rPar.Get32(1)->GetInteger(); + sal_Int16 nMonth = rPar.Get32(2)->GetInteger(); + sal_Int16 nDay = rPar.Get32(3)->GetInteger(); double dDate; if( implDateSerial( nYear, nMonth, nDay, true, SbDateCorrection::RollOver, dDate ) ) { - rPar.Get(0)->PutDate( dDate ); + rPar.Get32(0)->PutDate( dDate ); } } void SbRtl_TimeSerial(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 4 ) + if ( rPar.Count32() < 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_Int16 nHour = rPar.Get(1)->GetInteger(); + sal_Int16 nHour = rPar.Get32(1)->GetInteger(); if ( nHour == 24 ) { nHour = 0; // because of UNO DateTimes, which go till 24 o'clock } - sal_Int16 nMinute = rPar.Get(2)->GetInteger(); - sal_Int16 nSecond = rPar.Get(3)->GetInteger(); + sal_Int16 nMinute = rPar.Get32(2)->GetInteger(); + sal_Int16 nSecond = rPar.Get32(3)->GetInteger(); if ((nHour < 0 || nHour > 23) || (nMinute < 0 || nMinute > 59 ) || (nSecond < 0 || nSecond > 59 )) @@ -2021,12 +2021,12 @@ void SbRtl_TimeSerial(StarBASIC *, SbxArray & rPar, bool) return; } - rPar.Get(0)->PutDate( implTimeSerial(nHour, nMinute, nSecond) ); // JSM + rPar.Get32(0)->PutDate( implTimeSerial(nHour, nMinute, nSecond) ); // JSM } void SbRtl_DateValue(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -2047,7 +2047,7 @@ void SbRtl_DateValue(StarBASIC *, SbxArray & rPar, bool) LanguageType eLangType = Application::GetSettings().GetLanguageTag().getLanguageType(); sal_uInt32 nIndex = pFormatter->GetStandardIndex( eLangType); double fResult; - OUString aStr( rPar.Get(1)->GetOUString() ); + OUString aStr( rPar.Get32(1)->GetOUString() ); bool bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult ); SvNumFormatType nType = pFormatter->GetType( nIndex ); @@ -2076,7 +2076,7 @@ void SbRtl_DateValue(StarBASIC *, SbxArray & rPar, bool) fResult = ceil( fResult ); } } - rPar.Get(0)->PutDate( fResult ); + rPar.Get32(0)->PutDate( fResult ); } else { @@ -2087,7 +2087,7 @@ void SbRtl_DateValue(StarBASIC *, SbxArray & rPar, bool) void SbRtl_TimeValue(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -2104,7 +2104,7 @@ void SbRtl_TimeValue(StarBASIC *, SbxArray & rPar, bool) sal_uInt32 nIndex = 0; double fResult; - bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetOUString(), + bool bSuccess = pFormatter->IsNumberFormat( rPar.Get32(1)->GetOUString(), nIndex, fResult ); SvNumFormatType nType = pFormatter->GetType(nIndex); if(bSuccess && (nType==SvNumFormatType::TIME||nType==SvNumFormatType::DATETIME)) @@ -2114,7 +2114,7 @@ void SbRtl_TimeValue(StarBASIC *, SbxArray & rPar, bool) // cut days fResult = fmod( fResult, 1 ); } - rPar.Get(0)->PutDate( fResult ); + rPar.Get32(0)->PutDate( fResult ); } else { @@ -2125,30 +2125,30 @@ void SbRtl_TimeValue(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Day(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariableRef pArg = rPar.Get( 1 ); + SbxVariableRef pArg = rPar.Get32(1); double aDate = pArg->GetDate(); sal_Int16 nDay = implGetDateDay( aDate ); - rPar.Get(0)->PutInteger( nDay ); + rPar.Get32(0)->PutInteger( nDay ); } } void SbRtl_Year(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int16 nYear = implGetDateYear( rPar.Get(1)->GetDate() ); - rPar.Get(0)->PutInteger( nYear ); + sal_Int16 nYear = implGetDateYear( rPar.Get32(1)->GetDate() ); + rPar.Get32(0)->PutInteger( nYear ); } } @@ -2163,42 +2163,42 @@ sal_Int16 implGetHour( double dDate ) void SbRtl_Hour(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - double nArg = rPar.Get(1)->GetDate(); + double nArg = rPar.Get32(1)->GetDate(); sal_Int16 nHour = implGetHour( nArg ); - rPar.Get(0)->PutInteger( nHour ); + rPar.Get32(0)->PutInteger( nHour ); } } void SbRtl_Minute(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - double nArg = rPar.Get(1)->GetDate(); + double nArg = rPar.Get32(1)->GetDate(); sal_Int16 nMin = implGetMinute( nArg ); - rPar.Get(0)->PutInteger( nMin ); + rPar.Get32(0)->PutInteger( nMin ); } } void SbRtl_Month(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int16 nMonth = implGetDateMonth( rPar.Get(1)->GetDate() ); - rPar.Get(0)->PutInteger( nMonth ); + sal_Int16 nMonth = implGetDateMonth( rPar.Get32(1)->GetDate() ); + rPar.Get32(0)->PutInteger( nMonth ); } } @@ -2218,15 +2218,15 @@ sal_Int16 implGetSecond( double dDate ) void SbRtl_Second(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - double nArg = rPar.Get(1)->GetDate(); + double nArg = rPar.Get32(1)->GetDate(); sal_Int16 nSecond = implGetSecond( nArg ); - rPar.Get(0)->PutInteger( nSecond ); + rPar.Get32(0)->PutInteger( nSecond ); } } @@ -2247,7 +2247,7 @@ double Now_Impl() void SbRtl_Now(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutDate( Now_Impl() ); + rPar.Get32(0)->PutDate( Now_Impl() ); } // Date Time() @@ -2257,7 +2257,7 @@ void SbRtl_Time(StarBASIC *, SbxArray & rPar, bool bWrite) if ( !bWrite ) { tools::Time aTime( tools::Time::SYSTEM ); - SbxVariable* pMeth = rPar.Get( 0 ); + SbxVariable* pMeth = rPar.Get32(0); OUString aRes; if( pMeth->IsFixed() ) { @@ -2307,7 +2307,7 @@ void SbRtl_Timer(StarBASIC *, SbxArray & rPar, bool) nSeconds *= 3600; nSeconds += aTime.GetMin() * 60; nSeconds += aTime.GetSec(); - rPar.Get(0)->PutDate( static_cast<double>(nSeconds) ); + rPar.Get32(0)->PutDate( static_cast<double>(nSeconds) ); } @@ -2317,7 +2317,7 @@ void SbRtl_Date(StarBASIC *, SbxArray & rPar, bool bWrite) { Date aToday( Date::SYSTEM ); double nDays = static_cast<double>(GetDayDiff( aToday )); - SbxVariable* pMeth = rPar.Get( 0 ); + SbxVariable* pMeth = rPar.Get32(0); if( pMeth->IsString() ) { OUString aRes; @@ -2352,25 +2352,25 @@ void SbRtl_Date(StarBASIC *, SbxArray & rPar, bool bWrite) void SbRtl_IsArray(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) != 0); + rPar.Get32(0)->PutBool((rPar.Get32(1)->GetType() & SbxARRAY) != 0); } } void SbRtl_IsObject(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariable* pVar = rPar.Get(1); + SbxVariable* pVar = rPar.Get32(1); bool bObject = pVar->IsObject(); SbxBase* pObj = (bObject ? pVar->GetObject() : nullptr); @@ -2378,20 +2378,20 @@ void SbRtl_IsObject(StarBASIC *, SbxArray & rPar, bool) { bObject = pUnoClass->getUnoClass().is(); } - rPar.Get( 0 )->PutBool( bObject ); + rPar.Get32(0)->PutBool( bObject ); } } void SbRtl_IsDate(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { // #46134 only string is converted, all other types result in sal_False - SbxVariableRef xArg = rPar.Get( 1 ); + SbxVariableRef xArg = rPar.Get32(1); SbxDataType eType = xArg->GetType(); bool bDate = false; @@ -2412,13 +2412,13 @@ void SbRtl_IsDate(StarBASIC *, SbxArray & rPar, bool) SbxBase::ResetError(); SbxBase::SetError( nPrevError ); } - rPar.Get( 0 )->PutBool( bDate ); + rPar.Get32(0)->PutBool( bDate ); } } void SbRtl_IsEmpty(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -2427,29 +2427,29 @@ void SbRtl_IsEmpty(StarBASIC *, SbxArray & rPar, bool) SbxVariable* pVar = nullptr; if( SbiRuntime::isVBAEnabled() ) { - pVar = getDefaultProp( rPar.Get(1) ); + pVar = getDefaultProp( rPar.Get32(1) ); } if ( pVar ) { pVar->Broadcast( SfxHintId::BasicDataWanted ); - rPar.Get( 0 )->PutBool( pVar->IsEmpty() ); + rPar.Get32(0)->PutBool( pVar->IsEmpty() ); } else { - rPar.Get( 0 )->PutBool( rPar.Get(1)->IsEmpty() ); + rPar.Get32(0)->PutBool( rPar.Get32(1)->IsEmpty() ); } } } void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxVariable* pVar =rPar.Get( 1 ); + SbxVariable* pVar =rPar.Get32(1); SbUnoObject* pObj = dynamic_cast<SbUnoObject*>( pVar ); if ( !pObj ) { @@ -2465,18 +2465,18 @@ void SbRtl_IsError(StarBASIC *, SbxArray & rPar, bool) } if ( xError.is() ) { - rPar.Get( 0 )->PutBool( xError->hasError() ); + rPar.Get32(0)->PutBool( xError->hasError() ); } else { - rPar.Get( 0 )->PutBool( rPar.Get(1)->IsErr() ); + rPar.Get32(0)->PutBool( rPar.Get32(1)->IsErr() ); } } } void SbRtl_IsNull(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -2484,8 +2484,8 @@ void SbRtl_IsNull(StarBASIC *, SbxArray & rPar, bool) { // #51475 because of Uno-objects return true // even if the pObj value is NULL - SbxVariableRef pArg = rPar.Get( 1 ); - bool bNull = rPar.Get(1)->IsNull(); + SbxVariableRef pArg = rPar.Get32(1); + bool bNull = rPar.Get32(1)->IsNull(); if( !bNull && pArg->GetType() == SbxOBJECT ) { SbxBase* pObj = pArg->GetObject(); @@ -2494,33 +2494,33 @@ void SbRtl_IsNull(StarBASIC *, SbxArray & rPar, bool) bNull = true; } } - rPar.Get( 0 )->PutBool( bNull ); + rPar.Get32(0)->PutBool( bNull ); } } void SbRtl_IsNumeric(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - rPar.Get( 0 )->PutBool( rPar.Get( 1 )->IsNumericRTL() ); + rPar.Get32(0)->PutBool( rPar.Get32(1)->IsNumericRTL() ); } } void SbRtl_IsMissing(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { // #57915 Missing is reported by an error - rPar.Get( 0 )->PutBool( rPar.Get(1)->IsErr() ); + rPar.Get32(0)->PutBool( rPar.Get32(1)->IsErr() ); } } @@ -2638,7 +2638,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) { OUString aPath; - sal_uInt16 nParCount = rPar.Count(); + const sal_uInt32 nParCount = rPar.Count32(); if( nParCount > 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -2654,7 +2654,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) { if ( nParCount >= 2 ) { - OUString aFileParam = rPar.Get(1)->GetOUString(); + OUString aFileParam = rPar.Get32(1)->GetOUString(); OUString aFileURLStr = implSetupWildcard(aFileParam, rRTLData); if (!rRTLData.sFullNameToBeChecked.isEmpty()) @@ -2670,7 +2670,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) aNameOnlyStr = aFileURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset ); } - rPar.Get(0)->PutString( aNameOnlyStr ); + rPar.Get32(0)->PutString( aNameOnlyStr ); return; } @@ -2685,14 +2685,14 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) } else { - rPar.Get(0)->PutString( "" ); + rPar.Get32(0)->PutString( "" ); } SbAttributes nFlags = SbAttributes::NONE; if ( nParCount > 2 ) { rRTLData.nDirFlags = nFlags - = static_cast<SbAttributes>(rPar.Get(2)->GetInteger()); + = static_cast<SbAttributes>(rPar.Get32(2)->GetInteger()); } else { @@ -2792,7 +2792,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) break; } } - rPar.Get(0)->PutString( aPath ); + rPar.Get32(0)->PutString( aPath ); } } else @@ -2800,7 +2800,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) // TODO: OSL if ( nParCount >= 2 ) { - OUString aFileParam = rPar.Get(1)->GetOUString(); + OUString aFileParam = rPar.Get32(1)->GetOUString(); OUString aDirURL = implSetupWildcard(aFileParam, rRTLData); @@ -2808,7 +2808,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) if ( nParCount > 2 ) { rRTLData.nDirFlags = nFlags - = static_cast<SbAttributes>(rPar.Get(2)->GetInteger()); + = static_cast<SbAttributes>(rPar.Get32(2)->GetInteger()); } else { @@ -2822,7 +2822,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) if( nRet != FileBase::E_None ) { rRTLData.pDir.reset(); - rPar.Get(0)->PutString( OUString() ); + rPar.Get32(0)->PutString( OUString() ); return; } @@ -2903,7 +2903,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool) break; } } - rPar.Get(0)->PutString( aPath ); + rPar.Get32(0)->PutString( aPath ); } } } @@ -2914,7 +2914,7 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) (void)pBasic; (void)bWrite; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { sal_Int16 nFlags = 0; @@ -2923,7 +2923,7 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) #if defined(_WIN32) if( SbiRuntime::isVBAEnabled() ) { - OUString aPathURL = getFullPath( rPar.Get(1)->GetOUString() ); + OUString aPathURL = getFullPath( rPar.Get32(1)->GetOUString() ); OUString aPath; FileBase::getSystemPathFromFileURL( aPathURL, aPath ); DWORD nRealFlags = GetFileAttributesW (o3tl::toW(aPath.getStr())); @@ -2939,7 +2939,7 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) { StarBASIC::Error( ERRCODE_BASIC_FILE_NOT_FOUND ); } - rPar.Get(0)->PutInteger( nFlags ); + rPar.Get32(0)->PutInteger( nFlags ); return; } @@ -2952,7 +2952,7 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) { try { - OUString aPath = getFullPath( rPar.Get(1)->GetOUString() ); + OUString aPath = getFullPath( rPar.Get32(1)->GetOUString() ); bool bExists = false; try { bExists = xSFI->exists( aPath ); } catch(const Exception & ) {} @@ -2987,7 +2987,7 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) else { DirectoryItem aItem; - (void)DirectoryItem::get( getFullPath( rPar.Get(1)->GetOUString() ), aItem ); + (void)DirectoryItem::get( getFullPath( rPar.Get32(1)->GetOUString() ), aItem ); FileStatus aFileStatus( osl_FileStatus_Mask_Attributes | osl_FileStatus_Mask_Type ); (void)aItem.getFileStatus( aFileStatus ); sal_uInt64 nAttributes = aFileStatus.getAttributes(); @@ -3004,7 +3004,7 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) nFlags |= sal_uInt16(SbAttributes::DIRECTORY); } } - rPar.Get(0)->PutInteger( nFlags ); + rPar.Get32(0)->PutInteger( nFlags ); } else { @@ -3015,13 +3015,13 @@ void SbRtl_GetAttr(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) void SbRtl_FileDateTime(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - OUString aPath = rPar.Get(1)->GetOUString(); + OUString aPath = rPar.Get32(1)->GetOUString(); tools::Time aTime( tools::Time::EMPTY ); Date aDate( Date::EMPTY ); if( hasUno() ) @@ -3107,7 +3107,7 @@ void SbRtl_FileDateTime(StarBASIC *, SbxArray & rPar, bool) pFormatter->GetOutputString( fSerial, nIndex, aRes, &pCol ); } - rPar.Get(0)->PutString( aRes ); + rPar.Get32(0)->PutString( aRes ); } } @@ -3115,13 +3115,13 @@ void SbRtl_FileDateTime(StarBASIC *, SbxArray & rPar, bool) void SbRtl_EOF(StarBASIC *, SbxArray & rPar, bool) { // No changes for UCB - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get32(1)->GetInteger(); SbiIoSystem* pIO = GetSbData()->pInst->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); if ( !pSbStrm ) @@ -3145,7 +3145,7 @@ void SbRtl_EOF(StarBASIC *, SbxArray & rPar, bool) { beof = pSvStrm->eof(); // for binary data! } - rPar.Get(0)->PutBool( beof ); + rPar.Get32(0)->PutBool( beof ); } } @@ -3156,13 +3156,13 @@ void SbRtl_FileAttr(StarBASIC *, SbxArray & rPar, bool) // not touched by the adjustment to virtual URLs, as it only works on // already opened files and the name doesn't matter there. - if ( rPar.Count() != 3 ) + if ( rPar.Count32() != 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get32(1)->GetInteger(); SbiIoSystem* pIO = GetSbData()->pInst->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); if ( !pSbStrm ) @@ -3171,7 +3171,7 @@ void SbRtl_FileAttr(StarBASIC *, SbxArray & rPar, bool) return; } sal_Int16 nRet; - if ( rPar.Get(2)->GetInteger() == 1 ) + if ( rPar.Get32(2)->GetInteger() == 1 ) { nRet = static_cast<sal_Int16>(pSbStrm->GetMode()); } @@ -3179,19 +3179,19 @@ void SbRtl_FileAttr(StarBASIC *, SbxArray & rPar, bool) { nRet = 0; // System file handle not supported } - rPar.Get(0)->PutInteger( nRet ); + rPar.Get32(0)->PutInteger( nRet ); } } void SbRtl_Loc(StarBASIC *, SbxArray & rPar, bool) { // No changes for UCB - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get32(1)->GetInteger(); SbiIoSystem* pIO = GetSbData()->pInst->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); if ( !pSbStrm ) @@ -3223,20 +3223,20 @@ void SbRtl_Loc(StarBASIC *, SbxArray & rPar, bool) { nPos = pSvStrm->Tell(); } - rPar.Get(0)->PutLong( static_cast<sal_Int32>(nPos) ); + rPar.Get32(0)->PutLong( static_cast<sal_Int32>(nPos) ); } } void SbRtl_Lof(StarBASIC *, SbxArray & rPar, bool) { // No changes for UCB - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get32(1)->GetInteger(); SbiIoSystem* pIO = GetSbData()->pInst->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); if ( !pSbStrm ) @@ -3246,7 +3246,7 @@ void SbRtl_Lof(StarBASIC *, SbxArray & rPar, bool) } SvStream* pSvStrm = pSbStrm->GetStrm(); sal_uInt64 const nLen = pSvStrm->TellEnd(); - rPar.Get(0)->PutLong( static_cast<sal_Int32>(nLen) ); + rPar.Get32(0)->PutLong( static_cast<sal_Int32>(nLen) ); } } @@ -3254,13 +3254,13 @@ void SbRtl_Lof(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Seek(StarBASIC *, SbxArray & rPar, bool) { // No changes for UCB - int nArgs = static_cast<int>(rPar.Count()); + int nArgs = static_cast<int>(rPar.Count32()); if ( nArgs < 2 || nArgs > 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_Int16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get32(1)->GetInteger(); SbiIoSystem* pIO = GetSbData()->pInst->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); if ( !pSbStrm ) @@ -3278,11 +3278,11 @@ void SbRtl_Seek(StarBASIC *, SbxArray & rPar, bool) nPos = nPos / pSbStrm->GetBlockLen(); } nPos++; // Basic counts from 1 - rPar.Get(0)->PutLong( static_cast<sal_Int32>(nPos) ); + rPar.Get32(0)->PutLong( static_cast<sal_Int32>(nPos) ); } else // Seek-Statement { - sal_Int32 nPos = rPar.Get(2)->GetLong(); + sal_Int32 nPos = rPar.Get32(2)->GetLong(); if ( nPos < 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -3301,7 +3301,7 @@ void SbRtl_Seek(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Format(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count(); + const sal_uInt32 nArgCount = rPar.Count32(); if ( nArgCount < 2 || nArgCount > 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -3311,21 +3311,21 @@ void SbRtl_Format(StarBASIC *, SbxArray & rPar, bool) OUString aResult; if( nArgCount == 2 ) { - rPar.Get(1)->Format( aResult ); + rPar.Get32(1)->Format( aResult ); } else { - OUString aFmt( rPar.Get(2)->GetOUString() ); - rPar.Get(1)->Format( aResult, &aFmt ); + OUString aFmt( rPar.Get32(2)->GetOUString() ); + rPar.Get32(1)->Format( aResult, &aFmt ); } - rPar.Get(0)->PutString( aResult ); + rPar.Get32(0)->PutString( aResult ); } } // https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/formatnumber-function void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool) { - const sal_uInt16 nArgCount = rPar.Count(); + const sal_uInt32 nArgCount = rPar.Count32(); if (nArgCount < 2 || nArgCount > 6) { StarBASIC::Error(ERRCODE_BASIC_BAD_ARGUMENT); @@ -3335,9 +3335,9 @@ void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool) // The UI locale never changes -> we can use static value here static const LocaleDataWrapper localeData(Application::GetSettings().GetUILanguageTag()); sal_Int16 nNumDigitsAfterDecimal = -1; - if (nArgCount > 2 && !rPar.Get(2)->IsEmpty()) + if (nArgCount > 2 && !rPar.Get32(2)->IsEmpty()) { - nNumDigitsAfterDecimal = rPar.Get(2)->GetInteger(); + nNumDigitsAfterDecimal = rPar.Get32(2)->GetInteger(); if (nNumDigitsAfterDecimal < -1) { StarBASIC::Error(ERRCODE_BASIC_BAD_ARGUMENT); @@ -3350,9 +3350,9 @@ void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool) nNumDigitsAfterDecimal = LocaleDataWrapper::getNumDigits(); bool bIncludeLeadingDigit = LocaleDataWrapper::isNumLeadingZero(); - if (nArgCount > 3 && !rPar.Get(3)->IsEmpty()) + if (nArgCount > 3 && !rPar.Get32(3)->IsEmpty()) { - switch (rPar.Get(3)->GetInteger()) + switch (rPar.Get32(3)->GetInteger()) { case ooo::vba::VbTriState::vbFalse: bIncludeLeadingDigit = false; @@ -3370,9 +3370,9 @@ void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool) } bool bUseParensForNegativeNumbers = false; - if (nArgCount > 4 && !rPar.Get(4)->IsEmpty()) + if (nArgCount > 4 && !rPar.Get32(4)->IsEmpty()) { - switch (rPar.Get(4)->GetInteger()) + switch (rPar.Get32(4)->GetInteger()) { case ooo::vba::VbTriState::vbFalse: case ooo::vba::VbTriState::vbUseDefault: @@ -3388,9 +3388,9 @@ void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool) } bool bGroupDigits = false; - if (nArgCount > 5 && !rPar.Get(5)->IsEmpty()) + if (nArgCount > 5 && !rPar.Get32(5)->IsEmpty()) { - switch (rPar.Get(5)->GetInteger()) + switch (rPar.Get32(5)->GetInteger()) { case ooo::vba::VbTriState::vbFalse: case ooo::vba::VbTriState::vbUseDefault: @@ -3405,7 +3405,7 @@ void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool) } } - double fVal = rPar.Get(1)->GetDouble(); + double fVal = rPar.Get32(1)->GetDouble(); const bool bNegative = fVal < 0; if (bNegative) fVal = fabs(fVal); // Always work with non-negatives, to easily handle leading zero @@ -3446,7 +3446,7 @@ void SbRtl_FormatNumber(StarBASIC*, SbxArray& rPar, bool) aResult = "-" + aResult; } - rPar.Get(0)->PutString(aResult); + rPar.Get32(0)->PutString(aResult); } namespace { @@ -3483,13 +3483,13 @@ class theRandomNumberGenerator : public rtl::Static<RandomNumberGenerator, theRa void SbRtl_Randomize(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() > 2 ) + if ( rPar.Count32() > 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - if( rPar.Count() == 2 ) + if( rPar.Count32() == 2 ) { - int nSeed = static_cast<int>(rPar.Get(1)->GetInteger()); + int nSeed = static_cast<int>(rPar.Get32(1)->GetInteger()); theRandomNumberGenerator::get().global_rng.seed(nSeed); } // without parameter, no need to do anything - RNG is seeded at first use @@ -3497,7 +3497,7 @@ void SbRtl_Randomize(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Rnd(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() > 2 ) + if ( rPar.Count32() > 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -3505,7 +3505,7 @@ void SbRtl_Rnd(StarBASIC *, SbxArray & rPar, bool) { std::uniform_real_distribution<double> dist(0.0, 1.0); double const tmp(dist(theRandomNumberGenerator::get().global_rng)); - rPar.Get(0)->PutDouble(tmp); + rPar.Get32(0)->PutDouble(tmp); } } @@ -3521,21 +3521,21 @@ void SbRtl_Rnd(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Shell(StarBASIC *, SbxArray & rPar, bool) { - std::size_t nArgCount = rPar.Count(); + const sal_uInt32 nArgCount = rPar.Count32(); if ( nArgCount < 2 || nArgCount > 5 ) { - rPar.Get(0)->PutLong(0); + rPar.Get32(0)->PutLong(0); StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { oslProcessOption nOptions = osl_Process_SEARCHPATH | osl_Process_DETACHED; - OUString aCmdLine = rPar.Get(1)->GetOUString(); + OUString aCmdLine = rPar.Get32(1)->GetOUString(); // attach additional parameters - everything must be parsed anyway if( nArgCount >= 4 ) { - OUString tmp = rPar.Get(3)->GetOUString().trim(); + OUString tmp = rPar.Get32(3)->GetOUString().trim(); if (!tmp.isEmpty()) { aCmdLine += " " + tmp; @@ -3606,7 +3606,7 @@ void SbRtl_Shell(StarBASIC *, SbxArray & rPar, bool) sal_Int16 nWinStyle = 0; if( nArgCount >= 3 ) { - nWinStyle = rPar.Get(2)->GetInteger(); + nWinStyle = rPar.Get32(2)->GetInteger(); switch( nWinStyle ) { case 2: @@ -3623,7 +3623,7 @@ void SbRtl_Shell(StarBASIC *, SbxArray & rPar, bool) bool bSync = false; if( nArgCount >= 5 ) { - bSync = rPar.Get(4)->GetBool(); + bSync = rPar.Get32(4)->GetBool(); } if( bSync ) { @@ -3678,21 +3678,21 @@ void SbRtl_Shell(StarBASIC *, SbxArray & rPar, bool) } else { - rPar.Get(0)->PutLong( 0 ); + rPar.Get32(0)->PutLong( 0 ); } } } void SbRtl_VarType(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxDataType eType = rPar.Get(1)->GetType(); - rPar.Get(0)->PutInteger( static_cast<sal_Int16>(eType) ); + SbxDataType eType = rPar.Get32(1)->GetType(); + rPar.Get32(0)->PutInteger( static_cast<sal_Int16>(eType) ); } } @@ -3815,19 +3815,19 @@ static OUString getObjectTypeName( SbxVariable* pVar ) void SbRtl_TypeName(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxDataType eType = rPar.Get(1)->GetType(); + SbxDataType eType = rPar.Get32(1)->GetType(); bool bIsArray = ( ( eType & SbxARRAY ) != 0 ); OUString aRetStr; if ( SbiRuntime::isVBAEnabled() && eType == SbxOBJECT ) { - aRetStr = getObjectTypeName( rPar.Get(1) ); + aRetStr = getObjectTypeName( rPar.Get32(1) ); } else { @@ -3837,33 +3837,33 @@ void SbRtl_TypeName(StarBASIC *, SbxArray & rPar, bool) { aRetStr += "()"; } - rPar.Get(0)->PutString( aRetStr ); + rPar.Get32(0)->PutString( aRetStr ); } } void SbRtl_Len(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - const OUString& rStr = rPar.Get(1)->GetOUString(); - rPar.Get(0)->PutLong( rStr.getLength() ); + const OUString& rStr = rPar.Get32(1)->GetOUString(); + rPar.Get32(0)->PutLong( rStr.getLength() ); } } void SbRtl_DDEInitiate(StarBASIC *, SbxArray & rPar, bool) { - int nArgs = static_cast<int>(rPar.Count()); + int nArgs = static_cast<int>(rPar.Count32()); if ( nArgs != 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - const OUString& rApp = rPar.Get(1)->GetOUString(); - const OUString& rTopic = rPar.Get(2)->GetOUString(); + const OUString& rApp = rPar.Get32(1)->GetOUString(); + const OUString& rTopic = rPar.Get32(2)->GetOUString(); SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl(); size_t nChannel; @@ -3874,20 +3874,20 @@ void SbRtl_DDEInitiate(StarBASIC *, SbxArray & rPar, bool) } else { - rPar.Get(0)->PutInteger( static_cast<sal_Int16>(nChannel) ); + rPar.Get32(0)->PutInteger( static_cast<sal_Int16>(nChannel) ); } } void SbRtl_DDETerminate(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - int nArgs = static_cast<int>(rPar.Count()); + rPar.Get32(0)->PutEmpty(); + int nArgs = static_cast<int>(rPar.Count32()); if ( nArgs != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - size_t nChannel = rPar.Get(1)->GetInteger(); + size_t nChannel = rPar.Get32(1)->GetInteger(); SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl(); ErrCode nDdeErr = pDDE->Terminate( nChannel ); if( nDdeErr ) @@ -3898,8 +3898,8 @@ void SbRtl_DDETerminate(StarBASIC *, SbxArray & rPar, bool) void SbRtl_DDETerminateAll(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - int nArgs = static_cast<int>(rPar.Count()); + rPar.Get32(0)->PutEmpty(); + int nArgs = static_cast<int>(rPar.Count32()); if ( nArgs != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -3916,14 +3916,14 @@ void SbRtl_DDETerminateAll(StarBASIC *, SbxArray & rPar, bool) void SbRtl_DDERequest(StarBASIC *, SbxArray & rPar, bool) { - int nArgs = static_cast<int>(rPar.Count()); + int nArgs = static_cast<int>(rPar.Count32()); if ( nArgs != 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - size_t nChannel = rPar.Get(1)->GetInteger(); - const OUString& rItem = rPar.Get(2)->GetOUString(); + size_t nChannel = rPar.Get32(1)->GetInteger(); + const OUString& rItem = rPar.Get32(2)->GetOUString(); SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl(); OUString aResult; ErrCode nDdeErr = pDDE->Request( nChannel, rItem, aResult ); @@ -3933,21 +3933,21 @@ void SbRtl_DDERequest(StarBASIC *, SbxArray & rPar, bool) } else { - rPar.Get(0)->PutString( aResult ); + rPar.Get32(0)->PutString( aResult ); } } void SbRtl_DDEExecute(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - int nArgs = static_cast<int>(rPar.Count()); + rPar.Get32(0)->PutEmpty(); + int nArgs = static_cast<int>(rPar.Count32()); if ( nArgs != 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - size_t nChannel = rPar.Get(1)->GetInteger(); - const OUString& rCommand = rPar.Get(2)->GetOUString(); + size_t nChannel = rPar.Get32(1)->GetInteger(); + const OUString& rCommand = rPar.Get32(2)->GetOUString(); SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl(); ErrCode nDdeErr = pDDE->Execute( nChannel, rCommand ); if( nDdeErr ) @@ -3958,16 +3958,16 @@ void SbRtl_DDEExecute(StarBASIC *, SbxArray & rPar, bool) void SbRtl_DDEPoke(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - int nArgs = static_cast<int>(rPar.Count()); + rPar.Get32(0)->PutEmpty(); + int nArgs = static_cast<int>(rPar.Count32()); if ( nArgs != 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - size_t nChannel = rPar.Get(1)->GetInteger(); - const OUString& rItem = rPar.Get(2)->GetOUString(); - const OUString& rData = rPar.Get(3)->GetOUString(); + size_t nChannel = rPar.Get32(1)->GetInteger(); + const OUString& rItem = rPar.Get32(2)->GetOUString(); + const OUString& rData = rPar.Get32(3)->GetOUString(); SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl(); ErrCode nDdeErr = pDDE->Poke( nChannel, rItem, rData ); if( nDdeErr ) @@ -3979,7 +3979,7 @@ void SbRtl_DDEPoke(StarBASIC *, SbxArray & rPar, bool) void SbRtl_FreeFile(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 1 ) + if ( rPar.Count32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; @@ -3991,7 +3991,7 @@ void SbRtl_FreeFile(StarBASIC *, SbxArray & rPar, bool) SbiStream* pStrm = pIO->GetStream( nChannel ); if( !pStrm ) { - rPar.Get(0)->PutInteger( nChannel ); + rPar.Get32(0)->PutInteger( nChannel ); return; } nChannel++; @@ -4001,22 +4001,22 @@ void SbRtl_FreeFile(StarBASIC *, SbxArray & rPar, bool) void SbRtl_LBound(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + const sal_uInt32 nParCount = rPar.Count32(); if ( nParCount != 3 && nParCount != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxBase* pParObj = rPar.Get(1)->GetObject(); + SbxBase* pParObj = rPar.Get32(1)->GetObject(); SbxDimArray* pArr = dynamic_cast<SbxDimArray*>( pParObj ); if( pArr ) { sal_Int32 nLower, nUpper; - short nDim = (nParCount == 3) ? static_cast<short>(rPar.Get(2)->GetInteger()) : 1; + short nDim = (nParCount == 3) ? static_cast<short>(rPar.Get32(2)->GetInteger()) : 1; if( !pArr->GetDim32( nDim, nLower, nUpper ) ) StarBASIC::Error( ERRCODE_BASIC_OUT_OF_RANGE ); else - rPar.Get(0)->PutLong( nLower ); + rPar.Get32(0)->PutLong( nLower ); } else StarBASIC::Error( ERRCODE_BASIC_MUST_HAVE_DIMS ); @@ -4024,23 +4024,23 @@ void SbRtl_LBound(StarBASIC *, SbxArray & rPar, bool) void SbRtl_UBound(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + const sal_uInt32 nParCount = rPar.Count32(); if ( nParCount != 3 && nParCount != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxBase* pParObj = rPar.Get(1)->GetObject(); + SbxBase* pParObj = rPar.Get32(1)->GetObject(); SbxDimArray* pArr = dynamic_cast<SbxDimArray*>( pParObj ); if( pArr ) { sal_Int32 nLower, nUpper; - short nDim = (nParCount == 3) ? static_cast<short>(rPar.Get(2)->GetInteger()) : 1; + short nDim = (nParCount == 3) ? static_cast<short>(rPar.Get32(2)->GetInteger()) : 1; if( !pArr->GetDim32( nDim, nLower, nUpper ) ) StarBASIC::Error( ERRCODE_BASIC_OUT_OF_RANGE ); else - rPar.Get(0)->PutLong( nUpper ); + rPar.Get32(0)->PutLong( nUpper ); } else StarBASIC::Error( ERRCODE_BASIC_MUST_HAVE_DIMS ); @@ -4048,15 +4048,15 @@ void SbRtl_UBound(StarBASIC *, SbxArray & rPar, bool) void SbRtl_RGB(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 4 ) + if ( rPar.Count32() != 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_Int32 nRed = rPar.Get(1)->GetInteger() & 0xFF; - sal_Int32 nGreen = rPar.Get(2)->GetInteger() & 0xFF; - sal_Int32 nBlue = rPar.Get(3)->GetInteger() & 0xFF; + sal_Int32 nRed = rPar.Get32(1)->GetInteger() & 0xFF; + sal_Int32 nGreen = rPar.Get32(2)->GetInteger() & 0xFF; + sal_Int32 nBlue = rPar.Get32(3)->GetInteger() & 0xFF; sal_Int32 nRGB; SbiInstance* pInst = GetSbData()->pInst; @@ -4069,7 +4069,7 @@ void SbRtl_RGB(StarBASIC *, SbxArray & rPar, bool) { nRGB = (nRed << 16) | (nGreen << 8) | nBlue; } - rPar.Get(0)->PutLong( nRGB ); + rPar.Get32(0)->PutLong( nRGB ); } void SbRtl_QBColor(StarBASIC *, SbxArray & rPar, bool) @@ -4094,34 +4094,34 @@ void SbRtl_QBColor(StarBASIC *, SbxArray & rPar, bool) 0xFFFFFF, }; - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_Int16 nCol = rPar.Get(1)->GetInteger(); + sal_Int16 nCol = rPar.Get32(1)->GetInteger(); if( nCol < 0 || nCol > 15 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } sal_Int32 nRGB = pRGB[ nCol ]; - rPar.Get(0)->PutLong( nRGB ); + rPar.Get32(0)->PutLong( nRGB ); } // StrConv(string, conversion, LCID) void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool) { - std::size_t nArgCount = rPar.Count()-1; + const sal_uInt32 nArgCount = rPar.Count32()-1; if( nArgCount < 2 || nArgCount > 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - OUString aOldStr = rPar.Get(1)->GetOUString(); - sal_Int32 nConversion = rPar.Get(2)->GetLong(); + OUString aOldStr = rPar.Get32(1)->GetOUString(); + sal_Int32 nConversion = rPar.Get32(2)->GetLong(); LanguageType nLanguage = LANGUAGE_SYSTEM; @@ -4129,7 +4129,7 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool) if( nOldLen == 0 ) { // null string,return - rPar.Get(0)->PutString(aOldStr); + rPar.Get32(0)->PutString(aOldStr); return; } @@ -4192,7 +4192,7 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool) // there is no concept about default codepage in unix. so it is incorrectly in unix OUString aOUStr = OStringToOUString(aOStr, osl_getThreadTextEncoding()); - rPar.Get(0)->PutString( aOUStr ); + rPar.Get32(0)->PutString( aOUStr ); return; } else if ( (nConversion & 0x80) == 128 ) // vbFromUnicode @@ -4207,16 +4207,16 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool) { if( bIncIndex ) { - pArray->AddDim( 1, nArraySize ); + pArray->AddDim32( 1, nArraySize ); } else { - pArray->AddDim( 0, nArraySize-1 ); + pArray->AddDim32( 0, nArraySize-1 ); } } else { - pArray->unoAddDim( 0, -1 ); + pArray->unoAddDim32( 0, -1 ); } for( sal_Int32 i=0; i< nArraySize; i++) @@ -4225,16 +4225,16 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool) pNew->PutByte(*pChar); pChar++; pNew->SetFlag( SbxFlagBits::Write ); - short aIdx[1]; + sal_Int32 aIdx[1]; aIdx[0] = i; if( bIncIndex ) { ++aIdx[0]; } - pArray->Put(pNew, aIdx); + pArray->Put32(pNew, aIdx); } - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); @@ -4242,13 +4242,13 @@ void SbRtl_StrConv(StarBASIC *, SbxArray & rPar, bool) refVar->SetParameters( nullptr ); return; } - rPar.Get(0)->PutString(aNewStr); + rPar.Get32(0)->PutString(aNewStr); } void SbRtl_Beep(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 1 ) + if ( rPar.Count32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; @@ -4258,14 +4258,14 @@ void SbRtl_Beep(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Load(StarBASIC *, SbxArray & rPar, bool) { - if( rPar.Count() != 2 ) + if( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxBase* pObj = rPar.Get(1)->GetObject(); + SbxBase* pObj = rPar.Get32(1)->GetObject(); if ( pObj ) { if (SbUserFormModule* pModule = dynamic_cast<SbUserFormModule*>(pObj)) @@ -4285,15 +4285,15 @@ void SbRtl_Load(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Unload(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if( rPar.Count() != 2 ) + rPar.Get32(0)->PutEmpty(); + if( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxBase* pObj = rPar.Get(1)->GetObject(); + SbxBase* pObj = rPar.Get32(1)->GetObject(); if ( pObj ) { if (SbUserFormModule* pFormModule = dynamic_cast<SbUserFormModule*>(pObj)) @@ -4313,13 +4313,13 @@ void SbRtl_Unload(StarBASIC *, SbxArray & rPar, bool) void SbRtl_LoadPicture(StarBASIC *, SbxArray & rPar, bool) { - if( rPar.Count() != 2 ) + if( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - OUString aFileURL = getFullPath( rPar.Get(1)->GetOUString() ); + OUString aFileURL = getFullPath( rPar.Get32(1)->GetOUString() ); std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aFileURL, StreamMode::READ )); if( pStream ) { @@ -4329,23 +4329,23 @@ void SbRtl_LoadPicture(StarBASIC *, SbxArray & rPar, bool) SbxObjectRef xRef = new SbStdPicture; static_cast<SbStdPicture*>(xRef.get())->SetGraphic( aGraphic ); - rPar.Get(0)->PutObject( xRef.get() ); + rPar.Get32(0)->PutObject( xRef.get() ); } } void SbRtl_SavePicture(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if( rPar.Count() != 3 ) + rPar.Get32(0)->PutEmpty(); + if( rPar.Count32() != 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxBase* pObj = rPar.Get(1)->GetObject(); + SbxBase* pObj = rPar.Get32(1)->GetObject(); if (SbStdPicture *pPicture = dynamic_cast<SbStdPicture*>(pObj)) { - SvFileStream aOStream( rPar.Get(2)->GetOUString(), StreamMode::WRITE | StreamMode::TRUNC ); + SvFileStream aOStream( rPar.Get32(2)->GetOUString(), StreamMode::WRITE | StreamMode::TRUNC ); const Graphic& aGraphic = pPicture->GetGraphic(); WriteGraphic( aOStream, aGraphic ); } @@ -4353,7 +4353,7 @@ void SbRtl_SavePicture(StarBASIC *, SbxArray & rPar, bool) void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count(); + const sal_uInt32 nArgCount = rPar.Count32(); if( nArgCount < 2 || nArgCount > 6 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -4361,7 +4361,7 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool) } WinBits nType = 0; // MB_OK if( nArgCount >= 3 ) - nType = static_cast<WinBits>(rPar.Get(2)->GetInteger()); + nType = static_cast<WinBits>(rPar.Get32(2)->GetInteger()); WinBits nStyle = nType; nStyle &= 15; // delete bits 4-16 if (nStyle > 5) @@ -4378,11 +4378,11 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool) No = 7 }; - OUString aMsg = rPar.Get(1)->GetOUString(); + OUString aMsg = rPar.Get32(1)->GetOUString(); OUString aTitle; if( nArgCount >= 4 ) { - aTitle = rPar.Get(3)->GetOUString(); + aTitle = rPar.Get32(3)->GetOUString(); } else { @@ -4481,16 +4481,16 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool) xBox->set_title(aTitle); sal_Int16 nRet = xBox->run(); - rPar.Get(0)->PutInteger(nRet); + rPar.Get32(0)->PutInteger(nRet); } void SbRtl_SetAttr(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if ( rPar.Count() == 3 ) + rPar.Get32(0)->PutEmpty(); + if ( rPar.Count32() == 3 ) { - OUString aStr = rPar.Get(1)->GetOUString(); - SbAttributes nFlags = static_cast<SbAttributes>( rPar.Get(2)->GetInteger() ); + OUString aStr = rPar.Get32(1)->GetOUString(); + SbAttributes nFlags = static_cast<SbAttributes>( rPar.Get32(2)->GetInteger() ); if( hasUno() ) { @@ -4528,7 +4528,7 @@ void SbRtl_Reset(StarBASIC *, SbxArray &, bool) void SbRtl_DumpAllObjects(StarBASIC * pBasic, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count(); + const sal_uInt32 nArgCount = rPar.Count32(); if( nArgCount < 2 || nArgCount > 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -4544,9 +4544,9 @@ void SbRtl_DumpAllObjects(StarBASIC * pBasic, SbxArray & rPar, bool) { p = p->GetParent(); } - SvFileStream aStrm( rPar.Get( 1 )->GetOUString(), + SvFileStream aStrm( rPar.Get32(1)->GetOUString(), StreamMode::WRITE | StreamMode::TRUNC ); - p->Dump( aStrm, rPar.Get( 2 )->GetBool() ); + p->Dump( aStrm, rPar.Get32(2)->GetBool() ); aStrm.Close(); if( aStrm.GetError() != ERRCODE_NONE ) { @@ -4558,9 +4558,9 @@ void SbRtl_DumpAllObjects(StarBASIC * pBasic, SbxArray & rPar, bool) void SbRtl_FileExists(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - OUString aStr = rPar.Get(1)->GetOUString(); + OUString aStr = rPar.Get32(1)->GetOUString(); bool bExists = false; if( hasUno() ) @@ -4584,7 +4584,7 @@ void SbRtl_FileExists(StarBASIC *, SbxArray & rPar, bool) FileBase::RC nRet = DirectoryItem::get( getFullPath( aStr ), aItem ); bExists = (nRet == FileBase::E_None); } - rPar.Get(0)->PutBool( bExists ); + rPar.Get32(0)->PutBool( bExists ); } else { @@ -4594,16 +4594,16 @@ void SbRtl_FileExists(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Partition(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 5 ) + if ( rPar.Count32() != 5 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_Int32 nNumber = rPar.Get(1)->GetLong(); - sal_Int32 nStart = rPar.Get(2)->GetLong(); - sal_Int32 nStop = rPar.Get(3)->GetLong(); - sal_Int32 nInterval = rPar.Get(4)->GetLong(); + sal_Int32 nNumber = rPar.Get32(1)->GetLong(); + sal_Int32 nStart = rPar.Get32(2)->GetLong(); + sal_Int32 nStop = rPar.Get32(3)->GetLong(); + sal_Int32 nInterval = rPar.Get32(4)->GetLong(); if( nStart < 0 || nStop <= nStart || nInterval < 1 ) { @@ -4669,7 +4669,7 @@ void SbRtl_Partition(StarBASIC *, SbxArray & rPar, bool) } } aRetStr.append( aUpperValue ); - rPar.Get(0)->PutString( aRetStr.makeStringAndClear()); + rPar.Get32(0)->PutString( aRetStr.makeStringAndClear()); } #endif diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index ad782bc8ef38..75f273042a60 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -103,7 +103,7 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool) const sal_Int16 vbSet = 8; // At least 3 parameter needed plus function itself -> 4 - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if ( nParCount < 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -111,7 +111,7 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool) } // 1. parameter is object - SbxBase* pObjVar = rPar.Get(1)->GetObject(); + SbxBase* pObjVar = rPar.Get32(1)->GetObject(); SbxObject* pObj = nullptr; if( pObjVar ) pObj = dynamic_cast<SbxObject*>( pObjVar ); @@ -127,10 +127,10 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool) } // 2. parameter is ProcedureName - OUString aNameStr = rPar.Get(2)->GetOUString(); + OUString aNameStr = rPar.Get32(2)->GetOUString(); // 3. parameter is CallType - sal_Int16 nCallType = rPar.Get(3)->GetInteger(); + sal_Int16 nCallType = rPar.Get32(3)->GetInteger(); //SbxObject* pFindObj = NULL; SbxVariable* pFindVar = pObj->Find( aNameStr, SbxClassType::DontCare ); @@ -148,7 +148,7 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool) aVals.eType = SbxVARIANT; pFindVar->Get( aVals ); - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); refVar->Put( aVals ); } break; @@ -160,7 +160,7 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxVariableRef pValVar = rPar.Get(4); + SbxVariableRef pValVar = rPar.Get32(4); if( nCallType == vbLet ) { SbxValues aVals; @@ -191,19 +191,19 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool) // Setup parameters SbxArrayRef xArray; - sal_uInt16 nMethParamCount = nParCount - 4; + sal_uInt32 nMethParamCount = nParCount - 4; if( nMethParamCount > 0 ) { xArray = new SbxArray; - for( sal_uInt16 i = 0 ; i < nMethParamCount ; i++ ) + for( sal_uInt32 i = 0 ; i < nMethParamCount ; i++ ) { - SbxVariable* pPar = rPar.Get( i + 4 ); - xArray->Put( pPar, i + 1 ); + SbxVariable* pPar = rPar.Get32( i + 4 ); + xArray->Put32( pPar, i + 1 ); } } // Call method - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); if( xArray.is() ) pMeth->SetParameters( xArray.get() ); pMeth->Call( refVar.get() ); @@ -218,46 +218,46 @@ void SbRtl_CallByName(StarBASIC *, SbxArray & rPar, bool) void SbRtl_CBool(StarBASIC *, SbxArray & rPar, bool) // JSM { bool bVal = false; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); bVal = pSbxVariable->GetBool(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutBool(bVal); + rPar.Get32(0)->PutBool(bVal); } void SbRtl_CByte(StarBASIC *, SbxArray & rPar, bool) // JSM { sal_uInt8 nByte = 0; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); nByte = pSbxVariable->GetByte(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutByte(nByte); + rPar.Get32(0)->PutByte(nByte); } void SbRtl_CCur(StarBASIC *, SbxArray & rPar, bool) { sal_Int64 nCur = 0; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); nCur = pSbxVariable->GetCurrency(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutCurrency( nCur ); + rPar.Get32(0)->PutCurrency( nCur ); } void SbRtl_CDec(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) @@ -267,18 +267,18 @@ void SbRtl_CDec(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) #ifdef _WIN32 SbxDecimal* pDec = nullptr; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); pDec = pSbxVariable->GetDecimal(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutDecimal( pDec ); + rPar.Get32(0)->PutDecimal( pDec ); #else - rPar.Get(0)->PutEmpty(); + rPar.Get32(0)->PutEmpty(); StarBASIC::Error(ERRCODE_BASIC_NOT_IMPLEMENTED); #endif } @@ -286,24 +286,24 @@ void SbRtl_CDec(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) void SbRtl_CDate(StarBASIC *, SbxArray & rPar, bool) // JSM { double nVal = 0.0; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); nVal = pSbxVariable->GetDate(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutDate(nVal); + rPar.Get32(0)->PutDate(nVal); } void SbRtl_CDbl(StarBASIC *, SbxArray & rPar, bool) // JSM { double nVal = 0.0; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); if( pSbxVariable->GetType() == SbxSTRING ) { // #41690 @@ -324,45 +324,45 @@ void SbRtl_CDbl(StarBASIC *, SbxArray & rPar, bool) // JSM StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutDouble(nVal); + rPar.Get32(0)->PutDouble(nVal); } void SbRtl_CInt(StarBASIC *, SbxArray & rPar, bool) // JSM { sal_Int16 nVal = 0; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); nVal = pSbxVariable->GetInteger(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutInteger(nVal); + rPar.Get32(0)->PutInteger(nVal); } void SbRtl_CLng(StarBASIC *, SbxArray & rPar, bool) // JSM { sal_Int32 nVal = 0; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); nVal = pSbxVariable->GetLong(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutLong(nVal); + rPar.Get32(0)->PutLong(nVal); } void SbRtl_CSng(StarBASIC *, SbxArray & rPar, bool) // JSM { float nVal = float(0.0); - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); if( pSbxVariable->GetType() == SbxSTRING ) { // #41690 @@ -384,65 +384,65 @@ void SbRtl_CSng(StarBASIC *, SbxArray & rPar, bool) // JSM { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutSingle(nVal); + rPar.Get32(0)->PutSingle(nVal); } void SbRtl_CStr(StarBASIC *, SbxArray & rPar, bool) // JSM { OUString aString; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); aString = pSbxVariable->GetOUString(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutString(aString); + rPar.Get32(0)->PutString(aString); } void SbRtl_CVar(StarBASIC *, SbxArray & rPar, bool) // JSM { SbxValues aVals( SbxVARIANT ); - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); pSbxVariable->Get( aVals ); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->Put( aVals ); + rPar.Get32(0)->Put( aVals ); } void SbRtl_CVErr(StarBASIC *, SbxArray & rPar, bool) { sal_Int16 nErrCode = 0; - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); nErrCode = pSbxVariable->GetInteger(); } else { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - rPar.Get(0)->PutErr( nErrCode ); + rPar.Get32(0)->PutErr( nErrCode ); } void SbRtl_Iif(StarBASIC *, SbxArray & rPar, bool) // JSM { - if ( rPar.Count() == 4 ) + if ( rPar.Count32() == 4 ) { - if (rPar.Get(1)->GetBool()) + if (rPar.Get32(1)->GetBool()) { - *rPar.Get(0) = *rPar.Get(2); + *rPar.Get32(0) = *rPar.Get32(2); } else { - *rPar.Get(0) = *rPar.Get(3); + *rPar.Get32(0) = *rPar.Get32(3); } } else @@ -453,14 +453,14 @@ void SbRtl_Iif(StarBASIC *, SbxArray & rPar, bool) // JSM void SbRtl_GetSystemType(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 1 ) + if ( rPar.Count32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { // Removed for SRC595 - rPar.Get(0)->PutInteger( -1 ); + rPar.Get32(0)->PutInteger( -1 ); } } @@ -469,7 +469,7 @@ void SbRtl_GetGUIType(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) (void)pBasic; (void)bWrite; - if ( rPar.Count() != 1 ) + if ( rPar.Count32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } @@ -477,86 +477,86 @@ void SbRtl_GetGUIType(StarBASIC * pBasic, SbxArray & rPar, bool bWrite) { // 17.7.2000 Make simple solution for testtool / fat office #if defined(_WIN32) - rPar.Get(0)->PutInteger( 1 ); + rPar.Get32(0)->PutInteger( 1 ); #elif defined(UNX) - rPar.Get(0)->PutInteger( 4 ); + rPar.Get32(0)->PutInteger( 4 ); #else - rPar.Get(0)->PutInteger( -1 ); + rPar.Get32(0)->PutInteger( -1 ); #endif } } void SbRtl_Red(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int32 nRGB = rPar.Get(1)->GetLong(); + sal_Int32 nRGB = rPar.Get32(1)->GetLong(); nRGB &= 0x00FF0000; nRGB >>= 16; - rPar.Get(0)->PutInteger( static_cast<sal_Int16>(nRGB) ); + rPar.Get32(0)->PutInteger( static_cast<sal_Int16>(nRGB) ); } } void SbRtl_Green(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int32 nRGB = rPar.Get(1)->GetLong(); + sal_Int32 nRGB = rPar.Get32(1)->GetLong(); nRGB &= 0x0000FF00; nRGB >>= 8; - rPar.Get(0)->PutInteger( static_cast<sal_Int16>(nRGB) ); + rPar.Get32(0)->PutInteger( static_cast<sal_Int16>(nRGB) ); } } void SbRtl_Blue(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - sal_Int32 nRGB = rPar.Get(1)->GetLong(); + sal_Int32 nRGB = rPar.Get32(1)->GetLong(); nRGB &= 0x000000FF; - rPar.Get(0)->PutInteger( static_cast<sal_Int16>(nRGB) ); + rPar.Get32(0)->PutInteger( static_cast<sal_Int16>(nRGB) ); } } void SbRtl_Switch(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nCount = rPar.Count(); + sal_uInt32 nCount = rPar.Count32(); if( !(nCount & 0x0001 )) { // number of arguments must be odd StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - sal_uInt16 nCurExpr = 1; + sal_uInt32 nCurExpr = 1; while( nCurExpr < (nCount-1) ) { - if( rPar.Get( nCurExpr )->GetBool()) + if( rPar.Get32( nCurExpr )->GetBool()) { - (*rPar.Get(0)) = *(rPar.Get(nCurExpr+1)); + (*rPar.Get32(0)) = *(rPar.Get32(nCurExpr+1)); return; } nCurExpr += 2; } - rPar.Get(0)->PutNull(); + rPar.Get32(0)->PutNull(); } //i#64882# Common wait impl for existing Wait and new WaitUntil // rtl functions void Wait_Impl( bool bDurationBased, SbxArray& rPar ) { - if( rPar.Count() != 2 ) + if( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; @@ -564,14 +564,14 @@ void Wait_Impl( bool bDurationBased, SbxArray& rPar ) long nWait = 0; if ( bDurationBased ) { - double dWait = rPar.Get(1)->GetDouble(); + double dWait = rPar.Get32(1)->GetDouble(); double dNow = Now_Impl(); double dSecs = ( dWait - dNow ) * 24.0 * 3600.0; nWait = static_cast<long>( dSecs * 1000 ); // wait in thousands of sec } else { - nWait = rPar.Get(1)->GetLong(); + nWait = rPar.Get32(1)->GetLong(); } if( nWait < 0 ) { @@ -607,57 +607,57 @@ void SbRtl_DoEvents(StarBASIC *, SbxArray & rPar, bool) // we already process application events etc. in between // basic runtime pcode ( on a timed basis ) // always return 0 - rPar.Get(0)->PutInteger( 0 ); + rPar.Get32(0)->PutInteger( 0 ); Application::Reschedule( true ); } void SbRtl_GetGUIVersion(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 1 ) + if ( rPar.Count32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { // Removed for SRC595 - rPar.Get(0)->PutLong( -1 ); + rPar.Get32(0)->PutLong( -1 ); } } void SbRtl_Choose(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - sal_Int16 nIndex = rPar.Get(1)->GetInteger(); - sal_uInt16 nCount = rPar.Count(); + sal_Int16 nIndex = rPar.Get32(1)->GetInteger(); + sal_uInt32 nCount = rPar.Count32(); nCount--; - if( nCount == 1 || nIndex > (nCount-1) || nIndex < 1 ) + if( nCount == 1 || nIndex > sal::static_int_cast<sal_Int16>(nCount-1) || nIndex < 1 ) { - rPar.Get(0)->PutNull(); + rPar.Get32(0)->PutNull(); return; } - (*rPar.Get(0)) = *(rPar.Get(nIndex+1)); + (*rPar.Get32(0)) = *(rPar.Get32(nIndex+1)); } void SbRtl_Trim(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - OUString aStr(comphelper::string::strip(rPar.Get(1)->GetOUString(), ' ')); - rPar.Get(0)->PutString(aStr); + OUString aStr(comphelper::string::strip(rPar.Get32(1)->GetOUString(), ' ')); + rPar.Get32(0)->PutString(aStr); } } void SbRtl_GetSolarVersion(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutLong( LIBO_VERSION_MAJOR * 10000 + LIBO_VERSION_MINOR * 100 + LIBO_VERSION_MICRO * 1); + rPar.Get32(0)->PutLong( LIBO_VERSION_MAJOR * 10000 + LIBO_VERSION_MINOR * 100 + LIBO_VERSION_MICRO * 1); } void SbRtl_TwipsPerPixelX(StarBASIC *, SbxArray & rPar, bool) @@ -671,7 +671,7 @@ void SbRtl_TwipsPerPixelX(StarBASIC *, SbxArray & rPar, bool) aSize = pDevice->PixelToLogic( aSize, aMap ); nResult = aSize.Width() / 100; } - rPar.Get(0)->PutLong( nResult ); + rPar.Get32(0)->PutLong( nResult ); } void SbRtl_TwipsPerPixelY(StarBASIC *, SbxArray & rPar, bool) @@ -685,17 +685,17 @@ void SbRtl_TwipsPerPixelY(StarBASIC *, SbxArray & rPar, bool) aSize = pDevice->PixelToLogic( aSize, aMap ); nResult = aSize.Height() / 100; } - rPar.Get(0)->PutLong( nResult ); + rPar.Get32(0)->PutLong( nResult ); } void SbRtl_FreeLibrary(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } - GetSbData()->pInst->GetDllMgr()->FreeDll( rPar.Get(1)->GetOUString() ); + GetSbData()->pInst->GetDllMgr()->FreeDll( rPar.Get32(1)->GetOUString() ); } bool IsBaseIndexOne() { @@ -714,7 +714,7 @@ bool IsBaseIndexOne() void SbRtl_Array(StarBASIC *, SbxArray & rPar, bool) { SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); - sal_uInt16 nArraySize = rPar.Count() - 1; + sal_uInt32 nArraySize = rPar.Count32() - 1; // ignore Option Base so far (unfortunately only known by the compiler) bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); @@ -722,35 +722,35 @@ void SbRtl_Array(StarBASIC *, SbxArray & rPar, bool) { if ( bIncIndex ) { - pArray->AddDim( 1, nArraySize ); + pArray->AddDim32( 1, sal::static_int_cast<sal_Int32>(nArraySize) ); } else { - pArray->AddDim( 0, nArraySize-1 ); + pArray->AddDim32( 0, sal::static_int_cast<sal_Int32>(nArraySize) - 1 ); } } else { - pArray->unoAddDim( 0, -1 ); + pArray->unoAddDim32( 0, -1 ); } // insert parameters into the array - for( sal_uInt16 i = 0 ; i < nArraySize ; i++ ) + for( sal_uInt32 i = 0 ; i < nArraySize ; i++ ) { - SbxVariable* pVar = rPar.Get(i+1); + SbxVariable* pVar = rPar.Get32(i+1); SbxVariable* pNew = new SbxEnsureParentVariable(*pVar); pNew->SetFlag( SbxFlagBits::Write ); - short aIdx[1]; - aIdx[0] = static_cast< short >(i); + sal_Int32 aIdx[1]; + aIdx[0] = static_cast<sal_Int32>(i); if ( bIncIndex ) { ++aIdx[0]; } - pArray->Put(pNew, aIdx); + pArray->Put32(pNew, aIdx); } // return array - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); @@ -769,12 +769,12 @@ void SbRtl_Array(StarBASIC *, SbxArray & rPar, bool) void SbRtl_DimArray(StarBASIC *, SbxArray & rPar, bool) { SbxDimArray * pArray = new SbxDimArray( SbxVARIANT ); - sal_uInt16 nArrayDims = rPar.Count() - 1; + sal_uInt32 nArrayDims = rPar.Count32() - 1; if( nArrayDims > 0 ) { - for( sal_uInt16 i = 0; i < nArrayDims ; i++ ) + for( sal_uInt32 i = 0; i < nArrayDims ; i++ ) { - sal_Int32 ub = rPar.Get(i+1)->GetLong(); + sal_Int32 ub = rPar.Get32(i+1)->GetLong(); if( ub < 0 ) { StarBASIC::Error( ERRCODE_BASIC_OUT_OF_RANGE ); @@ -785,9 +785,9 @@ void SbRtl_DimArray(StarBASIC *, SbxArray & rPar, bool) } else { - pArray->unoAddDim( 0, -1 ); + pArray->unoAddDim32( 0, -1 ); } - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); @@ -821,13 +821,13 @@ void SbRtl_DimArray(StarBASIC *, SbxArray & rPar, bool) // 1st parameter = the object's name as string void SbRtl_FindObject(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 2 ) + if ( rPar.Count32() < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - OUString aNameStr = rPar.Get(1)->GetOUString(); + OUString aNameStr = rPar.Get32(1)->GetOUString(); SbxBase* pFind = StarBASIC::FindSBXInCurrentScope( aNameStr ); SbxObject* pFindObj = nullptr; @@ -835,7 +835,7 @@ void SbRtl_FindObject(StarBASIC *, SbxArray & rPar, bool) { pFindObj = dynamic_cast<SbxObject*>( pFind ); } - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); refVar->PutObject( pFindObj ); } @@ -844,13 +844,13 @@ void SbRtl_FindObject(StarBASIC *, SbxArray & rPar, bool) // 2nd parameter = the property's name as string void SbRtl_FindPropertyObject(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() < 3 ) + if ( rPar.Count32() < 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxBase* pObjVar = rPar.Get(1)->GetObject(); + SbxBase* pObjVar = rPar.Get32(1)->GetObject(); SbxObject* pObj = nullptr; if( pObjVar ) { @@ -862,7 +862,7 @@ void SbRtl_FindPropertyObject(StarBASIC *, SbxArray & rPar, bool) pObj = dynamic_cast<SbxObject*>( pObjVarObj ); } - OUString aNameStr = rPar.Get(2)->GetOUString(); + OUString aNameStr = rPar.Get32(2)->GetOUString(); SbxObject* pFindObj = nullptr; if( pObj ) @@ -875,7 +875,7 @@ void SbRtl_FindPropertyObject(StarBASIC *, SbxArray & rPar, bool) StarBASIC::Error( ERRCODE_BASIC_BAD_PARAMETER ); } - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); refVar->PutObject( pFindObj ); } @@ -1093,20 +1093,20 @@ static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, // nCurDim = 1...n static bool lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, - bool bBinary, short nCurDim, short* pOtherDims, bool bWrite ) + bool bBinary, sal_Int32 nCurDim, sal_Int32* pOtherDims, bool bWrite ) { SAL_WARN_IF( nCurDim <= 0,"basic", "Bad Dim"); - short nLower, nUpper; - if( !rArr.GetDim( nCurDim, nLower, nUpper ) ) + sal_Int32 nLower, nUpper; + if( !rArr.GetDim32( nCurDim, nLower, nUpper ) ) return false; - for( short nCur = nLower; nCur <= nUpper; nCur++ ) + for(sal_Int32 nCur = nLower; nCur <= nUpper; nCur++ ) { pOtherDims[ nCurDim-1 ] = nCur; if( nCurDim != 1 ) lcl_WriteReadSbxArray(rArr, pStrm, bBinary, nCurDim-1, pOtherDims, bWrite); else { - SbxVariable* pVar = rArr.Get( const_cast<const short*>(pOtherDims) ); + SbxVariable* pVar = rArr.Get32( pOtherDims ); bool bRet; if( bWrite ) bRet = lcl_WriteSbxVariable(*pVar, pStrm, bBinary, 0, true ); @@ -1121,13 +1121,13 @@ static bool lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, static void PutGet( SbxArray& rPar, bool bPut ) { - if ( rPar.Count() != 4 ) + if ( rPar.Count32() != 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_Int16 nFileNo = rPar.Get(1)->GetInteger(); - SbxVariable* pVar2 = rPar.Get(2); + sal_Int16 nFileNo = rPar.Get32(1)->GetInteger(); + SbxVariable* pVar2 = rPar.Get32(2); SbxDataType eType2 = pVar2->GetType(); bool bHasRecordNo = (eType2 != SbxEMPTY && eType2 != SbxERROR); long nRecordNo = pVar2->GetLong(); @@ -1164,7 +1164,7 @@ static void PutGet( SbxArray& rPar, bool bPut ) } SbxDimArray* pArr = nullptr; - SbxVariable* pVar = rPar.Get(3); + SbxVariable* pVar = rPar.Get32(3); if( pVar->GetType() & SbxARRAY ) { SbxBase* pParObj = pVar->GetObject(); @@ -1176,8 +1176,8 @@ static void PutGet( SbxArray& rPar, bool bPut ) if( pArr ) { sal_uInt64 const nFPos = pStrm->Tell(); - short nDims = pArr->GetDims(); - std::unique_ptr<short[]> pDims(new short[ nDims ]); + sal_Int32 nDims = pArr->GetDims32(); + std::unique_ptr<sal_Int32[]> pDims(new sal_Int32[ nDims ]); bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims.get(),bPut); pDims.reset(); if( nBlockLen ) @@ -1206,21 +1206,21 @@ void SbRtl_Get(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Environ(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } OUString aResult; // should be ANSI but that's not possible under Win16 in the DLL - OString aByteStr(OUStringToOString(rPar.Get(1)->GetOUString(), + OString aByteStr(OUStringToOString(rPar.Get32(1)->GetOUString(), osl_getThreadTextEncoding())); const char* pEnvStr = getenv(aByteStr.getStr()); if ( pEnvStr ) { aResult = OUString(pEnvStr, strlen(pEnvStr), osl_getThreadTextEncoding()); } - rPar.Get(0)->PutString( aResult ); + rPar.Get32(0)->PutString( aResult ); } static double GetDialogZoomFactor( bool bX, long nValue ) @@ -1255,60 +1255,60 @@ static double GetDialogZoomFactor( bool bX, long nValue ) void SbRtl_GetDialogZoomFactorX(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - rPar.Get(0)->PutDouble( GetDialogZoomFactor( true, rPar.Get(1)->GetLong() )); + rPar.Get32(0)->PutDouble( GetDialogZoomFactor( true, rPar.Get32(1)->GetLong() )); } void SbRtl_GetDialogZoomFactorY(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - rPar.Get(0)->PutDouble( GetDialogZoomFactor( false, rPar.Get(1)->GetLong())); + rPar.Get32(0)->PutDouble( GetDialogZoomFactor( false, rPar.Get32(1)->GetLong())); } void SbRtl_EnableReschedule(StarBASIC *, SbxArray & rPar, bool) { - rPar.Get(0)->PutEmpty(); - if ( rPar.Count() != 2 ) + rPar.Get32(0)->PutEmpty(); + if ( rPar.Count32() != 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); if( GetSbData()->pInst ) - GetSbData()->pInst->EnableReschedule( rPar.Get(1)->GetBool() ); + GetSbData()->pInst->EnableReschedule( rPar.Get32(1)->GetBool() ); } void SbRtl_GetSystemTicks(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 1 ) + if ( rPar.Count32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - rPar.Get(0)->PutLong( tools::Time::GetSystemTicks() ); + rPar.Get32(0)->PutLong( tools::Time::GetSystemTicks() ); } void SbRtl_GetPathSeparator(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 1 ) + if ( rPar.Count32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - rPar.Get(0)->PutString( OUString( SAL_PATHDELIMITER ) ); + rPar.Get32(0)->PutString( OUString( SAL_PATHDELIMITER ) ); } void SbRtl_ResolvePath(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - OUString aStr = rPar.Get(1)->GetOUString(); - rPar.Get(0)->PutString( aStr ); + OUString aStr = rPar.Get32(1)->GetOUString(); + rPar.Get32(0)->PutString( aStr ); } else { @@ -1318,13 +1318,13 @@ void SbRtl_ResolvePath(StarBASIC *, SbxArray & rPar, bool) void SbRtl_TypeLen(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - SbxDataType eType = rPar.Get(1)->GetType(); + SbxDataType eType = rPar.Get32(1)->GetType(); sal_Int16 nLen = 0; switch( eType ) { @@ -1380,14 +1380,14 @@ void SbRtl_TypeLen(StarBASIC *, SbxArray & rPar, bool) case SbxLPWSTR: case SbxCoreSTRING: case SbxSTRING: - nLen = static_cast<sal_Int16>(rPar.Get(1)->GetOUString().getLength()); + nLen = static_cast<sal_Int16>(rPar.Get32(1)->GetOUString().getLength()); break; default: nLen = 0; break; } - rPar.Get(0)->PutInteger( nLen ); + rPar.Get32(0)->PutInteger( nLen ); } } @@ -1462,16 +1462,16 @@ void SbRtl_GlobalScope(StarBASIC * pBasic, SbxArray & rPar, bool) { p = p->GetParent(); } - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); refVar->PutObject( p ); } // Helper functions to convert Url from/to system paths void SbRtl_ConvertToUrl(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - OUString aStr = rPar.Get(1)->GetOUString(); + OUString aStr = rPar.Get32(1)->GetOUString(); INetURLObject aURLObj( aStr, INetProtocol::File ); OUString aFileURL = aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); if( aFileURL.isEmpty() ) @@ -1482,7 +1482,7 @@ void SbRtl_ConvertToUrl(StarBASIC *, SbxArray & rPar, bool) { aFileURL = aStr; } - rPar.Get(0)->PutString(aFileURL); + rPar.Get32(0)->PutString(aFileURL); } else { @@ -1492,16 +1492,16 @@ void SbRtl_ConvertToUrl(StarBASIC *, SbxArray & rPar, bool) void SbRtl_ConvertFromUrl(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() == 2 ) + if ( rPar.Count32() == 2 ) { - OUString aStr = rPar.Get(1)->GetOUString(); + OUString aStr = rPar.Get32(1)->GetOUString(); OUString aSysPath; ::osl::File::getSystemPathFromFileURL( aStr, aSysPath ); if( aSysPath.isEmpty() ) { aSysPath = aStr; } - rPar.Get(0)->PutString(aSysPath); + rPar.Get32(0)->PutString(aSysPath); } else { @@ -1518,17 +1518,17 @@ void SbRtl_GetDefaultContext(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Join(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if ( nParCount != 3 && nParCount != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxBase* pParObj = rPar.Get(1)->GetObject(); + SbxBase* pParObj = rPar.Get32(1)->GetObject(); SbxDimArray* pArr = dynamic_cast<SbxDimArray*>( pParObj ); if( pArr ) { - if( pArr->GetDims() != 1 ) + if( pArr->GetDims32() != 1 ) { StarBASIC::Error( ERRCODE_BASIC_WRONG_DIMS ); // Syntax Error?! return; @@ -1536,26 +1536,26 @@ void SbRtl_Join(StarBASIC *, SbxArray & rPar, bool) OUString aDelim; if( nParCount == 3 ) { - aDelim = rPar.Get(2)->GetOUString(); + aDelim = rPar.Get32(2)->GetOUString(); } else { aDelim = " "; } OUStringBuffer aRetStr(32); - short nLower, nUpper; - pArr->GetDim( 1, nLower, nUpper ); - short aIdx[1]; + sal_Int32 nLower, nUpper; + pArr->GetDim32( 1, nLower, nUpper ); + sal_Int32 aIdx[1]; for (aIdx[0] = nLower; aIdx[0] <= nUpper; ++aIdx[0]) { - OUString aStr = pArr->Get(aIdx)->GetOUString(); + OUString aStr = pArr->Get32(aIdx)->GetOUString(); aRetStr.append(aStr); if (aIdx[0] != nUpper) { aRetStr.append(aDelim); } } - rPar.Get(0)->PutString( aRetStr.makeStringAndClear() ); + rPar.Get32(0)->PutString( aRetStr.makeStringAndClear() ); } else { @@ -1566,22 +1566,22 @@ void SbRtl_Join(StarBASIC *, SbxArray & rPar, bool) void SbRtl_Split(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if ( nParCount < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - OUString aExpression = rPar.Get(1)->GetOUString(); - short nArraySize = 0; + OUString aExpression = rPar.Get32(1)->GetOUString(); + sal_Int32 nArraySize = 0; std::vector< OUString > vRet; if( !aExpression.isEmpty() ) { OUString aDelim; if( nParCount >= 3 ) { - aDelim = rPar.Get(2)->GetOUString(); + aDelim = rPar.Get32(2)->GetOUString(); } else { @@ -1591,7 +1591,7 @@ void SbRtl_Split(StarBASIC *, SbxArray & rPar, bool) sal_Int32 nCount = -1; if( nParCount == 4 ) { - nCount = rPar.Get(3)->GetLong(); + nCount = rPar.Get32(3)->GetLong(); } sal_Int32 nDelimLen = aDelim.getLength(); if( nDelimLen ) @@ -1634,18 +1634,18 @@ void SbRtl_Split(StarBASIC *, SbxArray & rPar, bool) } SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); - pArray->unoAddDim( 0, nArraySize-1 ); + pArray->unoAddDim32( 0, nArraySize-1 ); // insert parameter(s) into the array - for( short i = 0 ; i < nArraySize ; i++ ) + for(sal_Int32 i = 0 ; i < nArraySize ; i++ ) { SbxVariableRef xVar = new SbxVariable( SbxVARIANT ); xVar->PutString( vRet[i] ); - pArray->Put( xVar.get(), &i ); + pArray->Put32( xVar.get(), &i ); } // return array - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SbxFlagBits::Fixed ); refVar->PutObject( pArray ); @@ -1656,7 +1656,7 @@ void SbRtl_Split(StarBASIC *, SbxArray & rPar, bool) // MonthName(month[, abbreviate]) void SbRtl_MonthName(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount != 2 && nParCount != 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1672,7 +1672,7 @@ void SbRtl_MonthName(StarBASIC *, SbxArray & rPar, bool) Sequence< CalendarItem2 > aMonthSeq = xCalendar->getMonths2(); sal_Int32 nMonthCount = aMonthSeq.getLength(); - sal_Int16 nVal = rPar.Get(1)->GetInteger(); + sal_Int16 nVal = rPar.Get32(1)->GetInteger(); if( nVal < 1 || nVal > nMonthCount ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1681,19 +1681,19 @@ void SbRtl_MonthName(StarBASIC *, SbxArray & rPar, bool) bool bAbbreviate = false; if( nParCount == 3 ) - bAbbreviate = rPar.Get(2)->GetBool(); + bAbbreviate = rPar.Get32(2)->GetBool(); const CalendarItem2* pCalendarItems = aMonthSeq.getConstArray(); const CalendarItem2& rItem = pCalendarItems[nVal - 1]; OUString aRetStr = ( bAbbreviate ? rItem.AbbrevName : rItem.FullName ); - rPar.Get(0)->PutString(aRetStr); + rPar.Get32(0)->PutString(aRetStr); } // WeekdayName(weekday, abbreviate, firstdayofweek) void SbRtl_WeekdayName(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount < 2 || nParCount > 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1709,11 +1709,11 @@ void SbRtl_WeekdayName(StarBASIC *, SbxArray & rPar, bool) Sequence< CalendarItem2 > aDaySeq = xCalendar->getDays2(); sal_Int16 nDayCount = static_cast<sal_Int16>(aDaySeq.getLength()); - sal_Int16 nDay = rPar.Get(1)->GetInteger(); + sal_Int16 nDay = rPar.Get32(1)->GetInteger(); sal_Int16 nFirstDay = 0; if( nParCount == 4 ) { - nFirstDay = rPar.Get(3)->GetInteger(); + nFirstDay = rPar.Get32(3)->GetInteger(); if( nFirstDay < 0 || nFirstDay > 7 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1734,7 +1734,7 @@ void SbRtl_WeekdayName(StarBASIC *, SbxArray & rPar, bool) bool bAbbreviate = false; if( nParCount >= 3 ) { - SbxVariable* pPar2 = rPar.Get(2); + SbxVariable* pPar2 = rPar.Get32(2); if( !pPar2->IsErr() ) { bAbbreviate = pPar2->GetBool(); @@ -1745,29 +1745,29 @@ void SbRtl_WeekdayName(StarBASIC *, SbxArray & rPar, bool) const CalendarItem2& rItem = pCalendarItems[nDay - 1]; OUString aRetStr = ( bAbbreviate ? rItem.AbbrevName : rItem.FullName ); - rPar.Get(0)->PutString( aRetStr ); + rPar.Get32(0)->PutString( aRetStr ); } void SbRtl_Weekday(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if ( nParCount < 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); } else { - double aDate = rPar.Get(1)->GetDate(); + double aDate = rPar.Get32(1)->GetDate(); bool bFirstDay = false; sal_Int16 nFirstDay = 0; if ( nParCount > 2 ) { - nFirstDay = rPar.Get(2)->GetInteger(); + nFirstDay = rPar.Get32(2)->GetInteger(); bFirstDay = true; } sal_Int16 nDay = implGetWeekDay( aDate, bFirstDay, nFirstDay ); - rPar.Get(0)->PutInteger( nDay ); + rPar.Get32(0)->PutInteger( nDay ); } } @@ -1854,14 +1854,14 @@ static sal_Int16 limitDate( sal_Int32 n32Year, sal_Int16& rMonth, sal_Int16& rDa void SbRtl_DateAdd(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount != 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - OUString aStringCode = rPar.Get(1)->GetOUString(); + OUString aStringCode = rPar.Get32(1)->GetOUString(); IntervalInfo const * pInfo = getIntervalInfo( aStringCode ); if( !pInfo ) { @@ -1869,8 +1869,8 @@ void SbRtl_DateAdd(StarBASIC *, SbxArray & rPar, bool) return; } - sal_Int32 lNumber = rPar.Get(2)->GetLong(); - double dDate = rPar.Get(3)->GetDate(); + sal_Int32 lNumber = rPar.Get32(2)->GetLong(); + double dDate = rPar.Get32(3)->GetDate(); double dNewDate = 0; if( pInfo->mbSimple ) { @@ -1949,7 +1949,7 @@ void SbRtl_DateAdd(StarBASIC *, SbxArray & rPar, bool) dNewDate += dHoursMinutesSeconds; } - rPar.Get(0)->PutDate( dNewDate ); + rPar.Get32(0)->PutDate( dNewDate ); } static double RoundImpl( double d ) @@ -1961,14 +1961,14 @@ void SbRtl_DateDiff(StarBASIC *, SbxArray & rPar, bool) { // DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount < 4 || nParCount > 6 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - OUString aStringCode = rPar.Get(1)->GetOUString(); + OUString aStringCode = rPar.Get32(1)->GetOUString(); IntervalInfo const * pInfo = getIntervalInfo( aStringCode ); if( !pInfo ) { @@ -1976,8 +1976,8 @@ void SbRtl_DateDiff(StarBASIC *, SbxArray & rPar, bool) return; } - double dDate1 = rPar.Get(2)->GetDate(); - double dDate2 = rPar.Get(3)->GetDate(); + double dDate1 = rPar.Get32(2)->GetDate(); + double dDate2 = rPar.Get32(3)->GetDate(); double dRet = 0.0; switch( pInfo->meInterval ) @@ -2029,7 +2029,7 @@ void SbRtl_DateDiff(StarBASIC *, SbxArray & rPar, bool) sal_Int16 nFirstDay = 1; // Default if( nParCount >= 5 ) { - nFirstDay = rPar.Get(4)->GetInteger(); + nFirstDay = rPar.Get32(4)->GetInteger(); if( nFirstDay < 0 || nFirstDay > 7 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -2079,7 +2079,7 @@ void SbRtl_DateDiff(StarBASIC *, SbxArray & rPar, bool) break; } } - rPar.Get(0)->PutDouble( dRet ); + rPar.Get32(0)->PutDouble( dRet ); } static double implGetDateOfFirstDayInFirstWeek @@ -2152,14 +2152,14 @@ void SbRtl_DatePart(StarBASIC *, SbxArray & rPar, bool) { // DatePart(interval, date[,firstdayofweek[, firstweekofyear]]) - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount < 3 || nParCount > 5 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - OUString aStringCode = rPar.Get(1)->GetOUString(); + OUString aStringCode = rPar.Get32(1)->GetOUString(); IntervalInfo const * pInfo = getIntervalInfo( aStringCode ); if( !pInfo ) { @@ -2167,7 +2167,7 @@ void SbRtl_DatePart(StarBASIC *, SbxArray & rPar, bool) return; } - double dDate = rPar.Get(2)->GetDate(); + double dDate = rPar.Get32(2)->GetDate(); sal_Int32 nRet = 0; switch( pInfo->meInterval ) @@ -2206,7 +2206,7 @@ void SbRtl_DatePart(StarBASIC *, SbxArray & rPar, bool) sal_Int16 nFirstDay = 1; // Default if( nParCount >= 4 ) { - nFirstDay = rPar.Get(3)->GetInteger(); + nFirstDay = rPar.Get32(3)->GetInteger(); bFirstDay = true; } nRet = implGetWeekDay( dDate, bFirstDay, nFirstDay ); @@ -2216,11 +2216,11 @@ void SbRtl_DatePart(StarBASIC *, SbxArray & rPar, bool) { sal_Int16 nFirstDay = 1; // Default if( nParCount >= 4 ) - nFirstDay = rPar.Get(3)->GetInteger(); + nFirstDay = rPar.Get32(3)->GetInteger(); sal_Int16 nFirstWeek = 1; // Default if( nParCount == 5 ) - nFirstWeek = rPar.Get(4)->GetInteger(); + nFirstWeek = rPar.Get32(4)->GetInteger(); sal_Int16 nYear = implGetDateYear( dDate ); bool bError = false; @@ -2262,24 +2262,24 @@ void SbRtl_DatePart(StarBASIC *, SbxArray & rPar, bool) break; } } - rPar.Get(0)->PutLong( nRet ); + rPar.Get32(0)->PutLong( nRet ); } // FormatDateTime(Date[,NamedFormat]) void SbRtl_FormatDateTime(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount < 2 || nParCount > 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - double dDate = rPar.Get(1)->GetDate(); + double dDate = rPar.Get32(1)->GetDate(); sal_Int16 nNamedFormat = 0; if( nParCount > 2 ) { - nNamedFormat = rPar.Get(2)->GetInteger(); + nNamedFormat = rPar.Get32(2)->GetInteger(); if( nNamedFormat < 0 || nNamedFormat > 4 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -2363,36 +2363,36 @@ void SbRtl_FormatDateTime(StarBASIC *, SbxArray & rPar, bool) break; } - rPar.Get(0)->PutString( aRetStr ); + rPar.Get32(0)->PutString( aRetStr ); } void SbRtl_Frac(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount != 2) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); double dVal = pSbxVariable->GetDouble(); if(dVal >= 0) - rPar.Get(0)->PutDouble(dVal - ::rtl::math::approxFloor(dVal)); + rPar.Get32(0)->PutDouble(dVal - ::rtl::math::approxFloor(dVal)); else - rPar.Get(0)->PutDouble(dVal - ::rtl::math::approxCeil(dVal)); + rPar.Get32(0)->PutDouble(dVal - ::rtl::math::approxCeil(dVal)); } void SbRtl_Round(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nParCount = rPar.Count(); + sal_uInt32 nParCount = rPar.Count32(); if( nParCount != 2 && nParCount != 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); double dVal = pSbxVariable->GetDouble(); double dRes = 0.0; if( dVal != 0.0 ) @@ -2407,7 +2407,7 @@ void SbRtl_Round(StarBASIC *, SbxArray & rPar, bool) sal_Int16 numdecimalplaces = 0; if( nParCount == 3 ) { - numdecimalplaces = rPar.Get(2)->GetInteger(); + numdecimalplaces = rPar.Get32(2)->GetInteger(); if( numdecimalplaces < 0 || numdecimalplaces > 22 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -2430,7 +2430,7 @@ void SbRtl_Round(StarBASIC *, SbxArray & rPar, bool) if( bNeg ) dRes = -dRes; } - rPar.Get(0)->PutDouble( dRes ); + rPar.Get32(0)->PutDouble( dRes ); } static void CallFunctionAccessFunction( const Sequence< Any >& aArgs, const OUString& sFuncName, SbxVariable* pRet ) @@ -2459,7 +2459,7 @@ static void CallFunctionAccessFunction( const Sequence< Any >& aArgs, const OUSt void SbRtl_SYD(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 4 ) { @@ -2470,17 +2470,17 @@ void SbRtl_SYD(StarBASIC *, SbxArray & rPar, bool) // retrieve non-optional params Sequence< Any > aParams( 4 ); - aParams[ 0 ] <<= rPar.Get(1)->GetDouble(); - aParams[ 1 ] <<= rPar.Get(2)->GetDouble(); - aParams[ 2 ] <<= rPar.Get(3)->GetDouble(); - aParams[ 3 ] <<= rPar.Get(4)->GetDouble(); + aParams[ 0 ] <<= rPar.Get32(1)->GetDouble(); + aParams[ 1 ] <<= rPar.Get32(2)->GetDouble(); + aParams[ 2 ] <<= rPar.Get32(3)->GetDouble(); + aParams[ 3 ] <<= rPar.Get32(4)->GetDouble(); - CallFunctionAccessFunction( aParams, "SYD", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "SYD", rPar.Get32( 0 ) ); } void SbRtl_SLN(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 ) { @@ -2491,16 +2491,16 @@ void SbRtl_SLN(StarBASIC *, SbxArray & rPar, bool) // retrieve non-optional params Sequence< Any > aParams( 3 ); - aParams[ 0 ] <<= rPar.Get(1)->GetDouble(); - aParams[ 1 ] <<= rPar.Get(2)->GetDouble(); - aParams[ 2 ] <<= rPar.Get(3)->GetDouble(); + aParams[ 0 ] <<= rPar.Get32(1)->GetDouble(); + aParams[ 1 ] <<= rPar.Get32(2)->GetDouble(); + aParams[ 2 ] <<= rPar.Get32(3)->GetDouble(); - CallFunctionAccessFunction( aParams, "SLN", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "SLN", rPar.Get32( 0 ) ); } void SbRtl_Pmt(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 || nArgCount > 5 ) { @@ -2509,9 +2509,9 @@ void SbRtl_Pmt(StarBASIC *, SbxArray & rPar, bool) } // retrieve non-optional params - double rate = rPar.Get(1)->GetDouble(); - double nper = rPar.Get(2)->GetDouble(); - double pmt = rPar.Get(3)->GetDouble(); + double rate = rPar.Get32(1)->GetDouble(); + double nper = rPar.Get32(2)->GetDouble(); + double pmt = rPar.Get32(3)->GetDouble(); // set default values for Optional args double fv = 0; @@ -2520,14 +2520,14 @@ void SbRtl_Pmt(StarBASIC *, SbxArray & rPar, bool) // fv if ( nArgCount >= 4 ) { - if( rPar.Get(4)->GetType() != SbxEMPTY ) - fv = rPar.Get(4)->GetDouble(); + if( rPar.Get32(4)->GetType() != SbxEMPTY ) + fv = rPar.Get32(4)->GetDouble(); } // type if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - type = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + type = rPar.Get32(5)->GetDouble(); } Sequence< Any > aParams( 5 ); @@ -2537,12 +2537,12 @@ void SbRtl_Pmt(StarBASIC *, SbxArray & rPar, bool) aParams[ 3 ] <<= fv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, "Pmt", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "Pmt", rPar.Get32( 0 ) ); } void SbRtl_PPmt(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 4 || nArgCount > 6 ) { @@ -2551,10 +2551,10 @@ void SbRtl_PPmt(StarBASIC *, SbxArray & rPar, bool) } // retrieve non-optional params - double rate = rPar.Get(1)->GetDouble(); - double per = rPar.Get(2)->GetDouble(); - double nper = rPar.Get(3)->GetDouble(); - double pv = rPar.Get(4)->GetDouble(); + double rate = rPar.Get32(1)->GetDouble(); + double per = rPar.Get32(2)->GetDouble(); + double nper = rPar.Get32(3)->GetDouble(); + double pv = rPar.Get32(4)->GetDouble(); // set default values for Optional args double fv = 0; @@ -2563,14 +2563,14 @@ void SbRtl_PPmt(StarBASIC *, SbxArray & rPar, bool) // fv if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - fv = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + fv = rPar.Get32(5)->GetDouble(); } // type if ( nArgCount >= 6 ) { - if( rPar.Get(6)->GetType() != SbxEMPTY ) - type = rPar.Get(6)->GetDouble(); + if( rPar.Get32(6)->GetType() != SbxEMPTY ) + type = rPar.Get32(6)->GetDouble(); } Sequence< Any > aParams( 6 ); @@ -2581,12 +2581,12 @@ void SbRtl_PPmt(StarBASIC *, SbxArray & rPar, bool) aParams[ 4 ] <<= fv; aParams[ 5 ] <<= type; - CallFunctionAccessFunction( aParams, "PPmt", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "PPmt", rPar.Get32( 0 ) ); } void SbRtl_PV(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 || nArgCount > 5 ) { @@ -2595,9 +2595,9 @@ void SbRtl_PV(StarBASIC *, SbxArray & rPar, bool) } // retrieve non-optional params - double rate = rPar.Get(1)->GetDouble(); - double nper = rPar.Get(2)->GetDouble(); - double pmt = rPar.Get(3)->GetDouble(); + double rate = rPar.Get32(1)->GetDouble(); + double nper = rPar.Get32(2)->GetDouble(); + double pmt = rPar.Get32(3)->GetDouble(); // set default values for Optional args double fv = 0; @@ -2606,14 +2606,14 @@ void SbRtl_PV(StarBASIC *, SbxArray & rPar, bool) // fv if ( nArgCount >= 4 ) { - if( rPar.Get(4)->GetType() != SbxEMPTY ) - fv = rPar.Get(4)->GetDouble(); + if( rPar.Get32(4)->GetType() != SbxEMPTY ) + fv = rPar.Get32(4)->GetDouble(); } // type if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - type = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + type = rPar.Get32(5)->GetDouble(); } Sequence< Any > aParams( 5 ); @@ -2623,12 +2623,12 @@ void SbRtl_PV(StarBASIC *, SbxArray & rPar, bool) aParams[ 3 ] <<= fv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, "PV", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "PV", rPar.Get32( 0 ) ); } void SbRtl_NPV(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 1 || nArgCount > 2 ) { @@ -2637,8 +2637,8 @@ void SbRtl_NPV(StarBASIC *, SbxArray & rPar, bool) } Sequence< Any > aParams( 2 ); - aParams[ 0 ] <<= rPar.Get(1)->GetDouble(); - Any aValues = sbxToUnoValue( rPar.Get(2), + aParams[ 0 ] <<= rPar.Get32(1)->GetDouble(); + Any aValues = sbxToUnoValue( rPar.Get32(2), cppu::UnoType<Sequence<double>>::get() ); // convert for calc functions @@ -2648,12 +2648,12 @@ void SbRtl_NPV(StarBASIC *, SbxArray & rPar, bool) aParams[ 1 ] = aValues; - CallFunctionAccessFunction( aParams, "NPV", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "NPV", rPar.Get32( 0 ) ); } void SbRtl_NPer(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 || nArgCount > 5 ) { @@ -2662,9 +2662,9 @@ void SbRtl_NPer(StarBASIC *, SbxArray & rPar, bool) } // retrieve non-optional params - double rate = rPar.Get(1)->GetDouble(); - double pmt = rPar.Get(2)->GetDouble(); - double pv = rPar.Get(3)->GetDouble(); + double rate = rPar.Get32(1)->GetDouble(); + double pmt = rPar.Get32(2)->GetDouble(); + double pv = rPar.Get32(3)->GetDouble(); // set default values for Optional args double fv = 0; @@ -2673,14 +2673,14 @@ void SbRtl_NPer(StarBASIC *, SbxArray & rPar, bool) // fv if ( nArgCount >= 4 ) { - if( rPar.Get(4)->GetType() != SbxEMPTY ) - fv = rPar.Get(4)->GetDouble(); + if( rPar.Get32(4)->GetType() != SbxEMPTY ) + fv = rPar.Get32(4)->GetDouble(); } // type if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - type = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + type = rPar.Get32(5)->GetDouble(); } Sequence< Any > aParams( 5 ); @@ -2690,12 +2690,12 @@ void SbRtl_NPer(StarBASIC *, SbxArray & rPar, bool) aParams[ 3 ] <<= fv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, "NPer", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "NPer", rPar.Get32( 0 ) ); } void SbRtl_MIRR(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 ) { @@ -2706,7 +2706,7 @@ void SbRtl_MIRR(StarBASIC *, SbxArray & rPar, bool) // retrieve non-optional params Sequence< Any > aParams( 3 ); - Any aValues = sbxToUnoValue( rPar.Get(1), + Any aValues = sbxToUnoValue( rPar.Get32(1), cppu::UnoType<Sequence<double>>::get() ); // convert for calc functions @@ -2715,15 +2715,15 @@ void SbRtl_MIRR(StarBASIC *, SbxArray & rPar, bool) aValues <<= sValues; aParams[ 0 ] = aValues; - aParams[ 1 ] <<= rPar.Get(2)->GetDouble(); - aParams[ 2 ] <<= rPar.Get(3)->GetDouble(); + aParams[ 1 ] <<= rPar.Get32(2)->GetDouble(); + aParams[ 2 ] <<= rPar.Get32(3)->GetDouble(); - CallFunctionAccessFunction( aParams, "MIRR", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "MIRR", rPar.Get32( 0 ) ); } void SbRtl_IRR(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 1 || nArgCount > 2 ) { @@ -2731,7 +2731,7 @@ void SbRtl_IRR(StarBASIC *, SbxArray & rPar, bool) return; } // retrieve non-optional params - Any aValues = sbxToUnoValue( rPar.Get(1), + Any aValues = sbxToUnoValue( rPar.Get32(1), cppu::UnoType<Sequence<double>>::get() ); // convert for calc functions @@ -2744,20 +2744,20 @@ void SbRtl_IRR(StarBASIC *, SbxArray & rPar, bool) // guess if ( nArgCount >= 2 ) { - if( rPar.Get(2)->GetType() != SbxEMPTY ) - guess = rPar.Get(2)->GetDouble(); + if( rPar.Get32(2)->GetType() != SbxEMPTY ) + guess = rPar.Get32(2)->GetDouble(); } Sequence< Any > aParams( 2 ); aParams[ 0 ] = aValues; aParams[ 1 ] <<= guess; - CallFunctionAccessFunction( aParams, "IRR", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "IRR", rPar.Get32( 0 ) ); } void SbRtl_IPmt(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 4 || nArgCount > 6 ) { @@ -2766,10 +2766,10 @@ void SbRtl_IPmt(StarBASIC *, SbxArray & rPar, bool) } // retrieve non-optional params - double rate = rPar.Get(1)->GetDouble(); - double per = rPar.Get(2)->GetInteger(); - double nper = rPar.Get(3)->GetDouble(); - double pv = rPar.Get(4)->GetDouble(); + double rate = rPar.Get32(1)->GetDouble(); + double per = rPar.Get32(2)->GetInteger(); + double nper = rPar.Get32(3)->GetDouble(); + double pv = rPar.Get32(4)->GetDouble(); // set default values for Optional args double fv = 0; @@ -2778,14 +2778,14 @@ void SbRtl_IPmt(StarBASIC *, SbxArray & rPar, bool) // fv if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - fv = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + fv = rPar.Get32(5)->GetDouble(); } // type if ( nArgCount >= 6 ) { - if( rPar.Get(6)->GetType() != SbxEMPTY ) - type = rPar.Get(6)->GetDouble(); + if( rPar.Get32(6)->GetType() != SbxEMPTY ) + type = rPar.Get32(6)->GetDouble(); } Sequence< Any > aParams( 6 ); @@ -2796,12 +2796,12 @@ void SbRtl_IPmt(StarBASIC *, SbxArray & rPar, bool) aParams[ 4 ] <<= fv; aParams[ 5 ] <<= type; - CallFunctionAccessFunction( aParams, "IPmt", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "IPmt", rPar.Get32( 0 ) ); } void SbRtl_FV(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 || nArgCount > 5 ) { @@ -2810,9 +2810,9 @@ void SbRtl_FV(StarBASIC *, SbxArray & rPar, bool) } // retrieve non-optional params - double rate = rPar.Get(1)->GetDouble(); - double nper = rPar.Get(2)->GetDouble(); - double pmt = rPar.Get(3)->GetDouble(); + double rate = rPar.Get32(1)->GetDouble(); + double nper = rPar.Get32(2)->GetDouble(); + double pmt = rPar.Get32(3)->GetDouble(); // set default values for Optional args double pv = 0; @@ -2821,14 +2821,14 @@ void SbRtl_FV(StarBASIC *, SbxArray & rPar, bool) // pv if ( nArgCount >= 4 ) { - if( rPar.Get(4)->GetType() != SbxEMPTY ) - pv = rPar.Get(4)->GetDouble(); + if( rPar.Get32(4)->GetType() != SbxEMPTY ) + pv = rPar.Get32(4)->GetDouble(); } // type if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - type = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + type = rPar.Get32(5)->GetDouble(); } Sequence< Any > aParams( 5 ); @@ -2838,12 +2838,12 @@ void SbRtl_FV(StarBASIC *, SbxArray & rPar, bool) aParams[ 3 ] <<= pv; aParams[ 4 ] <<= type; - CallFunctionAccessFunction( aParams, "FV", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "FV", rPar.Get32( 0 ) ); } void SbRtl_DDB(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 4 || nArgCount > 5 ) { @@ -2852,10 +2852,10 @@ void SbRtl_DDB(StarBASIC *, SbxArray & rPar, bool) } // retrieve non-optional params - double cost = rPar.Get(1)->GetDouble(); - double salvage = rPar.Get(2)->GetDouble(); - double life = rPar.Get(3)->GetDouble(); - double period = rPar.Get(4)->GetDouble(); + double cost = rPar.Get32(1)->GetDouble(); + double salvage = rPar.Get32(2)->GetDouble(); + double life = rPar.Get32(3)->GetDouble(); + double period = rPar.Get32(4)->GetDouble(); // set default values for Optional args double factor = 2; @@ -2863,8 +2863,8 @@ void SbRtl_DDB(StarBASIC *, SbxArray & rPar, bool) // factor if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - factor = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + factor = rPar.Get32(5)->GetDouble(); } Sequence< Any > aParams( 5 ); @@ -2874,12 +2874,12 @@ void SbRtl_DDB(StarBASIC *, SbxArray & rPar, bool) aParams[ 3 ] <<= period; aParams[ 4 ] <<= factor; - CallFunctionAccessFunction( aParams, "DDB", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "DDB", rPar.Get32( 0 ) ); } void SbRtl_Rate(StarBASIC *, SbxArray & rPar, bool) { - sal_uInt16 nArgCount = rPar.Count()-1; + sal_uInt32 nArgCount = rPar.Count32()-1; if ( nArgCount < 3 || nArgCount > 6 ) { @@ -2892,9 +2892,9 @@ void SbRtl_Rate(StarBASIC *, SbxArray & rPar, bool) double pmt = 0; double pv = 0; - nper = rPar.Get(1)->GetDouble(); - pmt = rPar.Get(2)->GetDouble(); - pv = rPar.Get(3)->GetDouble(); + nper = rPar.Get32(1)->GetDouble(); + pmt = rPar.Get32(2)->GetDouble(); + pv = rPar.Get32(3)->GetDouble(); // set default values for Optional args double fv = 0; @@ -2904,22 +2904,22 @@ void SbRtl_Rate(StarBASIC *, SbxArray & rPar, bool) // fv if ( nArgCount >= 4 ) { - if( rPar.Get(4)->GetType() != SbxEMPTY ) - fv = rPar.Get(4)->GetDouble(); + if( rPar.Get32(4)->GetType() != SbxEMPTY ) + fv = rPar.Get32(4)->GetDouble(); } // type if ( nArgCount >= 5 ) { - if( rPar.Get(5)->GetType() != SbxEMPTY ) - type = rPar.Get(5)->GetDouble(); + if( rPar.Get32(5)->GetType() != SbxEMPTY ) + type = rPar.Get32(5)->GetDouble(); } // guess if ( nArgCount >= 6 ) { - if( rPar.Get(6)->GetType() != SbxEMPTY ) - guess = rPar.Get(6)->GetDouble(); + if( rPar.Get32(6)->GetType() != SbxEMPTY ) + guess = rPar.Get32(6)->GetDouble(); } Sequence< Any > aParams( 6 ); @@ -2930,18 +2930,18 @@ void SbRtl_Rate(StarBASIC *, SbxArray & rPar, bool) aParams[ 4 ] <<= type; aParams[ 5 ] <<= guess; - CallFunctionAccessFunction( aParams, "Rate", rPar.Get( 0 ) ); + CallFunctionAccessFunction( aParams, "Rate", rPar.Get32( 0 ) ); } void SbRtl_StrReverse(StarBASIC *, SbxArray & rPar, bool) { - if ( rPar.Count() != 2 ) + if ( rPar.Count32() != 2 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - SbxVariable *pSbxVariable = rPar.Get(1); + SbxVariable *pSbxVariable = rPar.Get32(1); if( pSbxVariable->IsNull() ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -2949,13 +2949,13 @@ void SbRtl_StrReverse(StarBASIC *, SbxArray & rPar, bool) } OUString aStr = comphelper::string::reverseString(pSbxVariable->GetOUString()); - rPar.Get(0)->PutString( aStr ); + rPar.Get32(0)->PutString( aStr ); } void SbRtl_CompatibilityMode(StarBASIC *, SbxArray & rPar, bool) { bool bEnabled = false; - sal_uInt16 nCount = rPar.Count(); + sal_uInt32 nCount = rPar.Count32(); if ( nCount != 1 && nCount != 2 ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -2964,24 +2964,24 @@ void SbRtl_CompatibilityMode(StarBASIC *, SbxArray & rPar, bool) { if ( nCount == 2 ) { - pInst->EnableCompatibility( rPar.Get(1)->GetBool() ); + pInst->EnableCompatibility( rPar.Get32(1)->GetBool() ); } bEnabled = pInst->IsCompatibility(); } - rPar.Get(0)->PutBool( bEnabled ); + rPar.Get32(0)->PutBool( bEnabled ); } void SbRtl_Input(StarBASIC *, SbxArray & rPar, bool) { // 2 parameters needed - if ( rPar.Count() < 3 ) + if ( rPar.Count32() < 3 ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - sal_uInt16 nByteCount = rPar.Get(1)->GetUShort(); - sal_Int16 nFileNumber = rPar.Get(2)->GetInteger(); + sal_uInt16 nByteCount = rPar.Get32(1)->GetUShort(); + sal_Int16 nFileNumber = rPar.Get32(2)->GetInteger(); SbiIoSystem* pIosys = GetSbData()->pInst->GetIoSystem(); SbiStream* pSbStrm = pIosys->GetStream( nFileNumber ); @@ -3001,14 +3001,14 @@ void SbRtl_Input(StarBASIC *, SbxArray & rPar, bool) StarBASIC::Error( err ); return; } - rPar.Get(0)->PutString(OStringToOUString(aByteBuffer, osl_getThreadTextEncoding())); + rPar.Get32(0)->PutString(OStringToOUString(aByteBuffer, osl_getThreadTextEncoding())); } void SbRtl_Me(StarBASIC *, SbxArray & rPar, bool) { SbModule* pActiveModule = GetSbData()->pInst->GetActiveModule(); SbClassModuleObject* pClassModuleObject = dynamic_cast<SbClassModuleObject*>( pActiveModule ); - SbxVariableRef refVar = rPar.Get(0); + SbxVariableRef refVar = rPar.Get32(0); if( pClassModuleObject == nullptr ) { SbObjModule* pMod = dynamic_cast<SbObjModule*>( pActiveModule ); diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx index 28bd71a31bd6..1d81ee7279fc 100644 --- a/basic/source/runtime/props.cxx +++ b/basic/source/runtime/props.cxx @@ -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); } diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 257aca35dcae..d2cb9fe988b5 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -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; diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index c8138e34ac60..708c09649a84 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -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; diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx index d6ae5d5dc35a..c65f7fc9f190 100644 --- a/basic/source/runtime/stdobj1.cxx +++ b/basic/source/runtime/stdobj1.cxx @@ -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; diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index 6a3cc720c91d..152ab5a671f4 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -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 ); } diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index ab69d3e032a6..7c186b4767aa 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -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 ) ); } } diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index d5f46f06ac46..63f54b19d119 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -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 == ',' ) diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index f9ad3b24f816..143a1ea4156d 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -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 ) { diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index 65fdb906daf9..8edfb9d7ab2b 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -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; diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index a36abf52256a..bd668a02964d 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -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; } } diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 01d394b14d83..d8425d59aaa6 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -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( diff --git a/include/basic/sbx.hxx b/include/basic/sbx.hxx index 2cdf24117001..51cd516b53e0 100644 --- a/include/basic/sbx.hxx +++ b/include/basic/sbx.hxx @@ -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; diff --git a/include/basic/sbxobj.hxx b/include/basic/sbxobj.hxx index 7ad0953ae500..10d4c074c423 100644 --- a/include/basic/sbxobj.hxx +++ b/include/basic/sbxobj.hxx @@ -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 diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 4fd89ccb206f..655588a5a841 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -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 diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index eb3fb987c034..1e112c386043 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -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; diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 877020e061c5..93b32a408d5b 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -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 ) diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx index 684d5b1c67b1..485b66bd0fa7 100644 --- a/scripting/source/basprov/basmodnode.cxx +++ b/scripting/source/basprov/basmodnode.cxx @@ -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; } diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index 067765a574e6..0f7a5ec6cc2a 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -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; diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index 2f11382e5298..b0dc7d481d09 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -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: diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 0cf38b1632b2..9ae217cafc09 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -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(); |