diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2015-11-19 10:45:12 +0200 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2015-11-19 10:48:40 +0200 |
commit | cfaa269832db6243f828e18b012a13967a2937aa (patch) | |
tree | f1dc239a9244592e83ee0cda65a131995aee9a0b /sd | |
parent | 4a6268f0d37f377181f972ed307d2a074e8e1b6a (diff) |
Further cleanup of 229fc164dc1773484b74eca016863cf68860e81b
Change-Id: Iaafc02f7c925c82b6bd7f98dd875028880b8788d
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/controller/displaymodecontroller.cxx | 71 | ||||
-rw-r--r-- | sd/source/ui/controller/displaymodecontroller.hxx | 52 |
2 files changed, 29 insertions, 94 deletions
diff --git a/sd/source/ui/controller/displaymodecontroller.cxx b/sd/source/ui/controller/displaymodecontroller.cxx index df867953159e..6a04f9a7a823 100644 --- a/sd/source/ui/controller/displaymodecontroller.cxx +++ b/sd/source/ui/controller/displaymodecontroller.cxx @@ -8,54 +8,46 @@ * */ -#include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/text/WritingMode.hpp> -#include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/drawing/DrawViewMode.hpp> - -#include <osl/mutex.hxx> - -#include <vcl/svapp.hxx> -#include <vcl/toolbox.hxx> - -#include <svl/languageoptions.hxx> - -#include <svtools/ctrltool.hxx> -#include <svtools/ctrlbox.hxx> +#include <svtools/popupwindowcontroller.hxx> #include <svtools/toolbarmenu.hxx> #include <svtools/valueset.hxx> +#include <vcl/toolbox.hxx> -#include <toolkit/helper/vclunohelper.hxx> -#include <comphelper/processfactory.hxx> - -#include <sfx2/imagemgr.hxx> - -#include "app.hrc" -#include "facreg.hxx" -#include "glob.hrc" #include "strings.hrc" #include "res_bmp.hrc" #include "sdresid.hxx" -#include "pres.hxx" -#include "displaymodecontroller.hxx" -#include "ViewShellBase.hxx" using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::text; using namespace ::com::sun::star::frame; -using namespace ::com::sun::star::drawing; using namespace ::com::sun::star::beans; namespace sd { // Component to select which display mode has to be used. -// Composed of a combobox in the toolbar and a popup menu to select -// the value +// Composed of a dropdown button in the toolbar and a +// popup menu to select the value + +class DisplayModeController : public svt::PopupWindowController +{ +public: + DisplayModeController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + + virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) + throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException, std::exception ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException, std::exception ) override; + + void setToolboxItemImage( sal_uInt16 nImage ); + + using svt::PopupWindowController::createPopupWindow; +}; class DisplayModeToolbarMenu : public svtools::ToolbarMenu { @@ -63,7 +55,7 @@ public: DisplayModeToolbarMenu( DisplayModeController& rController, const Reference< XFrame >& xFrame, vcl::Window* pParent ); virtual ~DisplayModeToolbarMenu(); - virtual void dispose() SAL_OVERRIDE; + virtual void dispose() override; protected: DECL_LINK_TYPED( SelectToolbarMenuHdl, ToolbarMenu*, void ); @@ -155,8 +147,6 @@ DisplayModeToolbarMenu::DisplayModeToolbarMenu( DisplayModeController& rControll OUString aTitle1( SD_RESSTR( STR_DISPLAYMODE_EDITMODES ) ); OUString aTitle2( SD_RESSTR( STR_DISPLAYMODE_MASTERMODES ) ); - SvtLanguageOptions aLanguageOptions; - SetSelectHdl( LINK( this, DisplayModeToolbarMenu, SelectToolbarMenuHdl ) ); mpDisplayModeSet1 = createEmptyValueSetControl(); @@ -232,14 +222,13 @@ void DisplayModeToolbarMenu::SelectHdl(void * pControl) nImage = mastermodes[mpDisplayModeSet2->GetSelectItemId() - 5 ].mnBmpResId; } - Sequence< PropertyValue > aArgs; if (!sCommandURL.isEmpty()) - mrController.dispatchCommand( sCommandURL, aArgs ); + mrController.dispatchCommand( sCommandURL, Sequence< PropertyValue >() ); mrController.setToolboxItemImage( nImage ); } -DisplayModeController::DisplayModeController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ) +DisplayModeController::DisplayModeController( const css::uno::Reference< css::uno::XComponentContext >& rxContext ) : svt::PopupWindowController( rxContext, Reference< frame::XFrame >(), OUString() ) { } @@ -294,13 +283,11 @@ Sequence< OUString > SAL_CALL DisplayModeController::getSupportedServiceNames( } - extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL -com_sun_star_comp_sd_DisplayModeController_get_implementation(::com::sun::star::uno::XComponentContext* context, - ::com::sun::star::uno::Sequence<css::uno::Any> const &) +com_sun_star_comp_sd_DisplayModeController_get_implementation( css::uno::XComponentContext* context, + css::uno::Sequence<css::uno::Any> const &) { return cppu::acquire(new sd::DisplayModeController(context)); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/controller/displaymodecontroller.hxx b/sd/source/ui/controller/displaymodecontroller.hxx deleted file mode 100644 index 8167890ef4bc..000000000000 --- a/sd/source/ui/controller/displaymodecontroller.hxx +++ /dev/null @@ -1,52 +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_SD_SOURCE_UI_CONTROLLER_DISPLAYMODECONTROLLER_HXX -#define INCLUDED_SD_SOURCE_UI_CONTROLLER_DISPLAYMODECONTROLLER_HXX - -#include <svtools/popupwindowcontroller.hxx> - -namespace sd -{ - -class DisplayModeController : public svt::PopupWindowController -{ -public: - DisplayModeController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext ); - - virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE; - - // XInitialization - virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) - throw ( css::uno::Exception, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; - - void setToolboxItemImage( sal_uInt16 nImage ); - - using svt::PopupWindowController::createPopupWindow; -}; - -} - -#endif // INCLUDED_SD_SOURCE_UI_CONTROLLER_DISPLAYMODECONTROLLER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |