Kaydet (Commit) 85552d86 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:nullptr (automatic rewrite)

Change-Id: Ibe4adf92bb8eaf8b093bae87136d3a6a59e856f4
üst 6f66890d
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
static void Back2Delemitter( SvStream & ); static void Back2Delemitter( SvStream & );
static void WriteStars( SvStream & ); static void WriteStars( SvStream & );
virtual bool SetName( const OString& rName, SvIdlDataBase * = NULL ); virtual bool SetName( const OString& rName, SvIdlDataBase * = nullptr );
const SvHelpContext& GetHelpContext() const { return aHelpContext; } const SvHelpContext& GetHelpContext() const { return aHelpContext; }
virtual const SvString & GetName() const { return aName; } virtual const SvString & GetName() const { return aName; }
virtual const SvString & GetHelpText() const { return aHelpText; } virtual const SvString & GetHelpText() const { return aHelpText; }
...@@ -136,7 +136,7 @@ public: ...@@ -136,7 +136,7 @@ public:
for( SvMetaObjectMemberList::reverse_iterator it = aList.rbegin(); it != aList.rend(); ++it ) for( SvMetaObjectMemberList::reverse_iterator it = aList.rbegin(); it != aList.rend(); ++it )
if( isSvMetaObject(*it) ) if( isSvMetaObject(*it) )
return *it; return *it;
return NULL; return nullptr;
} }
}; };
......
...@@ -123,7 +123,7 @@ public: ...@@ -123,7 +123,7 @@ public:
SvMetaType * ReadKnownType( SvTokenStream & rInStm ); SvMetaType * ReadKnownType( SvTokenStream & rInStm );
SvMetaAttribute * ReadKnownAttr( SvTokenStream & rInStm, SvMetaAttribute * ReadKnownAttr( SvTokenStream & rInStm,
SvMetaType * pType = NULL ); SvMetaType * pType = nullptr );
SvMetaAttribute * SearchKnownAttr( const SvIdentifier& ); SvMetaAttribute * SearchKnownAttr( const SvIdentifier& );
SvMetaClass * ReadKnownClass( SvTokenStream & rInStm ); SvMetaClass * ReadKnownClass( SvTokenStream & rInStm );
void AddDepFile(OUString const& rFileName); void AddDepFile(OUString const& rFileName);
......
...@@ -54,7 +54,7 @@ protected: ...@@ -54,7 +54,7 @@ protected:
public: public:
TYPEINFO_OVERRIDE(); TYPEINFO_OVERRIDE();
virtual bool SetName( const OString& rName, SvIdlDataBase * = NULL ) override; virtual bool SetName( const OString& rName, SvIdlDataBase * = nullptr ) override;
SvMetaModule( bool bImported ); SvMetaModule( bool bImported );
......
...@@ -198,7 +198,7 @@ public: ...@@ -198,7 +198,7 @@ public:
void SetListPos(sal_uLong n) void SetListPos(sal_uLong n)
{ nListPos = n; } { nListPos = n; }
void ResetSlotPointer() void ResetSlotPointer()
{ pNextSlot = pLinkedSlot = 0; } { pNextSlot = pLinkedSlot = nullptr; }
virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ) override; virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ) override;
virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase, virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
......
...@@ -159,7 +159,7 @@ public: ...@@ -159,7 +159,7 @@ public:
const OString& GetCName() const; const OString& GetCName() const;
char GetParserChar() const { return cParserChar; } char GetParserChar() const { return cParserChar; }
virtual bool SetName( const OString& rName, SvIdlDataBase * = NULL ) override; virtual bool SetName( const OString& rName, SvIdlDataBase * = nullptr ) override;
virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
......
...@@ -179,7 +179,7 @@ SvStringHashEntry * SvStringHashTable::Get( sal_uInt32 nIndex ) const ...@@ -179,7 +179,7 @@ SvStringHashEntry * SvStringHashTable::Get( sal_uInt32 nIndex ) const
{ {
if( IsEntry( nIndex ) ) if( IsEntry( nIndex ) )
return pEntries + nIndex; return pEntries + nIndex;
return NULL; return nullptr;
} }
bool SvStringHashTable::equals( const OString& rElement, bool SvStringHashTable::equals( const OString& rElement,
......
...@@ -104,7 +104,7 @@ SvTokenStream::SvTokenStream( const OUString & rFileName ) ...@@ -104,7 +104,7 @@ SvTokenStream::SvTokenStream( const OUString & rFileName )
} }
SvTokenStream::SvTokenStream( SvStream & rStream, const OUString & rFileName ) SvTokenStream::SvTokenStream( SvStream & rStream, const OUString & rFileName )
: pInStream( NULL ) : pInStream( nullptr )
, rInStream( rStream ) , rInStream( rStream )
, aFileName( rFileName ) , aFileName( rFileName )
{ {
......
...@@ -167,7 +167,7 @@ SvMetaReference::SvMetaReference() ...@@ -167,7 +167,7 @@ SvMetaReference::SvMetaReference()
TYPEINIT1( SvMetaExtern, SvMetaReference ); TYPEINIT1( SvMetaExtern, SvMetaReference );
SvMetaExtern::SvMetaExtern() SvMetaExtern::SvMetaExtern()
: pModule( NULL ) : pModule( nullptr )
, bReadUUId( false ) , bReadUUId( false )
, bReadVersion( false ) , bReadVersion( false )
{ {
...@@ -175,7 +175,7 @@ SvMetaExtern::SvMetaExtern() ...@@ -175,7 +175,7 @@ SvMetaExtern::SvMetaExtern()
SvMetaModule * SvMetaExtern::GetModule() const SvMetaModule * SvMetaExtern::GetModule() const
{ {
DBG_ASSERT( pModule != NULL, "module not set" ); DBG_ASSERT( pModule != nullptr, "module not set" );
return pModule; return pModule;
} }
......
...@@ -39,10 +39,10 @@ SvMetaSlot::SvMetaSlot() ...@@ -39,10 +39,10 @@ SvMetaSlot::SvMetaSlot()
, aSynchron( true, false ) , aSynchron( true, false )
, aRecordPerSet( true, false ) , aRecordPerSet( true, false )
, aRecordAbsolute( false, false ) , aRecordAbsolute( false, false )
, pLinkedSlot(0) , pLinkedSlot(nullptr)
, pNextSlot(0) , pNextSlot(nullptr)
, nListPos(0) , nListPos(0)
, pEnumValue(0) , pEnumValue(nullptr)
{ {
} }
...@@ -52,10 +52,10 @@ SvMetaSlot::SvMetaSlot( SvMetaType * pType ) ...@@ -52,10 +52,10 @@ SvMetaSlot::SvMetaSlot( SvMetaType * pType )
, aSynchron( true, false ) , aSynchron( true, false )
, aRecordPerSet( true, false ) , aRecordPerSet( true, false )
, aRecordAbsolute( false, false ) , aRecordAbsolute( false, false )
, pLinkedSlot(0) , pLinkedSlot(nullptr)
, pNextSlot(0) , pNextSlot(nullptr)
, nListPos(0) , nListPos(0)
, pEnumValue(0) , pEnumValue(nullptr)
{ {
} }
...@@ -67,7 +67,7 @@ bool SvMetaSlot::IsVariable() const ...@@ -67,7 +67,7 @@ bool SvMetaSlot::IsVariable() const
bool SvMetaSlot::IsMethod() const bool SvMetaSlot::IsMethod() const
{ {
bool b = SvMetaAttribute::IsMethod(); bool b = SvMetaAttribute::IsMethod();
b |= NULL != GetMethod(); b |= nullptr != GetMethod();
return b; return b;
} }
...@@ -553,14 +553,14 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix, ...@@ -553,14 +553,14 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
} }
// iron out EnumSlots // iron out EnumSlots
SvMetaTypeEnum * pEnum = NULL; SvMetaTypeEnum * pEnum = nullptr;
SvMetaType * pBType = GetType()->GetBaseType(); SvMetaType * pBType = GetType()->GetBaseType();
pEnum = dynamic_cast<SvMetaTypeEnum*>( pBType ); pEnum = dynamic_cast<SvMetaTypeEnum*>( pBType );
if( GetPseudoSlots() && pEnum && pEnum->Count() ) if( GetPseudoSlots() && pEnum && pEnum->Count() )
{ {
// clone the MasterSlot // clone the MasterSlot
SvMetaSlotRef xEnumSlot; SvMetaSlotRef xEnumSlot;
SvMetaSlot *pFirstEnumSlot = NULL; SvMetaSlot *pFirstEnumSlot = nullptr;
for( sal_uLong n = 0; n < pEnum->Count(); n++ ) for( sal_uLong n = 0; n < pEnum->Count(); n++ )
{ {
// create SlotId // create SlotId
...@@ -576,7 +576,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix, ...@@ -576,7 +576,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
OString aSId = aBuf.makeStringAndClear(); OString aSId = aBuf.makeStringAndClear();
xEnumSlot = NULL; xEnumSlot = nullptr;
for( m=0; m<rBase.GetAttrList().size(); m++ ) for( m=0; m<rBase.GetAttrList().size(); m++ )
{ {
SvMetaAttribute * pAttr = rBase.GetAttrList()[m]; SvMetaAttribute * pAttr = rBase.GetAttrList()[m];
...@@ -625,7 +625,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix, ...@@ -625,7 +625,7 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
SvSlotElement *pEle; SvSlotElement *pEle;
do do
{ {
pEle = ( ++i < rList.size() ) ? rList[ i ] : NULL; pEle = ( ++i < rList.size() ) ? rList[ i ] : nullptr;
if ( pEle && pEle->xSlot->pLinkedSlot == this ) if ( pEle && pEle->xSlot->pLinkedSlot == this )
{ {
xEnumSlot->pNextSlot = pEle->xSlot; xEnumSlot->pNextSlot = pEle->xSlot;
...@@ -712,7 +712,7 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, ...@@ -712,7 +712,7 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
if ( !GetExport() && !GetHidden() ) if ( !GetExport() && !GetHidden() )
return; return;
bool bIsEnumSlot = 0 != pEnumValue; bool bIsEnumSlot = nullptr != pEnumValue;
rOutStm.WriteCharPtr( "// Slot Nr. " ) rOutStm.WriteCharPtr( "// Slot Nr. " )
.WriteCharPtr( OString::number(nListPos).getStr() ) .WriteCharPtr( OString::number(nListPos).getStr() )
...@@ -765,8 +765,8 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, ...@@ -765,8 +765,8 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
// look for the next slot with the same StateMethod like me // look for the next slot with the same StateMethod like me
// the slotlist is set to the current slot // the slotlist is set to the current slot
size_t i = nStart; size_t i = nStart;
SvSlotElement* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL; SvSlotElement* pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr;
pNextSlot = pEle ? &pEle->xSlot : NULL; pNextSlot = pEle ? &pEle->xSlot : nullptr;
while ( pNextSlot ) while ( pNextSlot )
{ {
if ( !pNextSlot->pNextSlot && if ( !pNextSlot->pNextSlot &&
...@@ -774,8 +774,8 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, ...@@ -774,8 +774,8 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
) { ) {
break; break;
} }
pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL; pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr;
pNextSlot = pEle ? &pEle->xSlot : NULL; pNextSlot = pEle ? &pEle->xSlot : nullptr;
} }
if ( !pNextSlot ) if ( !pNextSlot )
...@@ -783,15 +783,15 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount, ...@@ -783,15 +783,15 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
// There is no slot behind me that has the same ExecMethod. // There is no slot behind me that has the same ExecMethod.
// So I search for the first slot with it (could be myself). // So I search for the first slot with it (could be myself).
i = 0; i = 0;
pEle = rSlotList.empty() ? NULL : rSlotList[ i ]; pEle = rSlotList.empty() ? nullptr : rSlotList[ i ];
pNextSlot = pEle ? &pEle->xSlot : NULL; pNextSlot = pEle ? &pEle->xSlot : nullptr;
while ( pNextSlot != this ) while ( pNextSlot != this )
{ {
if ( !pNextSlot->pEnumValue && if ( !pNextSlot->pEnumValue &&
pNextSlot->GetStateMethod() == GetStateMethod() ) pNextSlot->GetStateMethod() == GetStateMethod() )
break; break;
pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : NULL; pEle = ( ++i < rSlotList.size() ) ? rSlotList[ i ] : nullptr;
pNextSlot = pEle ? &pEle->xSlot : NULL; pNextSlot = pEle ? &pEle->xSlot : nullptr;
} }
} }
......
...@@ -225,7 +225,7 @@ TYPEINIT1( SvMetaType, SvMetaExtern ); ...@@ -225,7 +225,7 @@ TYPEINIT1( SvMetaType, SvMetaExtern );
: aCall0( CALL_VALUE, false ) \ : aCall0( CALL_VALUE, false ) \
, aCall1( CALL_VALUE, false ) \ , aCall1( CALL_VALUE, false ) \
, aSbxDataType( 0, false ) \ , aSbxDataType( 0, false ) \
, pAttrList( NULL ) \ , pAttrList( nullptr ) \
, nType( TYPE_BASE ) \ , nType( TYPE_BASE ) \
, bIsItem( false ) \ , bIsItem( false ) \
, bIsShell( false ) \ , bIsShell( false ) \
......
...@@ -106,7 +106,7 @@ char const * SyntaxStrings[] = { ...@@ -106,7 +106,7 @@ char const * SyntaxStrings[] = {
"\t\t{ slot }", "\t\t{ slot }",
"\t'}'\n", "\t'}'\n",
"---syntax example is sfx.idl---\n", "---syntax example is sfx.idl---\n",
NULL }; nullptr };
char CommandLineSyntax[] = char CommandLineSyntax[] =
"-fs<slotmap file>\n" "-fs<slotmap file>\n"
......
...@@ -31,7 +31,7 @@ SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd ) ...@@ -31,7 +31,7 @@ SvIdlDataBase::SvIdlDataBase( const SvCommand& rCmd )
: bExport( false ) : bExport( false )
, nUniqueId( 0 ) , nUniqueId( 0 )
, nVerbosity( rCmd.nVerbosity ) , nVerbosity( rCmd.nVerbosity )
, pIdTable( NULL ) , pIdTable( nullptr )
{ {
sSlotMapFile = rCmd.aSlotMapFile; sSlotMapFile = rCmd.aSlotMapFile;
} }
...@@ -78,7 +78,7 @@ SvMetaModule * SvIdlDataBase::GetModule( const OString& rName ) ...@@ -78,7 +78,7 @@ SvMetaModule * SvIdlDataBase::GetModule( const OString& rName )
for( sal_uLong n = 0; n < aModuleList.size(); n++ ) for( sal_uLong n = 0; n < aModuleList.size(); n++ )
if( aModuleList[n]->GetName().getString().equals(rName) ) if( aModuleList[n]->GetName().getString().equals(rName) )
return aModuleList[n]; return aModuleList[n];
return NULL; return nullptr;
} }
void SvIdlDataBase::SetError( const OString& rError, SvToken& rTok ) void SvIdlDataBase::SetError( const OString& rError, SvToken& rTok )
...@@ -270,7 +270,7 @@ SvMetaType * SvIdlDataBase::FindType( const SvMetaType * pPType, ...@@ -270,7 +270,7 @@ SvMetaType * SvIdlDataBase::FindType( const SvMetaType * pPType,
for( SvMetaTypeMemberList::const_iterator it = rList.begin(); it != rList.end(); ++it ) for( SvMetaTypeMemberList::const_iterator it = rList.begin(); it != rList.end(); ++it )
if( *it == pPType ) if( *it == pPType )
return *it; return *it;
return NULL; return nullptr;
} }
SvMetaType * SvIdlDataBase::FindType( const OString& rName ) SvMetaType * SvIdlDataBase::FindType( const OString& rName )
...@@ -278,7 +278,7 @@ SvMetaType * SvIdlDataBase::FindType( const OString& rName ) ...@@ -278,7 +278,7 @@ SvMetaType * SvIdlDataBase::FindType( const OString& rName )
for( SvMetaTypeMemberList::const_iterator it = aTypeList.begin(); it != aTypeList.end(); ++it ) for( SvMetaTypeMemberList::const_iterator it = aTypeList.begin(); it != aTypeList.end(); ++it )
if( rName.equals((*it)->GetName().getString()) ) if( rName.equals((*it)->GetName().getString()) )
return *it; return *it;
return NULL; return nullptr;
} }
SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm ) SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
...@@ -325,7 +325,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm ) ...@@ -325,7 +325,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
OString aName = pTok->GetString(); OString aName = pTok->GetString();
SvMetaTypeMemberList & rList = GetTypeList(); SvMetaTypeMemberList & rList = GetTypeList();
SvMetaTypeMemberList::const_iterator it = rList.begin(); SvMetaTypeMemberList::const_iterator it = rList.begin();
SvMetaType * pType = NULL; SvMetaType * pType = nullptr;
while( it != rList.end() ) while( it != rList.end() )
{ {
if( (*it)->GetName().getString().equals(aName) ) if( (*it)->GetName().getString().equals(aName) )
...@@ -373,7 +373,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm ) ...@@ -373,7 +373,7 @@ SvMetaType * SvIdlDataBase::ReadKnownType( SvTokenStream & rInStm )
} }
} }
rInStm.Seek( nTokPos ); rInStm.Seek( nTokPos );
return NULL; return nullptr;
} }
SvMetaAttribute * SvIdlDataBase::ReadKnownAttr SvMetaAttribute * SvIdlDataBase::ReadKnownAttr
...@@ -412,7 +412,7 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr ...@@ -412,7 +412,7 @@ SvMetaAttribute * SvIdlDataBase::ReadKnownAttr
} }
rInStm.Seek( nTokPos ); rInStm.Seek( nTokPos );
return NULL; return nullptr;
} }
SvMetaAttribute* SvIdlDataBase::SearchKnownAttr SvMetaAttribute* SvIdlDataBase::SearchKnownAttr
...@@ -431,7 +431,7 @@ SvMetaAttribute* SvIdlDataBase::SearchKnownAttr ...@@ -431,7 +431,7 @@ SvMetaAttribute* SvIdlDataBase::SearchKnownAttr
} }
} }
return NULL; return nullptr;
} }
SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm ) SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm )
...@@ -448,7 +448,7 @@ SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm ) ...@@ -448,7 +448,7 @@ SvMetaClass * SvIdlDataBase::ReadKnownClass( SvTokenStream & rInStm )
} }
rInStm.Seek( nTokPos ); rInStm.Seek( nTokPos );
return NULL; return nullptr;
} }
void SvIdlDataBase::Write(const OString& rText) void SvIdlDataBase::Write(const OString& rText)
...@@ -495,7 +495,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm ) ...@@ -495,7 +495,7 @@ void SvIdlDataBase::WriteError( SvTokenStream & rInStm )
aErrorText.append("may be <"); aErrorText.append("may be <");
aErrorText.append(aError.GetText()); aErrorText.append(aError.GetText());
} }
SvToken * pPrevTok = NULL; SvToken * pPrevTok = nullptr;
while( pTok != pPrevTok ) while( pTok != pPrevTok )
{ {
pPrevTok = pTok; pPrevTok = pTok;
...@@ -551,7 +551,7 @@ bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, bool bImported, const ...@@ -551,7 +551,7 @@ bool SvIdlWorkingBase::ReadSvIdl( SvTokenStream & rInStm, bool bImported, const
{ {
rInStm.GetToken_Next(); rInStm.GetToken_Next();
bOk = rInStm.Read( '(' ); // optional bOk = rInStm.Read( '(' ); // optional
pTok = bOk ? rInStm.GetToken_Next() : NULL; pTok = bOk ? rInStm.GetToken_Next() : nullptr;
if( pTok && pTok->IsString() ) if( pTok && pTok->IsString() )
{ {
OUString aFullName; OUString aFullName;
......
...@@ -34,8 +34,8 @@ IdlDll & GetIdlApp() ...@@ -34,8 +34,8 @@ IdlDll & GetIdlApp()
} }
IdlDll::IdlDll() IdlDll::IdlDll()
: pHashTable( NULL ) : pHashTable( nullptr )
, pGlobalNames( NULL ) , pGlobalNames( nullptr )
{} {}
......
...@@ -91,7 +91,7 @@ inline OUString tempFileHelper(OUString const & fname) ...@@ -91,7 +91,7 @@ inline OUString tempFileHelper(OUString const & fname)
{ {
OUString aTmpDir( fname.copy( 0, delimIndex ) ); OUString aTmpDir( fname.copy( 0, delimIndex ) );
osl::FileBase::getFileURLFromSystemPath( aTmpDir, aTmpDir ); osl::FileBase::getFileURLFromSystemPath( aTmpDir, aTmpDir );
osl::FileBase::createTempFile( &aTmpDir, 0, &aTmpFile ); osl::FileBase::createTempFile( &aTmpDir, nullptr, &aTmpFile );
osl::FileBase::getSystemPathFromFileURL( aTmpFile, aTmpFile ); osl::FileBase::getSystemPathFromFileURL( aTmpFile, aTmpFile );
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment