diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-08 10:26:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-08 12:35:09 +0000 |
commit | a66731982e93cdcc5beaa5b0586a7f12a7fc0ef6 (patch) | |
tree | 19064090be4d97781c16aa6e79a4f7a09d561ae9 /basic | |
parent | 20475c78db5c62f2c8711e59753476bd9b4e2f1c (diff) |
convert SFX_HINT to scoped enum
Notes
(*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a
dynamic_cast check.
(*) In SC, removed the hint id field from ScIndexHint, no point in
storing the hint id twice
(*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no
point in storing two different hint ids
(*) In some cases, multiple #define's used to map to the same SFX_HINT
value (notably the SFX_HINT_USER* values). I made all of those separate
values.
Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5
Reviewed-on: https://gerrit.libreoffice.org/31751
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basicmanagerrepository.cxx | 2 | ||||
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 8 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 12 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 30 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 24 | ||||
-rw-r--r-- | basic/source/runtime/stdobj.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/stdobj1.cxx | 12 | ||||
-rw-r--r-- | basic/source/sbx/sbxcoll.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxexec.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 14 | ||||
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 14 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 20 |
14 files changed, 78 insertions, 78 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index cb09047ec184..03d730985b2c 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -577,7 +577,7 @@ namespace basic void ImplRepository::Notify( SfxBroadcaster& _rBC, const SfxHint& _rHint ) { - if ( _rHint.GetId() != SFX_HINT_DYING ) + if ( _rHint.GetId() != SfxHintId::Dying ) // not interested in return; diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index f7ee7b1e6af0..236c14e853b9 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -849,7 +849,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) BasicManager::~BasicManager() { // Notify listener if something needs to be saved - Broadcast( SfxHint( SFX_HINT_DYING) ); + Broadcast( SfxHint( SfxHintId::Dying) ); } void BasicManager::LegacyDeleteBasicManager( BasicManager*& _rpManager ) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index d03eaa35c34b..b991514a4825 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -2061,10 +2061,10 @@ void BasicCollection::Notify( SfxBroadcaster& rCst, const SfxHint& rHint ) const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint); if( p ) { - const sal_uInt32 nId = p->GetId(); - bool bRead = nId == SBX_HINT_DATAWANTED; - bool bWrite = nId == SBX_HINT_DATACHANGED; - bool bRequestInfo = nId == SBX_HINT_INFOWANTED; + const SfxHintId nId = p->GetId(); + bool bRead = nId == SfxHintId::BasicDataWanted; + bool bWrite = nId == SfxHintId::BasicDataChanged; + bool bRequestInfo = nId == SfxHintId::BasicInfoWanted; SbxVariable* pVar = p->GetVar(); SbxArray* pArg = pVar->GetParameters(); OUString aVarName( pVar->GetName() ); diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index e87d267823fc..18c000924ae1 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -1999,7 +1999,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if( pProp ) { bool bInvocation = pProp->isInvocationBased(); - if( pHint->GetId() == SBX_HINT_DATAWANTED ) + if( pHint->GetId() == SfxHintId::BasicDataWanted ) { // Test-Properties sal_Int32 nId = pProp->nId; @@ -2102,7 +2102,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } } } - else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + else if( pHint->GetId() == SfxHintId::BasicDataChanged ) { if( !bInvocation && mxUnoAccess.is() ) { @@ -2160,7 +2160,7 @@ void SbUnoObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) else if( pMeth ) { bool bInvocation = pMeth->isInvocationBased(); - if( pHint->GetId() == SBX_HINT_DATAWANTED ) + if( pHint->GetId() == SfxHintId::BasicDataWanted ) { // number of Parameter -1 because of Param0 == this sal_uInt32 nParamCount = pParams ? ((sal_uInt32)pParams->Count() - 1) : 0; @@ -3560,7 +3560,7 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SbxVariable* pVar = pHint->GetVar(); SbxArray* pParams = pVar->GetParameters(); SbUnoServiceCtor* pUnoCtor = dynamic_cast<SbUnoServiceCtor*>( pVar ); - if( pUnoCtor && pHint->GetId() == SBX_HINT_DATAWANTED ) + if( pUnoCtor && pHint->GetId() == SfxHintId::BasicDataWanted ) { // Parameter count -1 because of Param0 == this sal_uInt32 nParamCount = pParams ? ((sal_uInt32)pParams->Count() - 1) : 0; @@ -4912,7 +4912,7 @@ void SbUnoStructRefObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { StructFieldInfo::iterator it = maFields.find( pProp->GetName() ); // handle get/set of members of struct - if( pHint->GetId() == SBX_HINT_DATAWANTED ) + if( pHint->GetId() == SfxHintId::BasicDataWanted ) { // Test-Properties sal_Int32 nId = pProp->nId; @@ -4957,7 +4957,7 @@ void SbUnoStructRefObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) else StarBASIC::Error( ERRCODE_BASIC_PROPERTY_NOT_FOUND ); } - else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + else if( pHint->GetId() == SfxHintId::BasicDataChanged ) { if ( it != maFields.end() ) { diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 5ffda81153f0..972c47bb7c5b 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -318,7 +318,7 @@ DocObjectWrapper::getValue( const OUString& aPropertyName ) throw (UnknownProper SbxVariable* pProp = pProperty.get(); if ( pProp->GetType() == SbxEMPTY ) - pProperty->Broadcast( SBX_HINT_DATAWANTED ); + pProperty->Broadcast( SfxHintId::BasicDataWanted ); Any aRet = sbxToUnoValue( pProp ); return aRet; @@ -718,7 +718,7 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if( pProcProperty ) { - if( pHint->GetId() == SBX_HINT_DATAWANTED ) + if( pHint->GetId() == SfxHintId::BasicDataWanted ) { OUString aProcName = "Property Get " + pProcProperty->GetName(); @@ -753,7 +753,7 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pVar->Put( aVals ); } } - else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + else if( pHint->GetId() == SfxHintId::BasicDataChanged ) { SbxVariable* pMethVar = nullptr; @@ -794,7 +794,7 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else if( pMeth ) { - if( pHint->GetId() == SBX_HINT_DATAWANTED ) + if( pHint->GetId() == SfxHintId::BasicDataWanted ) { if( pMeth->bInvalid && !Compile() ) { @@ -817,8 +817,8 @@ void SbModule::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) // side effects when using name as variable implicitly bool bForwardToSbxObject = true; - const sal_uInt32 nId = pHint->GetId(); - if( (nId == SBX_HINT_DATAWANTED || nId == SBX_HINT_DATACHANGED) && + const SfxHintId nId = pHint->GetId(); + if( (nId == SfxHintId::BasicDataWanted || nId == SfxHintId::BasicDataChanged) && pVar->GetName().equalsIgnoreAsciiCase( "name" ) ) { bForwardToSbxObject = false; @@ -929,7 +929,7 @@ void SbModule::SetSource32( const OUString& r ) // Broadcast of a hint to all Basics -static void SendHint_( SbxObject* pObj, sal_uInt32 nId, SbMethod* p ) +static void SendHint_( SbxObject* pObj, SfxHintId nId, SbMethod* p ) { // Self a BASIC? if( dynamic_cast<const StarBASIC *>(pObj) != nullptr && pObj->IsBroadcaster() ) @@ -944,7 +944,7 @@ static void SendHint_( SbxObject* pObj, sal_uInt32 nId, SbMethod* p ) } } -static void SendHint( SbxObject* pObj, sal_uInt32 nId, SbMethod* p ) +static void SendHint( SbxObject* pObj, SfxHintId nId, SbMethod* p ) { while( pObj->GetParent() ) pObj = pObj->GetParent(); @@ -1120,7 +1120,7 @@ void SbModule::Run( SbMethod* pMeth ) { if( bDelInst ) { - SendHint( GetParent(), SBX_HINT_BASICSTART, pMeth ); + SendHint( GetParent(), SfxHintId::BasicStart, pMeth ); // 1996-10-16: #31460 New concept for StepInto/Over/Out // For an explanation see runtime.cxx at SbiInstance::CalcBreakCallLevel() @@ -1186,7 +1186,7 @@ void SbModule::Run( SbMethod* pMeth ) // #i30690 SolarMutexGuard aSolarGuard; - SendHint( GetParent(), SBX_HINT_BASICSTOP, pMeth ); + SendHint( GetParent(), SfxHintId::BasicStop, pMeth ); GlobalRunDeInit(); @@ -1847,7 +1847,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH { bDone = true; - if( pHint->GetId() == SBX_HINT_DATAWANTED ) + if( pHint->GetId() == SfxHintId::BasicDataWanted ) { OUString aProcName = "Property Get " + pProcProperty->GetName(); @@ -1882,7 +1882,7 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH pVar->Put( aVals ); } } - else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + else if( pHint->GetId() == SfxHintId::BasicDataChanged ) { SbxVariable* pMeth = nullptr; @@ -2101,16 +2101,16 @@ ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller ) // #100883 Own Broadcast for SbMethod -void SbMethod::Broadcast( sal_uInt32 nHintId ) +void SbMethod::Broadcast( SfxHintId nHintId ) { if( pCst && !IsSet( SbxFlagBits::NoBroadcast ) ) { // Because the method could be called from outside, test here once again // the authorisation - if( nHintId & SBX_HINT_DATAWANTED ) + if( nHintId == SfxHintId::BasicDataWanted ) if( !CanRead() ) return; - if( nHintId & SBX_HINT_DATACHANGED ) + if( nHintId == SfxHintId::BasicDataChanged ) if( !CanWrite() ) return; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 1fa46b1123c6..a95cf5c9219a 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2610,7 +2610,7 @@ RTLFUNC(IsEmpty) } if ( pVar ) { - pVar->Broadcast( SBX_HINT_DATAWANTED ); + pVar->Broadcast( SfxHintId::BasicDataWanted ); rPar.Get( 0 )->PutBool( pVar->IsEmpty() ); } else diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 98510c629d28..23d3f82d5955 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1019,13 +1019,13 @@ void SbiRuntime::TOSMakeTemp() SbxVariable* p = refExprStk->Get( nExprLvl - 1 ); if ( p->GetType() == SbxEMPTY ) { - p->Broadcast( SBX_HINT_DATAWANTED ); + p->Broadcast( SfxHintId::BasicDataWanted ); } SbxVariable* pDflt = nullptr; if ( bVBAEnabled && ( p->GetType() == SbxOBJECT || p->GetType() == SbxVARIANT ) && ((pDflt = getDefaultProp(p)) != nullptr) ) { - pDflt->Broadcast( SBX_HINT_DATAWANTED ); + pDflt->Broadcast( SfxHintId::BasicDataWanted ); // replacing new p on stack causes object pointed by // pDft->pParent to be deleted, when p2->Compute() is // called below pParent is accessed (but it's deleted) @@ -1301,12 +1301,12 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) SbxDataType p2Type = p2->GetType(); if ( p1Type == SbxEMPTY ) { - p1->Broadcast( SBX_HINT_DATAWANTED ); + p1->Broadcast( SfxHintId::BasicDataWanted ); p1Type = p1->GetType(); } if ( p2Type == SbxEMPTY ) { - p2->Broadcast( SBX_HINT_DATAWANTED ); + p2->Broadcast( SfxHintId::BasicDataWanted ); p2Type = p2->GetType(); } if ( p1Type == p2Type ) @@ -1322,13 +1322,13 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) if ( pDflt ) { p1 = pDflt; - p1->Broadcast( SBX_HINT_DATAWANTED ); + p1->Broadcast( SfxHintId::BasicDataWanted ); } pDflt = getDefaultProp( p2.get() ); if ( pDflt ) { p2 = pDflt; - p2->Broadcast( SBX_HINT_DATAWANTED ); + p2->Broadcast( SfxHintId::BasicDataWanted ); } } @@ -1543,12 +1543,12 @@ void SbiRuntime::StepIS() SbxDataType eType2 = refVar2->GetType(); if ( eType1 == SbxEMPTY ) { - refVar1->Broadcast( SBX_HINT_DATAWANTED ); + refVar1->Broadcast( SfxHintId::BasicDataWanted ); eType1 = refVar1->GetType(); } if ( eType2 == SbxEMPTY ) { - refVar2->Broadcast( SBX_HINT_DATAWANTED ); + refVar2->Broadcast( SfxHintId::BasicDataWanted ); eType2 = refVar2->GetType(); } @@ -1568,7 +1568,7 @@ void SbiRuntime::StepIS() void SbiRuntime::StepGET() { SbxVariable* p = GetTOS(); - p->Broadcast( SBX_HINT_DATAWANTED ); + p->Broadcast( SfxHintId::BasicDataWanted ); } // #67607 copy Uno-Structs @@ -1672,7 +1672,7 @@ void SbiRuntime::StepPUT() // aren't dealt with if the object is a member of some parent object bool bObjAssign = false; if ( refVar->GetType() == SbxEMPTY ) - refVar->Broadcast( SBX_HINT_DATAWANTED ); + refVar->Broadcast( SfxHintId::BasicDataWanted ); if ( refVar->GetType() == SbxOBJECT ) { if ( dynamic_cast<const SbxMethod *>(refVar.get()) != nullptr || ! refVar->GetParent() ) @@ -2806,7 +2806,7 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 ) { // named variables ( that are Any especially properties ) can be empty at this point and need a broadcast if ( pVal->GetType() == SbxEMPTY ) - pVal->Broadcast( SBX_HINT_DATAWANTED ); + pVal->Broadcast( SfxHintId::BasicDataWanted ); // evaluate methods and properties! SbxVariable* pRes = new SbxVariable( *pVal ); pVal = pRes; @@ -3862,7 +3862,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) SbxVariable* pDflt = getDefaultProp( pElem ); if ( pDflt ) { - pDflt->Broadcast( SBX_HINT_DATAWANTED ); + pDflt->Broadcast( SfxHintId::BasicDataWanted ); SbxBaseRef pDfltObj = pDflt->GetObject(); if( pDfltObj.Is() ) { diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 115252c5b6a9..0eac637f8fba 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -824,15 +824,15 @@ void SbiStdObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) const sal_uInt16 nCallId = static_cast<sal_uInt16>(pVar->GetUserData()); if( nCallId ) { - const sal_uInt32 t = pHint->GetId(); - if( t == SBX_HINT_INFOWANTED ) + const SfxHintId t = pHint->GetId(); + if( t == SfxHintId::BasicInfoWanted ) pVar->SetInfo( GetInfo( static_cast<short>(pVar->GetUserData()) ) ); else { bool bWrite = false; - if( t == SBX_HINT_DATACHANGED ) + if( t == SfxHintId::BasicDataChanged ) bWrite = true; - if( t == SBX_HINT_DATAWANTED || bWrite ) + if( t == SfxHintId::BasicDataWanted || bWrite ) { RtlCall p = aMethods[ nCallId-1 ].pFunc; SbxArrayRef rPar( pPar_ ); diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx index a46520bbd544..3635a47e3bc4 100644 --- a/basic/source/runtime/stdobj1.cxx +++ b/basic/source/runtime/stdobj1.cxx @@ -134,7 +134,7 @@ void SbStdPicture::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if( pHint ) { - if( pHint->GetId() == SBX_HINT_INFOWANTED ) + if( pHint->GetId() == SfxHintId::BasicInfoWanted ) { SbxObject::Notify( rBC, rHint ); return; @@ -143,7 +143,7 @@ void SbStdPicture::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); const sal_uInt32 nWhich = pVar->GetUserData(); - bool bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + bool bWrite = pHint->GetId() == SfxHintId::BasicDataChanged; // Propteries switch( nWhich ) @@ -252,7 +252,7 @@ void SbStdFont::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if( pHint ) { - if( pHint->GetId() == SBX_HINT_INFOWANTED ) + if( pHint->GetId() == SfxHintId::BasicInfoWanted ) { SbxObject::Notify( rBC, rHint ); return; @@ -261,7 +261,7 @@ void SbStdFont::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); const sal_uInt32 nWhich = pVar->GetUserData(); - bool bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + bool bWrite = pHint->GetId() == SfxHintId::BasicDataChanged; // Propteries switch( nWhich ) @@ -407,7 +407,7 @@ void SbStdClipboard::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) if( pHint ) { - if( pHint->GetId() == SBX_HINT_INFOWANTED ) + if( pHint->GetId() == SfxHintId::BasicInfoWanted ) { SbxObject::Notify( rBC, rHint ); return; @@ -416,7 +416,7 @@ void SbStdClipboard::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); const sal_uInt32 nWhich = pVar->GetUserData(); - bool bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + bool bWrite = pHint->GetId() == SfxHintId::BasicDataChanged; // Methods switch( nWhich ) diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index 8971c866619a..3fa3b690d19b 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -117,9 +117,9 @@ void SbxCollection::Notify( SfxBroadcaster& rCst, const SfxHint& rHint ) const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint); if( p ) { - const sal_uInt32 nId = p->GetId(); - bool bRead = ( nId == SBX_HINT_DATAWANTED ); - bool bWrite = ( nId == SBX_HINT_DATACHANGED ); + const SfxHintId nId = p->GetId(); + bool bRead = ( nId == SfxHintId::BasicDataWanted ); + bool bWrite = ( nId == SfxHintId::BasicDataChanged ); SbxVariable* pVar = p->GetVar(); SbxArray* pArg = pVar->GetParameters(); if( bRead || bWrite ) diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index 47775b02a554..24afd3388d0b 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -261,7 +261,7 @@ static SbxVariableRef Assign( SbxObject* pObj, SbxObject* pGbl, const sal_Unicod } else // Simple call: once activating - refVar->Broadcast( SBX_HINT_DATAWANTED ); + refVar->Broadcast( SfxHintId::BasicDataWanted ); } *ppBuf = p; return refVar; diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index e4e7e3827493..098a580a9869 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -136,9 +136,9 @@ void SbxObject::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint); if( p ) { - const sal_uInt32 nId = p->GetId(); - bool bRead = ( nId == SBX_HINT_DATAWANTED ); - bool bWrite = ( nId == SBX_HINT_DATACHANGED ); + const SfxHintId nId = p->GetId(); + bool bRead = ( nId == SfxHintId::BasicDataWanted ); + bool bWrite = ( nId == SfxHintId::BasicDataChanged ); SbxVariable* pVar = p->GetVar(); if( bRead || bWrite ) { @@ -295,7 +295,7 @@ bool SbxObject::Call( const OUString& rName, SbxArray* pParam ) { pMeth->SetParameters( pParam ); } - pMeth->Broadcast( SBX_HINT_DATAWANTED ); + pMeth->Broadcast( SfxHintId::BasicDataWanted ); pMeth->SetParameters( nullptr ); return true; } @@ -413,7 +413,7 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp SetModified( true ); // The object listen always StartListening( pVar->GetBroadcaster(), true ); - Broadcast( SBX_HINT_OBJECTCHANGED ); + Broadcast( SfxHintId::BasicObjectChanged ); return pVar; } @@ -457,7 +457,7 @@ void SbxObject::Insert( SbxVariable* pVar ) pVar->SetParent( this ); } SetModified( true ); - Broadcast( SBX_HINT_OBJECTCHANGED ); + Broadcast( SfxHintId::BasicObjectChanged ); #ifdef DBG_UTIL static const char* pCls[] = { "DontCare","Array","Value","Variable","Method","Property","Object" }; @@ -557,7 +557,7 @@ void SbxObject::Remove( SbxVariable* pVar ) pVar_->SetParent( nullptr ); } SetModified( true ); - Broadcast( SBX_HINT_OBJECTCHANGED ); + Broadcast( SfxHintId::BasicObjectChanged ); } } diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 1c9352368517..6ce2239206e1 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -59,7 +59,7 @@ SbxValue::SbxValue( const SbxValue& r ) } else { - const_cast<SbxValue*>(&r)->Broadcast( SBX_HINT_DATAWANTED ); + const_cast<SbxValue*>(&r)->Broadcast( SfxHintId::BasicDataWanted ); aData = r.aData; // Copy pointer, increment references switch( aData.eType ) @@ -133,7 +133,7 @@ SbxValue& SbxValue::operator=( const SbxValue& r ) SbxValue::~SbxValue() { - Broadcast( SBX_HINT_DYING ); + Broadcast( SfxHintId::BasicDying ); SetFlag( SbxFlagBits::Write ); SbxValue::Clear(); } @@ -182,7 +182,7 @@ void SbxValue::Clear() // Dummy -void SbxValue::Broadcast( sal_uInt32 ) +void SbxValue::Broadcast( SfxHintId ) {} //////////////////////////// Readout data @@ -284,7 +284,7 @@ bool SbxValue::Get( SbxValues& rRes ) const p = TheRealValue( true ); if( p ) { - p->Broadcast( SBX_HINT_DATAWANTED ); + p->Broadcast( SfxHintId::BasicDataWanted ); switch( rRes.eType ) { case SbxEMPTY: @@ -519,7 +519,7 @@ bool SbxValue::Put( const SbxValues& rVal ) if( !IsError() ) { p->SetModified( true ); - p->Broadcast( SBX_HINT_DATACHANGED ); + p->Broadcast( SfxHintId::BasicDataChanged ); if( eOld != ERRCODE_SBX_OK ) SetError( eOld ); bRes = true; @@ -689,7 +689,7 @@ bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const } // Test downcast!!! if( nullptr != dynamic_cast<const SbxVariable*>( this) ) - const_cast<SbxVariable*>(static_cast<const SbxVariable*>(this))->Broadcast( SBX_HINT_DATAWANTED ); + const_cast<SbxVariable*>(static_cast<const SbxVariable*>(this))->Broadcast( SfxHintId::BasicDataWanted ); SbxDataType t = GetType(); if( t == SbxSTRING ) { @@ -817,7 +817,7 @@ bool SbxValue::Convert( SbxDataType eTo ) Put( aNew ); SetModified( true ); } - Broadcast( SBX_HINT_CONVERTED ); + Broadcast( SfxHintId::BasicConverted ); return true; } else diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 27766dfc7fd4..5e8307d0a6a9 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -155,20 +155,20 @@ SbxArray* SbxVariable::GetParameters() const // Perhaps some day one could cut the parameter 0. // Then the copying will be dropped... -void SbxVariable::Broadcast( sal_uInt32 nHintId ) +void SbxVariable::Broadcast( SfxHintId nHintId ) { if( pCst && !IsSet( SbxFlagBits::NoBroadcast ) ) { // Because the method could be called from outside, check the // rights here again - if( nHintId & SBX_HINT_DATAWANTED ) + if( nHintId == SfxHintId::BasicDataWanted ) { if( !CanRead() ) { return; } } - if( nHintId & SBX_HINT_DATACHANGED ) + if( nHintId == SfxHintId::BasicDataChanged ) { if( !CanWrite() ) { @@ -201,7 +201,7 @@ SbxInfo* SbxVariable::GetInfo() { if( !pInfo.Is() ) { - Broadcast( SBX_HINT_INFOWANTED ); + Broadcast( SfxHintId::BasicInfoWanted ); if( pInfo.Is() ) { SetModified( true ); @@ -582,7 +582,7 @@ bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) pInfo = new SbxInfo; pInfo->LoadData( rStrm, (sal_uInt16) cMark ); } - Broadcast( SBX_HINT_DATACHANGED ); + Broadcast( SfxHintId::BasicDataChanged ); nHash = MakeHashCode( maName ); SetModified( true ); return true; @@ -662,20 +662,20 @@ SbxAlias::~SbxAlias() } } -void SbxAlias::Broadcast( sal_uInt32 nHt ) +void SbxAlias::Broadcast( SfxHintId nHt ) { if( xAlias.Is() ) { xAlias->SetParameters( GetParameters() ); - if( nHt == SBX_HINT_DATAWANTED ) + if( nHt == SfxHintId::BasicDataWanted ) { SbxVariable::operator=( *xAlias ); } - else if( nHt == SBX_HINT_DATACHANGED || nHt == SBX_HINT_CONVERTED ) + else if( nHt == SfxHintId::BasicDataChanged || nHt == SfxHintId::BasicConverted ) { *xAlias = *this; } - else if( nHt == SBX_HINT_INFOWANTED ) + else if( nHt == SfxHintId::BasicInfoWanted ) { xAlias->Broadcast( nHt ); pInfo = xAlias->GetInfo(); @@ -686,7 +686,7 @@ void SbxAlias::Broadcast( sal_uInt32 nHt ) void SbxAlias::Notify( SfxBroadcaster&, const SfxHint& rHint ) { const SbxHint* p = dynamic_cast<const SbxHint*>(&rHint); - if( p && p->GetId() == SBX_HINT_DYING ) + if( p && p->GetId() == SfxHintId::BasicDying ) { xAlias.Clear(); // delete the alias? |