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

Noel Grandin noel.grandin at collabora.co.uk
Wed Oct 4 13:06:30 UTC 2017


 compilerplugins/clang/mergeclasses.results |    1 
 sw/inc/IInterface.hxx                      |   61 -----------------------------
 sw/inc/doc.hxx                             |   31 ++++++++++----
 sw/source/core/doc/doc.cxx                 |    1 
 4 files changed, 23 insertions(+), 71 deletions(-)

New commits:
commit 20356442cdc34f1292dcdb88622dede8f0368d8a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Oct 4 12:15:36 2017 +0200

    loplugin:mergeclasses merge IInterface with SwDoc
    
    Change-Id: I6d400540c878db4504f6830aa9a3a6a381162520
    Reviewed-on: https://gerrit.libreoffice.org/43127
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index e12911791dbb..51388db5a6a5 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -62,7 +62,6 @@ merge IDocumentTimerAccess with sw::DocumentTimerManager
 merge IDocumentUndoRedo with sw::UndoManager
 merge IFinishedThreadListener with ThreadListener
 merge IGrammarContact with SwGrammarContact
-merge IInterface with SwDoc
 merge IStyleAccess with SwStyleManager
 merge IStylePoolIteratorAccess with (anonymous namespace)::Iterator
 merge ISwFrameControl with SwFrameMenuButtonBase
diff --git a/sw/inc/IInterface.hxx b/sw/inc/IInterface.hxx
deleted file mode 100644
index 3d372fefaa5f..000000000000
--- a/sw/inc/IInterface.hxx
+++ /dev/null
@@ -1,61 +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 INCLUDED_SW_INC_IINTERFACE_HXX
-#define INCLUDED_SW_INC_IINTERFACE_HXX
-
-#include <sal/types.h>
-
-/** The base interface
- */
-class IInterface
-{
-public:
-
-    /** Acquire a reference to an instance. A caller shall release
-        the instance by calling 'release' when it is no longer needed.
-        'acquire' and 'release' calls need to be balanced.
-
-        @returns
-        the current reference count of the instance for debugging purposes.
-    */
-    virtual sal_Int32 acquire() = 0;
-
-    /** Releases a reference to an instance. A caller has to call
-        'release' when a before acquired reference to an instance
-        is no longer needed. 'acquire' and 'release' calls need to
-        be balanced.
-
-    @returns
-        the current reference count of the instance for debugging purposes.
-    */
-    virtual sal_Int32 release() = 0;
-
-    /** Returns the current reference count. This method should be used for
-        debugging purposes. Using it otherwise is a signal of a design flaw.
-    */
-    virtual sal_Int32 getReferenceCount() const = 0;
-
-protected:
-    virtual ~IInterface() {};
-};
-
-#endif // INCLUDED_SW_INC_IINTERFACE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 424aa738434f..281054bfd9ff 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -20,7 +20,6 @@
 #define INCLUDED_SW_INC_DOC_HXX
 
 // SwDoc interfaces
-#include <IInterface.hxx>
 #include <IDocumentMarkAccess.hxx>
 #include <com/sun/star/embed/XEmbeddedObject.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
@@ -230,8 +229,7 @@ void StartGrammarChecking( SwDoc &rDoc );
 using SwRubyList = std::vector<std::unique_ptr<SwRubyListEntry>>;
 
 // Represents the model of a Writer document.
-class SW_DLLPUBLIC SwDoc :
-    public IInterface
+class SW_DLLPUBLIC SwDoc
 {
     friend class ::sw::DocumentContentOperationsManager;
 
@@ -438,7 +436,7 @@ public:
 
     // Life cycle
     SwDoc();
-    virtual ~SwDoc() override;
+    virtual ~SwDoc();
 
     bool IsInDtor() const { return mbDtor; }
 
@@ -448,10 +446,27 @@ public:
     SwNodes      & GetNodes()       { return *m_pNodes; }
     SwNodes const& GetNodes() const { return *m_pNodes; }
 
-    // IInterface
-    virtual sal_Int32 acquire() override;
-    virtual sal_Int32 release() override;
-    virtual sal_Int32 getReferenceCount() const override;
+    /** Acquire a reference to an instance. A caller shall release
+        the instance by calling 'release' when it is no longer needed.
+        'acquire' and 'release' calls need to be balanced.
+
+        @returns
+        the current reference count of the instance for debugging purposes.
+    */
+    sal_Int32 acquire();
+    /** Releases a reference to an instance. A caller has to call
+        'release' when a before acquired reference to an instance
+        is no longer needed. 'acquire' and 'release' calls need to
+        be balanced.
+
+    @returns
+        the current reference count of the instance for debugging purposes.
+    */
+    sal_Int32 release();
+    /** Returns the current reference count. This method should be used for
+        debugging purposes. Using it otherwise is a signal of a design flaw.
+    */
+    sal_Int32 getReferenceCount() const;
 
     // IDocumentSettingAccess
     IDocumentSettingAccess const & getIDocumentSettingAccess() const; //The IDocumentSettingAccess interface
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index a8216e67b53a..33211afdd558 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -136,7 +136,6 @@
 
 using namespace ::com::sun::star;
 
-/* IInterface */
 sal_Int32 SwDoc::acquire()
 {
     assert(mReferenceCount >= 0);


More information about the Libreoffice-commits mailing list