Bug 128555 - UI: "Remove hyperlink" is missing in context menu for selected text
Summary: UI: "Remove hyperlink" is missing in context menu for selected text
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, needsUXEval, regression
Depends on:
Blocks: Hyperlink
  Show dependency treegraph
 
Reported: 2019-11-02 17:26 UTC by Stanislav Horacek
Modified: 2019-11-08 09:13 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 Stanislav Horacek 2019-11-02 17:26:09 UTC
Since version 6.4, it is not possible to remove all hyperlinks in selected text by single command.

1. Open a Writer document containing text with more hyperlinks.
2. Select all in the document (Ctrl+A).
3. Invoke a context menu by right click - the menu does not contain "Remove hyperlink" command.

Expected: The "Remove hyperlink" command should be there.

I also tried to customize the context menu, but with no success.

Tested in: Verze: 6.4.0.0.alpha1+, build ID: 80109586e6cb6d3e2e0a53a9079c3125ec9b8368
Comment 1 sdc.blanco 2019-11-03 00:46:52 UTC
Can reproduce with:
Version: 6.4.0.0.alpha1 (x64)
Build ID: cc57df8f942f239d29cb575ea5a7cb01405db787
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: GL; VCL: win; 

No problem (i.e., "Remove Hyperlink" appears) with:
Version: 6.3.3.1 (x64)
Build ID: f41f4c7f9507aeca13cb9df51f34d80e8ba30a99
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win;
Comment 2 IM 2019-11-04 00:28:40 UTC
Thank you for reporting the bug. I can confirm that the bug is present in:

Version: 6.4.0.0.alpha1 (x64)
Build ID: cc57df8f942f239d29cb575ea5a7cb01405db787
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default; VCL: win; 
Locale: pl-PL (pl_PL); UI-Language: en-US
Calc: threaded
Comment 3 Xisco Faulí 2019-11-05 10:57:36 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=cae4b4951f061a67fab779493e6992d9097f4a4d

author	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2019-08-12 12:53:38 +0200
committer	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2019-08-12 16:02:08 +0200
commit cae4b4951f061a67fab779493e6992d9097f4a4d (patch)
tree 7dd65245047343ef64e6502a453b174526fef8e4
parent 137c7fb55462bf2b8792fc742f9f8343a23aac87 (diff)
tdf#120734 Only enable "Remove hyperlink" when hyperlink selected

Bisected with: bibisect-linux64-6.4

Adding Cc: to Samuel Mehrbrodt
Comment 4 Samuel Mehrbrodt (allotropia) 2019-11-06 12:25:43 UTC
Hm the remove hyperlink now does what it's supposed to do: It removes the hyperlink under the cursor.

Why should a user expect the "Remove hyperlink" function to work when selecting any amount of text (which might include hyperlinks) - is there any specific use case where this is needed?
Comment 5 sdc.blanco 2019-11-06 13:33:13 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #4)
> is there any specific use case where this is needed?

Copy and paste a paragraph (or more) from Wikipedia.
(it will most likely have many hyperlinks.)

In 6.3.3.2 it is possible to select part or all of this copied text to remove all the selected hyperlinks (at one go).  This is practical when one wants to have the text from Wikipedia, but does not want all the hyperlinks (because of formatting, etc.)  (Same kind of situation with other webpages.)

With 6.4.0.0 -- it is necessary to take them one at a time.

