summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-11-13 21:23:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-11-14 10:11:32 +0000
commitc17f51c74ce8ef4fc4827766ce9c1c338a3e54c4 (patch)
treec5c5e491f2d8abd911c3c421e2bf379bdde2c8d3 /sot
parenta94b6ec2d57cab51d79329ea62d908f3b3713505 (diff)
The additional methods of SO2_*_REF over SV_*_REF are now unused
so they can now be replaced by SV_*_REF now Change-Id: I2207d6582cab5f41851064f3d0c773e9421c0078
Diffstat (limited to 'sot')
-rw-r--r--sot/Package_inc.mk1
-rw-r--r--sot/inc/sot/factory.hxx1
-rw-r--r--sot/inc/sot/object.hxx6
-rw-r--r--sot/inc/sot/sotref.hxx63
-rw-r--r--sot/inc/sot/storage.hxx8
-rw-r--r--sot/source/base/factory.cxx29
-rw-r--r--sot/source/base/object.cxx13
7 files changed, 6 insertions, 115 deletions
diff --git a/sot/Package_inc.mk b/sot/Package_inc.mk
index 371ab98ebbb9..4a0ff1613a07 100644
--- a/sot/Package_inc.mk
+++ b/sot/Package_inc.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_Package_add_file,sot_inc,inc/sot/formats.hxx,sot/formats.hxx))
$(eval $(call gb_Package_add_file,sot_inc,inc/sot/object.hxx,sot/object.hxx))
$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdata.hxx,sot/sotdata.hxx))
$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotdllapi.h,sot/sotdllapi.h))
-$(eval $(call gb_Package_add_file,sot_inc,inc/sot/sotref.hxx,sot/sotref.hxx))
$(eval $(call gb_Package_add_file,sot_inc,inc/sot/stg.hxx,sot/stg.hxx))
$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storage.hxx,sot/storage.hxx))
$(eval $(call gb_Package_add_file,sot_inc,inc/sot/storinfo.hxx,sot/storinfo.hxx))
diff --git a/sot/inc/sot/factory.hxx b/sot/inc/sot/factory.hxx
index b62c97f072fc..726b24382756 100644
--- a/sot/inc/sot/factory.hxx
+++ b/sot/inc/sot/factory.hxx
@@ -57,7 +57,6 @@ public:
void PutSuperClass( const SotFactory * );
virtual void * CreateInstance( SotObject ** ppObj = NULL ) const;
- void * CastAndAddRef( SotObject * ) const;
sal_Bool Is( const SotFactory * pSuperClass ) const;
const SotFactory * GetSuper( sal_uInt16 nPos ) const
diff --git a/sot/inc/sot/object.hxx b/sot/inc/sot/object.hxx
index 81d3d3739dee..b1b9316afcd3 100644
--- a/sot/inc/sot/object.hxx
+++ b/sot/inc/sot/object.hxx
@@ -20,9 +20,9 @@
#ifndef _SOT_OBJECT_HXX
#define _SOT_OBJECT_HXX
-#include <sot/sotref.hxx>
#include <sot/sotdata.hxx>
#include <tools/globname.hxx>
+#include <tools/ref.hxx>
#include "sot/sotdllapi.h"
/*************************************************************************
@@ -287,8 +287,6 @@ public:
sal_Bool Owner() const { return bOwner; }
- void* CastAndAddRef( const SotFactory * pFact );
-
sal_uInt16 GetOwnerLockCount() const { return nOwnerLockCount; }
void OwnerLock( sal_Bool bLock );
@@ -302,7 +300,7 @@ private:
};
//==================class SotObjectRef======================================
-SV_IMPL_REF(SotObject)
+SV_DECL_IMPL_REF(SotObject)
#endif // _IFACE_HXX
diff --git a/sot/inc/sot/sotref.hxx b/sot/inc/sot/sotref.hxx
deleted file mode 100644
index 4465909c3659..000000000000
--- a/sot/inc/sot/sotref.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef _SOT_SOTREF_HXX
-#define _SOT_SOTREF_HXX
-
-#include <tools/ref.hxx>
-
-//========================================================================
-#ifndef SVT_DECL_SOTOBJECT_DEFINED
-#define SVT_DECL_SOTOBJECT_DEFINED
-class SotObject;
-class SotObjectRef
-{
- PRV_SV_DECL_REF(SotObject)
-};
-#endif
-
-//========================================================================
-#define SO2_DECL_REF(ClassName) \
-class ClassName; \
-class ClassName##Ref \
-{ \
- PRV_SV_DECL_REF(ClassName) \
- inline ClassName##Ref( const SotObjectRef & ); \
- inline ClassName##Ref( SotObject * pObjP ); \
-};
-
-#define SO2_IMPL_REF(ClassName) \
-SV_IMPL_REF(ClassName) \
-inline ClassName##Ref::ClassName##Ref( const SotObjectRef & r ) \
-{ \
- pObj = (ClassName *)ClassName::ClassFactory()->CastAndAddRef( &r ); \
-} \
-inline ClassName##Ref::ClassName##Ref( SotObject * pObjP ) \
-{ \
- pObj = (ClassName *)ClassName::ClassFactory()->CastAndAddRef( pObjP );\
-}
-
-
-#define SO2_DECL_IMPL_REF(ClassName) \
- SO2_DECL_REF(ClassName) \
- SO2_IMPL_REF(ClassName)
-
-#endif // _SO2REF_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sot/storage.hxx b/sot/inc/sot/storage.hxx
index 3a01028df107..abe1d831fa08 100644
--- a/sot/inc/sot/storage.hxx
+++ b/sot/inc/sot/storage.hxx
@@ -80,9 +80,9 @@ public:
#ifndef SOT_DECL_SOTSTORAGESTREAM_DEFINED
#define SOT_DECL_SOTSTORAGESTREAM_DEFINED
-SO2_DECL_REF(SotStorageStream)
+SV_DECL_REF(SotStorageStream)
#endif
-SO2_IMPL_REF(SotStorageStream)
+SV_IMPL_REF(SotStorageStream)
namespace ucbhelper
{
@@ -210,9 +210,9 @@ public:
#ifndef SOT_DECL_SOTSTORAGE_DEFINED
#define SOT_DECL_SOTSTORAGE_DEFINED
-SO2_DECL_REF(SotStorage)
+SV_DECL_REF(SotStorage)
#endif
-SO2_IMPL_REF(SotStorage)
+SV_IMPL_REF(SotStorage)
#define SvStorage SotStorage
#define SvStorageRef SotStorageRef
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index 783568308912..28c285027cd7 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -195,35 +195,6 @@ void * SotFactory::CreateInstance( SotObject ** ppObj ) const
return pCreateFunc( ppObj );
}
-//=========================================================================
-void * SotFactory::CastAndAddRef
-(
- SotObject * pObj /* Das Objekt von dem der Typ gepr"uft wird. */
-) const
-/* [Beschreibung]
-
- Ist eine Optimierung, damit die Ref-Klassen k"urzer implementiert
- werden k"onnen. pObj wird auf den Typ der Factory gecastet.
- In c++ (wenn es immer erlaubt w"are) w"urde der void * wie im
- Beispiel gebildet.
- Factory der Klasse SvPersist.
- void * p = (void *)(SvPersist *)pObj;
-
- [R"uckgabewert]
-
- void *, NULL, pObj war NULL oder das Objekt war nicht vom Typ
- der Factory.
- Ansonsten wird pObj zuerst auf den Typ der Factory
- gecastet und dann auf void *.
-
- [Querverweise]
-
- <SotObject::CastAndAddRef>
-*/
-{
- return pObj ? pObj->CastAndAddRef( this ) : NULL;
-}
-
/*************************************************************************
|* SotFactory::Is()
|*
diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx
index 3bf6d92bda14..b69d2602d356 100644
--- a/sot/source/base/object.cxx
+++ b/sot/source/base/object.cxx
@@ -72,19 +72,6 @@ IUnknown * SotObject::GetInterface( const SvGlobalName & )
return NULL;
}
-/*************************************************************************
-|* SotObject::CastAndAddRef()
-|*
-|* Beschreibung
-*************************************************************************/
-void* SotObject::CastAndAddRef( const SotFactory * pFact )
-{
- void * pCast = Cast( pFact );
- if( pCast )
- AddRef();
- return pCast;
-}
-
//=========================================================================
void SotObject::OwnerLock
(