summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-07 16:19:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-08 12:38:51 +0000
commitc405820c8e7195e331539e11c5a1ea14596f62a1 (patch)
treee23ad96d3e85476ea55d6bd9897b22bd853855ec /include
parent96a502b3756a1c100b40235f50ef2122d5b543f9 (diff)
deduplicate MutexAndBroadcastHelper
there are two very similar classes, standardise on the one in include/comphelper Change-Id: If85729dcea01e65a2d095bb211fe643c783ebf1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148442 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/toolkit/controls/unocontrolmodel.hxx7
-rw-r--r--include/toolkit/helper/mutexandbroadcasthelper.hxx44
2 files changed, 3 insertions, 48 deletions
diff --git a/include/toolkit/controls/unocontrolmodel.hxx b/include/toolkit/controls/unocontrolmodel.hxx
index fb32aa5b0860..a3f0516e8157 100644
--- a/include/toolkit/controls/unocontrolmodel.hxx
+++ b/include/toolkit/controls/unocontrolmodel.hxx
@@ -28,7 +28,7 @@
#include <com/sun/star/util/XCloneable.hpp>
#include <cppuhelper/weakagg.hxx>
-#include <toolkit/helper/mutexandbroadcasthelper.hxx>
+#include <comphelper/broadcasthelper.hxx>
#include <toolkit/helper/listenermultiplexer.hxx>
#include <cppuhelper/propshlp.hxx>
@@ -55,7 +55,7 @@ typedef ::cppu::WeakAggImplHelper6 < css::awt::XControlModel
> UnoControlModel_Base;
class UnoControlModel :public UnoControlModel_Base
- ,public MutexAndBroadcastHelper
+ ,public comphelper::OMutexAndBroadcastHelper
,public ::cppu::OPropertySetHelper
{
private:
@@ -105,8 +105,7 @@ protected:
#ifdef _MSC_VER
UnoControlModel() //do not use! needed by MSVC at compile time to satisfy WeakAggImplHelper7
: UnoControlModel_Base()
- , MutexAndBroadcastHelper()
- , OPropertySetHelper( BrdcstHelper )
+ , OPropertySetHelper( m_aBHelper )
, maDisposeListeners( *this )
, m_xContext( css::uno::Reference< css::uno::XComponentContext >() )
{
diff --git a/include/toolkit/helper/mutexandbroadcasthelper.hxx b/include/toolkit/helper/mutexandbroadcasthelper.hxx
deleted file mode 100644
index 4cc98e6a9304..000000000000
--- a/include/toolkit/helper/mutexandbroadcasthelper.hxx
+++ /dev/null
@@ -1,44 +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_TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX
-#define INCLUDED_TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX
-
-#include <cppuhelper/interfacecontainer.h>
-
-
-// Helper class with Mutex and BroadcastHelper, because they must be
-// initialized before calling the OPropertySetHelper-CTOR
-
-class MutexAndBroadcastHelper
-{
-public:
- MutexAndBroadcastHelper() : BrdcstHelper( Mutex ) {}
-
- ::osl::Mutex Mutex;
- ::cppu::OBroadcastHelper BrdcstHelper;
-
- ::osl::Mutex& GetMutex() { return Mutex; }
- ::cppu::OBroadcastHelper& GetBroadcastHelper() { return BrdcstHelper; }
-};
-
-#endif // _TOOLKIT_HELPER_MUTEXANDBROADCASTHELPER_HXX
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */