summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-12-09 13:06:03 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-12-09 14:18:25 +0100
commit62f3f3d92aa204eaaa063b30d7ade44df501b997 (patch)
treeb241ad744abad62cf898947757e88617811b309c /basctl
parent6303f8ac291233b1f6888a8d71e769debe0f9fb0 (diff)
SbxArray: drop 16-bit indices
Change-Id: I43b478187636b9bb53fdf7ab938436ae364bd7a7 Reviewed-on: https://gerrit.libreoffice.org/84733 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2.cxx12
-rw-r--r--basctl/source/basicide/baside2b.cxx59
-rw-r--r--basctl/source/basicide/basobj2.cxx14
-rw-r--r--basctl/source/basicide/basobj3.cxx2
-rw-r--r--basctl/source/basicide/macrodlg.cxx6
5 files changed, 47 insertions, 46 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;