[Libreoffice-commits] core.git: codemaker/source cppuhelper/source cppu/qa

Jochen Nitschke j.nitschke+logerrit at ok.de
Fri Apr 8 09:33:12 UTC 2016


 codemaker/source/cppumaker/cpputype.cxx     |   10 +++++++---
 codemaker/source/cppumaker/dependencies.hxx |    6 ++++--
 cppu/qa/test_any.cxx                        |    6 ++++--
 cppu/qa/test_reference.cxx                  |    6 ++++--
 cppuhelper/source/servicemanager.cxx        |   24 ++++++++++++++++--------
 cppuhelper/source/servicemanager.hxx        |   23 +++++++++++++++++------
 cppuhelper/source/typemanager.cxx           |    6 ++++--
 cppuhelper/source/weak.cxx                  |   15 +++++++++++----
 8 files changed, 67 insertions(+), 29 deletions(-)

New commits:
commit 98d7b02f2b69f2f88a03054183933df7f190017d
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Thu Apr 7 20:26:54 2016 +0200

    tdf#94306 replace boost::noncopyable in cppuhelper
    
    and related modules.
    Replace with C++11 delete copy-constructur
    and copy-assignment.
    
    Change-Id: I18aa9fe4ff696f9b5472cbe4cd0097cb174618b7
    Reviewed-on: https://gerrit.libreoffice.org/23904
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 7189405..0c7be86 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -26,7 +26,6 @@
 #include <vector>
 #include <iostream>
 
-#include "boost/noncopyable.hpp"
 #include "rtl/alloc.h"
 #include "rtl/ref.hxx"
 #include "rtl/ustrbuf.hxx"
@@ -146,13 +145,16 @@ bool isBootstrapType(OUString const & name) {
     return false;
 }
 
-class CppuType: private boost::noncopyable {
+class CppuType {
 public:
     CppuType(
         OUString const & name, rtl::Reference< TypeManager > const & typeMgr);
 
     virtual ~CppuType() {}
 
+    CppuType(const CppuType&) = delete;
+    const CppuType& operator=(const CppuType&) = delete;
+
     void dump(CppuOptions const & options);
 
     bool dumpFile(
@@ -1030,12 +1032,14 @@ void dumpDeprecation(FileStream & out, bool deprecated) {
     }
 }
 
-class BaseOffset: private boost::noncopyable {
+class BaseOffset {
 public:
     BaseOffset(
         rtl::Reference< TypeManager > const & manager,
         rtl::Reference< unoidl::InterfaceTypeEntity > const & entity):
         manager_(manager), offset_(0) { calculateBases(entity); }
+    BaseOffset(const BaseOffset&) = delete;
+    const BaseOffset& operator=(const BaseOffset&) = delete;
 
     sal_Int32 get() const { return offset_; }
 
diff --git a/codemaker/source/cppumaker/dependencies.hxx b/codemaker/source/cppumaker/dependencies.hxx
index afd902b..e1513a3 100644
--- a/codemaker/source/cppumaker/dependencies.hxx
+++ b/codemaker/source/cppumaker/dependencies.hxx
@@ -24,7 +24,6 @@
 
 #include <map>
 
-#include "boost/noncopyable.hpp"
 #include "rtl/ref.hxx"
 
 namespace rtl { class OUString; }
@@ -39,7 +38,7 @@ namespace codemaker { namespace cppumaker {
 
    <p>This class is not multi-thread–safe.</p>
  */
-class Dependencies: private boost::noncopyable {
+class Dependencies {
 public:
     /**
        Flags to distinguish whether or not one entity depends on another entity
@@ -66,6 +65,9 @@ public:
 
     ~Dependencies();
 
+    Dependencies(const Dependencies&) = delete;
+    const Dependencies& operator=(const Dependencies&) = delete;
+
     Map const & getMap() const { return m_map; }
 
     bool hasBooleanDependency() const { return m_booleanDependency; }
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index 4fdd4a4..e173b10 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -43,7 +43,6 @@
 #include "Struct2.hpp"
 #include "Struct2a.hpp"
 #include "Struct2b.hpp"
-#include "boost/noncopyable.hpp"
 #include "boost/type_traits/is_same.hpp"
 #include "com/sun/star/uno/Any.hxx"
 #include "com/sun/star/uno/Reference.hxx"
@@ -59,10 +58,13 @@
 
 namespace {
 
-class Base: private boost::noncopyable {
+class Base {
 public:
     Base(): m_count(0) {}
 
+    Base(const Base&) = delete;
+    const Base& operator=(const Base&) = delete;
+
     void acquire() {
         if (osl_atomic_increment(&m_count) == SAL_MAX_INT32) {
             abort();
diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx
index 0187766..c04b8b1 100644
--- a/cppu/qa/test_reference.cxx
+++ b/cppu/qa/test_reference.cxx
@@ -19,7 +19,6 @@
 
 #include <sal/types.h>
 
-#include <boost/noncopyable.hpp>
 #include <cppunit/TestSuite.h>
 #include <cppunit/TestFixture.h>
 #include <cppunit/TestCase.h>
@@ -39,7 +38,7 @@ using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::RuntimeException;
 using ::com::sun::star::uno::UNO_SET_THROW;
 
-class Foo: public Interface1, private boost::noncopyable
+class Foo: public Interface1
 {
 public:
     Foo()
@@ -47,6 +46,9 @@ public:
     {
     }
 
+    Foo(const Foo&) = delete;
+    const Foo& operator=(const Foo&) = delete;
+
     virtual Any SAL_CALL queryInterface(const Type & _type)
         throw (RuntimeException, std::exception) override
     {
diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx
index fe761fe..cd4d817 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -13,7 +13,6 @@
 #include <cassert>
 #include <vector>
 
-#include <boost/noncopyable.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/container/ElementExistException.hpp>
@@ -105,13 +104,16 @@ void removeFromImplementationMap(
 // For simplicity, this code keeps throwing
 // css::registry::InvalidRegistryException for invalid XML rdbs (even though
 // that does not fit the exception's name):
-class Parser: private boost::noncopyable {
+class Parser {
 public:
     Parser(
         rtl::OUString const & uri,
         css::uno::Reference< css::uno::XComponentContext > const & alienContext,
         cppuhelper::ServiceManager::Data * data);
 
+    Parser(const Parser&) = delete;
+    const Parser& operator=(const Parser&) = delete;
+
 private:
     void handleComponent();
 
@@ -438,13 +440,15 @@ rtl::OUString Parser::getNameAttribute() {
 }
 
 class ContentEnumeration:
-    public cppu::WeakImplHelper1< css::container::XEnumeration >,
-    private boost::noncopyable
+    public cppu::WeakImplHelper1< css::container::XEnumeration >
 {
 public:
     explicit ContentEnumeration(std::vector< css::uno::Any > const & factories):
         factories_(factories), iterator_(factories_.begin()) {}
 
+    ContentEnumeration(const ContentEnumeration&) = delete;
+    const ContentEnumeration& operator=(const ContentEnumeration&) = delete;
+
 private:
     virtual ~ContentEnumeration() {}
 
@@ -490,8 +494,7 @@ css::beans::Property getDefaultContextProperty() {
 }
 
 class SingletonFactory:
-    public cppu::WeakImplHelper1<css::lang::XSingleComponentFactory>,
-    private boost::noncopyable
+    public cppu::WeakImplHelper1<css::lang::XSingleComponentFactory>
 {
 public:
     SingletonFactory(
@@ -502,6 +505,9 @@ public:
         manager_(manager), implementation_(implementation)
     { assert(manager.is()); assert(implementation.get() != nullptr); }
 
+    SingletonFactory(const SingletonFactory&) = delete;
+    const SingletonFactory& operator=(const SingletonFactory&) = delete;
+
 private:
     virtual ~SingletonFactory() {}
 
@@ -544,8 +550,7 @@ SingletonFactory::createInstanceWithArgumentsAndContext(
 class ImplementationWrapper:
     public cppu::WeakImplHelper3<
         css::lang::XSingleComponentFactory, css::lang::XSingleServiceFactory,
-        css::lang::XServiceInfo >,
-    private boost::noncopyable
+        css::lang::XServiceInfo >
 {
 public:
     ImplementationWrapper(
@@ -556,6 +561,9 @@ public:
         manager_(manager), implementation_(implementation)
     { assert(manager.is()); assert(implementation.get() != nullptr); }
 
+    ImplementationWrapper(const ImplementationWrapper&) = delete;
+    const ImplementationWrapper& operator=(const ImplementationWrapper&) = delete;
+
 private:
     virtual ~ImplementationWrapper() {}
 
diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx
index 9a01006..1b9cfdb 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -17,7 +17,6 @@
 #include <memory>
 #include <vector>
 
-#include <boost/noncopyable.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
@@ -60,12 +59,15 @@ typedef cppu::WeakComponentImplHelper<
 ServiceManagerBase;
 
 class ServiceManager:
-    private cppu::BaseMutex, public ServiceManagerBase,
-    private boost::noncopyable
+    private cppu::BaseMutex, public ServiceManagerBase
 {
 public:
-    struct Data: private boost::noncopyable {
-        struct ImplementationInfo: private boost::noncopyable {
+    struct Data {
+        Data() = default;
+        Data(const Data&) = delete;
+        const Data& operator=(const Data&) = delete;
+
+        struct ImplementationInfo {
             ImplementationInfo(
                 rtl::OUString const & theName, rtl::OUString const & theLoader,
                 rtl::OUString const & theUri,
@@ -84,6 +86,9 @@ public:
             explicit ImplementationInfo(rtl::OUString const & theName):
                 name(theName) {}
 
+            ImplementationInfo(const ImplementationInfo&) = delete;
+            const ImplementationInfo& operator=(const ImplementationInfo&) = delete;
+
             rtl::OUString const name;
             rtl::OUString const loader;
             rtl::OUString const uri;
@@ -97,7 +102,7 @@ public:
             std::vector< rtl::OUString > singletons;
         };
 
-        struct Implementation: private boost::noncopyable {
+        struct Implementation {
             Implementation(
                 rtl::OUString const & name, rtl::OUString const & loader,
                 rtl::OUString const & uri, rtl::OUString const & environment,
@@ -126,6 +131,9 @@ public:
                 component(theComponent), status(STATUS_LOADED), dispose(true)
             { assert(theFactory1.is() || theFactory2.is()); }
 
+            Implementation(const Implementation&) = delete;
+            const Implementation& operator=(const Implementation&) = delete;
+
             css::uno::Reference<css::uno::XInterface> createInstance(
                 css::uno::Reference<css::uno::XComponentContext> const &
                     context,
@@ -180,6 +188,9 @@ public:
 
     ServiceManager(): ServiceManagerBase(m_aMutex) {}
 
+    ServiceManager(const ServiceManager&) = delete;
+    const ServiceManager& operator=(const ServiceManager&) = delete;
+
     using ServiceManagerBase::acquire;
     using ServiceManagerBase::release;
 
diff --git a/cppuhelper/source/typemanager.cxx b/cppuhelper/source/typemanager.cxx
index 12a88dc..85ed6dc 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -17,7 +17,6 @@
 #include <stack>
 #include <vector>
 
-#include <boost/noncopyable.hpp>
 #include <com/sun/star/container/ElementExistException.hpp>
 #include <com/sun/star/container/NoSuchElementException.hpp>
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -845,12 +844,15 @@ MethodDescription::getExceptions() throw (css::uno::RuntimeException, std::excep
     return s;
 }
 
-class BaseOffset: private boost::noncopyable {
+class BaseOffset {
 public:
     explicit BaseOffset(
         css::uno::Reference< css::reflection::XInterfaceTypeDescription2 >
             const & description);
 
+    BaseOffset(const BaseOffset&) = delete;
+    const BaseOffset& operator=(const BaseOffset&) = delete;
+
     sal_Int32 get() const { return offset_; }
 
 private:
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 1b30df6..aa940af 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -19,7 +19,6 @@
 
 #include <sal/config.h>
 
-#include <boost/noncopyable.hpp>
 #include <osl/mutex.hxx>
 #include <cppuhelper/weakagg.hxx>
 #include <cppuhelper/interfacecontainer.hxx>
@@ -45,7 +44,7 @@ inline static Mutex & getWeakMutex()
 
 //-- OWeakConnectionPoint ----------------------------------------------------
 
-class OWeakConnectionPoint: public XAdapter, private boost::noncopyable
+class OWeakConnectionPoint: public XAdapter
 {
 public:
     /**
@@ -55,7 +54,11 @@ public:
         : m_aRefCount( 0 )
         , m_pObject(pObj)
         , m_aReferences( getWeakMutex() )
-        {}
+    {}
+
+    // noncopyable
+    OWeakConnectionPoint(const OWeakConnectionPoint&) = delete;
+    const OWeakConnectionPoint& operator=(const OWeakConnectionPoint&) = delete;
 
     // XInterface
     Any SAL_CALL        queryInterface( const Type & rType ) throw(css::uno::RuntimeException, std::exception) override;
@@ -315,12 +318,16 @@ namespace uno
 
 //-- OWeakRefListener -----------------------------------------------------
 
-class OWeakRefListener: public XReference, private boost::noncopyable
+class OWeakRefListener: public XReference
 {
 public:
     explicit OWeakRefListener(const Reference< XInterface >& xInt);
     virtual ~OWeakRefListener();
 
+    // noncopyable
+    OWeakRefListener(const OWeakRefListener&) = delete;
+    const OWeakRefListener& operator=(const OWeakRefListener&) = delete;
+
     // XInterface
     Any SAL_CALL queryInterface( const Type & rType ) throw(RuntimeException, std::exception) override;
     void SAL_CALL acquire() throw() override;


More information about the Libreoffice-commits mailing list