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:
Szymon Kłos 2023-09-07 16:41:19 +02:00 committed by Szymon Kłos
parent 9cb37bc439
commit da174cbb97
4 changed files with 14 additions and 4 deletions

View file

@ -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'},

View file

@ -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) ? {

View file

@ -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();
}
}

View file

@ -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)