summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorJacek Fraczek <fraczek.jacek@gmail.com>2016-10-12 20:04:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-18 09:27:56 +0000
commit398d641664baa6eaeb34789f0aebfd21e73edef3 (patch)
treef3185bdf569f8c9454e832cc8d7f08ce75f033a2 /basic
parentc5c24f2035ef5941e83f7f0b15cb000f806983cd (diff)
tdf#89307: Removed T* SvRef::opeartor &()
Usage has been replaced with SvRef::get() or removed where applicable. Change-Id: I49f108910b668466134c40940b53fc3ab2acd816 Reviewed-on: https://gerrit.libreoffice.org/29780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/basmgr/basmgr.cxx4
-rw-r--r--basic/source/classes/eventatt.cxx2
-rw-r--r--basic/source/classes/sbunoobj.cxx34
-rw-r--r--basic/source/runtime/runtime.cxx21
-rw-r--r--basic/source/sbx/sbxarray.cxx6
5 files changed, 35 insertions, 32 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 37bf1aaf048b..6e29cae01b8a 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1011,9 +1011,9 @@ bool BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) con
bool bLoaded = false;
if( xNew.Is() )
{
- if( nullptr != dynamic_cast<const StarBASIC*>( &xNew ) )
+ if( nullptr != dynamic_cast<const StarBASIC*>( xNew.get() ) )
{
- StarBASIC* pNew = static_cast<StarBASIC*>(xNew.get());
+ StarBASIC* pNew = static_cast<StarBASIC*>( xNew.get() );
// Use the Parent of the old BASICs
if( rOldBasic.Is() )
{
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx
index a90adf8bd385..e5c428e6493a 100644
--- a/basic/source/classes/eventatt.cxx
+++ b/basic/source/classes/eventatt.cxx
@@ -431,7 +431,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
// Get dialog
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
- if( !(pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj )) )
+ if( !(pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() )) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 561767afe199..141a3089fd6c 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -868,7 +868,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
return aRetType;
}
- if( nullptr != dynamic_cast<const SbxDimArray*>( &xObj) )
+ if( nullptr != dynamic_cast<const SbxDimArray*>( xObj.get() ) )
{
SbxBase* pObj = xObj.get();
SbxDimArray* pArray = static_cast<SbxDimArray*>(pObj);
@@ -962,12 +962,12 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
}
}
// No array, but ...
- else if( nullptr != dynamic_cast<const SbUnoObject*>( &xObj) )
+ else if( nullptr != dynamic_cast<const SbUnoObject*>( xObj.get() ) )
{
aRetType = static_cast<SbUnoObject*>(xObj.get())->getUnoAny().getValueType();
}
// SbUnoAnyObject?
- else if( nullptr != dynamic_cast<const SbUnoAnyObject*>( &xObj) )
+ else if( nullptr != dynamic_cast<const SbUnoAnyObject*>( xObj.get() ) )
{
aRetType = static_cast<SbUnoAnyObject*>(xObj.get())->getValue().getValueType();
}
@@ -990,9 +990,9 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType
SbxBaseRef xObj = pVar->GetObject();
if( xObj.Is() )
{
- if( nullptr != dynamic_cast<const SbUnoAnyObject*>( &xObj) )
+ if( nullptr != dynamic_cast<const SbUnoAnyObject*>( xObj.get() ) )
return static_cast<SbUnoAnyObject*>(xObj.get())->getValue();
- if( nullptr != dynamic_cast<const SbClassModuleObject*>( &xObj) )
+ if( nullptr != dynamic_cast<const SbClassModuleObject*>( xObj.get() ) )
{
Any aRetAny;
SbClassModuleObject* pClassModuleObj = static_cast<SbClassModuleObject*>(xObj.get());
@@ -1000,7 +1000,7 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType
if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) )
return aRetAny;
}
- if( nullptr == dynamic_cast<const SbUnoObject*>( &xObj) )
+ if( nullptr == dynamic_cast<const SbUnoObject*>( xObj.get() ) )
{
// Create NativeObjectWrapper to identify object in case of callbacks
SbxObject* pObj = dynamic_cast<SbxObject*>( pVar->GetObject() );
@@ -1189,7 +1189,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
if( eBaseType == SbxOBJECT )
{
SbxBaseRef xObj = pVar->GetObject();
- if( xObj.Is() && nullptr != dynamic_cast<const SbUnoAnyObject*>( &xObj) )
+ if( xObj.Is() && nullptr != dynamic_cast<const SbUnoAnyObject*>( xObj.get() ) )
{
return static_cast<SbUnoAnyObject*>(xObj.get())->getValue();
}
@@ -1244,11 +1244,11 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
}
SbxBaseRef pObj = pVar->GetObject();
- if( pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj) )
+ if( pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() ) )
{
aRetVal = static_cast<SbUnoObject*>(pObj.get())->getUnoAny();
}
- else if( pObj.Is() && nullptr != dynamic_cast<const SbUnoStructRefObject*>( &pObj) )
+ else if( pObj.Is() && nullptr != dynamic_cast<const SbUnoStructRefObject*>( pObj.get() ) )
{
aRetVal = static_cast<SbUnoStructRefObject*>(pObj.get())->getUnoAny();
}
@@ -1270,7 +1270,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
Reference< XIdlClass > xIdlClass;
SbxBaseRef pObj = pVar->GetObject();
- if( pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj) )
+ if( pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() ) )
{
Any aUnoAny = static_cast<SbUnoObject*>( pObj.get() )->getUnoAny();
aUnoAny >>= xIdlClass;
@@ -1306,7 +1306,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
case TypeClass_SEQUENCE:
{
SbxBaseRef xObj = pVar->GetObject();
- if( xObj.Is() && nullptr != dynamic_cast<const SbxDimArray*>( &xObj) )
+ if( xObj.Is() && nullptr != dynamic_cast<const SbxDimArray*>( xObj.get() ) )
{
SbxBase* pObj = xObj.get();
SbxDimArray* pArray = static_cast<SbxDimArray*>(pObj);
@@ -3084,7 +3084,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
// get the Uno-Object
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
- if( !(pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj)) )
+ if( !(pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() )) )
{
return;
}
@@ -3148,7 +3148,7 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
return;
}
SbxBaseRef pObj = rPar.Get( 1 )->GetObject();
- if( !(pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj)) )
+ if( !(pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() )) )
{
return;
}
@@ -3183,7 +3183,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
return;
}
SbxBaseRef pObj1 = xParam1->GetObject();
- if( !(pObj1.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj1 )) )
+ if( !(pObj1.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj1.get() )) )
{
return;
}
@@ -3202,7 +3202,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
return;
}
SbxBaseRef pObj2 = xParam2->GetObject();
- if( !(pObj2.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj2 )) )
+ if( !(pObj2.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj2.get() )) )
{
return;
}
@@ -4192,7 +4192,7 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, bool bWrite )
Reference< XIdlClass > xIdlClass;
SbxBaseRef pObj = pVal->GetObject();
- if( pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( &pObj) )
+ if( pObj.Is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() ) )
{
Any aUnoAny = static_cast<SbUnoObject*>(pObj.get())->getUnoAny();
aUnoAny >>= xIdlClass;
@@ -4286,7 +4286,7 @@ ModuleInvocationProxy::ModuleInvocationProxy( const OUString& aPrefix, SbxObject
, m_xScopeObj( xScopeObj )
, m_aListeners( m_aMutex )
{
- m_bProxyIsClassModuleObject = xScopeObj.Is() && nullptr != dynamic_cast<const SbClassModuleObject*>( &xScopeObj );
+ m_bProxyIsClassModuleObject = xScopeObj.Is() && nullptr != dynamic_cast<const SbClassModuleObject*>( xScopeObj.get() );
}
Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospection() throw(std::exception)
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 068858f76a65..1d9bacb93f19 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1596,11 +1596,11 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
return false;
}
// #115826: Exclude ProcedureProperties to avoid call to Property Get procedure
- else if( nullptr != dynamic_cast<const SbProcedureProperty*>( &refVar) )
+ else if( nullptr != dynamic_cast<const SbProcedureProperty*>( refVar.get() ) )
return false;
SbxObjectRef xValObj = static_cast<SbxObject*>(refVal->GetObject());
- if( !xValObj.Is() || nullptr != dynamic_cast<const SbUnoAnyObject*>( &xValObj) )
+ if( !xValObj.Is() || nullptr != dynamic_cast<const SbUnoAnyObject*>( xValObj.get() ) )
return false;
SbUnoObject* pUnoVal = dynamic_cast<SbUnoObject*>( xValObj.get() );
@@ -1911,7 +1911,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b
}
if ( bDimAsNew )
{
- if( nullptr == dynamic_cast<const SbxObject*>( &refVar) )
+ if( nullptr == dynamic_cast<const SbxObject*>( refVar.get() ) )
{
SbxBase* pValObjBase = refVal->GetObject();
if( pValObjBase == nullptr )
@@ -2398,9 +2398,9 @@ void SbiRuntime::StepARGV()
SbxVariableRef pVal = PopVar();
// Before fix of #94916:
- if( nullptr != dynamic_cast<const SbxMethod*>( &pVal)
- || nullptr != dynamic_cast<const SbUnoProperty*>( &pVal)
- || nullptr != dynamic_cast<const SbProcedureProperty*>( &pVal) )
+ if( nullptr != dynamic_cast<const SbxMethod*>( pVal.get() )
+ || nullptr != dynamic_cast<const SbUnoProperty*>( pVal.get() )
+ || nullptr != dynamic_cast<const SbProcedureProperty*>( pVal.get() ) )
{
// evaluate methods and properties!
SbxVariable* pRes = new SbxVariable( *pVal );
@@ -2807,7 +2807,10 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
{
OUString aAlias( pImg->GetString( static_cast<short>( nOp1 ) ) );
SbxVariableRef pVal = PopVar();
- if( bVBAEnabled && ( nullptr != dynamic_cast<const SbxMethod*>( &pVal) || nullptr != dynamic_cast<const SbUnoProperty*>( &pVal) || nullptr != dynamic_cast<const SbProcedureProperty*>( &pVal) ) )
+ if( bVBAEnabled &&
+ ( nullptr != dynamic_cast<const SbxMethod*>( pVal.get())
+ || nullptr != dynamic_cast<const SbUnoProperty*>( pVal.get())
+ || nullptr != dynamic_cast<const SbProcedureProperty*>( pVal.get()) ) )
{
// named variables ( that are Any especially properties ) can be empty at this point and need a broadcast
if ( pVal->GetType() == SbxEMPTY )
@@ -3186,7 +3189,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
SbxDataType t = refVal->GetType();
SbxVariable* pVal = refVal.get();
// we don't know the type of uno properties that are (maybevoid)
- if ( t == SbxEMPTY && nullptr != dynamic_cast<const SbUnoProperty*>( &refVal) )
+ if ( t == SbxEMPTY && nullptr != dynamic_cast<const SbUnoProperty*>( refVal.get() ) )
{
SbUnoProperty* pProp = static_cast<SbUnoProperty*>(pVal);
t = pProp->getRealType();
@@ -3675,7 +3678,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 )
{
// Check for default method with named parameters
SbxBaseRef xObj = p->GetObject();
- if (SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>(&xObj))
+ if (SbUnoObject* pUnoObj = dynamic_cast<SbUnoObject*>( xObj.get() ))
{
Any aAny = pUnoObj->getUnoAny();
diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx
index e96ac1aa0737..8bf551adc4c1 100644
--- a/basic/source/sbx/sbxarray.cxx
+++ b/basic/source/sbx/sbxarray.cxx
@@ -293,7 +293,7 @@ void SbxArray::Remove( SbxVariable* pVar )
{
for( size_t i = 0; i < mVarEntries.size(); i++ )
{
- if (&mVarEntries[i].mpVar == pVar)
+ if (mVarEntries[i].mpVar.get() == pVar)
{
Remove( i ); break;
}
@@ -359,7 +359,7 @@ SbxVariable* SbxArray::FindUserData( sal_uInt32 nData )
if (rEntry.mpVar->IsVisible() && rEntry.mpVar->GetUserData() == nData)
{
- p = &rEntry.mpVar;
+ p = rEntry.mpVar.get();
p->ResetFlag( SbxFlagBits::ExtFound );
break; // JSM 1995-10-06
}
@@ -417,7 +417,7 @@ SbxVariable* SbxArray::Find( const OUString& rName, SbxClassType t )
&& (t == SbxClassType::DontCare || rEntry.mpVar->GetClass() == t)
&& (rEntry.mpVar->GetName().equalsIgnoreAsciiCase(rName)))
{
- p = &rEntry.mpVar;
+ p = rEntry.mpVar.get();
p->ResetFlag(SbxFlagBits::ExtFound);
break;
}