tdf#91013 Convert freezepanes menu to xml
Change-Id: Iedab5e5be5358f7716a2b33de3f0db582a401155
This commit is contained in:
@@ -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 \
|
||||
|
@@ -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 <cppuhelper/supportsservice.hxx>
|
||||
#include <svtools/popupmenucontrollerbase.hxx>
|
||||
#include <vcl/menu.hxx>
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
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<OUString> 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<css::uno::Any> const &)
|
||||
{
|
||||
return cppu::acquire(new FreezePanesMenuController(context));
|
||||
}
|
||||
|
||||
}
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -121,10 +121,6 @@
|
||||
constructor="com_sun_star_comp_framework_SaveAsMenuController_get_implementation">
|
||||
<service name="com.sun.star.frame.PopupMenuController"/>
|
||||
</implementation>
|
||||
<implementation name="com.sun.star.comp.framework.FreezePanesMenuController"
|
||||
constructor="com_sun_star_comp_framework_FreezePanesMenuController_get_implementation">
|
||||
<service name="com.sun.star.frame.PopupMenuController"/>
|
||||
</implementation>
|
||||
<implementation name="com.sun.star.comp.framework.StatusBarControllerFactory"
|
||||
constructor="com_sun_star_comp_framework_StatusBarControllerFactory_get_implementation">
|
||||
<service name="com.sun.star.frame.StatusbarControllerFactory"/>
|
||||
|
@@ -310,10 +310,13 @@
|
||||
<value>.uno:FreezePanesMenu</value>
|
||||
</prop>
|
||||
<prop oor:name="Module">
|
||||
<value/>
|
||||
<value>com.sun.star.sheet.SpreadsheetDocument</value>
|
||||
</prop>
|
||||
<prop oor:name="Controller">
|
||||
<value>com.sun.star.comp.framework.FreezePanesMenuController</value>
|
||||
<value>com.sun.star.comp.framework.ResourceMenuController</value>
|
||||
</prop>
|
||||
<prop oor:name="Value">
|
||||
<value>freezepanes</value>
|
||||
</prop>
|
||||
</node>
|
||||
</node>
|
||||
@@ -1070,7 +1073,7 @@
|
||||
<value>.uno:FreezePanes</value>
|
||||
</prop>
|
||||
<prop oor:name="Module">
|
||||
<value/>
|
||||
<value>com.sun.star.sheet.SpreadsheetDocument</value>
|
||||
</prop>
|
||||
<prop oor:name="Controller">
|
||||
<value>com.sun.star.comp.framework.GenericPopupToolbarController</value>
|
||||
|
@@ -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 \
|
||||
|
13
sc/uiconfig/scalc/popupmenu/freezepanes.xml
Normal file
13
sc/uiconfig/scalc/popupmenu/freezepanes.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
* 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/.
|
||||
*
|
||||
-->
|
||||
<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
|
||||
<menu:menuitem menu:id=".uno:FreezePanesFirstColumn"/>
|
||||
<menu:menuitem menu:id=".uno:FreezePanesFirstRow"/>
|
||||
</menu:menupopup>
|
Reference in New Issue
Block a user