summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorJacek Fraczek <fraczek.jacek@gmail.com>2016-10-05 22:00:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-10 08:48:30 +0000
commitf004aa99514d385f3ee254bba735f5eaeb7d9ad8 (patch)
treeaacd5792f553b8e9cbf029cc7e0797ed0dd423fe /scripting
parent728c7327bd97602a38723553ed044ea4c01d13b2 (diff)
tdf#89307: Removed SvRef::operator T*()
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/basprov/basmodnode.cxx4
-rw-r--r--scripting/source/basprov/basscript.cxx18
2 files changed, 11 insertions, 11 deletions
diff --git a/scripting/source/basprov/basmodnode.cxx b/scripting/source/basprov/basmodnode.cxx
index a08def174eda..b1ee7d495790 100644
--- a/scripting/source/basprov/basmodnode.cxx
+++ b/scripting/source/basprov/basmodnode.cxx
@@ -79,7 +79,7 @@ namespace basprov
if ( m_pModule )
{
- SbxArray* pMethods = m_pModule->GetMethods();
+ SbxArray* pMethods = m_pModule->GetMethods().get();
if ( pMethods )
{
sal_Int32 nCount = pMethods->Count();
@@ -114,7 +114,7 @@ namespace basprov
bool bReturn = false;
if ( m_pModule )
{
- SbxArray* pMethods = m_pModule->GetMethods();
+ SbxArray* pMethods = m_pModule->GetMethods().get();
if ( pMethods && pMethods->Count() > 0 )
bReturn = true;
}
diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx
index 37a2554ac955..6e71cfbd223b 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -163,7 +163,7 @@ namespace basprov
Any aReturn;
- if ( m_xMethod )
+ if ( m_xMethod.Is() )
{
// check if compiled
SbModule* pModule = static_cast< SbModule* >( m_xMethod->GetParent() );
@@ -206,8 +206,8 @@ namespace basprov
for ( sal_Int32 i = 0; i < nParamsCount; ++i )
{
SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT );
- unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), pParams[i] );
- xSbxParams->Put( xSbxVar, static_cast< sal_uInt16 >( i ) + 1 );
+ unoToSbxValue( xSbxVar.get(), pParams[i] );
+ xSbxParams->Put( xSbxVar.get(), static_cast< sal_uInt16 >( i ) + 1 );
// Enable passing by ref
if ( xSbxVar->GetType() != SbxVARIANT )
@@ -215,7 +215,7 @@ namespace basprov
}
}
if ( xSbxParams.Is() )
- m_xMethod->SetParameters( xSbxParams );
+ m_xMethod->SetParameters( xSbxParams.get() );
// call method
SbxVariableRef xReturn = new SbxVariable;
@@ -229,11 +229,11 @@ namespace basprov
if ( m_caller.getLength() && m_caller[ 0 ].hasValue() )
{
SbxVariableRef xCallerVar = new SbxVariable( SbxVARIANT );
- unoToSbxValue( static_cast< SbxVariable* >( xCallerVar ), m_caller[ 0 ] );
- nErr = m_xMethod->Call( xReturn, xCallerVar );
+ unoToSbxValue( xCallerVar.get(), m_caller[ 0 ] );
+ nErr = m_xMethod->Call( xReturn.get(), xCallerVar.get() );
}
else
- nErr = m_xMethod->Call( xReturn );
+ nErr = m_xMethod->Call( xReturn.get() );
if ( m_documentBasicManager && m_xDocumentScriptContext.is() )
m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent );
@@ -259,7 +259,7 @@ namespace basprov
if ( pVar )
{
SbxVariableRef xVar = pVar;
- aOutParamMap.insert( OutParamMap::value_type( n - 1, sbxToUnoValue( xVar ) ) );
+ aOutParamMap.insert( OutParamMap::value_type( n - 1, sbxToUnoValue( xVar.get() ) ) );
}
}
}
@@ -277,7 +277,7 @@ namespace basprov
}
// get return value
- aReturn = sbxToUnoValue( xReturn );
+ aReturn = sbxToUnoValue( xReturn.get() );
// reset parameters
m_xMethod->SetParameters( nullptr );