From 291544d481a79ce037018dd7cefbfec719b76f2d Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Thu, 28 Jan 2016 13:38:46 +0200 Subject: tdf#93837 starmath: Convert RID_VIEWMENU to xml Also fixes .uno:Adjust->.uno:ZoomOptimal forgotten by ffc2e5be1f712b09710e2096ad2f7eb81b80118d Change-Id: Ifa3d1144b2d85290d7d27de50f5ad430ae0cfc8d --- .../data/org/openoffice/Office/UI/MathCommands.xcu | 2 +- .../org/openoffice/Office/UI/MathWindowState.xcu | 5 ++ starmath/UIConfig_smath.mk | 4 ++ starmath/inc/smcommands.h | 32 ------------- starmath/inc/starmath.hrc | 1 - starmath/inc/view.hxx | 1 - starmath/source/document.cxx | 3 +- starmath/source/smres.src | 53 ---------------------- starmath/source/view.cxx | 13 +----- starmath/uiconfig/smath/menubar/menubar.xml | 2 +- starmath/uiconfig/smath/popupmenu/view.xml | 19 ++++++++ 11 files changed, 32 insertions(+), 103 deletions(-) delete mode 100644 starmath/inc/smcommands.h create mode 100644 starmath/uiconfig/smath/popupmenu/view.xml diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu index 4d612cd79156..c79905f72f91 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu @@ -148,7 +148,7 @@ 1 - + Sho~w All diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathWindowState.xcu index eab88e96451f..bd679f723693 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/MathWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/MathWindowState.xcu @@ -20,6 +20,11 @@ + + + Work Area + + 0,0 diff --git a/starmath/UIConfig_smath.mk b/starmath/UIConfig_smath.mk index a798bf751bb7..2df545d7a67b 100644 --- a/starmath/UIConfig_smath.mk +++ b/starmath/UIConfig_smath.mk @@ -13,6 +13,10 @@ $(eval $(call gb_UIConfig_add_menubarfiles,modules/smath,\ starmath/uiconfig/smath/menubar/menubar \ )) +$(eval $(call gb_UIConfig_add_popupmenufiles,modules/smath,\ + starmath/uiconfig/smath/popupmenu/view \ +)) + $(eval $(call gb_UIConfig_add_statusbarfiles,modules/smath,\ starmath/uiconfig/smath/statusbar/statusbar \ )) diff --git a/starmath/inc/smcommands.h b/starmath/inc/smcommands.h deleted file mode 100644 index 35d29ab324d9..000000000000 --- a/starmath/inc/smcommands.h +++ /dev/null @@ -1,32 +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_STARMATH_INC_SMCOMMANDS_H -#define INCLUDED_STARMATH_INC_SMCOMMANDS_H - -#define CMD_SID_ADJUST ".uno:Adjust" -#define CMD_SID_DRAW ".uno:Draw" -#define CMD_SID_VIEW100 ".uno:View100" -#define CMD_SID_VIEW200 ".uno:View200" -#define CMD_SID_VIEW050 ".uno:View50" -#define CMD_SID_ZOOMIN ".uno:ZoomIn" -#define CMD_SID_ZOOMOUT ".uno:ZoomOut" - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index b6f5c0ae85d7..cab9a94b9423 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -83,7 +83,6 @@ #define RID_UNDOFORMATNAME (RID_APP_START + 504) #define RID_COMMANDMENU (RID_APP_START + 701) -#define RID_VIEWMENU (RID_APP_START + 702) #define RID_FONTREGULAR (RID_APP_START + 804) #define RID_FONTITALIC (RID_APP_START + 805) #define RID_FONTBOLD (RID_APP_START + 806) diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 8f9f1aedea8a..672c090d3fdd 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -91,7 +91,6 @@ protected: virtual void KeyInput(const KeyEvent& rKEvt) override; virtual void Command(const CommandEvent& rCEvt) override; virtual void StateChanged( StateChangedType eChanged ) override; - DECL_LINK_TYPED(MenuSelectHdl, Menu*, bool); private: void RepaintViewShellDoc(); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 0ff39dc7f8dd..6d6bd01003c6 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -108,8 +108,7 @@ SFX_IMPL_SUPERCLASS_INTERFACE(SmDocShell, SfxObjectShell) void SmDocShell::InitInterface_Impl() { - GetStaticInterface()->RegisterPopupMenu(SmResId(RID_VIEWMENU)); - GetStaticInterface()->RegisterPopupMenu(SmResId(RID_COMMANDMENU)); + GetStaticInterface()->RegisterPopupMenu("view"); } SFX_IMPL_OBJECTFACTORY(SmDocShell, SvGlobalName(SO3_SM_CLASSID), SfxObjectShellFlags::STD_NORMAL, "smath" ) diff --git a/starmath/source/smres.src b/starmath/source/smres.src index 1909f556526c..50872d97fda0 100644 --- a/starmath/source/smres.src +++ b/starmath/source/smres.src @@ -20,7 +20,6 @@ #include #include #include "starmath.hrc" -#include "smcommands.h" String RID_FONTREGULAR { @@ -42,58 +41,6 @@ String GID_MATH { Text = "StarMath" ; }; -Menu RID_VIEWMENU -{ - ItemList = - { - MenuItem - { - Identifier = SID_ZOOM_50_PERCENT; - HelpId = CMD_SID_VIEW050 ; - Text [ en-US ] = "~View 50%" ; - }; - MenuItem - { - Identifier = SID_ZOOM_100_PERCENT ; - HelpId = CMD_SID_VIEW100 ; - Text [ en-US ] = "View ~100%" ; - }; - MenuItem - { - Identifier = SID_ZOOM_200_PERCENT ; - HelpId = CMD_SID_VIEW200 ; - Text [ en-US ] = "View ~200%" ; - }; - MenuItem - { - Identifier = SID_ZOOMIN ; - HelpId = CMD_SID_ZOOMIN ; - Text [ en-US ] = "~Zoom In" ; - }; - MenuItem - { - Identifier = SID_ZOOMOUT ; - HelpId = CMD_SID_ZOOMOUT ; - Text [ en-US ] = "Zoom ~Out" ; - }; - MenuItem - { - Identifier = SID_ZOOM_OPTIMAL ; - HelpId = CMD_SID_ADJUST ; - Text [ en-US ] = "~Display All" ; - }; - MenuItem - { - Separator = TRUE ; - }; - MenuItem - { - Identifier = SID_DRAW ; - HelpId = CMD_SID_DRAW ; - Text [ en-US ] = "U~pdate" ; - }; - }; -}; String STR_BLACK { diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index a808a6868a5f..fc7c04ca5173 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -563,9 +563,6 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt) case CommandEventId::ContextMenu: { GetParent()->ToTop(); - SmResId aResId( RID_VIEWMENU ); - std::unique_ptr xPopupMenu(new PopupMenu(aResId)); - xPopupMenu->SetSelectHdl(LINK(this, SmGraphicWindow, MenuSelectHdl)); Point aPos(5, 5); if (rCEvt.IsMouseEvent()) aPos = rCEvt.GetMousePosPixel(); @@ -573,7 +570,7 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt) // added for replaceability of context menus pViewShell->GetViewFrame()->GetBindings().GetDispatcher() - ->ExecutePopup( aResId, this, &aPos ); + ->ExecutePopup( this, &aPos ); bCallBase = false; } @@ -603,14 +600,6 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt) } -IMPL_LINK_TYPED( SmGraphicWindow, MenuSelectHdl, Menu *, pMenu, bool ) -{ - SmViewShell *pViewSh = GetView(); - if (pViewSh) - pViewSh->GetViewFrame()->GetDispatcher()->Execute( pMenu->GetCurItemId() ); - return false; -} - void SmGraphicWindow::SetZoom(sal_uInt16 Factor) { nZoom = std::min(std::max((sal_uInt16) Factor, (sal_uInt16) MINZOOM), (sal_uInt16) MAXZOOM); diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml index e51d861c8fc7..6b45d6129e31 100644 --- a/starmath/uiconfig/smath/menubar/menubar.xml +++ b/starmath/uiconfig/smath/menubar/menubar.xml @@ -85,7 +85,7 @@ - + diff --git a/starmath/uiconfig/smath/popupmenu/view.xml b/starmath/uiconfig/smath/popupmenu/view.xml new file mode 100644 index 000000000000..16233ce372fb --- /dev/null +++ b/starmath/uiconfig/smath/popupmenu/view.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + -- cgit v1.2.3