Kaydet (Commit) 20356442 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:mergeclasses merge IInterface with SwDoc

Change-Id: I6d400540c878db4504f6830aa9a3a6a381162520
Reviewed-on: https://gerrit.libreoffice.org/43127Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst da5cdcde
......@@ -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
......
/* -*- 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: */
......@@ -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
......
......@@ -136,7 +136,6 @@
using namespace ::com::sun::star;
/* IInterface */
sal_Int32 SwDoc::acquire()
{
assert(mReferenceCount >= 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment