summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2016-01-28 13:38:46 +0200
committerMaxim Monastirsky <momonasmon@gmail.com>2016-01-28 15:03:55 +0200
commit291544d481a79ce037018dd7cefbfec719b76f2d (patch)
tree1080c81afc3e877525812f7a905ac21da2189a79
parentb9160c2511287223d7e014de3134fde917b9320e (diff)
tdf#93837 starmath: Convert RID_VIEWMENU to xml
Also fixes .uno:Adjust->.uno:ZoomOptimal forgotten by ffc2e5be1f712b09710e2096ad2f7eb81b80118d Change-Id: Ifa3d1144b2d85290d7d27de50f5ad430ae0cfc8d
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu2
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/MathWindowState.xcu5
-rw-r--r--starmath/UIConfig_smath.mk4
-rw-r--r--starmath/inc/smcommands.h32
-rw-r--r--starmath/inc/starmath.hrc1
-rw-r--r--starmath/inc/view.hxx1
-rw-r--r--starmath/source/document.cxx3
-rw-r--r--starmath/source/smres.src53
-rw-r--r--starmath/source/view.cxx13
-rw-r--r--starmath/uiconfig/smath/menubar/menubar.xml2
-rw-r--r--starmath/uiconfig/smath/popupmenu/view.xml19
11 files changed, 32 insertions, 103 deletions
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 @@
<value>1</value>
</prop>
</node>
- <node oor:name=".uno:Adjust" oor:op="replace">
+ <node oor:name=".uno:ZoomOptimal" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Sho~w All</value>
</prop>
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 @@
<oor:component-data xmlns:install="http://openoffice.org/2004/installation" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="MathWindowState" oor:package="org.openoffice.Office.UI">
<node oor:name="UIElements">
<node oor:name="States">
+ <node oor:name="private:resource/popupmenu/view" oor:op="replace">
+ <prop oor:name="UIName" oor:type="xs:string">
+ <value xml:lang="en-US">Work Area</value>
+ </prop>
+ </node>
<node oor:name="private:resource/toolbar/standardbar" oor:op="replace">
<prop oor:name="DockPos" oor:type="xs:string">
<value>0,0</value>
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 <sfx2/sfx.hrc>
#include <svx/globlmn.hrc>
#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<PopupMenu> 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 @@
<menu:menuitem menu:id=".uno:FullScreen"/>
<menu:menuitem menu:id=".uno:ZoomIn"/>
<menu:menuitem menu:id=".uno:ZoomOut"/>
- <menu:menuitem menu:id=".uno:Adjust"/>
+ <menu:menuitem menu:id=".uno:ZoomOptimal"/>
<menu:menu menu:id=".uno:ZoomMenu">
<menu:menupopup>
<menu:menuitem menu:id=".uno:Zoom50Percent"/>
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 @@
+<?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:Zoom50Percent"/>
+ <menu:menuitem menu:id=".uno:Zoom100Percent"/>
+ <menu:menuitem menu:id=".uno:Zoom200Percent"/>
+ <menu:menuitem menu:id=".uno:ZoomIn"/>
+ <menu:menuitem menu:id=".uno:ZoomOut"/>
+ <menu:menuitem menu:id=".uno:ZoomOptimal"/>
+ <menu:menuseparator/>
+ <menu:menuitem menu:id=".uno:Draw"/>
+</menu:menupopup>