Bug 159722 - HYPERLINK DIALOG: Internet hyperlink in path field instead of blank entry
Summary: HYPERLINK DIALOG: Internet hyperlink in path field instead of blank entry
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.2.0.0 beta1+
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Hyperlink-Dialog
  Show dependency treegraph
 
Reported: 2024-02-14 21:04 UTC by Adalbert Hanßen
Modified: 2024-09-05 16:55 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Bug report with screenshots (313.01 KB, application/vnd.oasis.opendocument.text)
2024-02-14 21:04 UTC, Adalbert Hanßen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adalbert Hanßen 2024-02-14 21:04:26 UTC
Created attachment 192568 [details]
Bug report with screenshots

This problem arises in 

Version: 24.2.2.0.0+ (X86_64) / LibreOffice Community
Build ID: 46169670ef4031888e143823b263577296d7867f
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

In my notebook documents, I often use Hyperlinks to other similar topics, many times in the same document. They look example like this: here I also deal with topic 1, topic 2 and topic 3. They are all under this headline.
The keywords “topic x” are provided with bookmarks and I want to refer to them as well as to the headline.

1.) While I am doing so accidentally another hyperlink is on the clipboard and this one is first fed into the first entry “Pfad” of the dialog.

2.) Then have to remove the automatic target for the path from the dialog, e.g. by first selecting everything in this field and then deleting it.

3.) But when I click on Dokument in order to select the bookmark with its proper selection item, it sometimes happens, that the just deleted URL reappears. It looks like that this reproducibly happens, if on the last usage of associating hyperlinks, the last one was an Internet Link, i.e. if the left uppermost button Internet is highlighted by a blue bar. . But as soon, as I click on the button, I am back to where I started! 

By clicking on the button Document, the path in the field above re-appears, which just had been deleted!

4.) If you start over again from this point by first leaving the whole dialog and reopening it, the next time the blue bar is at Dokument and now one can select the hyperlink in the same document by clicking to the button with the mouse pointer in the screenshot in order to open the dialog Hyperelink. 

Further steps (three additional) to be taken until a hyperlink is successfully inserted see attached document with screenshots.

If I count right, 7 steps have to be taken to associate a hyperlink to some text tag. It might be done with fewer steps. But the endless loop (unless you leave the dialog) in step 3 is definitely a bug. It is merely a question of good UI design, if it could not be done with fewer steps and less nested dialog windows.
Comment 1 Dieter 2024-03-07 18:33:58 UTC
Adalbert, let's reduce it to the first problem. Please open new reports for further problems.

Steps:
1. Open a new document
2. Insert -> Hyperlink -> document

Actual result:
"Path" contains a link to a webpage

Expected result:
Should be empty.

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ab95ed2c4b1eddc2188bd455653a77140aa3816c
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded
Comment 2 Regina Henschel 2024-09-05 11:29:57 UTC
That is the intended behavior after solution of bug 146576. But a similar complain is in bug 162753.
Comment 3 Adalbert Hanßen 2024-09-05 16:55:37 UTC
(In reply to Regina Henschel from comment #2)
> That is the intended behavior after solution of bug 146576. But a similar
> complain is in bug 162753.


The current solution makes it considerably more difficult to set hyperlinks to locations in the same document. The current solution only has hyperlink targets to the internet in mind.

The idea https://bugs.documentfoundation.org/show_bug.cgi?id=146576#c3 is still not solved, so probably the other hyperlink destinations mentioned there are also impeded.

Nevertheless, it often happens that you want to set hyperlinks to a position in the same document without already having the link target in the clipboard. This is made unreasonably difficult by the current solution.

If you delete the link target in the dialog, LO Writer should not come up with the idea of inserting a link target from the clipboard again, which can lead you into an endless loop!

Endless loops cause endless frustration.

If LO Writer only pre-fill the link position from the clipboard when invoked from some marked text without an associated hyperlink, AND if this is a syntactically correct hyperlink target that would be fine IF IT DOES NOT insert the hyperlink a second time within the hyperlink dialog ESPECIALLY NOT after deleting a pre-populated hyperlink in the first field. This would make all users happy. Also the contributors of the extended discussion at # 162753. 

The point is: 

1. Use the clipboard content to preset a target only if it is syntactically a valid hyperlink target. Don't preset from the clipboard, if this is syntactically no hyperlink target.

2. Use it at most once after the current instance of the dialog is invoked.

3. Don't use it, if the dialog is invoked for an existing hyperlink: then come up as if this is what might be edited/altered by the user.