From bded4ddd6da0de2c465b28a51d773720338542c3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 3 Jul 2015 11:22:38 +0200 Subject: Make RegistryTypeWriter non-copyable (and note the operator == vs. = typo) Change-Id: I9c25149967ed9b80f5e8f014de0dfee2e8f485d8 --- registry/source/reflwrit.cxx | 26 -------------------------- registry/source/reflwrit.hxx | 10 +++------- 2 files changed, 3 insertions(+), 33 deletions(-) (limited to 'registry') diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index 288beb9d73ad..689bc2daa099 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -1165,14 +1165,6 @@ void TypeWriter::createBlop() extern "C" { -static void TYPEREG_CALLTYPE acquire(TypeWriterImpl hEntry) -{ - TypeWriter* pEntry = static_cast(hEntry); - - if (pEntry != NULL) - pEntry->m_refCount++; -} - static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry) { TypeWriter* pEntry = static_cast(hEntry); @@ -1374,29 +1366,11 @@ RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass, referenceCount); } -RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy) - : m_hImpl(toCopy.m_hImpl) -{ - acquire(m_hImpl); -} - RegistryTypeWriter::~RegistryTypeWriter() { release(m_hImpl); } -RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign) -{ - if (m_hImpl != toAssign.m_hImpl) - { - release(m_hImpl); - m_hImpl = toAssign.m_hImpl; - acquire(m_hImpl); - } - - return *this; -} - void RegistryTypeWriter::setFieldData( sal_uInt16 index, const rtl::OUString& name, const rtl::OUString& typeName, diff --git a/registry/source/reflwrit.hxx b/registry/source/reflwrit.hxx index 9bb8475302d3..dcf2eecaf722 100644 --- a/registry/source/reflwrit.hxx +++ b/registry/source/reflwrit.hxx @@ -58,18 +58,12 @@ public: sal_uInt16 methodCount, sal_uInt16 referenceCount); - /// Copy constructcor - RegistryTypeWriter(const RegistryTypeWriter& toCopy); - /** Destructor. The Destructor frees the internal data block. The pointer (returned by getBlop) will be set to NULL. */ ~RegistryTypeWriter(); - /// Assign operator - RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign); - /** sets the data for a field member of a type blob. @param index indicates the index of the field. @@ -100,7 +94,9 @@ public: */ sal_uInt32 getBlopSize(); -protected: +private: + RegistryTypeWriter(RegistryTypeWriter &) = delete; + void operator =(RegistryTypeWriter) = delete; /// stores the handle of an implementation class TypeWriterImpl m_hImpl; -- cgit