From 8e048c3c572dc02f1161744278d875c9f842574e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 27 Mar 2024 11:19:16 +0200 Subject: convert BasicScriptImplodNodeImpl to comphelper::WeakImplHelper and remove OBroadcastHelperHolder, since nothing uses it anymore Change-Id: Id07b4589e0893950974c6bf41e0d4f2d8dc7ee81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165491 Tested-by: Jenkins Reviewed-by: Noel Grandin --- scripting/source/basprov/basmethnode.hxx | 1 - scripting/source/basprov/basscript.cxx | 15 +++++------ scripting/source/basprov/basscript.hxx | 13 ++++------ scripting/source/inc/bcholder.hxx | 44 -------------------------------- 4 files changed, 11 insertions(+), 62 deletions(-) delete mode 100644 scripting/source/inc/bcholder.hxx (limited to 'scripting/source') diff --git a/scripting/source/basprov/basmethnode.hxx b/scripting/source/basprov/basmethnode.hxx index 169d06988f62..d50bb663cefa 100644 --- a/scripting/source/basprov/basmethnode.hxx +++ b/scripting/source/basprov/basmethnode.hxx @@ -19,7 +19,6 @@ #pragma once -#include #include #include #include diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index 148d1877d875..fdb6c5d02d44 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -67,9 +66,8 @@ constexpr OUString BASSCRIPT_PROPERTY_CALLER = u"Caller"_ustr; BasicScriptImpl::BasicScriptImpl( OUString funcName, SbMethodRef xMethod ) - : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) - ,OPropertyContainer( GetBroadcastHelper() ) - ,m_xMethod(std::move( xMethod )) + : + m_xMethod(std::move( xMethod )) ,m_funcName(std::move( funcName )) ,m_documentBasicManager( nullptr ) ,m_xDocumentScriptContext() @@ -79,9 +77,8 @@ constexpr OUString BASSCRIPT_PROPERTY_CALLER = u"Caller"_ustr; BasicScriptImpl::BasicScriptImpl( OUString funcName, SbMethodRef xMethod, - BasicManager& documentBasicManager, const Reference< XScriptInvocationContext >& documentScriptContext ) : ::scripting_helper::OBroadcastHelperHolder( m_aMutex ) - ,OPropertyContainer( GetBroadcastHelper() ) - ,m_xMethod(std::move( xMethod )) + BasicManager& documentBasicManager, const Reference< XScriptInvocationContext >& documentScriptContext ) : + m_xMethod(std::move( xMethod )) ,m_funcName(std::move( funcName )) ,m_documentBasicManager( &documentBasicManager ) ,m_xDocumentScriptContext( documentScriptContext ) @@ -121,13 +118,13 @@ constexpr OUString BASSCRIPT_PROPERTY_CALLER = u"Caller"_ustr; // XInterface - IMPLEMENT_FORWARD_XINTERFACE2( BasicScriptImpl, BasicScriptImpl_BASE, OPropertyContainer ) + IMPLEMENT_FORWARD_XINTERFACE2( BasicScriptImpl, BasicScriptImpl_BASE, comphelper::OPropertyContainer2 ) // XTypeProvider - IMPLEMENT_FORWARD_XTYPEPROVIDER2( BasicScriptImpl, BasicScriptImpl_BASE, OPropertyContainer ) + IMPLEMENT_FORWARD_XTYPEPROVIDER2( BasicScriptImpl, BasicScriptImpl_BASE, comphelper::OPropertyContainer2 ) // OPropertySetHelper diff --git a/scripting/source/basprov/basscript.hxx b/scripting/source/basprov/basscript.hxx index e7a94d706ee7..2adcd9c8b311 100644 --- a/scripting/source/basprov/basscript.hxx +++ b/scripting/source/basprov/basscript.hxx @@ -19,13 +19,12 @@ #pragma once -#include #include #include -#include #include +#include #include -#include +#include #include #include @@ -38,14 +37,12 @@ namespace basprov - typedef ::cppu::WeakImplHelper< + typedef ::comphelper::WeakImplHelper< css::script::provider::XScript > BasicScriptImpl_BASE; class BasicScriptImpl : public BasicScriptImpl_BASE, public SfxListener, - public cppu::BaseMutex, - public ::scripting_helper::OBroadcastHelperHolder, - public ::comphelper::OPropertyContainer, + public ::comphelper::OPropertyContainer2, public ::comphelper::OPropertyArrayUsageHelper< BasicScriptImpl > { private: @@ -60,7 +57,7 @@ namespace basprov css::uno::Sequence< css::uno::Any > m_caller; protected: // OPropertySetHelper - virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper( ) override; + virtual ::cppu::IPropertyArrayHelper& getInfoHelper( ) override; // OPropertyArrayUsageHelper virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override; diff --git a/scripting/source/inc/bcholder.hxx b/scripting/source/inc/bcholder.hxx deleted file mode 100644 index 9f8add31bb3e..000000000000 --- a/scripting/source/inc/bcholder.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 . - */ - -#pragma once - -#include -#include - - -namespace scripting_helper -{ - - class OBroadcastHelperHolder - { - ::cppu::OBroadcastHelper m_aBHelper; - - public: - OBroadcastHelperHolder( ::osl::Mutex& rMutex ) : m_aBHelper( rMutex ) { } - - ::cppu::OBroadcastHelper& GetBroadcastHelper() { return m_aBHelper; } - const ::cppu::OBroadcastHelper& GetBroadcastHelper() const { return m_aBHelper; } - }; - - -} // namespace scripting_helper - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit