Kaydet (Commit) 44a46d4f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:mergeclasses

Change-Id: I28d8bd79f266df7e9ea420f7238ed332ec4205a9
üst dee4645e
......@@ -249,7 +249,6 @@ merge slideshow::internal::UserPaintEventHandler with slideshow::internal::Paint
merge slideshow::internal::View with slideshow::internal::UnoView
merge slideshow::internal::ViewRepaintHandler with (anonymous namespace)::SlideShowImpl::SeparateListenerImpl
merge slideshow::internal::ViewUpdate with slideshow::internal::ShapeManagerImpl
merge store::IStoreHandle with store::OStoreObject
merge store::PageCache with store::PageCache_Impl
merge svgio::svgreader::InfoProvider with svgio::svgreader::SvgNode
merge svl::IUndoManager with SfxUndoManager
......
......@@ -27,48 +27,21 @@
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 *);
/*========================================================================
*
......
......@@ -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))
{
......
......@@ -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;
......
......@@ -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))
{
......
......@@ -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))
{
......
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