summaryrefslogtreecommitdiff
path: root/scripting/source
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 /scripting/source
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 'scripting/source')
-rw-r--r--scripting/source/basprov/basmodnode.cxx12
-rw-r--r--scripting/source/basprov/basscript.cxx9
2 files changed, 11 insertions, 10 deletions
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;