Commit aa2ab56e authored by eseidel's avatar eseidel

Bug #: 5391

Submitted by: Julien Palmas <julien.palmas@gmail.com>
Reviewed by: eseidel
        Merged over Shared -> Shared<T> change from kdom.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5391

        * WebCore.xcodeproj/project.pbxproj:
        * kdom/Shared.h:
        (KDOM::Shared::Shared):
        (KDOM::Shared::~Shared):
        (KDOM::Shared::refCount):
        (KDOM::Shared::ref):
        (KDOM::Shared::deref):
        * kdom/SharedPtr.h: Added.
        (KDOM::SharedPtr::SharedPtr):
        (KDOM::SharedPtr::~SharedPtr):
        (KDOM::SharedPtr::isNull):
        (KDOM::SharedPtr::notNull):
        (KDOM::SharedPtr::reset):
        (KDOM::SharedPtr::get):
        (KDOM::SharedPtr::operator!):
        (KDOM::SharedPtr::operator bool):
        (KDOM::SharedPtr::operator==):
        (KDOM::::operator):
        * kdom/TreeShared.h:
        (KDOM::TreeShared::TreeShared):
        (KDOM::TreeShared::~TreeShared):
        (KDOM::TreeShared::refCount):
        (KDOM::TreeShared::ref):
        (KDOM::TreeShared::deref):
        (KDOM::TreeShared::parent):
        (KDOM::TreeShared::setParent):
        * kdom/core/DOMConfigurationImpl.cpp:
        (DOMConfigurationImpl::DOMConfigurationImpl):
        * kdom/core/DOMConfigurationImpl.h:
        * kdom/core/DOMErrorHandlerImpl.cpp:
        (DOMErrorHandlerImpl::DOMErrorHandlerImpl):
        * kdom/core/DOMErrorHandlerImpl.h:
        * kdom/core/DOMErrorImpl.cpp:
        (DOMErrorImpl::DOMErrorImpl):
        * kdom/core/DOMErrorImpl.h:
        (KDOM::):
        * kdom/core/DOMExceptionImpl.cpp:
        (DOMExceptionImpl::DOMExceptionImpl):
        * kdom/core/DOMExceptionImpl.h:
        * kdom/core/DOMList.h:
        (KDOM::DOMList::DOMList):
        (KDOM::DOMList::~DOMList):
        * kdom/core/DOMLocatorImpl.cpp:
        (DOMLocatorImpl::DOMLocatorImpl):
        * kdom/core/DOMLocatorImpl.h:
        * kdom/core/DOMObjectImpl.cpp:
        (DOMObjectImpl::DOMObjectImpl):
        * kdom/core/DOMObjectImpl.h:
        * kdom/core/DOMStringImpl.cpp:
        (DOMStringImpl::DOMStringImpl):
        * kdom/core/DOMStringImpl.h:
        * kdom/core/DOMUserDataImpl.cpp:
        (DOMUserDataImpl::DOMUserDataImpl):
        * kdom/core/DOMUserDataImpl.h:
        * kdom/core/NamedNodeMapImpl.cpp:
        (NamedNodeMapImpl::NamedNodeMapImpl):
        * kdom/core/NamedNodeMapImpl.h:
        * kdom/core/NodeImpl.h:
        * kdom/core/NodeListImpl.cpp:
        (NodeListImpl::NodeListImpl):
        * kdom/core/NodeListImpl.h:
        * kdom/core/TypeInfoImpl.cpp:
        (TypeInfoImpl::TypeInfoImpl):
        * kdom/core/TypeInfoImpl.h:
        * kdom/css/CSSRuleListImpl.cpp:
        (CSSRuleListImpl::CSSRuleListImpl):
        * kdom/css/CSSRuleListImpl.h:
        * kdom/css/CounterImpl.cpp:
        (CounterImpl::CounterImpl):
        * kdom/css/CounterImpl.h:
        * kdom/css/RGBColorImpl.cpp:
        (RGBColorImpl::RGBColorImpl):
        * kdom/css/RGBColorImpl.h:
        * kdom/css/RectImpl.cpp:
        (RectImpl::RectImpl):
        * kdom/css/RectImpl.h:
        * kdom/css/RenderStyle.cpp:
        (RenderStyle::RenderStyle):
        * kdom/css/RenderStyle.h:
        (KDOM::RenderStyle::RenderStyle):
        * kdom/css/RenderStyleDefs.cpp:
        (StyleSurroundData::StyleSurroundData):
        (StyleBoxData::StyleBoxData):
        (StyleVisualData::StyleVisualData):
        (StyleBackgroundData::StyleBackgroundData):
        (StyleMarqueeData::StyleMarqueeData):
        (StyleCSS3NonInheritedData::StyleCSS3NonInheritedData):
        (StyleCSS3InheritedData::StyleCSS3InheritedData):
        (StyleInheritedData::StyleInheritedData):
        * kdom/css/RenderStyleDefs.h:
        (KDOM::BorderData::BorderData):
        * kdom/css/StyleSheetListImpl.cpp:
        (StyleSheetListImpl::StyleSheetListImpl):
        * kdom/css/StyleSheetListImpl.h:
        * kdom/events/EventExceptionImpl.cpp:
        (EventExceptionImpl::EventExceptionImpl):
        * kdom/events/EventExceptionImpl.h:
        * kdom/events/EventImpl.cpp:
        (EventImpl::EventImpl):
        * kdom/events/EventImpl.h:
        * kdom/events/EventListenerImpl.cpp:
        (EventListenerImpl::EventListenerImpl):
        * kdom/events/EventListenerImpl.h:
        * kdom/ls/LSExceptionImpl.cpp:
        (LSExceptionImpl::LSExceptionImpl):
        * kdom/ls/LSExceptionImpl.h:
        * kdom/ls/LSInputImpl.cpp:
        (LSInputImpl::LSInputImpl):
        * kdom/ls/LSInputImpl.h:
        * kdom/ls/LSOutputImpl.cpp:
        (LSOutputImpl::LSOutputImpl):
        * kdom/ls/LSOutputImpl.h:
        * kdom/ls/LSParserFilterImpl.cpp:
        (LSParserFilterImpl::LSParserFilterImpl):
        * kdom/ls/LSParserFilterImpl.h:
        * kdom/ls/LSResourceResolverImpl.cpp:
        (LSResourceResolverImpl::LSResourceResolverImpl):
        * kdom/ls/LSResourceResolverImpl.h:
        * kdom/ls/LSSerializerImpl.cpp:
        (LSSerializerImpl::LSSerializerImpl):
        * kdom/ls/LSSerializerImpl.h:
        * kdom/range/RangeExceptionImpl.cpp:
        (RangeExceptionImpl::RangeExceptionImpl):
        * kdom/range/RangeExceptionImpl.h:
        * kdom/range/RangeImpl.cpp:
        (RangeImpl::RangeImpl):
        * kdom/range/RangeImpl.h:
        * kdom/traversal/NodeFilterImpl.cpp:
        (NodeFilterImpl::NodeFilterImpl):
        * kdom/traversal/NodeFilterImpl.h:
        (KDOM::NodeFilterCondition::NodeFilterCondition):
        (KDOM::NodeFilterCondition::~NodeFilterCondition):
        (KDOM::NodeFilterCondition::acceptNode):
        * kdom/traversal/TraversalImpl.cpp:
        (TraversalImpl::TraversalImpl):
        * kdom/traversal/TraversalImpl.h:
        * kdom/views/AbstractViewImpl.cpp:
        (AbstractViewImpl::AbstractViewImpl):
        * kdom/views/AbstractViewImpl.h:
        * kdom/xpath/XPathExceptionImpl.h:
        * kdom/xpath/XPathExpressionImpl.h:
        * kdom/xpath/XPathNSResolverImpl.h:
        * kdom/xpath/XPathResultImpl.h:
        * kdom/xpointer/NBCImpl.cpp:
        (NBCImpl::NBCImpl):
        * kdom/xpointer/NBCImpl.h:
        * kdom/xpointer/PointerPartImpl.cpp:
        (PointerPartImpl::PointerPartImpl):
        * kdom/xpointer/PointerPartImpl.h:
        * kdom/xpointer/XPointerExceptionImpl.cpp:
        (XPointerExceptionImpl::XPointerExceptionImpl):
        * kdom/xpointer/XPointerExceptionImpl.h:
        * kdom/xpointer/XPointerExpressionImpl.cpp:
        (XPointerExpressionImpl::XPointerExpressionImpl):
        * kdom/xpointer/XPointerExpressionImpl.h:
        * kdom/xpointer/XPointerResultImpl.cpp:
        (XPointerResultImpl::XPointerResultImpl):
        * kdom/xpointer/XPointerResultImpl.h:
        * ksvg2/css/SVGRenderStyleDefs.cpp:
        (StyleFillData::StyleFillData):
        (StyleStrokeData::StyleStrokeData):
        (StyleStopData::StyleStopData):
        (StyleClipData::StyleClipData):
        (StyleMarkerData::StyleMarkerData):
        (StyleMiscData::StyleMiscData):
        * ksvg2/css/SVGRenderStyleDefs.h:
        * ksvg2/svg/SVGAngleImpl.cpp:
        (SVGAngleImpl::SVGAngleImpl):
        * ksvg2/svg/SVGAngleImpl.h:
        * ksvg2/svg/SVGAnimatedBooleanImpl.cpp:
        (SVGAnimatedBooleanImpl::SVGAnimatedBooleanImpl):
        * ksvg2/svg/SVGAnimatedBooleanImpl.h:
        * ksvg2/svg/SVGAnimatedEnumerationImpl.cpp:
        (SVGAnimatedEnumerationImpl::SVGAnimatedEnumerationImpl):
        * ksvg2/svg/SVGAnimatedEnumerationImpl.h:
        * ksvg2/svg/SVGAnimatedIntegerImpl.cpp:
        (SVGAnimatedIntegerImpl::SVGAnimatedIntegerImpl):
        * ksvg2/svg/SVGAnimatedIntegerImpl.h:
        * ksvg2/svg/SVGAnimatedNumberImpl.cpp:
        (SVGAnimatedNumberImpl::SVGAnimatedNumberImpl):
        * ksvg2/svg/SVGAnimatedNumberImpl.h:
        * ksvg2/svg/SVGAnimatedTemplate.h:
        (KSVG::SVGAnimatedTemplate::SVGAnimatedTemplate):
        * ksvg2/svg/SVGExceptionImpl.cpp:
        (SVGExceptionImpl::SVGExceptionImpl):
        * ksvg2/svg/SVGExceptionImpl.h:
        * ksvg2/svg/SVGLengthImpl.cpp:
        (SVGLengthImpl::SVGLengthImpl):
        * ksvg2/svg/SVGLengthImpl.h:
        * ksvg2/svg/SVGMatrixImpl.cpp:
        (SVGMatrixImpl::SVGMatrixImpl):
        * ksvg2/svg/SVGMatrixImpl.h:
        * ksvg2/svg/SVGNumberImpl.cpp:
        (SVGNumberImpl::SVGNumberImpl):
        * ksvg2/svg/SVGNumberImpl.h:
        * ksvg2/svg/SVGPathSegImpl.cpp:
        (SVGPathSegImpl::SVGPathSegImpl):
        * ksvg2/svg/SVGPathSegImpl.h:
        * ksvg2/svg/SVGPointImpl.cpp:
        (SVGPointImpl::SVGPointImpl):
        * ksvg2/svg/SVGPointImpl.h:
        * ksvg2/svg/SVGPreserveAspectRatioImpl.cpp:
        (SVGPreserveAspectRatioImpl::SVGPreserveAspectRatioImpl):
        * ksvg2/svg/SVGPreserveAspectRatioImpl.h:
        * ksvg2/svg/SVGRectImpl.cpp:
        (SVGRectImpl::SVGRectImpl):
        * ksvg2/svg/SVGRectImpl.h:
        * ksvg2/svg/SVGTransformImpl.cpp:
        (SVGTransformImpl::SVGTransformImpl):
        * ksvg2/svg/SVGTransformImpl.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 97194b8f
