[Libreoffice-commits] online.git: loleaflet/src loleaflet/unocommands.js

Andras Timar andras.timar at collabora.com
Tue Jan 9 09:21:59 UTC 2018


 loleaflet/src/control/Control.Menubar.js |   42 ++-----------------------------
 loleaflet/unocommands.js                 |    1 
 2 files changed, 5 insertions(+), 38 deletions(-)

New commits:
commit f9bf3f61ea74656aa4d9647bc976ce5cfd07199c
Author: Andras Timar <andras.timar at collabora.com>
Date:   Tue Jan 9 10:17:02 2018 +0100

    Format - Page... dialog instead of custom Page menus
    
    Change-Id: I7b91505a7f875fa67d4e5214bd697451c4b3c5e2
    Reviewed-on: https://gerrit.libreoffice.org/47633
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 741f7341..8c13ba45 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -157,18 +157,10 @@ L.Control.Menubar = L.Control.extend({
 				{uno: '.uno:FontDialog'},
 				{uno: '.uno:ParagraphDialog'},
 				{uno: '.uno:OutlineBullet'},
+				{uno: '.uno:PageDialog'},
 				{type: 'separator'},
-				{uno: '.uno:ResetAttributes'},
-				{name: _('Page'), type: 'menu', menu: [
-					{name: 'A4, ' + _('Portrait'), type: 'action', id: 'a4portrait'},
-					{name: 'A4, ' + _('Landscape'), type: 'action', id: 'a4landscape'},
-					{name: 'A5, ' + _('Portrait'), type: 'action', id: 'a5portrait'},
-					{name: 'A5, ' + _('Landscape'), type: 'action', id: 'a5landscape'},
-					{name: 'Letter, ' + _('Portrait'), type: 'action', id: 'letterportrait'},
-					{name: 'Letter, ' + _('Landscape'), type: 'action', id: 'letterlandscape'},
-					{name: 'Legal, ' + _('Portrait'), type: 'action', id: 'legalportrait'},
-					{name: 'Legal, ' + _('Landscape'), type: 'action', id: 'legallandscape'}]}]
-			},
+				{uno: '.uno:ResetAttributes'}
+			]},
 			{name: _UNO('.uno:TableMenu', 'text'), type: 'menu', menu: [
 				{name: _UNO('.uno:TableInsertMenu', 'text'), type: 'menu', menu: [
 					{uno: '.uno:InsertRowsBefore'},
@@ -658,35 +650,9 @@ L.Control.Menubar = L.Control.extend({
 			map.fire('postMessage', {msgId: 'close', args: {EverModified: map._everModified, Deprecated: true}});
 			map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: map._everModified}});
 			map.remove();
-		}
-		else if (id === 'repair') {
+		} else if (id === 'repair') {
 			map._socket.sendMessage('commandvalues command=.uno:DocumentRepair');
-		} else if (id === 'a4portrait') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Width":{"type":"long", "value": "21000"},"AttributePageSize.Height":{"type":"long", "value": "29700"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-		} else if (id === 'a4landscape') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Height":{"type":"long", "value": "21000"},"AttributePageSize.Width":{"type":"long", "value": "29700"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
-		} else if (id === 'a5portrait') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Width":{"type":"long", "value": "14800"},"AttributePageSize.Height":{"type":"long", "value": "21000"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-		} else if (id === 'a5landscape') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Height":{"type":"long", "value": "14800"},"AttributePageSize.Width":{"type":"long", "value": "21000"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
-		} else if (id === 'letterportrait') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Width":{"type":"long", "value": "21950"},"AttributePageSize.Height":{"type":"long", "value": "27940"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-		} else if (id === 'letterlandscape') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Height":{"type":"long", "value": "21950"},"AttributePageSize.Width":{"type":"long", "value": "27940"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
-		} else if (id === 'legalportrait') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Width":{"type":"long", "value": "21590"},"AttributePageSize.Height":{"type":"long", "value": "35560"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "false"}}');
-		} else if (id === 'legallandscape') {
-			map.sendUnoCommand('.uno:AttributePageSize {"AttributePageSize.Height":{"type":"long", "value": "21590"},"AttributePageSize.Width":{"type":"long", "value": "35560"}}');
-			map.sendUnoCommand('.uno:AttributePage {"AttributePage.Landscape":{"type":"boolean", "value": "true"}}');
 		}
-
 		// Inform the host if asked
 		if ($(item).data('postmessage') === 'true') {
 			map.fire('postMessage', {msgId: 'Clicked_Button', args: {Id: id} });
diff --git a/loleaflet/unocommands.js b/loleaflet/unocommands.js
index 9d8175cb..62d300ff 100644
--- a/loleaflet/unocommands.js
+++ b/loleaflet/unocommands.js
@@ -139,6 +139,7 @@ var unoCommandsArray = {
 	OutlineBullet:{global:{menu:_('~Bullets and Numbering...'),},},
 	OutlineFont:{global:{menu:_('Outline'),},},
 	Overline:{global:{menu:_('Overline'),},},
+	PageDialog:{global:{menu:_('~Page...'),},text:{menu:_('~Page...'),},},
 	PageDown:{text:{menu:_('Next Page'),},},
 	PageUp:{text:{menu:_('Previous Page'),},},
 	ParaLeftToRight:{global:{menu:_('Left-To-Right'),},},


More information about the Libreoffice-commits mailing list