browser/src/control/Control.Menubar.ts | 192 +++++++++++++++++----------------
1 file changed, 103 insertions(+), 89 deletions(-)
New commits:
commit da4848fa1b12541c8811fe2694946512622855f5
Author: Hubert Figuière <
h...@collabora.com>
AuthorDate: Wed Feb 4 16:29:13 2026 -0500
Commit: Hubert Figuière <
h...@figuiere.net>
CommitDate: Wed Feb 11 15:19:08 2026 -0500
menubar: When searching for commands always check for unoid
Add 'unoid' to most menuitm that have UNO as label.
This allow finding these with _getItemsForCommand()
so we can hide them by UNO commands even if
the menu is of type of "action".
Signed-off-by: Hubert Figuière <
h...@collabora.com>
Change-Id: I037c61d663f92c394035e777c6d55d266174529d
diff --git a/browser/src/control/Control.Menubar.ts b/browser/src/control/Control.Menubar.ts
index 9d337c0c47..f93b711c0d 100644
--- a/browser/src/control/Control.Menubar.ts
+++ b/browser/src/control/Control.Menubar.ts
@@ -14,6 +14,9 @@ interface MenuItem {
id?: string;
name?: string;
uno?: string;
+ // Tag a menu item as being for the uno command, but don't do anything. If `uno` is set
+ // this shouldn't be. It is used by `_getItemsForCommand()`.
+ unoid?: string;
type?: string;
menu?: MenuItem[];
disabled?: boolean;
@@ -92,7 +95,7 @@ class Menubar extends window.L.Control {
],
text: [
{name: _UNO('.uno:PickList', 'text'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'text'), id: 'save', type: 'action'},
+ {name: _UNO('.uno:Save', 'text'), unoid: '.uno:Save', id: 'save', type: 'action'},
{name: _UNO('.uno:SaveAs', 'text'), id: 'saveas', type: window.prefs.get('saveAsMode') === 'group' ? 'menu' : 'action', menu: [
{name: _('ODF text document (.odt)'), id: 'saveas-odt', type: 'action'},
{name: _('Word 2003 Document (.doc)'), id: 'saveas-doc', type: 'action'},
@@ -119,7 +122,7 @@ class Menubar extends window.L.Control {
{name: _UNO('.uno:Signature', 'text'), uno: '.uno:Signature', id: 'signature'},
{name: _('Options'), id: 'settings-dialog', type: 'action', mobileapp: false},
{type: 'separator'},
- {name: _UNO('.uno:Print', 'text'), id: 'print', type: 'action'},
+ {name: _UNO('.uno:Print', 'text'), unoid: '.uno:Print', id: 'print', type: 'action'},
{name: _('Close document'), id: 'closedocument', type: 'action'}
]},
{name: _UNO('.uno:EditMenu', 'text'), id: 'editmenu', type: 'menu', menu: [
@@ -158,10 +161,10 @@ class Menubar extends window.L.Control {
menu: (window.mode.isTablet() ? [
{name: _('Reset zoom'), id: 'zoomreset', type: 'action'},
] as MenuItem[] : [
- {name: _UNO('.uno:FullScreen', 'text'), id: 'fullscreen', type: 'action'},
+ {name: _UNO('.uno:FullScreen', 'text'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:ZoomPlus', 'text'), id: 'zoomin', type: 'action'},
- {name: _UNO('.uno:ZoomMinus', 'text'), id: 'zoomout', type: 'action',},
+ {name: _UNO('.uno:ZoomPlus', 'text'), unoid: '.uno:ZoomPlus', id: 'zoomin', type: 'action'},
+ {name: _UNO('.uno:ZoomMinus', 'text'), unoid: '.uno:ZoomMinus', id: 'zoomout', type: 'action',},
{name: _('Fit to Screen'), id: 'fitwidthzoom', type: 'action'},
] as MenuItem[]).concat([
{type: 'separator'},
@@ -175,14 +178,14 @@ class Menubar extends window.L.Control {
{uno: '.uno:SidebarDeck.StyleListDeck', name: _('Style list')},
{uno: '.uno:Navigator', id: 'navigator'},
{type: 'separator'},
- {name: _UNO('.uno:ShowAnnotations', 'text'), id: 'showannotations', type: 'action'},
- {name: _UNO('.uno:ShowResolvedAnnotations', 'text'), id: 'showresolved', type: 'action'},
+ {name: _UNO('.uno:ShowAnnotations', 'text'), unoid: '.uno:ShowAnnotations', id: 'showannotations', type: 'action'},
+ {name: _UNO('.uno:ShowResolvedAnnotations', 'text'), unoid: '.uno:ShowResolvedAnnotations', id: 'showresolved', type: 'action'},
{uno: '.uno:ControlCodes'},
])},
{name: _UNO('.uno:InsertMenu', 'text'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'text'), id: 'insertgraphicremote', type: 'action'},
- {name: _UNO('.uno:InsertAnnotation', 'text'), id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'text'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'text'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
{name: _UNO('.uno:FontworkGalleryFloater'), uno: '.uno:FontworkGalleryFloater', id: 'fontworkgalleryfloater'},
{name: _UNO('.uno:DrawText'), uno: '.uno:DrawText'},
@@ -215,7 +218,7 @@ class Menubar extends window.L.Control {
{uno: '.uno:InsertBreak'},
{name: _UNO('.uno:InsertColumnBreak', 'spreadsheet'), uno: '.uno:InsertColumnBreak'},
{type: 'separator'},
- {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
+ {name: _UNO('.uno:HyperlinkDialog'), unoid: '.uno:HyperlinkDialog', id: 'inserthyperlink', type: 'action'},
{name: _('Smart Picker'), id: 'remotelink', type: 'action'},
{name: _('AI Assistant'), id: 'remoteaicontent', type: 'action'},
{type: 'separator'},
@@ -426,7 +429,7 @@ class Menubar extends window.L.Control {
presentation: [
{name: _UNO('.uno:PickList', 'presentation'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'presentation'), id: 'save', type: 'action'},
+ {name: _UNO('.uno:Save', 'presentation'), unoid: '.uno:Save', id: 'save', type: 'action'},
{name: _UNO('.uno:SaveAs', 'presentation'), id: 'saveas', type: window.prefs.get('saveAsMode') === 'group' ? 'menu' : 'action', menu: [
{name: _('ODF presentation (.odp)'), id: 'saveas-odp', type: 'action'},
{name: _('PowerPoint 2003 Presentation (.ppt)'), id: 'saveas-ppt', type: 'action'},
@@ -479,10 +482,10 @@ class Menubar extends window.L.Control {
menu: (window.mode.isTablet() ? [
{name: _('Reset zoom'), id: 'zoomreset', type: 'action'},
] as MenuItem[] : [
- {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action'},
+ {name: _UNO('.uno:FullScreen', 'presentation'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:ZoomPlus', 'presentation'), id: 'zoomin', type: 'action'},
- {name: _UNO('.uno:ZoomMinus', 'presentation'), id: 'zoomout', type: 'action'},
+ {name: _UNO('.uno:ZoomPlus', 'presentation'), unoid: '.uno:ZoomPlus', id: 'zoomin', type: 'action'},
+ {name: _UNO('.uno:ZoomMinus', 'presentation'), unoid: '.uno:ZoomMinus', id: 'zoomout', type: 'action'},
{name: _('Reset zoom'), id: 'zoomreset', type: 'action'},
] as MenuItem[]).concat([
{type: 'separator'},
@@ -501,23 +504,23 @@ class Menubar extends window.L.Control {
{uno: '.uno:Navigator', id: 'navigator'},
{type: 'separator'},
{uno: '.uno:ModifyPage'},
- {name: _UNO('.uno:SlideChangeWindow', 'presentation', true), id: 'transitiondeck', type: 'action'},
+ {name: _UNO('.uno:SlideChangeWindow', 'presentation', true), unoid: '.uno:SlideChangeWindow', id: 'transitiondeck', type: 'action'},
{uno: '.uno:MasterSlidesPanel'},
{uno: '.uno:CustomAnimation'}, // core version
//{name: _UNO('.uno:CustomAnimation', 'presentation', true), id: 'animationdeck', type: 'action'}, // online version
])},
{name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'presentation'), id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'presentation'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
{name: _('Local Multimedia...'), id: 'insertmultimedia', type: 'action'},
- {name: _UNO('.uno:SelectBackground', 'presentation'), id: 'selectbackground', type: 'action'},
- {name: _UNO('.uno:InsertAnnotation', 'presentation'), id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:SelectBackground', 'presentation'), unoid: '.uno:SelectBackground', id: 'selectbackground', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'presentation'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
{name: _UNO('.uno:FontworkGalleryFloater'), uno: '.uno:FontworkGalleryFloater', id: 'fontworkgalleryfloater'},
- {name: _UNO('.uno:Text', 'presentation'), id: 'inserttextbox', type: 'action'},
+ {name: _UNO('.uno:Text', 'presentation'), unoid: '.uno:Text', id: 'inserttextbox', type: 'action'},
{name: _UNO('.uno:VerticalText'), uno: '.uno:VerticalText'},
{type: 'separator'},
- {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
+ {name: _UNO('.uno:HyperlinkDialog'), unoid: '.uno:HyperlinkDialog', id: 'inserthyperlink', type: 'action'},
{name: _('Smart Picker'), id: 'remotelink', type: 'action'},
{name: _('AI Assistant'), id: 'remoteaicontent', type: 'action'},
{type: 'separator'},
@@ -570,11 +573,11 @@ class Menubar extends window.L.Control {
{uno: '.uno:TableDialog'}]
},
{name: _UNO('.uno:SlideMenu', 'presentation'), id: 'slide', type: 'menu', menu: [
- {name: _UNO('.uno:InsertSlide', 'presentation'), id: 'insertpage', type: 'action'},
- {name: _UNO('.uno:DuplicateSlide', 'presentation'), id: 'duplicatepage', type: 'action'},
- {name: _UNO('.uno:DeleteSlide', 'presentation'), id: 'deletepage', type: 'action'},
- {name: _UNO('.uno:ShowSlide', 'presentation'), id: 'showslide', type: 'action'},
- {name: _UNO('.uno:HideSlide', 'presentation'), id: 'hideslide', type: 'action'},
+ {name: _UNO('.uno:InsertSlide', 'presentation'), unoid: '.uno:InsertSlide', id: 'insertpage', type: 'action'},
+ {name: _UNO('.uno:DuplicateSlide', 'presentation'), unoid: '.uno:DuplicateSlide', id: 'duplicatepage', type: 'action'},
+ {name: _UNO('.uno:DeleteSlide', 'presentation'), unoid: '.uno:DeleteSlide', id: 'deletepage', type: 'action'},
+ {name: _UNO('.uno:ShowSlide', 'presentation'), unoid: '.uno:ShowSlide', id: 'showslide', type: 'action'},
+ {name: _UNO('.uno:HideSlide', 'presentation'), unoid: '.uno:HideSlide', id: 'hideslide', type: 'action'},
{type: 'separator'},
{name: _UNO('.uno:GotoSlide', 'presentation'), uno: '.uno:GotoPage'},
{type: 'separator', id: 'fullscreen-presentation-separator'},
@@ -609,14 +612,14 @@ class Menubar extends window.L.Control {
drawing: [
{name: _UNO('.uno:PickList', 'presentation'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'presentation'), id: 'save', type: 'action'},
- {name: _UNO('.uno:SaveAs', 'presentation'), id: 'saveas', type: 'action'},
+ {name: _UNO('.uno:Save', 'presentation'), unoid: '.uno:Save', id: 'save', type: 'action'},
+ {name: _UNO('.uno:SaveAs', 'presentation'), unoid: '.uno:SaveAs', id: 'saveas', type: 'action'},
{name: _('Export as'), id: 'exportas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 'exportas-pdf', type: 'action'}
]},
{name: _('Save Comments'), id: 'savecomments', type: 'action'},
{name: _('Share...'), id:'shareas', type: 'action'},
- {name: _UNO('.uno:Print', 'presentation'), id: 'print', type: 'action'},
+ {name: _UNO('.uno:Print', 'presentation'), unoid: '.uno:Print', id: 'print', type: 'action'},
{name: _('See revision history'), id: 'rev-history', type: 'action'},
{name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', type: 'action'},
@@ -646,10 +649,10 @@ class Menubar extends window.L.Control {
menu: (window.mode.isTablet() ? [
{name: _('Reset zoom'), id: 'zoomreset', type: 'action'},
] as MenuItem[] : [
- {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action'},
+ {name: _UNO('.uno:FullScreen', 'presentation'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:ZoomPlus', 'presentation'), id: 'zoomin', type: 'action'},
- {name: _UNO('.uno:ZoomMinus', 'presentation'), id: 'zoomout', type: 'action'},
+ {name: _UNO('.uno:ZoomPlus', 'presentation'), unoid: '.uno:ZoomPlus', id: 'zoomin', type: 'action'},
+ {name: _UNO('.uno:ZoomMinus', 'presentation'), unoid: '.uno:ZoomMinus', id: 'zoomout', type: 'action'},
{name: _('Reset zoom'), id: 'zoomreset', type: 'action'},
] as MenuItem[]).concat([
{type: 'separator'},
@@ -666,12 +669,12 @@ class Menubar extends window.L.Control {
])},
{name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'presentation'), id: 'insertgraphicremote', type: 'action'},
- {name: _UNO('.uno:SelectBackground', 'presentation'), id: 'selectbackground', type: 'action'},
- {name: _UNO('.uno:InsertAnnotation', 'presentation'), id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'presentation'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:SelectBackground', 'presentation'), unoid: '.uno:SelectBackground', id: 'selectbackground', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'presentation'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
{type: 'separator'},
- {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
+ {name: _UNO('.uno:HyperlinkDialog'), unoid: '.uno:HyperlinkDialog', id: 'inserthyperlink', type: 'action'},
{name: _('Smart Picker'), id: 'remotelink', type: 'action'},
{name: _('AI Assistant'), id: 'remoteaicontent', type: 'action'},
{type: 'separator'},
@@ -687,7 +690,7 @@ class Menubar extends window.L.Control {
{name: _UNO('.uno:InsertPageTitleField', 'presentation'), uno: '.uno:InsertPageTitleField'},
{name: _UNO('.uno:InsertPagesField', 'presentation'), uno: '.uno:InsertPagesField'},
]},
- {name: _UNO('.uno:InsertSignatureLine'), id: 'insert-signatureline', type: 'action'},
+ {name: _UNO('.uno:InsertSignatureLine'), unoid: '.uno:InsertSignatureLine', id: 'insert-signatureline', type: 'action'},
]},
{name: _UNO('.uno:FormatMenu', 'presentation'), id: 'format', type: 'menu', menu: [
{uno: '.uno:FontDialog'},
@@ -723,9 +726,9 @@ class Menubar extends window.L.Control {
{name: _UNO('.uno:TableDialog', 'presentation'), uno: '.uno:TableDialog'}]
},
{name: _UNO('.uno:PageMenu', 'presentation'), type: 'menu', menu: [
- {name: _UNO('.uno:InsertPage', 'presentation'), id: 'insertpage', type: 'action'},
- {name: _UNO('.uno:DuplicatePage', 'presentation'), id: 'duplicatepage', type: 'action'},
- {name: _UNO('.uno:DeletePage', 'presentation'), id: 'deletepage', type: 'action'},
+ {name: _UNO('.uno:InsertPage', 'presentation'), unoid: '.uno:InsertPage', id: 'insertpage', type: 'action'},
+ {name: _UNO('.uno:DuplicatePage', 'presentation'), unoid: '.uno:DuplicatePage', id: 'duplicatepage', type: 'action'},
+ {name: _UNO('.uno:DeletePage', 'presentation'), unoid: '.uno:DeletePage', id: 'deletepage', type: 'action'},
{name: _UNO('.uno:GotoPage', 'presentation'), uno: '.uno:GotoPage'}]
},
{name: _UNO('.uno:ToolsMenu', 'presentation'), id: 'tools', type: 'menu', menu: [
@@ -748,7 +751,7 @@ class Menubar extends window.L.Control {
spreadsheet: [
{name: _UNO('.uno:PickList', 'spreadsheet'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'spreadsheet'), id: 'save', type: 'action'},
+ {name: _UNO('.uno:Save', 'spreadsheet'), unoid: '.uno:Save', id: 'save', type: 'action'},
{name: _UNO('.uno:SaveAs', 'spreadsheet'), id: 'saveas', type: window.prefs.get('saveAsMode') === 'group' ? 'menu' : 'action', menu: [
{name: _('ODF spreadsheet (.ods)'), id: 'saveas-ods', type: 'action'},
{name: _('Excel 2003 Spreadsheet (.xls)'), id: 'saveas-xls', type: 'action'},
@@ -794,10 +797,10 @@ class Menubar extends window.L.Control {
menu: (window.mode.isTablet() ? [
{name: _('Reset zoom'), id: 'zoomreset', type: 'action'},
] as MenuItem[] : [
- {name: _UNO('.uno:FullScreen', 'spreadsheet'), id: 'fullscreen', type: 'action'},
+ {name: _UNO('.uno:FullScreen', 'spreadsheet'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:ZoomPlus', 'text'), id: 'zoomin', type: 'action'},
- {name: _UNO('.uno:ZoomMinus', 'text'), id: 'zoomout', type: 'action',},
+ {name: _UNO('.uno:ZoomPlus', 'text'), unoid: '.uno:ZoomPlus', id: 'zoomin', type: 'action'},
+ {name: _UNO('.uno:ZoomMinus', 'text'), unoid: '.uno:ZoomMinus', id: 'zoomout', type: 'action',},
{name: _('Reset zoom'), id: 'zoomreset', type: 'action'},
] as MenuItem[]).concat([
{type: 'separator'},
@@ -820,11 +823,11 @@ class Menubar extends window.L.Control {
])},
{name: _UNO('.uno:InsertMenu', 'spreadsheet'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'spreadsheet'), id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'spreadsheet'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
{name: _UNO('.uno:DataDataPilotRun', 'spreadsheet'), uno: '.uno:DataDataPilotRun'},
{name: _UNO('.uno:InsertCalcTable', 'spreadsheet'), uno: '.uno:InsertCalcTable'},
{name: _UNO('.uno:InsertSparkline', 'spreadsheet'), uno: '.uno:InsertSparkline'},
- {name: _UNO('.uno:InsertAnnotation', 'spreadsheet'), id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'spreadsheet'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
{uno: '.uno:InsertObjectChart'},
{name: _UNO('.uno:FontworkGalleryFloater'), uno: '.uno:FontworkGalleryFloater', id: 'fontworkgalleryfloater'},
{name: _UNO('.uno:DrawText'), uno: '.uno:DrawText'},
@@ -1047,8 +1050,8 @@ class Menubar extends window.L.Control {
mobiletext: [
{name: _('Search'), id: 'recsearch', type: 'action'},
{name: _UNO('.uno:PickList', 'text'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'text'), id: 'save', type: 'action'},
- {name: _UNO('.uno:SaveAs', 'text'), id: 'saveas', type: 'action'},
+ {name: _UNO('.uno:Save', 'text'), unoid: '.uno:Save', id: 'save', type: 'action'},
+ {name: _UNO('.uno:SaveAs', 'text'), unoid: '.uno:SaveAs', id: 'saveas', type: 'action'},
{name: _('Export as'), id: 'exportas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 'exportas-pdf', type: 'action'},
{name: _('EPUB (.epub)'), id: 'exportas-epub', type: 'action'}
@@ -1056,7 +1059,7 @@ class Menubar extends window.L.Control {
{name: _('Share...'), id:'shareas', type: 'action'},
{name: _('See revision history'), id: 'rev-history', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:Print', 'text'), id: 'print', type: 'action'},
+ {name: _UNO('.uno:Print', 'text'), unoid: '.uno:Print', id: 'print', type: 'action'},
]},
{name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', type: 'action'},
@@ -1087,7 +1090,7 @@ class Menubar extends window.L.Control {
{uno: '.uno:NextTrackedChange'}
]},
{name: _UNO('.uno:ViewMenu', 'text'), id: 'view', type: 'menu', menu: [
- {name: _UNO('.uno:FullScreen', 'text'), id: 'fullscreen', type: 'action', mobileapp: false},
+ {name: _UNO('.uno:FullScreen', 'text'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action', mobileapp: false},
{uno: '.uno:ControlCodes', id: 'formattingmarks'},
{uno: '.uno:SpellOnline'},
{name: _UNO('.uno:ShowResolvedAnnotations', 'text'), id: 'showresolved', uno: '.uno:ShowResolvedAnnotations'},
@@ -1113,15 +1116,15 @@ class Menubar extends window.L.Control {
mobilepresentation: [
{name: _('Search'), id: 'recsearch', type: 'action'},
{name: _UNO('.uno:PickList', 'presentation'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'presentation'), id: 'save', type: 'action'},
- {name: _UNO('.uno:SaveAs', 'presentation'), id: 'saveas', type: 'action'},
+ {name: _UNO('.uno:Save', 'presentation'), unoid: '.uno:Save', id: 'save', type: 'action'},
+ {name: _UNO('.uno:SaveAs', 'presentation'), unoid: '.uno:SaveAs', id: 'saveas', type: 'action'},
{name: _('Export as'), id: 'exportas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 'exportas-pdf', type: 'action'}
]},
{name: _('Share...'), id:'shareas', type: 'action'},
{name: _('See revision history'), id: 'rev-history', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:Print', 'presentation'), id: 'print', type: 'action'},
+ {name: _UNO('.uno:Print', 'presentation'), uno: '.uno:Print', id: 'print', type: 'action'},
]},
{name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id:'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: !window.ThisIsAMobileApp ? 'exportdirectpdf' : 'downloadas-pdf', type: 'action'},
@@ -1143,7 +1146,7 @@ class Menubar extends window.L.Control {
]},
{name: _UNO('.uno:ViewMenu', 'presentation'), id: 'view', type: 'menu', menu: [
{uno: '.uno:SpellOnline'},
- {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action', mobileapp: false},
+ {name: _UNO('.uno:FullScreen', 'presentation'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action', mobileapp: false},
{name: _('Dark Mode'), id: 'toggledarktheme', type: 'action'},
{name: _('Invert Background'), id: 'invertbackground', type: 'action'},
]
@@ -1164,9 +1167,9 @@ class Menubar extends window.L.Control {
]
},
{name: _UNO('.uno:SlideMenu', 'presentation'), id: 'slidemenu', type: 'menu', menu: [
- {name: _UNO('.uno:InsertSlide', 'presentation'), id: 'insertpage', type: 'action'},
- {name: _UNO('.uno:DuplicateSlide', 'presentation'), id: 'duplicatepage', type: 'action'},
- {name: _UNO('.uno:DeleteSlide', 'presentation'), id: 'deletepage', type: 'action'}]
+ {name: _UNO('.uno:InsertSlide', 'presentation'), unoid: '.uno:InsertSlide', id: 'insertpage', type: 'action'},
+ {name: _UNO('.uno:DuplicateSlide', 'presentation'), unoid: '.uno:DuplicateSlide', id: 'duplicatepage', type: 'action'},
+ {name: _UNO('.uno:DeleteSlide', 'presentation'), unoid: '.uno:DeleteSlide', id: 'deletepage', type: 'action'}]
},
{name: _UNO('.uno:RunMacro'), id: 'runmacro', uno: '.uno:RunMacro'},
{name: _('Fullscreen presentation'), id: 'fullscreen-presentation', type: 'action'},
@@ -1178,13 +1181,13 @@ class Menubar extends window.L.Control {
mobiledrawing: [
{name: _('Search'), id: 'recsearch', type: 'action'},
{name: _UNO('.uno:PickList', 'presentation'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'presentation'), id: 'save', type: 'action'},
- {name: _UNO('.uno:SaveAs', 'presentation'), id: 'saveas', type: 'action'},
+ {name: _UNO('.uno:Save', 'presentation'), unoid: '.uno:Save', id: 'save', type: 'action'},
+ {name: _UNO('.uno:SaveAs', 'presentation'), unoid: '.uno:SaveAs', id: 'saveas', type: 'action'},
{name: _('Export as'), id: 'exportas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 'exportas-pdf', type: 'action'}
]},
{name: _('Share...'), id:'shareas', type: 'action'},
- {name: _UNO('.uno:Print', 'presentation'), id: 'print', type: 'action'},
+ {name: _UNO('.uno:Print', 'presentation'), unoid: '.uno:Print', id: 'print', type: 'action'},
{name: _('See revision history'), id: 'rev-history', type: 'action'},
]},
{name: !window.ThisIsAMobileApp ? _('Download as') : _('Export as'), id:'downloadas', type: 'menu', menu: [
@@ -1204,7 +1207,7 @@ class Menubar extends window.L.Control {
]},
{name: _UNO('.uno:ViewMenu', 'presentation'), id: 'view', type: 'menu', menu: [
{uno: '.uno:SpellOnline'},
- {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action', mobileapp: false},
+ {name: _UNO('.uno:FullScreen', 'presentation'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action', mobileapp: false},
{name: _('Dark Mode'), id: 'toggledarktheme', type: 'action'},
{name: _('Invert Background'), id: 'invertbackground', type: 'action'},
]
@@ -1220,9 +1223,9 @@ class Menubar extends window.L.Control {
{name: _UNO('.uno:MergeCells', 'presentation'), uno: '.uno:MergeCells'}]
},
{name: _UNO('.uno:PageMenu', 'presentation'), id: 'pagemenu', type: 'menu', menu: [
- {name: _UNO('.uno:InsertPage', 'presentation'), id: 'insertpage', type: 'action'},
- {name: _UNO('.uno:DuplicatePage', 'presentation'), id: 'duplicatepage', type: 'action'},
- {name: _UNO('.uno:DeletePage', 'presentation'), id: 'deletepage', type: 'action'}]
+ {name: _UNO('.uno:InsertPage', 'presentation'), unoid: '.uno:InsertPage', id: 'insertpage', type: 'action'},
+ {name: _UNO('.uno:DuplicatePage', 'presentation'), unoid: '.uno:DuplicatePage', id: 'duplicatepage', type: 'action'},
+ {name: _UNO('.uno:DeletePage', 'presentation'), unoid: '.uno:DeletePage', id: 'deletepage', type: 'action'}]
},
{name: _UNO('.uno:RunMacro'), id: 'runmacro', uno: '.uno:RunMacro'},
{name: _('Latest Updates'), id: 'latestupdates', type: 'action', iosapp: false},
@@ -1233,15 +1236,15 @@ class Menubar extends window.L.Control {
mobilespreadsheet: [
{name: _('Search'), id: 'recsearch', type: 'action'},
{name: _UNO('.uno:PickList', 'spreadsheet'), id: 'file', type: 'menu', menu: [
- {name: _UNO('.uno:Save', 'spreadsheet'), id: 'save', type: 'action'},
- {name: _UNO('.uno:SaveAs', 'spreadsheet'), id: 'saveas', type: 'action'},
+ {name: _UNO('.uno:Save', 'spreadsheet'), unoid: '.uno:Save', id: 'save', type: 'action'},
+ {name: _UNO('.uno:SaveAs', 'spreadsheet'), unoid: '.uno:SaveAs', id: 'saveas', type: 'action'},
{name: _('Export as'), id: 'exportas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 'exportas-pdf', type: 'action'}
]},
{name: _('Share...'), id:'shareas', type: 'action'},
{name: _('See revision history'), id: 'rev-history', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:Print', 'spreadsheet'), id: 'print', type: 'action'},
+ {name: _UNO('.uno:Print', 'spreadsheet'), unoid: '.uno:Print', id: 'print', type: 'action'},
{name: _('Define print area'), uno: '.uno:DefinePrintArea' },
{name: _('Remove print area'), uno: '.uno:DeletePrintArea' },
]},
@@ -1264,7 +1267,7 @@ class Menubar extends window.L.Control {
]},
{name: _UNO('.uno:ViewMenu', 'spreadsheet'), id: 'view', type: 'menu', menu: [
{uno: '.uno:SpellOnline'},
- {name: _UNO('.uno:FullScreen', 'presentation'), id: 'fullscreen', type: 'action', mobileapp: false},
+ {name: _UNO('.uno:FullScreen', 'presentation'), unoid: '.uno:FullScreen', id: 'fullscreen', type: 'action', mobileapp: false},
{name: _('Dark Mode'), id: 'toggledarktheme', type: 'action'},
{name: _('Invert Background'), id: 'invertbackground', type: 'action'},
]
@@ -1309,10 +1312,10 @@ class Menubar extends window.L.Control {
'text' : {
name: _UNO('.uno:InsertMenu', 'text'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'text'), id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'text'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
{uno: '.uno:InsertObjectChart'},
- {name: _UNO('.uno:InsertAnnotation', 'text'), id: 'insertcomment', type: 'action'},
- {name: _UNO('.uno:TableMenu'), id: 'inserttable', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'text'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:TableMenu'), unoid: '.uno:TableMenu', id: 'inserttable', type: 'action'},
{type: 'separator'},
{name: _UNO('.uno:InsertField', 'text'), id: 'insertfield', type: 'menu', menu: [
{uno: '.uno:InsertPageNumberField'},
@@ -1335,8 +1338,8 @@ class Menubar extends window.L.Control {
{uno: '.uno:InsertPagebreak'},
{name: _UNO('.uno:InsertColumnBreak', 'spreadsheet'), uno: '.uno:InsertColumnBreak'},
{type: 'separator'},
- {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
- {name: _UNO('.uno:ShapesMenu'), id: 'insertshape', type: 'action'},
+ {name: _UNO('.uno:HyperlinkDialog'), unoid: '.uno:HyperlinkDialog', id: 'inserthyperlink', type: 'action'},
+ {name: _UNO('.uno:ShapesMenu'), unoid: '.uno:ShapesMenu', id: 'insertshape', type: 'action'},
{name: _UNO('.uno:FontworkGalleryFloater'), uno: '.uno:FontworkGalleryFloater', id: 'fontworkgalleryfloater'},
{name: _UNO('.uno:FormattingMarkMenu', 'text'), id: 'formattingmark', type: 'menu', menu: [
{uno: '.uno:InsertNonBreakingSpace'},
@@ -1359,12 +1362,12 @@ class Menubar extends window.L.Control {
'spreadsheet' : {
name: _UNO('.uno:InsertMenu', 'spreadsheet'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'spreadsheet'), id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'spreadsheet'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
{uno: '.uno:InsertObjectChart'},
- {name: _UNO('.uno:InsertAnnotation', 'spreadsheet'), id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'spreadsheet'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
{type: 'separator'},
- {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
- {name: _UNO('.uno:ShapesMenu'), id: 'insertshape', type: 'action'},
+ {name: _UNO('.uno:HyperlinkDialog'), unoid: '.uno:HyperlinkDialog', id: 'inserthyperlink', type: 'action'},
+ {name: _UNO('.uno:ShapesMenu'), unoid: '.uno:ShapesMenu', id: 'insertshape', type: 'action'},
{uno: '.uno:InsertCurrentDate'},
{uno: '.uno:InsertCurrentTime'},
// other fields need EditEngine context & can't be disabled in the menu.
@@ -1373,14 +1376,14 @@ class Menubar extends window.L.Control {
'presentation' : {
name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'presentation'), id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'presentation'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
{uno: '.uno:InsertObjectChart'},
- {name: _UNO('.uno:InsertAnnotation', 'presentation'), id: 'insertcomment', type: 'action'},
- {name: _UNO('.uno:TableMenu'), id: 'inserttable', type: 'action'},
- {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
- {name: _UNO('.uno:ShapesMenu'), id: 'insertshape', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'presentation'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:TableMenu'), unoid: '.uno:TableMenu', id: 'inserttable', type: 'action'},
+ {name: _UNO('.uno:HyperlinkDialog'), unoid: '.uno:HyperlinkDialog', id: 'inserthyperlink', type: 'action'},
+ {name: _UNO('.uno:ShapesMenu'), unoid: '.uno:ShapesMenu', id: 'insertshape', type: 'action'},
{name: _UNO('.uno:FontworkGalleryFloater'), uno: '.uno:FontworkGalleryFloater', id: 'fontworkgalleryfloater'},
- {name: _UNO('.uno:Text', 'presentation'), id: 'inserttextbox', type: 'action'},
+ {name: _UNO('.uno:Text', 'presentation'), unoid: '.uno:Text', id: 'inserttextbox', type: 'action'},
{name: _UNO('.uno:InsertField', 'text'), id: 'insertfield', type: 'menu', menu: [
{uno: '.uno:InsertDateFieldFix'},
{uno: '.uno:InsertDateFieldVar'},
@@ -1396,14 +1399,14 @@ class Menubar extends window.L.Control {
drawing : {
name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', type: 'menu', menu: [
{name: _('Local Image...'), id: 'insertgraphic', type: 'action'},
- {name: _UNO('.uno:InsertGraphic', 'presentation'), id: 'insertgraphicremote', type: 'action'},
+ {name: _UNO('.uno:InsertGraphic', 'presentation'), unoid: '.uno:InsertGraphic', id: 'insertgraphicremote', type: 'action'},
{uno: '.uno:InsertObjectChart'},
- {name: _UNO('.uno:InsertAnnotation', 'presentation'), id: 'insertcomment', type: 'action'},
- {name: _UNO('.uno:TableMenu'), id: 'inserttable', type: 'action'},
- {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
- {name: _UNO('.uno:ShapesMenu'), id: 'insertshape', type: 'action'},
+ {name: _UNO('.uno:InsertAnnotation', 'presentation'), unoid: '.uno:InsertAnnotation', id: 'insertcomment', type: 'action'},
+ {name: _UNO('.uno:TableMenu'), unoid: '.uno:TableMenu', id: 'inserttable', type: 'action'},
+ {name: _UNO('.uno:HyperlinkDialog'), unoid: '.uno:HyperlinkDialog', id: 'inserthyperlink', type: 'action'},
+ {name: _UNO('.uno:ShapesMenu'), unoid: '.uno:ShapesMenu', id: 'insertshape', type: 'action'},
{name: _UNO('.uno:FontworkGalleryFloater'), uno: '.uno:FontworkGalleryFloater', id: 'fontworkgalleryfloater'},
- {name: _UNO('.uno:Text', 'presentation'), id: 'inserttextbox', type: 'action'},
+ {name: _UNO('.uno:Text', 'presentation'), unoid: '.uno:Text', id: 'inserttextbox', type: 'action'},
{name: _UNO('.uno:InsertField', 'text'), id: 'insertfield', type: 'menu', menu: [
{name: _UNO('.uno:InsertDateFieldFix', 'presentation'), uno: '.uno:InsertDateFieldFix'},
{name: _UNO('.uno:InsertDateFieldVar', 'presentation'), uno: '.uno:InsertDateFieldVar'},
@@ -2675,6 +2678,8 @@ class Menubar extends window.L.Control {
$(aItem).data('id', menu[i].id);
if (menu[i].uno !== undefined)
$(aItem).data('uno', menu[i].uno);
+ if (menu[i].unoid !== undefined)
+ $(aItem).data('unoid', menu[i].unoid);
aItem.tabIndex = 0;
}
@@ -2777,6 +2782,7 @@ class Menubar extends window.L.Control {
var items = this._getItems();
if (items == null)
return null;
+ const isUno = commandId.startsWith('.uno:');
var found = $(items).filter(function() {
var item = $(this.children[0]);
var type = item.data('type');
@@ -2784,7 +2790,15 @@ class Menubar extends window.L.Control {
if (type == 'unocommand') {
id = $(item).data('uno');
} else if (type == 'action') {
- id = $(item).data('id');
+ if (isUno) {
+ id = $(item).data('unoid');
+ if (!id) {
+ id = $(item).data('uno');
+ }
+ }
+ if (!id) {
+ id = $(item).data('id');
+ }
}
if (id && id == commandId) {
return true;