diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-09-30 16:10:07 +0200 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-10-06 07:29:37 +0000 |
commit | 89d39bc100aabf5dccbe77c0b5c0c85736e85b39 (patch) | |
tree | 871a91210913ecee91530c95392534bf18f80f3f /idl/inc/basobj.hxx | |
parent | 32b9901dae7403453d773f5904de15551a323595 (diff) |
tdf#94559: 4th step to remove rtti.hxx
replaced use of PTR_CAST, IS_TYPE, ISA in
idl, editeng, sc, sd, sw, sfx2, sot, starmath
Change-Id: I4a5bba4fdc4829099618c09b690c83f876a3d653
Reviewed-on: https://gerrit.libreoffice.org/19132
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'idl/inc/basobj.hxx')
-rw-r--r-- | idl/inc/basobj.hxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx index 71dc13675b46..f63e1580f569 100644 --- a/idl/inc/basobj.hxx +++ b/idl/inc/basobj.hxx @@ -23,7 +23,7 @@ #include <tools/ref.hxx> #include <bastype.hxx> #include <tools/pstm.hxx> - +#include <functional> class SvTokenStream; class SvMetaObject; class SvIdlDataBase; @@ -67,6 +67,10 @@ public: virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ); virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ); }; +template<class T> bool checkSvMetaObject(const SvMetaObject* pObject) +{ + return dynamic_cast<const T*>(pObject) != nullptr; +} class SvMetaObjectMemberStack { @@ -77,10 +81,10 @@ public: void Push( SvMetaObject * pObj ) { aList.push_back( pObj ); } SvMetaObject * Pop() { return aList.pop_back(); } - SvMetaObject * Get( TypeId nType ) + SvMetaObject * Get( std::function<bool ( const SvMetaObject* )> isSvMetaObject ) { for( SvMetaObjectMemberList::reverse_iterator it = aList.rbegin(); it != aList.rend(); ++it ) - if( (*it)->IsA( nType ) ) + if( isSvMetaObject(*it) ) return *it; return NULL; } |