Bug 88918 - Edit→Hyperlink… is greyed out when an object with a hyperlink is selected in Draw
Summary: Edit→Hyperlink… is greyed out when an object with a hyperlink is selected in ...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Omkar Nikam
URL:
Whiteboard:
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks: Hyperlink
  Show dependency treegraph
 
Reported: 2015-01-30 00:23 UTC by Reuben Thomas
Modified: 2024-04-22 10:39 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reuben Thomas 2015-01-30 00:23:50 UTC
To reproduce:

1. Open a new Draw document.
2. Draw a filled rectangle using the rectangle tool.
3. Select the rectangle.
4. Insert→Hyperlink and add a link (I used a web link)
5. Select the rectangle.
6. Open the Edit menu, observe that "Hyperlink…" is greyed out.
7. Click the top toolbar's Hyperlink tool, observe that it lets you edit the hyperlink.
Comment 1 A (Andy) 2015-01-31 10:20:51 UTC
Reproducible with LO 4.4.0.3, Win 8.1.
Comment 2 QA Administrators 2016-02-21 08:35:09 UTC Comment hidden (obsolete)
Comment 3 Reuben Thomas 2016-02-21 21:34:49 UTC
I can reproduce in 5.0.5 on Ubuntu 14.04.

The "Hyperlink" toolbar button does not appear in the toolbar (any more?) so I right-clicked on the toolbar to get it.
Comment 4 QA Administrators 2017-03-06 15:09:18 UTC Comment hidden (obsolete)
Comment 5 Reuben Thomas 2017-03-06 19:30:26 UTC
I was able to reproduce this bug in LibreOffice 5.3.0.3 on GNU/Linux.

Some details appear to have changed, so I note the revised procedure to reproduce below:

1. Open a new Draw document.
2. Draw a filled rectangle using the rectangle tool.
3. Select the rectangle.
4. Insert→Link and add a link (I used a web link)
5. Select the rectangle.
6. Open the Edit menu, observe that "Link…" is greyed out.
7. Right click the toolbar's handle, Link, observe that it lets you edit the hyperlink. (You can also edit the link with Insert→Link, which is rather unintuitive.)

As last year, there is no "Link" or "Hyperlink" button on the toolbar any more, but I can find one by right-clicking on the toolbar handle.

The online documentation appears to be out of date: https://help.libreoffice.org/5.3/Draw/Insert still mentions "Insert→Hyperlink", while the actual Insert menu item is "Link".
Comment 6 QA Administrators 2018-08-22 02:36:22 UTC Comment hidden (obsolete)
Comment 7 Reuben Thomas 2018-08-22 09:51:16 UTC
I was able to reproduce in 6.0.6 on Ubuntu 18.04. I followed the instructions in Comment 5, except that "Link" is now once again called "Hyperlink".
Comment 8 QA Administrators 2019-09-02 09:25:08 UTC Comment hidden (obsolete)
Comment 9 Reuben Thomas 2019-09-02 22:33:14 UTC
Confirmed in 6.3.0.4 running in Ubuntu 18.04 (installed from snap), following the instructions as in Comment 7.
Comment 10 QA Administrators 2021-09-02 03:53:12 UTC Comment hidden (obsolete)
Comment 11 Reuben Thomas 2021-09-02 10:41:03 UTC
Reproduced in 6.4.7.2 in Ubuntu 20.04, with following updated procedure (same as for 6.3):

1. Open a new Draw document.
2. Draw a filled rectangle using the rectangle tool.
3. Select the rectangle.
4. Insert→Hyperlink and add a link (I used a web link)
5. Select the rectangle.
6. Open the Edit menu, observe that "Hyperlink" is greyed out.
7. Right click the toolbar's handle, Hyperlink, observe that it lets you edit the hyperlink. (You can also edit the link with Insert→Hyperlink, which is rather unintuitive.)
Comment 12 Stéphane Guillou (stragu) 2023-07-04 20:57:50 UTC
Same in OOo 3.3, so inherited.

Still present in a recent 24.2 master build.

Hossein, maybe an easyHack ?
Comment 13 Hossein 2023-07-31 14:33:24 UTC
(In reply to Stéphane Guillou (stragu) from comment #12)
> Hossein, maybe an easyHack ?
Yes.
The code pointers for this EasyHack is as follows:

Start from the menu, which is "Edit > Hyperlink". In fact, it is "~Hyperlink", as it has underline below H:

$ git grep -w ~Hyperlink

The search leads to this file:
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu

Opening this xml file, one may find the command uno:EditHyperlink which is invoked by selection that menu option. Then, you can search for this command inside the code.

The opened dialog for editing the hyperlink as the text "Hyperlink Type" inside it. Searching for this text leads to the exact ui:

$ git grep "Hyperlink Type"
cui/uiconfig/ui/hyperlinkinternetpage.ui

Searching for EditHyperlink (instead of uno:EditHyperlink) in C++ files, leads to a few files:

$ git grep -l EditHyperlink *.cxx
sc/source/ui/view/editsh.cxx
sc/source/ui/view/gridwin.cxx
sc/source/ui/view/tabvwshe.cxx
sd/source/ui/view/drviews4.cxx
sd/source/ui/view/drviews7.cxx

Only the last 2 are related to Draw (sd). In the last file, the below method determines when the EditHyperlink menu item should be disabled:

sd/source/ui/view/drviews7.cxx:284
bool DrawViewShell::ShouldDisableEditHyperlink() const
{
...
}

The EasyHacker should change this method, so that it can also handle a shape with a hyperlink attached to it. The patch should modify the only "else" block and handle such a situation.
Comment 14 Stéphane Guillou (stragu) 2024-03-15 03:37:01 UTC
nicholaskhoi2, are you still hoping to work on this? If not, please un-assign yourself.