diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-09 09:08:35 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-09 09:43:53 +0200 |
commit | cfa4ba4b2b7138f7b95fb725866ed37155ccceee (patch) | |
tree | a8796f81aa8d7eefeee59e63090f32fd2424d000 /idl | |
parent | 8bbcbcec91f723a3839bd80aa1d28e0420dfd1e6 (diff) |
simplify SvMetaObjectMemberStack
Change-Id: I7c1ba85fcb21925f5e912fa48207411e4fc1fbb4
Diffstat (limited to 'idl')
-rw-r--r-- | idl/inc/basobj.hxx | 18 | ||||
-rw-r--r-- | idl/inc/database.hxx | 4 | ||||
-rw-r--r-- | idl/source/objects/module.cxx | 2 | ||||
-rw-r--r-- | idl/source/prj/database.cxx | 2 |
4 files changed, 4 insertions, 22 deletions
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx index dbec6b476b78..af85f472c7d1 100644 --- a/idl/inc/basobj.hxx +++ b/idl/inc/basobj.hxx @@ -107,24 +107,6 @@ public: virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ); }; -class SvMetaObjectMemberStack -{ - SvRefMemberList<SvMetaObject *> aList; -public: - SvMetaObjectMemberStack() {;} - - void Push( SvMetaObject * pObj ) - { aList.push_back( pObj ); } - void Pop() { aList.pop_back(); } - SvMetaObject * Get( std::function<bool ( const SvMetaObject* )> isSvMetaObject ) - { - for( SvRefMemberList<SvMetaObject *>::reverse_iterator it = aList.rbegin(); it != aList.rend(); ++it ) - if( isSvMetaObject(*it) ) - return *it; - return nullptr; - } -}; - class SvMetaReference : public SvMetaObject { protected: diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx index c9259bf22fdf..e0bb7e2ace83 100644 --- a/idl/inc/database.hxx +++ b/idl/inc/database.hxx @@ -67,10 +67,10 @@ class SvIdlDataBase SvRefMemberList<SvMetaModule *> aModuleList; SvRefMemberList<SvMetaAttribute *> aAttrList; SvRefMemberList<SvMetaType *> aTmpTypeList; // not persistent + SvRefMemberList<SvMetaObject *> aContextStack; protected: ::std::set< OUString > m_DepFiles; - SvMetaObjectMemberStack aContextStack; OUString aPath; SvIdlError aError; void WriteReset() @@ -102,7 +102,7 @@ public: { aError = r; } const OUString & GetPath() const { return aPath; } - SvMetaObjectMemberStack & GetStack() { return aContextStack; } + SvRefMemberList<SvMetaObject *>& GetStack() { return aContextStack; } void Write(const OString& rText); static void WriteError(const OString& rErrWrn, diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx index 432421556f65..524a6d788a85 100644 --- a/idl/source/objects/module.cxx +++ b/idl/source/objects/module.cxx @@ -177,7 +177,7 @@ bool SvMetaModule::ReadSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) // set pointer to itself bOk = SvMetaObject::ReadSvIdl( rBase, rInStm ); } - rBase.GetStack().Pop(); // remove from stack + rBase.GetStack().pop_back(); // remove from stack } if( !bOk ) rInStm.Seek( nTokPos ); diff --git a/idl/source/prj/database.cxx b/idl/source/prj/database.cxx index a7f584f60c0d..52f375118463 100644 --- a/idl/source/prj/database.cxx +++ b/idl/source/prj/database.cxx @@ -87,7 +87,7 @@ void SvIdlDataBase::SetError( const OString& rError, SvToken& rTok ) void SvIdlDataBase::Push( SvMetaObject * pObj ) { - GetStack().Push( pObj ); + GetStack().push_back( pObj ); } bool SvIdlDataBase::FindId( const OString& rIdName, sal_uLong * pVal ) |