From 8bd418a6b8253a9d725981743a0375e2c8bb911e Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Sun, 17 Sep 2017 15:45:11 +0300 Subject: rptui::OToolboxController becomes unused, tdf#106762 related It was a wrapper around the color controller, because the latter used sfx2 registration. This will no longer be an issue, as we're moving to officecfg based registration. Change-Id: I45e1d8aeefdb62f5bd9b3dfac29910c77f0cd103 --- reportdesign/Library_rptui.mk | 1 - reportdesign/source/ui/inc/toolboxcontroller.hxx | 87 --------- reportdesign/source/ui/misc/rptuiservices.cxx | 3 - reportdesign/source/ui/misc/toolboxcontroller.cxx | 210 ---------------------- reportdesign/util/rptui.component | 3 - 5 files changed, 304 deletions(-) delete mode 100644 reportdesign/source/ui/inc/toolboxcontroller.hxx delete mode 100644 reportdesign/source/ui/misc/toolboxcontroller.cxx diff --git a/reportdesign/Library_rptui.mk b/reportdesign/Library_rptui.mk index f4e24c0e2f53..eef0ce6a36e6 100644 --- a/reportdesign/Library_rptui.mk +++ b/reportdesign/Library_rptui.mk @@ -71,7 +71,6 @@ $(eval $(call gb_Library_add_exception_objects,rptui,\ reportdesign/source/ui/misc/rptuiservices \ reportdesign/source/ui/misc/RptUndo \ reportdesign/source/ui/misc/statusbarcontroller \ - reportdesign/source/ui/misc/toolboxcontroller \ reportdesign/source/ui/misc/UITools \ reportdesign/source/ui/report/DesignView \ reportdesign/source/ui/report/dlgedclip \ diff --git a/reportdesign/source/ui/inc/toolboxcontroller.hxx b/reportdesign/source/ui/inc/toolboxcontroller.hxx deleted file mode 100644 index 83291253e5bc..000000000000 --- a/reportdesign/source/ui/inc/toolboxcontroller.hxx +++ /dev/null @@ -1,87 +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_REPORTDESIGN_SOURCE_UI_INC_TOOLBOXCONTROLLER_HXX -#define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_TOOLBOXCONTROLLER_HXX - -#include - -#include - -#include -#include -#include -#include -#include -#include - -class SvxColorToolBoxControl; -namespace rptui -{ - typedef ::cppu::ImplHelper2 < css::lang::XServiceInfo, - css::frame::XSubToolbarController> TToolboxController_BASE; - typedef rtl::Reference TToolbarHelper; - - class OToolboxController : public ::svt::ToolboxController - ,public TToolboxController_BASE - { - typedef std::map TCommandState; - TCommandState m_aStates; - TToolbarHelper m_pToolbarController; - OToolboxController(const OToolboxController&) = delete; - void operator =(const OToolboxController&) = delete; - public: - OToolboxController(const css::uno::Reference< css::uno::XComponentContext >& _rxORB); - virtual ~OToolboxController() override; - - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual void SAL_CALL acquire() throw () override; - virtual void SAL_CALL release() throw () override; - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() override; - virtual css::uno::Sequence< OUString> SAL_CALL getSupportedServiceNames() override; - // need by registration - /// @throws css::uno::RuntimeException - static OUString getImplementationName_Static(); - /// @throws css::uno::RuntimeException - static css::uno::Sequence< OUString > getSupportedServiceNames_Static(); - static css::uno::Reference< css::uno::XInterface > SAL_CALL - create(css::uno::Reference< css::uno::XComponentContext > const & xContext); - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - - // XInitialization - virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XStatusListener - virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; - // XToolbarController - virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override; - virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override; - - // XSubToolbarController - virtual sal_Bool SAL_CALL opensSubToolbar( ) override; - virtual OUString SAL_CALL getSubToolbarName( ) override; - virtual void SAL_CALL functionSelected( const OUString& aCommand ) override; - virtual void SAL_CALL updateImage( ) override; - }; - -} // rptui - -#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_TOOLBOXCONTROLLER_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/source/ui/misc/rptuiservices.cxx b/reportdesign/source/ui/misc/rptuiservices.cxx index 2424445129c0..3f949d713f03 100644 --- a/reportdesign/source/ui/misc/rptuiservices.cxx +++ b/reportdesign/source/ui/misc/rptuiservices.cxx @@ -19,7 +19,6 @@ #include #include #include "ReportController.hxx" -#include "toolboxcontroller.hxx" #include "statusbarcontroller.hxx" #include "DefaultInspection.hxx" #include "ReportComponentHandler.hxx" @@ -41,8 +40,6 @@ namespace cppu::ImplementationEntry entries[] = { { &OReportController::create, &OReportController::getImplementationName_Static, &OReportController::getSupportedServiceNames_Static, &cppu::createSingleComponentFactory, nullptr, 0 }, - { &OToolboxController::create, &OToolboxController::getImplementationName_Static, &OToolboxController::getSupportedServiceNames_Static, - &cppu::createSingleComponentFactory, nullptr, 0 }, { &OStatusbarController::create, &OStatusbarController::getImplementationName_Static, &OStatusbarController::getSupportedServiceNames_Static, &cppu::createSingleComponentFactory, nullptr, 0 }, { &DefaultComponentInspectorModel::create, &DefaultComponentInspectorModel::getImplementationName_Static, &DefaultComponentInspectorModel::getSupportedServiceNames_static, diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx deleted file mode 100644 index 1622f53b895b..000000000000 --- a/reportdesign/source/ui/misc/toolboxcontroller.cxx +++ /dev/null @@ -1,210 +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 "toolboxcontroller.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace rptui -{ - using namespace svt; - using namespace com::sun::star; - using namespace com::sun::star::uno; - using namespace com::sun::star::beans; - using namespace com::sun::star::lang; - using namespace frame; - using namespace util; - using namespace ui; - -OUString SAL_CALL OToolboxController::getImplementationName() -{ - return getImplementationName_Static(); -} - - -OUString OToolboxController::getImplementationName_Static() -{ - return OUString("com.sun.star.report.comp.ReportToolboxController"); -} - -Sequence< OUString> OToolboxController::getSupportedServiceNames_Static() -{ - Sequence aSupported { "com.sun.star.report.ReportToolboxController" }; - return aSupported; -} - -sal_Bool SAL_CALL OToolboxController::supportsService( const OUString& ServiceName ) -{ - return cppu::supportsService(this, ServiceName); -} - -Sequence< OUString> SAL_CALL OToolboxController::getSupportedServiceNames() -{ - return getSupportedServiceNames_Static(); -} - -Reference< XInterface > OToolboxController::create(Reference< XComponentContext > const & xContext) -{ - return * new OToolboxController(xContext); -} - -OToolboxController::OToolboxController(const Reference< XComponentContext >& _rxORB) - : m_pToolbarController(nullptr) -{ - osl_atomic_increment(&m_refCount); - m_xContext = _rxORB; - osl_atomic_decrement(&m_refCount); - -} - -OToolboxController::~OToolboxController() -{ -} - -// XInterface -Any SAL_CALL OToolboxController::queryInterface( const Type& _rType ) -{ - Any aReturn = ToolboxController::queryInterface(_rType); - if (!aReturn.hasValue()) - aReturn = TToolboxController_BASE::queryInterface(_rType); - return aReturn; -} - -void SAL_CALL OToolboxController::acquire() throw () -{ - ToolboxController::acquire(); -} - -void SAL_CALL OToolboxController::release() throw () -{ - ToolboxController::release(); -} - -void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments ) -{ - ToolboxController::initialize(_rArguments); - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard(m_aMutex); - sal_uInt16 nToolBoxId = 1; - - VclPtr< ToolBox > pToolBox = static_cast(VCLUnoHelper::GetWindow(getParent()).get()); - if ( pToolBox ) - { - const ToolBox::ImplToolItems::size_type nCount = pToolBox->GetItemCount(); - for (ToolBox::ImplToolItems::size_type nPos = 0; nPos < nCount; ++nPos) - { - const sal_uInt16 nItemId = pToolBox->GetItemId(nPos); - if ( pToolBox->GetItemCommand(nItemId) == m_aCommandURL ) - { - nToolBoxId = nItemId; - break; - } - } - if ( m_aCommandURL == ".uno:FontColor" || m_aCommandURL == ".uno:Color" ) - { - m_aStates.emplace(OUString(".uno:FontColor"),true); - m_aStates.emplace(OUString(".uno:Color"),true); - m_pToolbarController = new SvxColorToolBoxControl(SID_ATTR_CHAR_COLOR2,nToolBoxId,*pToolBox); - } - else - { - m_aStates.emplace(OUString(".uno:BackgroundColor"),true); - m_pToolbarController = new SvxColorToolBoxControl(SID_BACKGROUND_COLOR,nToolBoxId,*pToolBox); - } - - TCommandState::const_iterator aIter = m_aStates.begin(); - for (; aIter != m_aStates.end(); ++aIter) - addStatusListener(aIter->first); - - if ( m_pToolbarController.is() ) - m_pToolbarController->initialize(_rArguments); - // check if paste special is allowed, when not don't add DROPDOWN - pToolBox->SetItemBits(nToolBoxId,pToolBox->GetItemBits(nToolBoxId) | ToolBoxItemBits::DROPDOWN); - } -} - -void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event ) -{ - ::osl::MutexGuard aGuard(m_aMutex); - TCommandState::iterator aFind = m_aStates.find( Event.FeatureURL.Complete ); - if ( aFind != m_aStates.end() && m_pToolbarController.is() ) - m_pToolbarController->statusChanged( Event ); -} - -Reference< awt::XWindow > SAL_CALL OToolboxController::createPopupWindow() -{ - // execute the menu - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard(m_aMutex); - - Reference< awt::XWindow > xRet; - if ( m_pToolbarController.is() ) - xRet = m_pToolbarController->createPopupWindow(); - - return xRet; -} - -void SAL_CALL OToolboxController::execute( sal_Int16 KeyModifier ) -{ - if ( m_pToolbarController.is() ) - m_pToolbarController->execute( KeyModifier ); -} - -sal_Bool SAL_CALL OToolboxController::opensSubToolbar() -{ - return true; -} - -OUString SAL_CALL OToolboxController::getSubToolbarName() -{ - return OUString(); -} - -void SAL_CALL OToolboxController::functionSelected( const OUString& /*rCommand*/ ) -{ -} - -void SAL_CALL OToolboxController::updateImage( ) -{ - SolarMutexGuard aSolarMutexGuard; - ::osl::MutexGuard aGuard(m_aMutex); - if ( m_pToolbarController.is() ) - m_pToolbarController->updateImage(); -} - -} // rptui - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/util/rptui.component b/reportdesign/util/rptui.component index bb2058b50d22..bb7d4a5dd842 100644 --- a/reportdesign/util/rptui.component +++ b/reportdesign/util/rptui.component @@ -34,9 +34,6 @@ - - - -- cgit v1.2.3