......@@ -25,19 +25,25 @@
namespace KDOM
{
template<class T>
class Shared
{
public:
Shared();
virtual ~Shared();
Shared() : m_ref(0) { }
~Shared() { }
void ref();
virtual void deref();
int refCount() const { return m_ref; }
int refCount() const;
void ref() { m_ref++; }
void deref()
{
if(m_ref) m_ref--;
if(!m_ref) delete static_cast<T *>(this);
}
protected:
int m_ref;
unsigned int m_ref;
};
template<class T>
......
/*
Copyright(C) KHTML Team
Copyright(C) 2005 Frans Englich <frans.englich@telia.com>
This file is part of the KDE project
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or(at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef KDOM_SharedPtr_H
#define KDOM_SharedPtr_H
#include <kdebug.h>
#include <QtGlobal>
namespace KDOM
{
/**
* A smart pointer for handling pointers to Shared() classes.
*
* @see Shared
* @author the KHTML team
* @author Frans Englich <frans.englich@telia.com>
*/
template<class T> class SharedPtr
{
public:
SharedPtr() : m_ptr(0) {}
explicit SharedPtr(T *ptr) : m_ptr(ptr)
{
if(m_ptr)
m_ptr->ref();
}
SharedPtr(const SharedPtr &o) : m_ptr(o.m_ptr)
{
if(m_ptr)
m_ptr->ref();
}
template<typename X>
SharedPtr(const SharedPtr<X> &o) : m_ptr(static_cast<T *>(o.get()))
{
if(m_ptr)
m_ptr->ref();
}
~SharedPtr()
{
if(m_ptr)
m_ptr->deref();
}
bool isNull() const { return m_ptr == 0; }
bool notNull() const { return m_ptr != 0; }
void reset()
{
if(m_ptr)
m_ptr->deref();
m_ptr = 0;
}
void reset(T *o)
{
if(o)
o->ref();
if(m_ptr)
m_ptr->deref();
m_ptr = o;
}
T *get() const
{
return m_ptr;
}
T &operator*() const;
T *operator->() const;
bool operator!() const
{
return m_ptr == 0;
}
operator bool() const
{
return m_ptr != 0;
}
inline friend bool operator==(const SharedPtr &a, const SharedPtr &b)
{
return a.m_ptr == b.m_ptr;
}
inline friend bool operator==(const SharedPtr &a, const T *b)
{
return a.m_ptr == b;
}
inline friend bool operator==(const T *a, const SharedPtr &b)
{
return a == b.m_ptr;
}
SharedPtr &operator=(const SharedPtr &);
private:
T* m_ptr;
};
template<typename T>
SharedPtr<T> &SharedPtr<T>::operator=(const SharedPtr<T> &o)
{
if(o.m_ptr)
o.m_ptr->ref();
if(m_ptr)
m_ptr->deref();
m_ptr = o.m_ptr;
return *this;
}
template<typename T>
T &SharedPtr<T>::operator*() const
{
#ifndef NDEBUG
Q_CHECK_PTR(m_ptr);
if(!m_ptr)
kdDebug(26560) << kdBacktrace() << endl;
#endif
return *m_ptr;
}
template<typename T>
T *SharedPtr<T>::operator->() const
{
#ifndef NDEBUG
Q_CHECK_PTR(m_ptr);
if(!m_ptr)
kdDebug(26560) << kdBacktrace() << endl;
#endif
return m_ptr;
}
};
#endif
// vim:ts=4:noet
......@@ -27,25 +27,29 @@
namespace KDOM
{
template<class T> class TreeShared : public Shared
template<class T>
class TreeShared
{
public:
TreeShared() : Shared() { m_parent = 0; }
virtual ~TreeShared() { }
TreeShared() : m_ref(0), m_parent(0) { }
~TreeShared() { }
void setParent(T *parent) { m_parent = parent; }
T *parent() const { return m_parent; }
int refCount() const { return m_ref; }
virtual void deref()
{
if(m_ref)
m_ref--;
void ref() { m_ref++; }
if(!m_ref && !m_parent)
delete this;
void deref()
{
if(m_ref) m_ref--;
if(!m_ref && !m_parent) delete static_cast<T *>(this);
}
T *parent() const { return m_parent; }
void setParent(T *parent) { m_parent = parent; }
protected:
unsigned int m_ref;
T *m_parent;
};
};
......
......@@ -32,7 +32,7 @@ using namespace KDOM;
DOMStringListImpl *DOMConfigurationImpl::m_paramNames = 0;
DOMConfigurationImpl::DOMConfigurationImpl() : Shared()
DOMConfigurationImpl::DOMConfigurationImpl() : Shared<DOMConfigurationImpl>()
{
m_flags = 0;
m_flags |= FEATURE_COMMENTS;
......
......@@ -33,7 +33,7 @@ namespace KDOM
class DOMUserDataImpl;
class DOMStringListImpl;
class DOMConfigurationImpl : public Shared
class DOMConfigurationImpl : public Shared<DOMConfigurationImpl>
{
public:
DOMConfigurationImpl();
......
......@@ -26,7 +26,7 @@
using namespace KDOM;
DOMErrorHandlerImpl::DOMErrorHandlerImpl() : Shared()
DOMErrorHandlerImpl::DOMErrorHandlerImpl() : Shared<DOMErrorHandlerImpl>()
{
}
......
......@@ -30,7 +30,7 @@ namespace KDOM
{
class DOMErrorImpl;
class DOMErrorHandlerImpl : public Shared
class DOMErrorHandlerImpl : public Shared<DOMErrorHandlerImpl>
{
public:
DOMErrorHandlerImpl();
......
......@@ -28,7 +28,7 @@
using namespace KDOM;
DOMErrorImpl::DOMErrorImpl() : Shared()
DOMErrorImpl::DOMErrorImpl() : Shared<DOMErrorImpl>()
{
m_severity = 0;
m_message = 0;
......
......@@ -35,11 +35,11 @@ namespace KDOM
{
SEVERITY_WARNING = 1,
SEVERITY_ERROR = 2,
SEVERITY_FATAL_ERROR = 3,
SEVERITY_FATAL_ERROR = 3
};
// Introduced in DOM Level 3:
class DOMErrorImpl : public Shared
class DOMErrorImpl : public Shared<DOMErrorImpl>
{
public:
DOMErrorImpl();
......
......@@ -25,7 +25,7 @@
using namespace KDOM;
DOMExceptionImpl::DOMExceptionImpl(unsigned short code) : Shared()
DOMExceptionImpl::DOMExceptionImpl(unsigned short code) : Shared<DOMExceptionImpl>()
{
ref(); // ExceptionImpl classes need to ref themselves() as it's just
// very convienient to just use 'throw new ExceptionImpl' ...
......
......@@ -27,7 +27,7 @@
namespace KDOM
{
class DOMExceptionImpl : public Shared
class DOMExceptionImpl : public Shared<DOMExceptionImpl>
{
public:
DOMExceptionImpl(unsigned short code);
......
......@@ -29,12 +29,12 @@
namespace KDOM
{
template<class T>
class DOMList : public Shared
class DOMList : public Shared<DOMList<T> >
{
public:
DOMList() : Shared() { m_impl.setAutoDelete(false); }
DOMList() : Shared<DOMList<T> >() { m_impl.setAutoDelete(false); }
DOMList(const DOMList &other) { *this = other; }
~DOMList() { clear(); }
virtual ~DOMList() { clear(); }
DOMList<T> &operator=(const DOMList<T> &other)
{
......
......@@ -27,7 +27,7 @@
using namespace KDOM;
DOMLocatorImpl::DOMLocatorImpl() : Shared()
DOMLocatorImpl::DOMLocatorImpl() : Shared<DOMLocatorImpl>()
{
m_utf16Offset = -1;
m_relatedNode = 0;
......
......@@ -31,7 +31,7 @@ namespace KDOM
class DOMStringImpl;
// Introduced in DOM Level 3:
class DOMLocatorImpl : public Shared
class DOMLocatorImpl : public Shared<DOMLocatorImpl>
{
public:
DOMLocatorImpl();
......
......@@ -28,12 +28,12 @@ using namespace KDOM;
const bool False = false;
const bool True = true;
DOMObjectImpl::DOMObjectImpl() : Shared()
DOMObjectImpl::DOMObjectImpl() : Shared<DOMObjectImpl>()
{
m_userData = 0;
}
DOMObjectImpl::DOMObjectImpl(bool b) : Shared()
DOMObjectImpl::DOMObjectImpl(bool b) : Shared<DOMObjectImpl>()
{
m_userData = b ? (void *)&True : (void *)&False;
}
......
......@@ -28,7 +28,7 @@
namespace KDOM
{
// Introduced in DOM Level 3:
class DOMObjectImpl : public Shared
class DOMObjectImpl : public Shared<DOMObjectImpl>
{
public:
DOMObjectImpl();
......
......@@ -32,13 +32,13 @@ using namespace KDOM;
#define QT_ALLOC_QCHAR_VEC(N) (QChar *) new char[sizeof(QChar) * (N)]
#define QT_DELETE_QCHAR_VEC(P) delete[]((char *) (P))
DOMStringImpl::DOMStringImpl() : Shared()
DOMStringImpl::DOMStringImpl() : Shared<DOMStringImpl>()
{
m_str = 0;
m_len = 0;
}
DOMStringImpl::DOMStringImpl(const QChar *str, unsigned int len) : Shared()
DOMStringImpl::DOMStringImpl(const QChar *str, unsigned int len) : Shared<DOMStringImpl>()
{
bool haveStr = str && len;
m_str = QT_ALLOC_QCHAR_VEC(haveStr ? len : 1);
......@@ -56,7 +56,7 @@ DOMStringImpl::DOMStringImpl(const QChar *str, unsigned int len) : Shared()
}
}
DOMStringImpl::DOMStringImpl(const QString &str) : Shared()
DOMStringImpl::DOMStringImpl(const QString &str) : Shared<DOMStringImpl>()
{
int len = str.length();
m_str = QT_ALLOC_QCHAR_VEC(len);
......@@ -64,7 +64,7 @@ DOMStringImpl::DOMStringImpl(const QString &str) : Shared()
m_len = len;
}
DOMStringImpl::DOMStringImpl(const char *str) : Shared()
DOMStringImpl::DOMStringImpl(const char *str) : Shared<DOMStringImpl>()
{
if(str && *str)
{
......
......@@ -33,7 +33,7 @@
namespace KDOM
{
class DOMStringImpl : public Shared
class DOMStringImpl : public Shared<DOMStringImpl>
{
public:
DOMStringImpl();
......
......@@ -28,12 +28,12 @@ using namespace KDOM;
const bool False = false;
const bool True = true;
DOMUserDataImpl::DOMUserDataImpl() : Shared()
DOMUserDataImpl::DOMUserDataImpl() : Shared<DOMUserDataImpl>()
{
m_userData = 0;
}
DOMUserDataImpl::DOMUserDataImpl(bool b) : Shared()
DOMUserDataImpl::DOMUserDataImpl(bool b) : Shared<DOMUserDataImpl>()
{
m_userData = b ? (void *)&True : (void *)&False;
}
......
......@@ -35,7 +35,7 @@ namespace KJS
namespace KDOM
{
// Introduced in DOM Level 3:
class DOMUserDataImpl : public Shared
class DOMUserDataImpl : public Shared<DOMUserDataImpl>
{
public:
DOMUserDataImpl();
......
......@@ -34,7 +34,7 @@
using namespace KDOM;
NamedNodeMapImpl::NamedNodeMapImpl() : Shared()
NamedNodeMapImpl::NamedNodeMapImpl() : Shared<NamedNodeMapImpl>()
{
}
......
......@@ -36,7 +36,7 @@
namespace KDOM
{
class NamedNodeMapImpl : public Shared
class NamedNodeMapImpl : public Shared<NamedNodeMapImpl>
{
public:
NamedNodeMapImpl();
......
......@@ -60,8 +60,9 @@ namespace KDOM
class NodeListImpl;
class DocumentImpl;
class NamedAttrMapImpl;
template<typename T> class SharedPtr;
class DocumentPtr : public Shared
class DocumentPtr : public Shared<DocumentPtr>
{
public:
DocumentPtr() { doc = 0; }
......@@ -82,6 +83,8 @@ namespace KDOM
class NodeImpl : public EventTargetImpl
{
public:
typedef SharedPtr<NodeImpl> Ptr;
NodeImpl(DocumentPtr *doc);
virtual ~NodeImpl();
......
......@@ -32,7 +32,7 @@
using namespace KDOM;
NodeListImpl::NodeListImpl(NodeImpl *refNode) : Shared(), m_refNode(refNode)
NodeListImpl::NodeListImpl(NodeImpl *refNode) : Shared<NodeListImpl>(), m_refNode(refNode)
{
if(m_refNode)
m_refNode->ref();
......
......@@ -34,7 +34,7 @@
namespace KDOM
{
class NodeImpl;
class NodeListImpl : public Shared
class NodeListImpl : public Shared<NodeListImpl>
{
public:
NodeListImpl(NodeImpl *_refNode);
......
......@@ -24,7 +24,7 @@
using namespace KDOM;
TypeInfoImpl::TypeInfoImpl() : Shared()
TypeInfoImpl::TypeInfoImpl()
{
}
......
......@@ -30,7 +30,7 @@ namespace KDOM
class DOMStringImpl;
// Introduced in DOM Level 3:
class TypeInfoImpl : public Shared
class TypeInfoImpl : public Shared<TypeInfoImpl>
{
public:
TypeInfoImpl();
......
......@@ -27,7 +27,7 @@
using namespace KDOM;
CSSRuleListImpl::CSSRuleListImpl() : Shared()
CSSRuleListImpl::CSSRuleListImpl() : Shared<CSSRuleListImpl>()
{
}
......
......@@ -30,7 +30,7 @@
namespace KDOM
{
class CSSRuleImpl;
class CSSRuleListImpl : public Shared
class CSSRuleListImpl : public Shared<CSSRuleListImpl>
{
public:
CSSRuleListImpl();
......
......@@ -27,7 +27,7 @@
using namespace KDOM;
CounterImpl::CounterImpl() : Shared()
CounterImpl::CounterImpl() : Shared<CounterImpl>()
{
m_listStyle = 0;
m_separator = 0;
......
......@@ -28,7 +28,7 @@
namespace KDOM
{
class CounterImpl : public Shared
class CounterImpl : public Shared<CounterImpl>
{
public:
CounterImpl();
......
......@@ -26,16 +26,16 @@
using namespace KDOM;
RGBColorImpl::RGBColorImpl(CDFInterface *interface) : Shared(), m_interface(interface)
RGBColorImpl::RGBColorImpl(CDFInterface *interface) : Shared<RGBColorImpl>(), m_interface(interface)
{
}
RGBColorImpl::RGBColorImpl(CDFInterface *interface, const QRgb &color) : Shared(), m_interface(interface)
RGBColorImpl::RGBColorImpl(CDFInterface *interface, const QRgb &color) : Shared<RGBColorImpl>(), m_interface(interface)
{
m_color = color;
}
RGBColorImpl::RGBColorImpl(CDFInterface *interface, const QColor &color) : Shared(), m_interface(interface)
RGBColorImpl::RGBColorImpl(CDFInterface *interface, const QColor &color) : Shared<RGBColorImpl>(), m_interface(interface)
{