diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-06 14:50:13 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-07 08:27:26 +0200 |
commit | dff288c6ee45e027375ad3d7f3ea392df26f3aa0 (patch) | |
tree | 851f323137e4a0c90be5a6ab1dae5eb219607b76 /framework/source | |
parent | b700e3426ecbeadf1c8f5fad590101354706e227 (diff) |
loplugin:mergedclasses
Change-Id: I3eb2de4edcd4b2d757d1e0916e7c903b5d6c569e
Diffstat (limited to 'framework/source')
8 files changed, 17 insertions, 68 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 59c6a93ead13..74ea13ffb1d5 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -387,7 +387,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::removeResetListener(const css::u } // IStorageListener -void XMLBasedAcceleratorConfiguration::changesOccurred(const OUString& /*sPath*/) +void XMLBasedAcceleratorConfiguration::changesOccurred() { reload(); } diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx index f69cc429f732..784cf5839a85 100644 --- a/framework/source/accelerators/documentacceleratorconfiguration.cxx +++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx @@ -18,7 +18,6 @@ */ #include <accelerators/acceleratorconfiguration.hxx> -#include <accelerators/istoragelistener.hxx> #include <accelerators/presethandler.hxx> #include <xml/acceleratorconfigurationreader.hxx> diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index 0b23294cf93d..54ee97363efe 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -632,7 +632,7 @@ void PresetHandler::commitUserChanges() } } -void PresetHandler::addStorageListener(IStorageListener* pListener) +void PresetHandler::addStorageListener(XMLBasedAcceleratorConfiguration* pListener) { OUString sRelPath; EConfigType eCfgType; @@ -662,7 +662,7 @@ void PresetHandler::addStorageListener(IStorageListener* pListener) } } -void PresetHandler::removeStorageListener(IStorageListener* pListener) +void PresetHandler::removeStorageListener(XMLBasedAcceleratorConfiguration* pListener) { OUString sRelPath; EConfigType eCfgType; diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx index 0dd139ba3cbb..104b66fd3259 100644 --- a/framework/source/accelerators/storageholder.cxx +++ b/framework/source/accelerators/storageholder.cxx @@ -18,6 +18,7 @@ */ #include <accelerators/storageholder.hxx> +#include <accelerators/acceleratorconfiguration.hxx> #include <services.h> @@ -284,13 +285,13 @@ void StorageHolder::notifyPath(const OUString& sPath) pIt2 != rInfo.Listener.end(); ++pIt2 ) { - IStorageListener* pListener = *pIt2; + XMLBasedAcceleratorConfiguration* pListener = *pIt2; if (pListener) - pListener->changesOccurred(sNormedPath); + pListener->changesOccurred(); } } -void StorageHolder::addStorageListener( IStorageListener* pListener, +void StorageHolder::addStorageListener( XMLBasedAcceleratorConfiguration* pListener, const OUString& sPath ) { OUString sNormedPath = StorageHolder::impl_st_normPath(sPath); @@ -307,7 +308,7 @@ void StorageHolder::addStorageListener( IStorageListener* pListener, rInfo.Listener.push_back(pListener); } -void StorageHolder::removeStorageListener( IStorageListener* pListener, +void StorageHolder::removeStorageListener( XMLBasedAcceleratorConfiguration* pListener, const OUString& sPath ) { OUString sNormedPath = StorageHolder::impl_st_normPath(sPath); diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx index b423f4bbcd01..cf120ba76a70 100644 --- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx +++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx @@ -20,7 +20,6 @@ #ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ACCELERATORCONFIGURATION_HXX #define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ACCELERATORCONFIGURATION_HXX -#include <accelerators/istoragelistener.hxx> #include <accelerators/presethandler.hxx> #include <accelerators/acceleratorcache.hxx> #include <accelerators/keymapping.hxx> @@ -61,8 +60,7 @@ const char CFG_ENTRY_MODULES[] = "Modules"; /** implements a read/write access to the accelerator configuration. */ -class XMLBasedAcceleratorConfiguration : public IStorageListener, - public ::cppu::WeakImplHelper< +class XMLBasedAcceleratorConfiguration : public ::cppu::WeakImplHelper< css::form::XReset, // TODO use XPresetHandler instead if available css::ui::XAcceleratorConfiguration > // => css::ui::XUIConfigurationPersistence // css::ui::XUIConfigurationStorage @@ -176,8 +174,8 @@ class XMLBasedAcceleratorConfiguration : public IStorageListener, virtual void SAL_CALL removeResetListener(const css::uno::Reference< css::form::XResetListener >& xListener) throw(css::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // IStorageListener - virtual void changesOccurred(const OUString& sPath) SAL_OVERRIDE; + // called when changes occurred in the storage + void changesOccurred(); // helper for derived classes diff --git a/framework/source/inc/accelerators/istoragelistener.hxx b/framework/source/inc/accelerators/istoragelistener.hxx deleted file mode 100644 index b6786dc6bc79..000000000000 --- a/framework/source/inc/accelerators/istoragelistener.hxx +++ /dev/null @@ -1,49 +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_FRAMEWORK_SOURCE_INC_ACCELERATORS_ISTORAGELISTENER_HXX -#define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ISTORAGELISTENER_HXX - -#include <general.h> -#include <stdtypes.h> - -// definition - -namespace framework -{ - -/** - TODO document me - */ -class IStorageListener -{ - public: - - /** @short TODO */ - virtual void changesOccurred(const OUString& sPath) = 0; - - protected: - ~IStorageListener() {} -}; - -} // namespace framework - -#endif // INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ISTORAGELISTENER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx index a692f4d4241c..6ea5cd4f4b56 100644 --- a/framework/source/inc/accelerators/presethandler.hxx +++ b/framework/source/inc/accelerators/presethandler.hxx @@ -355,8 +355,8 @@ class PresetHandler void commitUserChanges(); /** TODO */ - void addStorageListener(IStorageListener* pListener); - void removeStorageListener(IStorageListener* pListener); + void addStorageListener(XMLBasedAcceleratorConfiguration* pListener); + void removeStorageListener(XMLBasedAcceleratorConfiguration* pListener); // helper diff --git a/framework/source/inc/accelerators/storageholder.hxx b/framework/source/inc/accelerators/storageholder.hxx index fcef47674374..54e75cd1ad21 100644 --- a/framework/source/inc/accelerators/storageholder.hxx +++ b/framework/source/inc/accelerators/storageholder.hxx @@ -20,7 +20,6 @@ #ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_STORAGEHOLDER_HXX #define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_STORAGEHOLDER_HXX -#include <accelerators/istoragelistener.hxx> #include <general.h> #include <stdtypes.h> @@ -29,6 +28,7 @@ namespace framework { +class XMLBasedAcceleratorConfiguration; /** TODO document me */ @@ -41,7 +41,7 @@ class StorageHolder /** @short TODO */ typedef ::std::vector< css::uno::Reference< css::embed::XStorage > > TStorageList; - typedef ::std::vector< IStorageListener* > TStorageListenerList; + typedef ::std::vector< XMLBasedAcceleratorConfiguration* > TStorageListenerList; struct TStorageInfo { @@ -118,12 +118,12 @@ class StorageHolder /** @short TODO */ - void addStorageListener( IStorageListener* pListener, + void addStorageListener( XMLBasedAcceleratorConfiguration* pListener, const OUString& sPath ); /** @short TODO */ - void removeStorageListener( IStorageListener* pListener, + void removeStorageListener( XMLBasedAcceleratorConfiguration* pListener, const OUString& sPath ); /** @short TODO |