From c3a2fa08763fb38e9325e609420db2f70e428cf0 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Wed, 17 Feb 2016 11:52:17 +0200 Subject: tdf#91013 Convert freezepanes menu to xml Change-Id: Iedab5e5be5358f7716a2b33de3f0db582a401155 --- framework/Library_fwk.mk | 1 - .../source/uielement/freezepanesmenucontroller.cxx | 104 --------------------- framework/util/fwk.component | 4 - .../data/org/openoffice/Office/UI/Controller.xcu | 9 +- sc/UIConfig_scalc.mk | 1 + sc/uiconfig/scalc/popupmenu/freezepanes.xml | 13 +++ 6 files changed, 20 insertions(+), 112 deletions(-) delete mode 100644 framework/source/uielement/freezepanesmenucontroller.cxx create mode 100644 sc/uiconfig/scalc/popupmenu/freezepanes.xml diff --git a/framework/Library_fwk.mk b/framework/Library_fwk.mk index f9aed1fced13..0c78fc460a2d 100644 --- a/framework/Library_fwk.mk +++ b/framework/Library_fwk.mk @@ -144,7 +144,6 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\ framework/source/uielement/popuptoolbarcontroller \ framework/source/uielement/progressbarwrapper \ framework/source/uielement/recentfilesmenucontroller \ - framework/source/uielement/freezepanesmenucontroller \ framework/source/uielement/resourcemenucontroller \ framework/source/uielement/saveasmenucontroller \ framework/source/uielement/spinfieldtoolbarcontroller \ diff --git a/framework/source/uielement/freezepanesmenucontroller.cxx b/framework/source/uielement/freezepanesmenucontroller.cxx deleted file mode 100644 index 9d4cd1bda4f4..000000000000 --- a/framework/source/uielement/freezepanesmenucontroller.cxx +++ /dev/null @@ -1,104 +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 -#include -#include -#include - -using namespace css; -using namespace com::sun::star::uno; -using namespace com::sun::star::frame; - -namespace { - -class FreezePanesMenuController : public svt::PopupMenuControllerBase -{ -public: - explicit FreezePanesMenuController( const uno::Reference< uno::XComponentContext >& xContext ); - virtual ~FreezePanesMenuController(); - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException, std::exception) override - { - return OUString("com.sun.star.comp.framework.FreezePanesMenuController"); - } - - virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) - throw (css::uno::RuntimeException, std::exception) override - { - return cppu::supportsService(this, ServiceName); - } - - virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() - throw (css::uno::RuntimeException, std::exception) override - { - css::uno::Sequence< OUString > aSeq { "com.sun.star.frame.PopupMenuController" }; - return aSeq; - } - - // XStatusListener - virtual void SAL_CALL statusChanged( const frame::FeatureStateEvent& Event ) throw ( uno::RuntimeException, std::exception ) override; - -private: - virtual void impl_setPopupMenu() override; -}; - -FreezePanesMenuController::FreezePanesMenuController( const uno::Reference< uno::XComponentContext >& xContext ) : - svt::PopupMenuControllerBase( xContext ) -{ -} - -FreezePanesMenuController::~FreezePanesMenuController() -{ -} - -void FreezePanesMenuController::impl_setPopupMenu() -{ - VCLXMenu* pPopupMenu = VCLXMenu::GetImplementation( m_xPopupMenu ); - Menu* pVCLPopupMenu = nullptr; - - SolarMutexGuard aSolarMutexGuard; - - if ( pPopupMenu ) - pVCLPopupMenu = pPopupMenu->GetMenu(); - - if ( pVCLPopupMenu ) - { - pVCLPopupMenu->InsertItem( ".uno:FreezePanesFirstColumn", m_xFrame ); - pVCLPopupMenu->InsertItem( ".uno:FreezePanesFirstRow", m_xFrame ); - } -} - -// XStatusListener -void SAL_CALL FreezePanesMenuController::statusChanged( const FeatureStateEvent& /*Event*/ ) throw ( RuntimeException, std::exception ) -{ -} - -extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL -com_sun_star_comp_framework_FreezePanesMenuController_get_implementation( - css::uno::XComponentContext *context, - css::uno::Sequence const &) -{ - return cppu::acquire(new FreezePanesMenuController(context)); -} - -} -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index f6ae4821979a..f14fbe4f06bc 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -121,10 +121,6 @@ constructor="com_sun_star_comp_framework_SaveAsMenuController_get_implementation"> - - - diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index b994e8001d4f..267177e614f8 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -310,10 +310,13 @@ .uno:FreezePanesMenu - + com.sun.star.sheet.SpreadsheetDocument - com.sun.star.comp.framework.FreezePanesMenuController + com.sun.star.comp.framework.ResourceMenuController + + + freezepanes @@ -1070,7 +1073,7 @@ .uno:FreezePanes - + com.sun.star.sheet.SpreadsheetDocument com.sun.star.comp.framework.GenericPopupToolbarController diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk index 968323bff070..4d92e3c0fad7 100644 --- a/sc/UIConfig_scalc.mk +++ b/sc/UIConfig_scalc.mk @@ -29,6 +29,7 @@ $(eval $(call gb_UIConfig_add_popupmenufiles,modules/scalc,\ sc/uiconfig/scalc/popupmenu/draw \ sc/uiconfig/scalc/popupmenu/drawtext \ sc/uiconfig/scalc/popupmenu/form \ + sc/uiconfig/scalc/popupmenu/freezepanes \ sc/uiconfig/scalc/popupmenu/graphic \ sc/uiconfig/scalc/popupmenu/media \ sc/uiconfig/scalc/popupmenu/oleobject \ diff --git a/sc/uiconfig/scalc/popupmenu/freezepanes.xml b/sc/uiconfig/scalc/popupmenu/freezepanes.xml new file mode 100644 index 000000000000..cc6d3147a446 --- /dev/null +++ b/sc/uiconfig/scalc/popupmenu/freezepanes.xml @@ -0,0 +1,13 @@ + + + + + + -- cgit v1.2.3