diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-09 12:20:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-12 09:13:33 +0200 |
commit | 48532dfa60da3a0a897a26a9ff9cf97e7bf195fd (patch) | |
tree | a0d9661801fd9edbe56934c665491f26a7c92779 /dbaccess | |
parent | fcddbf6fa3f8e35d04998e409c997570429fdf46 (diff) |
loplugin:mergeclasses
Change-Id: I1ce2e31e4dae780612e51b3806ee6044be9cf4bb
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/app/AppController.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppController.hxx | 53 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppDetailView.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppSwapWindow.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppView.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/app/AppView.hxx | 9 | ||||
-rw-r--r-- | dbaccess/source/ui/app/IApplicationController.hxx | 90 |
9 files changed, 49 insertions, 126 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index ce32ee5a0a9b..511f9ffa8e0c 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2248,10 +2248,6 @@ void OApplicationController::OnInvalidateClipboard() InvalidateFeature(SID_DB_APP_PASTE_SPECIAL); } -void OApplicationController::onCutEntry() -{ -} - void OApplicationController::onCopyEntry() { Execute(ID_BROWSER_COPY,Sequence<PropertyValue>()); @@ -2344,7 +2340,7 @@ PopupMenu* OApplicationController::getContextMenu( Control& /*_rControl*/ ) cons IController& OApplicationController::getCommandController() { - return *static_cast< IApplicationController* >( this ); + return *this; } ::cppu::OInterfaceContainerHelper* OApplicationController::getContextMenuInterceptors() diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index 483fb386b1b6..87ba2f22ac98 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -20,7 +20,6 @@ #ifndef INCLUDED_DBACCESS_SOURCE_UI_APP_APPCONTROLLER_HXX #define INCLUDED_DBACCESS_SOURCE_UI_APP_APPCONTROLLER_HXX -#include "IApplicationController.hxx" #include "AppElementType.hxx" #include "callbacks.hxx" #include "commontypes.hxx" @@ -80,7 +79,8 @@ namespace dbaui class OApplicationController :public OGenericUnoController ,public OApplicationController_Base - ,public IApplicationController + ,public IControlActionListener + ,public IContextMenuProvider { public: typedef ::std::vector< css::uno::Reference< css::container::XContainer > > TContainerVector; @@ -481,18 +481,41 @@ namespace dbaui */ void refreshTables(); - // IApplicationController - virtual bool onEntryDoubleClick(SvTreeListBox& _rTree) SAL_OVERRIDE; - virtual bool onContainerSelect(ElementType _eType) SAL_OVERRIDE; - virtual void onSelectionChanged() SAL_OVERRIDE; - virtual void onCutEntry() SAL_OVERRIDE; - virtual void onCopyEntry() SAL_OVERRIDE; - virtual void onPasteEntry() SAL_OVERRIDE; - virtual void onDeleteEntry() SAL_OVERRIDE; - virtual void previewChanged( sal_Int32 _nMode) SAL_OVERRIDE; - virtual void containerFound( const css::uno::Reference< css::container::XContainer >& _xContainer) SAL_OVERRIDE; - - // IController (base of IApplicationController) + /** called when an entry in a tree list box has been double-clicked + @param _rTree + The tree list box. + @return + <TRUE/> if the double click event has been handled by the called, and should not + be processed further. + */ + bool onEntryDoubleClick(SvTreeListBox& _rTree); + /** called when a container (category) in the application view has been selected + @param _pTree + The tree list box. + @return + <TRUE/> if the cotainer could be changed otherwise <FALSE/> + */ + bool onContainerSelect(ElementType _eType); + /** called when an entry in a tree view has been selected + @param _pEntry + the selected entry + */ + void onSelectionChanged(); + /** called when a "Copy" command is executed in a tree view + */ + void onCopyEntry(); + /** called when a "Paste" command is executed in a tree view + */ + void onPasteEntry(); + /** called when a "Delete" command is executed in a tree view + */ + void onDeleteEntry(); + /// called when the preview mode was changed + void previewChanged( sal_Int32 _nMode); + /// called when an object container of any kind was found during enumerating tree view elements + void containerFound( const css::uno::Reference< css::container::XContainer >& _xContainer); + + // IController virtual void executeUnChecked(const css::util::URL& _rCommand, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) SAL_OVERRIDE; virtual void executeChecked(const css::util::URL& _rCommand, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) SAL_OVERRIDE; virtual void executeUnChecked(sal_uInt16 _nCommandId, const css::uno::Sequence< css::beans::PropertyValue>& aArgs) SAL_OVERRIDE; @@ -512,7 +535,7 @@ namespace dbaui virtual sal_Int8 queryDrop( const AcceptDropEvent& _rEvt, const DataFlavorExVector& _rFlavors ) SAL_OVERRIDE; virtual sal_Int8 executeDrop( const ExecuteDropEvent& _rEvt ) SAL_OVERRIDE; - // IContextMenuProvider (base of IApplicationController) + // IContextMenuProvider virtual PopupMenu* getContextMenu( Control& _rControl ) const SAL_OVERRIDE; virtual IController& getCommandController() SAL_OVERRIDE; virtual ::cppu::OInterfaceContainerHelper* diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index b4b676915ea4..d1877b1b1e7b 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -62,8 +62,8 @@ #include <vcl/settings.hxx> #include <tools/stream.hxx> #include <rtl/ustrbuf.hxx> -#include "IApplicationController.hxx" #include "svtools/treelistentry.hxx" +#include "AppController.hxx" #include <com/sun/star/document/XDocumentProperties.hpp> @@ -759,7 +759,6 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons _pTreeView->SetEnterKeyHdl(LINK(this, OAppDetailPageHelper, OnEntryEnterKey)); _pTreeView->SetSelChangeHdl(LINK(this, OAppDetailPageHelper, OnEntrySelChange)); - _pTreeView->setCutHandler(LINK(this, OAppDetailPageHelper, OnCutEntry)); _pTreeView->setCopyHandler(LINK(this, OAppDetailPageHelper, OnCopyEntry)); _pTreeView->setPasteHandler(LINK(this, OAppDetailPageHelper, OnPasteEntry)); _pTreeView->setDeleteHandler(LINK(this, OAppDetailPageHelper, OnDeleteEntry)); @@ -920,11 +919,6 @@ IMPL_LINK_NOARG_TYPED(OAppDetailPageHelper, OnEntrySelChange, LinkParamNone*, vo getBorderWin().getView()->getAppController().onSelectionChanged(); } -IMPL_LINK_NOARG_TYPED( OAppDetailPageHelper, OnCutEntry, LinkParamNone*, void ) -{ - getBorderWin().getView()->getAppController().onCutEntry(); -} - IMPL_LINK_NOARG_TYPED( OAppDetailPageHelper, OnCopyEntry, LinkParamNone*, void ) { getBorderWin().getView()->getAppController().onCopyEntry(); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index 1666f163d3ec..63a08451dd9d 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -155,7 +155,6 @@ namespace dbaui DECL_LINK_TYPED( OnEntryEnterKey, DBTreeListBox*, void ); DECL_LINK_TYPED( OnEntrySelChange, LinkParamNone*, void ); - DECL_LINK_TYPED( OnCutEntry, LinkParamNone*, void ); DECL_LINK_TYPED( OnCopyEntry, LinkParamNone*, void ); DECL_LINK_TYPED( OnPasteEntry, LinkParamNone*, void ); DECL_LINK_TYPED( OnDeleteEntry, LinkParamNone*, void ); diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index ebca1a143ee0..8651666c8f09 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -44,9 +44,9 @@ #include "svtools/viewdataentry.hxx" #include <algorithm> #include "dbtreelistbox.hxx" -#include "IApplicationController.hxx" #include "imageprovider.hxx" #include "comphelper/processfactory.hxx" +#include "AppController.hxx" using namespace ::dbaui; using namespace ::com::sun::star::uno; diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx index 6544c40c869f..eb4a6189c97a 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.cxx +++ b/dbaccess/source/ui/app/AppSwapWindow.cxx @@ -27,7 +27,7 @@ #include <vcl/menu.hxx> #include <vcl/mnemonic.hxx> #include <vcl/settings.hxx> -#include "IApplicationController.hxx" +#include "AppController.hxx" using namespace ::dbaui; using namespace ::com::sun::star::uno; diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index 363d11176f4b..95b0b3d46188 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -43,7 +43,7 @@ #include <dbaccess/IController.hxx> #include "browserids.hxx" #include <unotools/pathoptions.hxx> -#include "IApplicationController.hxx" +#include "AppController.hxx" using namespace ::dbaui; using namespace ::com::sun::star::uno; @@ -179,7 +179,7 @@ OApplicationSwapWindow* OAppBorderWindow::getPanel() const // class OApplicationView OApplicationView::OApplicationView( vcl::Window* pParent ,const Reference< XComponentContext >& _rxOrb - ,IApplicationController& _rAppController + ,OApplicationController& _rAppController ,PreviewMode _ePreviewMode ) : ODataView( pParent, _rAppController, _rxOrb, WB_DIALOGCONTROL ) diff --git a/dbaccess/source/ui/app/AppView.hxx b/dbaccess/source/ui/app/AppView.hxx index 1ff50802b01e..b249729ebf33 100644 --- a/dbaccess/source/ui/app/AppView.hxx +++ b/dbaccess/source/ui/app/AppView.hxx @@ -37,11 +37,12 @@ class MnemonicGenerator; namespace dbaui { - class IApplicationController; class OApplicationView; class OApplicationDetailView; class OApplicationSwapWindow; class OTitleWindow; + class OApplicationController; + class OAppBorderWindow : public vcl::Window { VclPtr<OTitleWindow> m_pPanel; @@ -81,7 +82,7 @@ namespace dbaui css::uno::Reference< css::lang::XComponent > m_xObject; VclPtr<OAppBorderWindow> m_pWin; - IApplicationController& m_rAppController; + OApplicationController& m_rAppController; ChildFocusState m_eChildFocus; IClipboardTest* getActiveChild() const; @@ -100,7 +101,7 @@ namespace dbaui public: OApplicationView( vcl::Window* pParent ,const css::uno::Reference< css::uno::XComponentContext >& - ,IApplicationController& _rAppController + ,OApplicationController& _rAppController ,PreviewMode _ePreviewMode ); virtual ~OApplicationView(); @@ -116,7 +117,7 @@ namespace dbaui virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE; - inline IApplicationController& getAppController() const { return m_rAppController; } + inline OApplicationController& getAppController() const { return m_rAppController; } // IClipboardTest virtual bool isCutAllowed() SAL_OVERRIDE; diff --git a/dbaccess/source/ui/app/IApplicationController.hxx b/dbaccess/source/ui/app/IApplicationController.hxx deleted file mode 100644 index bfc48a23f60c..000000000000 --- a/dbaccess/source/ui/app/IApplicationController.hxx +++ /dev/null @@ -1,90 +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_DBACCESS_SOURCE_UI_APP_IAPPLICATIONCONTROLLER_HXX -#define INCLUDED_DBACCESS_SOURCE_UI_APP_IAPPLICATIONCONTROLLER_HXX - -#include <dbaccess/IController.hxx> -#include "AppElementType.hxx" -#include "callbacks.hxx" - -class SvTreeListBox; - -namespace dbaui -{ - - class SAL_NO_VTABLE IApplicationController :public IController - ,public IControlActionListener - ,public IContextMenuProvider - { - public: - /** called when an entry in a tree list box has been double-clicked - @param _rTree - The tree list box. - @return - <TRUE/> if the double click event has been handled by the called, and should not - be processed further. - */ - virtual bool onEntryDoubleClick( SvTreeListBox& _rTree ) = 0; - - /** called when a container (category) in the application view has been selected - @param _pTree - The tree list box. - @return - <TRUE/> if the cotainer could be changed otherwise <FALSE/> - */ - virtual bool onContainerSelect(ElementType _eType) = 0; - - /** called when an entry in a tree view has been selected - @param _pEntry - the selected entry - */ - virtual void onSelectionChanged() = 0; - - /** called when a "Cut" command is executed in a tree view - */ - virtual void onCutEntry() = 0; - - /** called when a "Copy" command is executed in a tree view - */ - virtual void onCopyEntry() = 0; - - /** called when a "Paste" command is executed in a tree view - */ - virtual void onPasteEntry() = 0; - - /** called when a "Delete" command is executed in a tree view - */ - virtual void onDeleteEntry() = 0; - - /// called when the preview mode was changed - virtual void previewChanged( sal_Int32 _nMode ) = 0; - - /// called when an object container of any kind was found during enumerating tree view elements - virtual void containerFound( const css::uno::Reference< css::container::XContainer >& _xContainer) = 0; - - protected: - ~IApplicationController() {} - }; - -} // namespace dbaui - -#endif // INCLUDED_DBACCESS_SOURCE_UI_APP_IAPPLICATIONCONTROLLER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |