From 2c8fe2e737b84ecd3dbac36a4fe6bd061bbd3bae Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 16 May 2016 10:11:04 +0200 Subject: update unusedmethods plugin to deal with constructors and fix the operator< implementations in some of the other plugins too. Change-Id: Ie5631e0cdc8d2a994ad2af2533cdb558a6cfc035 Reviewed-on: https://gerrit.libreoffice.org/25057 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../controller/dialogs/tp_3D_SceneIllumination.hxx | 1 - chart2/source/inc/LifeTime.hxx | 5 - chart2/source/inc/ModifyListenerCallBack.hxx | 57 ----------- chart2/source/tools/ModifyListenerCallBack.cxx | 105 --------------------- chart2/source/view/axes/VAxisProperties.hxx | 2 +- chart2/source/view/charttypes/VSeriesPlotter.cxx | 8 -- chart2/source/view/inc/VSeriesPlotter.hxx | 2 +- 7 files changed, 2 insertions(+), 178 deletions(-) delete mode 100644 chart2/source/inc/ModifyListenerCallBack.hxx delete mode 100644 chart2/source/tools/ModifyListenerCallBack.cxx (limited to 'chart2/source') diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx index 900a1f6306d6..7d8834aac1df 100644 --- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx +++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx @@ -19,7 +19,6 @@ #ifndef INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_3D_SCENEILLUMINATION_HXX #define INCLUDED_CHART2_SOURCE_CONTROLLER_DIALOGS_TP_3D_SCENEILLUMINATION_HXX -#include "ModifyListenerCallBack.hxx" #include "TimerTriggeredControllerLock.hxx" #include diff --git a/chart2/source/inc/LifeTime.hxx b/chart2/source/inc/LifeTime.hxx index 6552d2abbc86..e1e3ac6cdfdc 100644 --- a/chart2/source/inc/LifeTime.hxx +++ b/chart2/source/inc/LifeTime.hxx @@ -211,11 +211,6 @@ protected: T * m_pT; public: - NegativeGuard(T * pT) : m_pT(pT) - { - m_pT->release(); - } - NegativeGuard(T & t) : m_pT(&t) { m_pT->release(); diff --git a/chart2/source/inc/ModifyListenerCallBack.hxx b/chart2/source/inc/ModifyListenerCallBack.hxx deleted file mode 100644 index 99c075a68289..000000000000 --- a/chart2/source/inc/ModifyListenerCallBack.hxx +++ /dev/null @@ -1,57 +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_CHART2_SOURCE_INC_MODIFYLISTENERCALLBACK_HXX -#define INCLUDED_CHART2_SOURCE_INC_MODIFYLISTENERCALLBACK_HXX - -#include -#include -#include -#include "charttoolsdllapi.hxx" - -namespace chart { - -/** Use this class as a member if you want to listen on a XModifyBroadcaster -without becoming a XModifyListener yourself - */ - -class ModifyListenerCallBack_impl; - -class OOO_DLLPUBLIC_CHARTTOOLS ModifyListenerCallBack -{ -public: - explicit ModifyListenerCallBack( const Link& rCallBack ); - - virtual ~ModifyListenerCallBack(); - - SAL_DLLPRIVATE void stopListening(); - -private: //methods - ModifyListenerCallBack( const ModifyListenerCallBack& ) = delete; - -private: //member - ModifyListenerCallBack_impl* pModifyListener_impl; - css::uno::Reference< css::util::XModifyListener > m_xModifyListener; -}; - -} // namespace chart - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/tools/ModifyListenerCallBack.cxx b/chart2/source/tools/ModifyListenerCallBack.cxx deleted file mode 100644 index 0ac16b840aca..000000000000 --- a/chart2/source/tools/ModifyListenerCallBack.cxx +++ /dev/null @@ -1,105 +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 . - */ - -#include "ModifyListenerCallBack.hxx" -#include "MutexContainer.hxx" -#include - -using namespace ::com::sun::star; -using ::com::sun::star::uno::Reference; - -namespace chart { - -typedef ::cppu::WeakComponentImplHelper< css::util::XModifyListener > - ModifyListenerCallBack_Base; - -class ModifyListenerCallBack_impl - : public ::chart::MutexContainer - , public ModifyListenerCallBack_Base -{ -public: - explicit ModifyListenerCallBack_impl( const Link& rCallBack ); - virtual ~ModifyListenerCallBack_impl(); - - void stopListening(); - - //XModifyListener - virtual void SAL_CALL modified( const lang::EventObject& aEvent ) throw (uno::RuntimeException, std::exception) override; - - //XEventListener - virtual void SAL_CALL disposing( const lang::EventObject& Source ) throw (uno::RuntimeException, std::exception) override; - - using ::cppu::WeakComponentImplHelperBase::disposing; - -private: - Link m_aLink;//will be called on modify - Reference< util::XModifyBroadcaster > m_xBroadcaster;//broadcaster to listen at -}; - -ModifyListenerCallBack_impl::ModifyListenerCallBack_impl( const Link& rCallBack ) - : ModifyListenerCallBack_Base( m_aMutex ) - , m_aLink( rCallBack ) - , m_xBroadcaster(nullptr) -{ -} - -ModifyListenerCallBack_impl::~ModifyListenerCallBack_impl() -{ -} - -//XModifyListener -void SAL_CALL ModifyListenerCallBack_impl::modified( const lang::EventObject& /*aEvent*/ ) throw (uno::RuntimeException, std::exception) -{ - m_aLink.Call(nullptr); -} - -//XEventListener -void SAL_CALL ModifyListenerCallBack_impl::disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException, std::exception) -{ - m_xBroadcaster.clear(); -} - -void ModifyListenerCallBack_impl::stopListening() -{ - if( m_xBroadcaster.is() ) - { - m_xBroadcaster->removeModifyListener( this ); - m_xBroadcaster.clear(); - } -} - -ModifyListenerCallBack::ModifyListenerCallBack( const Link& rCallBack ) - : pModifyListener_impl( new ModifyListenerCallBack_impl(rCallBack) ) - , m_xModifyListener( pModifyListener_impl ) -{ -} - -ModifyListenerCallBack::~ModifyListenerCallBack() -{ - stopListening(); -} - -void ModifyListenerCallBack::stopListening() -{ - pModifyListener_impl->stopListening(); -} - -} // namespace chart - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/source/view/axes/VAxisProperties.hxx b/chart2/source/view/axes/VAxisProperties.hxx index 53d78c4c6a60..e6ecc72061a9 100644 --- a/chart2/source/view/axes/VAxisProperties.hxx +++ b/chart2/source/view/axes/VAxisProperties.hxx @@ -155,7 +155,7 @@ struct AxisProperties final TickmarkProperties makeTickmarkPropertiesForComplexCategories( sal_Int32 nTickLength, sal_Int32 nTickStartDistanceToAxis, sal_Int32 nTextLevel ) const; private: - AxisProperties(); + AxisProperties() = delete; TickmarkProperties makeTickmarkProperties( sal_Int32 nDepth ) const; //@todo get this from somewhere; maybe for each subincrement diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 8af02b0c1762..62966d3e790f 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -102,14 +102,6 @@ VDataSeriesGroup::CachedYValues::CachedYValues() { } -VDataSeriesGroup::VDataSeriesGroup() - : m_aSeriesVector() - , m_bMaxPointCountDirty(true) - , m_nMaxPointCount(0) - , m_aListOfCachedYValues() -{ -} - VDataSeriesGroup::VDataSeriesGroup( VDataSeries* pSeries ) : m_aSeriesVector(1,pSeries) , m_bMaxPointCountDirty(true) diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx index 2eeeb1af14ae..fb4ffbb8c6af 100644 --- a/chart2/source/view/inc/VSeriesPlotter.hxx +++ b/chart2/source/view/inc/VSeriesPlotter.hxx @@ -76,7 +76,7 @@ private: class VDataSeriesGroup final { public: - VDataSeriesGroup(); + VDataSeriesGroup() = delete; VDataSeriesGroup( VDataSeries* pSeries ); ~VDataSeriesGroup(); -- cgit