[Libreoffice-commits] core.git: sw/inc

David Ostrovsky david at ostrovsky.org
Wed Sep 9 07:55:28 PDT 2015


 sw/inc/IMark.hxx  |   24 ++++++++++++++++++++++++
 sw/inc/calbck.hxx |    2 ++
 2 files changed, 26 insertions(+)

New commits:
commit 98483599b76fe6d0113a657f057ff5ad799ade96
Author: David Ostrovsky <david at ostrovsky.org>
Date:   Sun Sep 6 21:33:15 2015 +0200

    sw: Help vs 2015 with virtual base inheritance
    
    MSVC 14.0 was failing to compile IMark class an friends with:
    error C2280: 'SwModify &SwModify::operator =(const SwModify &)':
    attempting to reference a deleted function: [1].
    
    After defining copy ctor and assignment operator in SwModify and
    derived classes as deleted the next failure was:
    
    error C2512: 'sw::mark::IMark::IMark': no appropriate default
    constructor available: [2].
    
    Defining default ctor as default in IMark and derived classes
    seems to make all compilers happy.
    
    [1] http://paste.openstack.org/show/447854
    [2] http://paste.openstack.org/show/447856
    
    Change-Id: I2822e8ec4b98ca18d0a0128ed2ceeb38f347c5bf
    Reviewed-on: https://gerrit.libreoffice.org/18362
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/inc/IMark.hxx b/sw/inc/IMark.hxx
index 8d7bf06..56850f8 100644
--- a/sw/inc/IMark.hxx
+++ b/sw/inc/IMark.hxx
@@ -36,6 +36,9 @@ namespace sw { namespace mark
         : virtual public SwModify // inherited as interface
         , public ::boost::totally_ordered<IMark>
     {
+        protected:
+            IMark() = default;
+
         public:
             //getters
             virtual const SwPosition& GetMarkPos() const =0;
@@ -67,21 +70,33 @@ namespace sw { namespace mark
 
             virtual OUString ToString( ) const =0;
             virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const = 0;
+        private:
+            IMark(IMark&) = delete;
+            IMark &operator =(IMark const&) = delete;
     };
 
     class SW_DLLPUBLIC IBookmark
         : virtual public IMark
     {
+        protected:
+            IBookmark() = default;
+
         public:
             virtual const OUString& GetShortName() const =0;
             virtual const vcl::KeyCode& GetKeyCode() const =0;
             virtual void SetShortName(const OUString&) =0;
             virtual void SetKeyCode(const vcl::KeyCode&) =0;
+        private:
+            IBookmark(IBookmark&) = delete;
+            IBookmark &operator =(IBookmark const&) = delete;
     };
 
     class SW_DLLPUBLIC IFieldmark
         : virtual public IMark
     {
+        protected:
+            IFieldmark() = default;
+
         public:
             typedef ::std::map< OUString, ::com::sun::star::uno::Any> parameter_map_t;
             //getters
@@ -94,14 +109,23 @@ namespace sw { namespace mark
             virtual void SetFieldname(const OUString& rFieldname) =0;
             virtual void SetFieldHelptext(const OUString& rFieldHelptext) =0;
             virtual void Invalidate() = 0;
+        private:
+            IFieldmark(IFieldmark&) = delete;
+            IFieldmark &operator =(IFieldmark const&) = delete;
     };
 
     class SW_DLLPUBLIC ICheckboxFieldmark
         : virtual public IFieldmark
     {
+        protected:
+            ICheckboxFieldmark() = default;
+
         public:
             virtual bool IsChecked() const =0;
             virtual void SetChecked(bool checked) =0;
+        private:
+            ICheckboxFieldmark(ICheckboxFieldmark&) = delete;
+            ICheckboxFieldmark &operator =(ICheckboxFieldmark const&) = delete;
     };
 
     // Apple llvm-g++ 4.2.1 with _GLIBCXX_DEBUG won't eat boost::bind for this
diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx
index 6313b16..f4eb806 100644
--- a/sw/inc/calbck.hxx
+++ b/sw/inc/calbck.hxx
@@ -158,6 +158,8 @@ class SW_DLLPUBLIC SwModify: public SwClient
     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE
         { NotifyClients( pOld, pNew ); };
 
+    SwModify(SwModify&) = delete;
+    SwModify &operator =(const SwModify&) = delete;
 public:
     SwModify()
         : SwClient(nullptr), m_pWriterListeners(nullptr), m_bModifyLocked(false), bLockClientList(false), m_bInDocDTOR(false), m_bInCache(false), m_bInSwFntCache(false)


More information about the Libreoffice-commits mailing list