diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-04 12:15:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-04 15:06:04 +0200 |
commit | 20356442cdc34f1292dcdb88622dede8f0368d8a (patch) | |
tree | 27c25b46c92acb741b938b0fdcf4dd94ba582da9 | |
parent | da5cdcdeddf7bc21606b4cb64d8b1fc412146935 (diff) |
loplugin:mergeclasses merge IInterface with SwDoc
Change-Id: I6d400540c878db4504f6830aa9a3a6a381162520
Reviewed-on: https://gerrit.libreoffice.org/43127
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | sw/inc/IInterface.hxx | 61 | ||||
-rw-r--r-- | sw/inc/doc.hxx | 31 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 1 |
4 files changed, 23 insertions, 71 deletions
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); |