sw/source/core/docnode/threadlistener.cxx | 3 + sw/source/core/inc/ithreadlistenerowner.hxx | 47 ---------------------------- sw/source/core/inc/observablethread.hxx | 2 - sw/source/core/inc/threadlistener.hxx | 9 ++--- sw/source/core/inc/threadmanager.hxx | 10 ++--- 5 files changed, 13 insertions(+), 58 deletions(-)
New commits: commit b4b48e0f0e5703021abfcafc0c6b16116daf8de3 Author: Noel Grandin <n...@peralex.com> Date: Mon May 25 15:12:21 2015 +0200 loplugin:unnecessarysuperclass, merge IThreadListenerOwner with ThreadManager Change-Id: I338706e012d311df3cabc2b25175765c63c1b24c Reviewed-on: https://gerrit.libreoffice.org/15899 Reviewed-by: Noel Grandin <noelgran...@gmail.com> Tested-by: Noel Grandin <noelgran...@gmail.com> diff --git a/sw/source/core/docnode/threadlistener.cxx b/sw/source/core/docnode/threadlistener.cxx index 6f82a83..8ba7572 100644 --- a/sw/source/core/docnode/threadlistener.cxx +++ b/sw/source/core/docnode/threadlistener.cxx @@ -17,12 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include <threadlistener.hxx> +#include <threadmanager.hxx> /** helper class to observe threads #i73788# */ -ThreadListener::ThreadListener( IThreadListenerOwner& rThreadListenerOwner ) +ThreadListener::ThreadListener( ThreadManager& rThreadListenerOwner ) : IFinishedThreadListener(), mrThreadListenerOwner( rThreadListenerOwner ) { diff --git a/sw/source/core/inc/ithreadlistenerowner.hxx b/sw/source/core/inc/ithreadlistenerowner.hxx deleted file mode 100644 index 5eed795..0000000 --- a/sw/source/core/inc/ithreadlistenerowner.hxx +++ /dev/null @@ -1,47 +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_SOURCE_CORE_INC_ITHREADLISTENEROWNER_HXX -#define INCLUDED_SW_SOURCE_CORE_INC_ITHREADLISTENEROWNER_HXX - -#include <ifinishedthreadlistener.hxx> -#include <boost/weak_ptr.hpp> - -/** interface class of the owner of a thread listener - - OD 2007-01-30 #i73788# -*/ -class IThreadListenerOwner -{ -public: - inline virtual ~IThreadListenerOwner() - { - }; - - virtual boost::weak_ptr< IFinishedThreadListener > GetThreadListenerWeakRef() = 0; - virtual void NotifyAboutFinishedThread( const oslInterlockedCount nThreadID ) = 0; - -protected: - inline IThreadListenerOwner() - { - }; -}; -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/observablethread.hxx b/sw/source/core/inc/observablethread.hxx index 4282006..45dccf9 100644 --- a/sw/source/core/inc/observablethread.hxx +++ b/sw/source/core/inc/observablethread.hxx @@ -24,8 +24,8 @@ #include <osl/interlck.h> #include <boost/weak_ptr.hpp> -#include <ithreadlistenerowner.hxx> #include <salhelper/simplereferenceobject.hxx> +#include <ifinishedthreadlistener.hxx> /** class for an observable thread diff --git a/sw/source/core/inc/threadlistener.hxx b/sw/source/core/inc/threadlistener.hxx index 4f5a181..7d39c45 100644 --- a/sw/source/core/inc/threadlistener.hxx +++ b/sw/source/core/inc/threadlistener.hxx @@ -20,15 +20,16 @@ #define INCLUDED_SW_SOURCE_CORE_INC_THREADLISTENER_HXX #include <ifinishedthreadlistener.hxx> -#include <ithreadlistenerowner.hxx> #include <observablethread.hxx> +class ThreadManager; + /** helper class to observe threads OD 2007-03-30 #i73788# An instance of this class can be used to observe a thread in order to be notified, if the thread has finished its work. The notification is - directly forward to its owner - an instance of IThreadListenerOwner + directly forward to its owner - an instance of ThreadManager Note: - A thread can only have one or none listener. - The notification is performed via the ThreadID @@ -37,7 +38,7 @@ class ThreadListener : public IFinishedThreadListener { public: - ThreadListener( IThreadListenerOwner& rThreadListenerOwner ); + ThreadListener( ThreadManager& rThreadListenerOwner ); virtual ~ThreadListener(); void ListenToThread( const oslInterlockedCount nThreadID, @@ -47,7 +48,7 @@ class ThreadListener : public IFinishedThreadListener private: - IThreadListenerOwner& mrThreadListenerOwner; + ThreadManager& mrThreadListenerOwner; }; #endif diff --git a/sw/source/core/inc/threadmanager.hxx b/sw/source/core/inc/threadmanager.hxx index 781821d..006190e 100644 --- a/sw/source/core/inc/threadmanager.hxx +++ b/sw/source/core/inc/threadmanager.hxx @@ -19,7 +19,6 @@ #ifndef INCLUDED_SW_SOURCE_CORE_INC_THREADMANAGER_HXX #define INCLUDED_SW_SOURCE_CORE_INC_THREADMANAGER_HXX -#include <ithreadlistenerowner.hxx> #include <vcl/timer.hxx> #include <vcl/idle.hxx> #include <osl/mutex.hxx> @@ -36,6 +35,8 @@ #include <boost/shared_ptr.hpp> #include <boost/weak_ptr.hpp> +#include <ifinishedthreadlistener.hxx> + /** class to manage threads @@ -44,16 +45,15 @@ It assures that not more than <mnStartedSize> threads are started. */ -class ThreadManager : public IThreadListenerOwner +class ThreadManager { public: explicit ThreadManager( ::com::sun::star::uno::Reference< ::com::sun::star::util::XJobManager >& rThreadJoiner ); virtual ~ThreadManager(); - // --> IThreadListenerOwner - virtual boost::weak_ptr< IFinishedThreadListener > GetThreadListenerWeakRef() SAL_OVERRIDE; - virtual void NotifyAboutFinishedThread( const oslInterlockedCount nThreadID ) SAL_OVERRIDE; + boost::weak_ptr< IFinishedThreadListener > GetThreadListenerWeakRef(); + void NotifyAboutFinishedThread( const oslInterlockedCount nThreadID ); /** initialization _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits