diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-06 15:07:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-07 08:27:26 +0200 |
commit | 44a46d4f3bc2852851f092b168e4b84d37719ca9 (patch) | |
tree | 8d2c6444c18eb21bd5223f271b66ed6aa6aa1b45 /store/source/object.hxx | |
parent | loplugin:mergeclasses (diff) | |
download | core-44a46d4f3bc2852851f092b168e4b84d37719ca9.tar.gz core-44a46d4f3bc2852851f092b168e4b84d37719ca9.zip |
loplugin:mergeclasses
Change-Id: I28d8bd79f266df7e9ea420f7238ed332ec4205a9
Diffstat (limited to 'store/source/object.hxx')
-rw-r--r-- | store/source/object.hxx | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/store/source/object.hxx b/store/source/object.hxx index 40bc287652ad..b44d83bef675 100644 --- a/store/source/object.hxx +++ b/store/source/object.hxx @@ -29,46 +29,19 @@ namespace store /*======================================================================== * - * IStoreHandle interface. - * - *======================================================================*/ -class IStoreHandle : public virtual salhelper::SimpleReferenceObject -{ -public: - /** Replaces dynamic_cast type checking. - */ - virtual bool isKindOf (sal_uInt32 nTypeId) = 0; - -protected: - virtual ~IStoreHandle() {} -}; - -/** Template helper function as dynamic_cast replacement. - */ -template<class store_handle_type> -store_handle_type * SAL_CALL query ( - IStoreHandle * pHandle, store_handle_type *); - -/*======================================================================== - * * OStoreObject interface. * *======================================================================*/ -class OStoreObject : public store::IStoreHandle +class OStoreObject : public virtual salhelper::SimpleReferenceObject { - /** Template function specialization as dynamic_cast replacement. - */ - friend OStoreObject* - SAL_CALL query<> (IStoreHandle *pHandle, OStoreObject*); - public: /** Construction. */ OStoreObject() {} - /** IStoreHandle. + /** Replaces dynamic_cast type checking. */ - virtual bool isKindOf (sal_uInt32 nTypeId) SAL_OVERRIDE; + virtual bool isKindOf (sal_uInt32 nTypeId); protected: /** Destruction. @@ -83,18 +56,11 @@ private: OStoreObject& operator= (const OStoreObject&) SAL_DELETED_FUNCTION; }; -/** Template function specialization as dynamic_cast replacement. +/** Template helper function as dynamic_cast replacement. */ -template<> inline OStoreObject* -SAL_CALL query (IStoreHandle *pHandle, OStoreObject*) -{ - if (pHandle && pHandle->isKindOf (OStoreObject::m_nTypeId)) - { - // Handle is kind of OStoreObject. - return static_cast<OStoreObject*>(pHandle); - } - return 0; -} +template<class store_handle_type> +store_handle_type * SAL_CALL query ( + OStoreObject * pHandle, store_handle_type *); /*======================================================================== * |