diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-21 14:41:58 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-08-26 04:30:03 -0500 |
commit | 37b9ea92ba81d74764a2345a9c75c65bfd272d2b (patch) | |
tree | 114a35309769e5bf7097737a9e8a5ff6e723e856 /basic | |
parent | 34827767b1551f7a61bcd53947255ad2d2a9e5da (diff) |
convert SBX flag bits to type-safe enum
Change-Id: I18d5d6a27f06ee60a5cb3dc393bf05b51bba4817
Reviewed-on: https://gerrit.libreoffice.org/11070
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/eventatt.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 10 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 8 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 10 | ||||
-rw-r--r-- | basic/source/comp/codegen.cxx | 2 | ||||
-rw-r--r-- | basic/source/comp/dim.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 6 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 18 | ||||
-rw-r--r-- | basic/source/runtime/stdobj.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxarray.cxx | 10 | ||||
-rw-r--r-- | basic/source/sbx/sbxbase.cxx | 16 | ||||
-rw-r--r-- | basic/source/sbx/sbxexec.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 4 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 6 |
16 files changed, 56 insertions, 54 deletions
diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index ee75d0fdf665..b7b6fdc23133 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -269,7 +269,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any if( aName == aLibName ) { // Search only in the lib, not automatically in application basic - sal_uInt16 nFlags = pBasic->GetFlags(); + SbxFlagBits nFlags = pBasic->GetFlags(); pBasic->ResetFlag( SBX_GBLSEARCH ); pMethVar = pBasic->Find( aMacro, SbxCLASS_DONTCARE ); pBasic->SetFlags( nFlags ); diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 61a1d723f895..db8487d21574 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -558,7 +558,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ) { pDest->unoAddDim( 0, -1 ); // variant array } - sal_uInt16 nSavFlags = pVar->GetFlags(); + SbxFlagBits nSavFlags = pVar->GetFlags(); pNewProp->ResetFlag( SBX_FIXED ); // need to reset the FIXED flag // when calling PutObject ( because the type will not match Object ) @@ -648,7 +648,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbMethod* pMethod = PTR_CAST(SbMethod, pVar ); if( pMethod ) { - sal_uInt16 nFlags_ = pMethod->GetFlags(); + SbxFlagBits nFlags_ = pMethod->GetFlags(); pMethod->SetFlag( SBX_NO_BROADCAST ); SbMethod* pNewMethod = new SbMethod( *pMethod ); pNewMethod->ResetFlag( SBX_NO_BROADCAST ); @@ -700,7 +700,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbProcedureProperty* pProcedureProp = PTR_CAST( SbProcedureProperty, pVar ); if( pProcedureProp ) { - sal_uInt16 nFlags_ = pProcedureProp->GetFlags(); + SbxFlagBits nFlags_ = pProcedureProp->GetFlags(); pProcedureProp->SetFlag( SBX_NO_BROADCAST ); SbProcedureProperty* pNewProp = new SbProcedureProperty ( pProcedureProp->GetName(), pProcedureProp->GetType() ); @@ -715,7 +715,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbxProperty* pProp = PTR_CAST( SbxProperty, pVar ); if( pProp ) { - sal_uInt16 nFlags_ = pProp->GetFlags(); + SbxFlagBits nFlags_ = pProp->GetFlags(); pProp->SetFlag( SBX_NO_BROADCAST ); SbxProperty* pNewProp = new SbxProperty( *pProp ); @@ -1361,7 +1361,7 @@ SbxVariable* StarBASIC::Find( const OUString& rName, SbxClassType t ) } // otherwise check if the element is available // unset GBLSEARCH-Flag (due to Rekursion) - sal_uInt16 nGblFlag = p->GetFlags() & SBX_GBLSEARCH; + SbxFlagBits nGblFlag = p->GetFlags() & SBX_GBLSEARCH; p->ResetFlag( SBX_GBLSEARCH ); pRes = p->Find( rName, t ); p->SetFlag( nGblFlag ); diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index f9938f56e91b..8a5e761ba47e 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -669,7 +669,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) if ( pArray ) { SbxDimArrayRef xArray = pArray; - sal_uInt16 nFlags = pVar->GetFlags(); + SbxFlagBits nFlags = pVar->GetFlags(); pVar->ResetFlag( SBX_FIXED ); pVar->PutObject( (SbxDimArray*)xArray ); pVar->SetFlags( nFlags ); @@ -799,7 +799,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) } // return the Array - sal_uInt16 nFlags = pVar->GetFlags(); + SbxFlagBits nFlags = pVar->GetFlags(); pVar->ResetFlag( SBX_FIXED ); pVar->PutObject( (SbxDimArray*)xArray ); pVar->SetFlags( nFlags ); @@ -2586,7 +2586,7 @@ SbxInfo* SbUnoMethod::GetInfo() OUString aParamName = rInfo.aName; SbxDataType t = SbxVARIANT; - sal_uInt16 nFlags_ = SBX_READ; + SbxFlagBits nFlags_ = SBX_READ; pInfo->AddParam( aParamName, t, nFlags_ ); } } @@ -3960,7 +3960,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet if( pVar ) { // #95792 Avoid a second call - sal_uInt16 nFlags = pVar->GetFlags(); + SbxFlagBits nFlags = pVar->GetFlags(); pVar->SetFlag( SBX_NO_BROADCAST ); *pRet = sbxToUnoValueImpl( pVar ); pVar->SetFlags( nFlags ); diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 8c26024f7ca2..6f1332fb668b 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -248,7 +248,7 @@ DocObjectWrapper::invoke( const OUString& aFunctionName, const Sequence< Any >& sal_uInt16 n = 1; for ( const SbxParamInfo* pParamInfo = pInfo->GetParam( n ); pParamInfo; pParamInfo = pInfo->GetParam( ++n ) ) { - if ( ( pParamInfo->nFlags & SBX_OPTIONAL ) != 0 ) + if ( ( pParamInfo->nFlags & SBX_OPTIONAL ) != SBX_NONE ) ++nSbxOptional; else nSbxOptional = 0; @@ -389,7 +389,7 @@ SbMethodRef DocObjectWrapper::getMethod( const OUString& aName ) throw (RuntimeE SbMethodRef pMethod = NULL; if ( m_pMod ) { - sal_uInt16 nSaveFlgs = m_pMod->GetFlags(); + SbxFlagBits nSaveFlgs = m_pMod->GetFlags(); // Limit search to this module m_pMod->ResetFlag( SBX_GBLSEARCH ); pMethod = dynamic_cast<SbMethod*>(m_pMod->SbModule::Find(aName, SbxCLASS_METHOD)); @@ -404,7 +404,7 @@ SbPropertyRef DocObjectWrapper::getProperty( const OUString& aName ) throw (Runt SbPropertyRef pProperty = NULL; if ( m_pMod ) { - sal_uInt16 nSaveFlgs = m_pMod->GetFlags(); + SbxFlagBits nSaveFlgs = m_pMod->GetFlags(); // Limit search to this module. m_pMod->ResetFlag( SBX_GBLSEARCH ); pProperty = dynamic_cast<SbProperty*>(m_pMod->SbModule::Find(aName, SbxCLASS_PROPERTY)); @@ -1123,7 +1123,7 @@ sal_uInt16 SbModule::Run( SbMethod* pMeth ) StarBASIC* pMSOMacroRuntimeLib = PTR_CAST(StarBASIC,pMSOMacroRuntimeLibVar); if( pMSOMacroRuntimeLib ) { - sal_uInt16 nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SBX_GBLSEARCH; + SbxFlagBits nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SBX_GBLSEARCH; pMSOMacroRuntimeLib->ResetFlag( SBX_GBLSEARCH ); SbxVariable* pAppSymbol = pMSOMacroRuntimeLib->Find( "Application", SbxCLASS_METHOD ); pMSOMacroRuntimeLib->SetFlag( nGblFlag ); @@ -2172,7 +2172,7 @@ void SbMethod::Broadcast( sal_uIntPtr nHintId ) pCst = pSave; pSave->Broadcast( SbxHint( nHintId, pThisCopy ) ); - sal_uInt16 nSaveFlags = GetFlags(); + SbxFlagBits nSaveFlags = GetFlags(); SetFlag( SBX_READWRITE ); pCst = NULL; Put( pThisCopy->GetValues_Impl() ); diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index d71c8432b4fa..5c1d06a851d3 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -313,7 +313,7 @@ void SbiCodeGen::Save() t = (SbxDataType) ( t | SbxARRAY ); } // #33677 hand-over an Optional-Info - sal_uInt16 nFlags = SBX_READ; + SbxFlagBits nFlags = SBX_READ; if( pPar->IsOptional() ) { nFlags |= SBX_OPTIONAL; diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index a796040f4736..a838be8f0bab 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -650,7 +650,7 @@ void SbiParser::DefType( bool bPrivate ) } else pArray->unoAddDim( 0, -1 ); // variant array - sal_uInt16 nSavFlags = pTypeElem->GetFlags(); + SbxFlagBits nSavFlags = pTypeElem->GetFlags(); // need to reset the FIXED flag // when calling PutObject ( because the type will not match Object ) pTypeElem->ResetFlag( SBX_FIXED ); diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 3397f56d8f0b..d6fcad2d509a 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -4374,7 +4374,7 @@ RTLFUNC(StrConv) } SbxVariableRef refVar = rPar.Get(0); - sal_uInt16 nFlags = refVar->GetFlags(); + SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 255ffd121120..8a8c9eae881c 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -841,7 +841,7 @@ RTLFUNC(Array) // return array SbxVariableRef refVar = rPar.Get(0); - sal_uInt16 nFlags = refVar->GetFlags(); + SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); @@ -881,7 +881,7 @@ RTLFUNC(DimArray) pArray->unoAddDim( 0, -1 ); } SbxVariableRef refVar = rPar.Get(0); - sal_uInt16 nFlags = refVar->GetFlags(); + SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); @@ -1831,7 +1831,7 @@ RTLFUNC(Split) // return array SbxVariableRef refVar = rPar.Get(0); - sal_uInt16 nFlags = refVar->GetFlags(); + SbxFlagBits nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index bfa5bc55a3ed..c7de8abfea60 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1711,7 +1711,7 @@ void SbiRuntime::StepPUT() SbxVariableRef refVar = PopVar(); // store on its own method (inside a function)? bool bFlagsChanged = false; - sal_uInt16 n = 0; + SbxFlagBits n = SBX_NONE; if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { bFlagsChanged = true; @@ -1863,7 +1863,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b else { bool bFlagsChanged = false; - sal_uInt16 n = 0; + SbxFlagBits n = SBX_NONE; if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { bFlagsChanged = true; @@ -2064,7 +2064,7 @@ void SbiRuntime::StepLSET() } else { - sal_uInt16 n = refVar->GetFlags(); + SbxFlagBits n = refVar->GetFlags(); if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { refVar->SetFlag( SBX_WRITE ); @@ -2100,7 +2100,7 @@ void SbiRuntime::StepRSET() } else { - sal_uInt16 n = refVar->GetFlags(); + SbxFlagBits n = refVar->GetFlags(); if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { refVar->SetFlag( SBX_WRITE ); @@ -2200,7 +2200,7 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar ) // a dimension (like for Uno-Sequences of the length 0) pArray->unoAddDim( 0, -1 ); } - sal_uInt16 nSavFlags = refVar->GetFlags(); + SbxFlagBits nSavFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nSavFlags ); @@ -2333,7 +2333,7 @@ void SbiRuntime::StepREDIMP_ERASE() static void lcl_clearImpl( SbxVariableRef& refVar, SbxDataType& eType ) { - sal_uInt16 nSavFlags = refVar->GetFlags(); + SbxFlagBits nSavFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->SetType( SbxDataType(eType & 0x0FFF) ); refVar->SetFlags( nSavFlags ); @@ -3553,7 +3553,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt // shall the type be converted? SbxDataType t2 = pElem->GetType(); bool bSet = false; - if( !( pElem->GetFlags() & SBX_FIXED ) ) + if( (pElem->GetFlags() & SBX_FIXED) == SBX_NONE ) { if( t != SbxVARIANT && t != t2 && t >= SbxINTEGER && t <= SbxSTRING ) @@ -3566,7 +3566,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt // remove potential rests of the last call of the SbxMethod // free Write before, so that there's no error - sal_uInt16 nSavFlags = pElem->GetFlags(); + SbxFlagBits nSavFlags = pElem->GetFlags(); pElem->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST ); pElem->SbxValue::Clear(); pElem->SetFlags( nSavFlags ); @@ -4115,7 +4115,7 @@ void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) if ( pInfo ) { const SbxParamInfo* pParam = pInfo->GetParam( i ); - if( pParam && ( (pParam->nFlags & SBX_OPTIONAL) != 0 ) ) + if( pParam && ( (pParam->nFlags & SBX_OPTIONAL) != SBX_NONE ) ) { // Default value? sal_uInt16 nDefaultId = (sal_uInt16)(pParam->nUserData & 0x0ffff); diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index af89c8ffc113..9a69beadcd1c 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -789,7 +789,7 @@ SbxVariable* SbiStdObject::Find( const OUString& rName, SbxClassType t ) if( bFound ) { // isolate Args-fields: - short nAccess = ( p->nArgs & _RWMASK ) >> 8; + SbxFlagBits nAccess = static_cast<SbxFlagBits>(( p->nArgs & _RWMASK ) >> 8); short nType = ( p->nArgs & _TYPEMASK ); if( p->nArgs & _CONST ) nAccess |= SBX_CONST; @@ -869,7 +869,7 @@ SbxInfo* SbiStdObject::GetInfo( short nIdx ) { p++; OUString aName_ = OUString::createFromAscii( p->pName ); - sal_uInt16 nFlags_ = ( p->nArgs >> 8 ) & 0x03; + SbxFlagBits nFlags_ = static_cast<SbxFlagBits>(( p->nArgs >> 8 ) & 0x03); if( p->nArgs & _OPT ) { nFlags_ |= SBX_OPTIONAL; diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index 651ef33d95d6..eafb2d23270f 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -408,7 +408,7 @@ SbxVariable* SbxArray::FindUserData( sal_uInt32 nData ) case SbxCLASS_OBJECT: { // Objects are not allowed to scan their parent. - sal_uInt16 nOld = pEntry->mpVar->GetFlags(); + SbxFlagBits nOld = pEntry->mpVar->GetFlags(); pEntry->mpVar->ResetFlag(SBX_GBLSEARCH); p = static_cast<SbxObject&>(*pEntry->mpVar).FindUserData(nData); pEntry->mpVar->SetFlags(nOld); @@ -468,7 +468,7 @@ SbxVariable* SbxArray::Find( const OUString& rName, SbxClassType t ) case SbxCLASS_OBJECT: { // Objects are not allowed to scan their parent. - sal_uInt16 nOld = pEntry->mpVar->GetFlags(); + SbxFlagBits nOld = pEntry->mpVar->GetFlags(); pEntry->mpVar->ResetFlag(SBX_GBLSEARCH); p = static_cast<SbxObject&>(*pEntry->mpVar).Find(rName, t); pEntry->mpVar->SetFlags(nOld); @@ -497,7 +497,7 @@ bool SbxArray::LoadData( SvStream& rStrm, sal_uInt16 nVer ) sal_uInt16 nElem; Clear(); bool bRes = true; - sal_uInt16 f = nFlags; + SbxFlagBits f = nFlags; nFlags |= SBX_WRITE; rStrm.ReadUInt16( nElem ); nElem &= 0x7FFF; @@ -531,14 +531,14 @@ bool SbxArray::StoreData( SvStream& rStrm ) const for( n = 0; n < mpVarEntries->size(); n++ ) { SbxVarEntry* pEntry = (*mpVarEntries)[n]; - if (pEntry->mpVar && !(pEntry->mpVar->GetFlags() & SBX_DONTSTORE)) + if (pEntry->mpVar && (pEntry->mpVar->GetFlags() & SBX_DONTSTORE) == SBX_NONE) nElem++; } rStrm.WriteUInt16( (sal_uInt16) nElem ); for( n = 0; n < mpVarEntries->size(); n++ ) { SbxVarEntry* pEntry = (*mpVarEntries)[n]; - if (pEntry->mpVar && !(pEntry->mpVar->GetFlags() & SBX_DONTSTORE)) + if (pEntry->mpVar && (pEntry->mpVar->GetFlags() & SBX_DONTSTORE) == SBX_NONE) { rStrm.WriteUInt16( (sal_uInt16) n ); if (!pEntry->mpVar->Store(rStrm)) diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index 766f5ef07beb..f7458e251571 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -200,12 +200,13 @@ SbxObject* SbxBase::CreateObject( const OUString& rClass ) SbxBase* SbxBase::Load( SvStream& rStrm ) { - sal_uInt16 nSbxId, nFlags, nVer; + sal_uInt16 nSbxId, nFlagsTmp, nVer; sal_uInt32 nCreator, nSize; - rStrm.ReadUInt32( nCreator ).ReadUInt16( nSbxId ).ReadUInt16( nFlags ).ReadUInt16( nVer ); + rStrm.ReadUInt32( nCreator ).ReadUInt16( nSbxId ).ReadUInt16( nFlagsTmp ).ReadUInt16( nVer ); + SbxFlagBits nFlags = static_cast<SbxFlagBits>(nFlagsTmp); // Correcting a foolishness of mine: - if( nFlags & SBX_RESERVED ) + if( (nFlags & SBX_RESERVED) != SBX_NONE ) nFlags = ( nFlags & ~SBX_RESERVED ) | SBX_GBLSEARCH; sal_Size nOldPos = rStrm.Tell(); @@ -256,7 +257,7 @@ void SbxBase::Skip( SvStream& rStrm ) bool SbxBase::Store( SvStream& rStrm ) { - if( !( nFlags & SBX_DONTSTORE ) ) + if( ( nFlags & SBX_DONTSTORE ) == SBX_NONE ) { rStrm.WriteUInt32( (sal_uInt32) GetCreator() ) .WriteUInt16( (sal_uInt16) GetSbxId() ) @@ -330,7 +331,7 @@ SbxObject* SbxFactory::CreateObject( const OUString& ) SbxInfo::~SbxInfo() {} -void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, sal_uInt16 nFlags) +void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, SbxFlagBits nFlags) { aParams.push_back(new SbxParamInfo(rName, eType, nFlags)); } @@ -354,11 +355,12 @@ bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer ) rStrm.ReadUInt32( nHelpId ).ReadUInt16( nParam ); while( nParam-- ) { - sal_uInt16 nType, nFlags; + sal_uInt16 nType, nFlagsTmp; sal_uInt32 nUserData = 0; OUString aName = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm, RTL_TEXTENCODING_ASCII_US); - rStrm.ReadUInt16( nType ).ReadUInt16( nFlags ); + rStrm.ReadUInt16( nType ).ReadUInt16( nFlagsTmp ); + SbxFlagBits nFlags = static_cast<SbxFlagBits>(nFlagsTmp); if( nVer > 1 ) rStrm.ReadUInt32( nUserData ); AddParam( aName, (SbxDataType) nType, nFlags ); diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index 9d34b7f935c1..c77719326f25 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -288,7 +288,7 @@ static SbxVariable* Element SbxVariableRef refVar; if( !aSym.isEmpty() ) { - sal_uInt16 nOld = pObj->GetFlags(); + SbxFlagBits nOld = pObj->GetFlags(); if( pObj == pGbl ) { pObj->SetFlag( SBX_GBLSEARCH ); diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 450562802ac1..15443694a371 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -200,10 +200,10 @@ SbxVariable* SbxObject::FindUserData( sal_uInt32 nData ) while( !pRes && pCur->pParent ) { // I myself was already searched! - sal_uInt16 nOwn = pCur->GetFlags(); + SbxFlagBits nOwn = pCur->GetFlags(); pCur->ResetFlag( SBX_EXTSEARCH ); // I search already global! - sal_uInt16 nPar = pCur->pParent->GetFlags(); + SbxFlagBits nPar = pCur->pParent->GetFlags(); pCur->pParent->ResetFlag( SBX_GBLSEARCH ); pRes = pCur->pParent->FindUserData( nData ); pCur->SetFlags( nOwn ); @@ -273,10 +273,10 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t ) while( !pRes && pCur->pParent ) { // I myself was already searched! - sal_uInt16 nOwn = pCur->GetFlags(); + SbxFlagBits nOwn = pCur->GetFlags(); pCur->ResetFlag( SBX_EXTSEARCH ); // I search already global! - sal_uInt16 nPar = pCur->pParent->GetFlags(); + SbxFlagBits nPar = pCur->pParent->GetFlags(); pCur->pParent->ResetFlag( SBX_GBLSEARCH ); pRes = pCur->pParent->Find( rName, t ); pCur->SetFlags( nOwn ); diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 1a5b8e28157a..d7e536933d0d 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -601,7 +601,7 @@ bool SbxValue::PutStringExt( const OUString& r ) // #34939: For Strings which contain a number, and if this has a Num-Type, // set a Fixed flag so that the type will not be changed - sal_uInt16 nFlags_ = GetFlags(); + SbxFlagBits nFlags_ = GetFlags(); if( ( eTargetType >= SbxINTEGER && eTargetType <= SbxCURRENCY ) || ( eTargetType >= SbxCHAR && eTargetType <= SbxUINT ) || eTargetType == SbxBOOL ) @@ -706,7 +706,7 @@ PUT( PutDecimal, SbxDECIMAL, SbxDecimal*, pDecimal ) bool SbxValue::IsFixed() const { - return ( (GetFlags() & SBX_FIXED) | (aData.eType & SbxBYREF) ) != 0; + return ((GetFlags() & SBX_FIXED) != SBX_NONE) || ((aData.eType & SbxBYREF) != 0); } // A variable is numeric, if it is EMPTY or really numeric diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 6776c0bb7f1c..89b712cd2115 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -166,7 +166,7 @@ void SbxVariable::Broadcast( sal_uIntPtr nHintId ) // Avoid further broadcasting SfxBroadcaster* pSave = pCst; pCst = NULL; - sal_uInt16 nSaveFlags = GetFlags(); + SbxFlagBits nSaveFlags = GetFlags(); SetFlag( SBX_READWRITE ); if( mpPar.Is() ) { @@ -250,7 +250,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const { aTmp += ","; } - if( i->nFlags & SBX_OPTIONAL ) + if( (i->nFlags & SBX_OPTIONAL) != SBX_NONE ) { aTmp += OUString( SbxRes( STRING_OPTIONAL ) ); } @@ -589,7 +589,7 @@ bool SbxVariable::StoreData( SvStream& rStrm ) const // #50200 Avoid that objects , which during the runtime // as return-value are saved in the method as a value were saved SbxVariable* pThis = (SbxVariable*)this; - sal_uInt16 nSaveFlags = GetFlags(); + SbxFlagBits nSaveFlags = GetFlags(); pThis->SetFlag( SBX_WRITE ); pThis->SbxValue::Clear(); pThis->SetFlags( nSaveFlags ); |