Additional information.  6.3.3.2 does not have tdf#120734.  That is, the "remove hyperlink" command is only shown when the selected text includes one (or more) hyperlink(s).
Comment 6 Samuel Mehrbrodt (allotropia) 2019-11-06 15:32:55 UTC
(In reply to sdc.blanco from comment #5)
> Copy and paste a paragraph (or more) from Wikipedia.
> (it will most likely have many hyperlinks.)
> 
> In 6.3.3.2 it is possible to select part or all of this copied text to
> remove all the selected hyperlinks (at one go).  This is practical when one
> wants to have the text from Wikipedia, but does not want all the hyperlinks
> (because of formatting, etc.)  (Same kind of situation with other webpages.)

Can't you use the "paste unformatted" feature for this?

Anyway, I guess I will probably just revert the patch causing this.
Comment 7 Xisco Faulí 2019-11-06 15:40:56 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #6)
> (In reply to sdc.blanco from comment #5)
> > Copy and paste a paragraph (or more) from Wikipedia.
> > (it will most likely have many hyperlinks.)
> > 
> > In 6.3.3.2 it is possible to select part or all of this copied text to
> > remove all the selected hyperlinks (at one go).  This is practical when one
> > wants to have the text from Wikipedia, but does not want all the hyperlinks
> > (because of formatting, etc.)  (Same kind of situation with other webpages.)
> 
> Can't you use the "paste unformatted" feature for this?

+1. That's what I would do in order to avoid future problems with styles, hyperlinks, etc...
Comment 8 Heiko Tietze 2019-11-06 16:34:14 UTC
Reverting the patch reintroduce the confusion reported in bug 120734. At least we should rename the command to "Remove hyperlink(s)" or "Clear hyperlinks". Another solution is to check whether the text contains a link and enable the command respectively. Doubt it's worth the effort.
Comment 9 sdc.blanco 2019-11-06 22:01:39 UTC
(In reply to Heiko Tietze from comment #8)
> Another solution is to check whether the text contains a link
> and enable the command respectively. Doubt it's worth the effort.

This is how it already works in 6.3.3.2  If there is one (or more) hyperlink in the selected text, then "Remove hyperlink" is shown.  If there is no hyperlink in the selected text (even if it is All text), then "Remove hyperlink" is not shown.  (so no problem like reported in bug #120734)

As for "Paste unformatted".  (Sounds like a good solution -- if one knew about this command in advance.  I didn't.)  But also sometimes, you may want to copy everything over, and then later decide to remove some, but not all the hyperlinks.  That would not be possible with the "Paste unformatted" solution.

Maybe the original bug reporter also has some good (or better) examples?
Comment 10 Samuel Mehrbrodt (allotropia) 2019-11-07 06:45:18 UTC
(In reply to sdc.blanco from comment #9)
> This is how it already works in 6.3.3.2  If there is one (or more) hyperlink
> in the selected text, then "Remove hyperlink" is shown.  If there is no
> hyperlink in the selected text (even if it is All text), then "Remove
> hyperlink" is not shown.  (so no problem like reported in bug #120734)

Did you check with the document from the bug report (attachment 145862 [details])?
Comment 11 Heiko Tietze 2019-11-07 07:18:05 UTC
(In reply to sdc.blanco from comment #9)
> This is how it already works in 6.3.3.2

(In reply to Samuel Mehrbrodt (CIB) from comment #10)
> Did you check with the document from the bug report

I see, there is no "Remove Hyperlink" in this document unless you add one. Rather than hiding I would just disable the command. However, even with hyperlink it's not possible to run the command with cursor on a different position, making the multiselection impossible (add http://www.libreoffice.org somewhere and select the full paragraph).

Interesting issue: Tested first with Calc (6.4) and while removing a single hyperlink works well it cuts the text on multiselection. Different topic?
Comment 12 sdc.blanco 2019-11-07 17:31:42 UTC
(In reply to Samuel Mehrbrodt (CIB) from comment #10)
> (In reply to sdc.blanco from comment #9)
> > This is how it already works in 6.3.3.2  If there is one (or more) hyperlink
¨> 
> Did you check with the document from the bug report (attachment 145862 [details]
> [details])?

Now I have checked -- and the problem appears (i.e., "Remove Hyperlink" is shown with this file) with 6.3.3.2

If I copy a few paragraphs to a new document, and then select all, then "remove hyperlink" is not shown.
Comment 13 Stanislav Horacek 2019-11-07 18:25:56 UTC
(In reply to sdc.blanco from comment #9)
> Maybe the original bug reporter also has some good (or better) examples?

My use case is also editing of web content copied from a browser, Wikipedia text is a nice example of that. I don't think that removing formatting and removing hyperlinks are coupled actions - e.g. to print a web article, it makes sense to remove the hyperlinks but keep the formatting.

Also, hyperlink texts are not checked by spellchecker - so quick way how to check them is to remove the hyperlinks temporarily.
Comment 14 Samuel Mehrbrodt (allotropia) 2019-11-08 08:34:42 UTC
Ok, I reverted the fix for bug 120734 - will see if that can be solved differently without breaking the "remove all hyperlinks" feature.