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 | |
parent | dee4645edca450c91139bb2a829bc995269de6ad (diff) |
loplugin:mergeclasses
Change-Id: I28d8bd79f266df7e9ea420f7238ed332ec4205a9
Diffstat (limited to 'store')
-rw-r--r-- | store/source/object.hxx | 48 | ||||
-rw-r--r-- | store/source/stordir.hxx | 4 | ||||
-rw-r--r-- | store/source/store.cxx | 6 | ||||
-rw-r--r-- | store/source/storlckb.hxx | 4 | ||||
-rw-r--r-- | store/source/storpage.hxx | 4 |
5 files changed, 16 insertions, 50 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 *); /*======================================================================== * diff --git a/store/source/stordir.hxx b/store/source/stordir.hxx index 8fb9de74798e..43ba3dc2badf 100644 --- a/store/source/stordir.hxx +++ b/store/source/stordir.hxx @@ -85,7 +85,7 @@ private: /** IStoreHandle query() template function specialization. */ friend OStoreDirectory_Impl* - SAL_CALL query<> (IStoreHandle *pHandle, OStoreDirectory_Impl*); + SAL_CALL query<> (OStoreObject *pHandle, OStoreDirectory_Impl*); /** Representation. */ @@ -103,7 +103,7 @@ private: }; template<> inline OStoreDirectory_Impl* -SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*) +SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreDirectory_Impl*) { if (pHandle && pHandle->isKindOf (OStoreDirectory_Impl::m_nTypeId)) { diff --git a/store/source/store.cxx b/store/source/store.cxx index c6e79a85e5a2..1b5107fc3837 100644 --- a/store/source/store.cxx +++ b/store/source/store.cxx @@ -48,7 +48,7 @@ public: static store_handle_type * SAL_CALL query (void * pHandle) { return store::query ( - static_cast<IStoreHandle*>(pHandle), + static_cast<OStoreObject*>(pHandle), static_cast<store_handle_type*>(0)); } }; @@ -68,7 +68,7 @@ storeError SAL_CALL store_acquireHandle ( storeHandle Handle ) SAL_THROW_EXTERN_C() { - IStoreHandle *pHandle = static_cast<IStoreHandle*>(Handle); + OStoreObject *pHandle = static_cast<OStoreObject*>(Handle); if (!pHandle) return store_E_InvalidHandle; @@ -83,7 +83,7 @@ storeError SAL_CALL store_releaseHandle ( storeHandle Handle ) SAL_THROW_EXTERN_C() { - IStoreHandle *pHandle = static_cast<IStoreHandle*>(Handle); + OStoreObject *pHandle = static_cast<OStoreObject*>(Handle); if (!pHandle) return store_E_InvalidHandle; diff --git a/store/source/storlckb.hxx b/store/source/storlckb.hxx index 67c4a14aea4d..4fffb471dd04 100644 --- a/store/source/storlckb.hxx +++ b/store/source/storlckb.hxx @@ -120,7 +120,7 @@ private: /** IStoreHandle query() template specialization. */ friend OStoreLockBytes* - SAL_CALL query<> (IStoreHandle *pHandle, OStoreLockBytes*); + SAL_CALL query<> (OStoreObject *pHandle, OStoreLockBytes*); /** Representation. */ @@ -139,7 +139,7 @@ private: }; template<> inline OStoreLockBytes* -SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*) +SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStoreLockBytes*) { if (pHandle && pHandle->isKindOf (OStoreLockBytes::m_nTypeId)) { diff --git a/store/source/storpage.hxx b/store/source/storpage.hxx index f400a3fbd25e..f57d720076d6 100644 --- a/store/source/storpage.hxx +++ b/store/source/storpage.hxx @@ -157,7 +157,7 @@ private: /** IStoreHandle query() template function specialization. */ friend OStorePageManager* - SAL_CALL query<> (IStoreHandle *pHandle, OStorePageManager*); + SAL_CALL query<> (OStoreObject *pHandle, OStorePageManager*); /** Representation. */ @@ -194,7 +194,7 @@ inline bool OStorePageManager::isValid() const } template<> inline OStorePageManager* -SAL_CALL query (IStoreHandle *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*) +SAL_CALL query (OStoreObject *pHandle, SAL_UNUSED_PARAMETER OStorePageManager*) { if (pHandle && pHandle->isKindOf (OStorePageManager::m_nTypeId)) { |