Use dialog from core in Calc Insert Hyperlink
introduce it in Calc only as it has better knowledge about cell content and what should be edited Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: Idc66e3380e83975b44ca88d47586de3bd0e7dee9
This commit is contained in:
parent
9cb37bc439
commit
da174cbb97
4 changed files with 14 additions and 4 deletions
|
@ -722,7 +722,7 @@ L.Control.Menubar = L.Control.extend({
|
|||
{name: _UNO('.uno:VerticalText'), uno: '.uno:VerticalText'},
|
||||
{uno: '.uno:FunctionDialog'},
|
||||
{type: 'separator'},
|
||||
{name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'},
|
||||
{name: _UNO('.uno:HyperlinkDialog'), uno: '.uno:HyperlinkDialog'},
|
||||
{name: _('Smart Picker'), id: 'remotelink', type: 'action'},
|
||||
{uno: '.uno:InsertSymbol'},
|
||||
{type: 'separator'},
|
||||
|
|
|
@ -1373,9 +1373,9 @@ L.Control.NotebookbarCalc = L.Control.NotebookbarWriter.extend({
|
|||
{
|
||||
'id': 'HyperlinkDialog',
|
||||
'class': 'unoHyperlinkDialog',
|
||||
'type': 'bigcustomtoolitem',
|
||||
'type': 'bigtoolitem',
|
||||
'text': _UNO('.uno:HyperlinkDialog'),
|
||||
'command': 'hyperlinkdialog',
|
||||
'command': '.uno:HyperlinkDialog',
|
||||
'accessibility': { focusBack: true, combination: 'I2', de: null }
|
||||
},
|
||||
(this._map['wopi'].EnableRemoteLinkPicker) ? {
|
||||
|
|
|
@ -155,7 +155,10 @@ function onClick(e, id, item) {
|
|||
map.uiManager.enterReadonlyOrClose();
|
||||
}
|
||||
else if (id === 'link') {
|
||||
map.showHyperlinkDialog();
|
||||
if (map.getDocType() == 'spreadsheet')
|
||||
map.sendUnoCommand('.uno:HyperlinkDialog');
|
||||
else
|
||||
map.showHyperlinkDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -839,6 +839,13 @@ L.Map.include({
|
|||
},
|
||||
|
||||
showHyperlinkDialog: function() {
|
||||
if (this.getDocType() === 'spreadsheet') {
|
||||
// show native core dialog
|
||||
// in case we try to edit email EditHyperlink doesn't work
|
||||
this.sendUnoCommand('.uno:HyperlinkDialog');
|
||||
return;
|
||||
}
|
||||
|
||||
var text = this.getTextForLink();
|
||||
var link = '';
|
||||
if (this.hyperlinkUnderCursor && this.hyperlinkUnderCursor.link)
|
||||
|
|
Loading…
Reference in a new issue