Bug 150017 - Impossible to add characters to Bookmark Text left or right from existing Bookmark Text.
Summary: Impossible to add characters to Bookmark Text left or right from existing Boo...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0
Keywords: needsUXEval
Depends on:
Blocks:
 
Reported: 2022-07-16 16:38 UTC by Olivier
Modified: 2023-10-23 12:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample Document (9.50 KB, application/vnd.oasis.opendocument.text)
2022-07-19 05:03 UTC, Rainer Bielefeld Retired
Details
Screenshot of document with 'edit bookmarks' dialog (140.46 KB, image/png)
2022-07-20 08:48 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier 2022-07-16 16:38:53 UTC
Description:
In Writer, I cannot change the text of a one-character bookmark.


Steps to Reproduce:
1. Create a one-character bookmark... 
  a. Select some one-character text, for example "A"
  b. Do "Insert > Bookmark"
2. Try to change the text of the bookmark
  a. For example try to write "A1" instead of "A"
  b. Observe that no text can be added to the bookmark.

Actual Results:
The text can only be added before or after the bookmark, but not to the bookmark.

Expected Results:
I should be able to change the bookmark text, even if it is only one character long.


Reproducible: Always


User Profile Reset: No



Additional Info:
Writer version 7.3.5.1 (current version on Debian Testing)

Every time I use LibreOffice, I find a bug.    
That is why I use it as few as possible.
Comment 1 Rainer Bielefeld Retired 2022-07-17 08:34:10 UTC
NOT reproducible  with  Installation of Version: 7.3.3.2 (x64) 
Build ID: d1d0ea68f081ee2800a922cac8f79445e4603348
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE |  Calc: threaded | ElementaryTheme | My normal User Profile

I Dialog "Insert -> Bookmark" i can easily modify Bookmark "B" for Letter "A" to bookmark name "C"

@Reporter:
"Try" is a much too vague description. Please bemore detailed (every mouse click, every key press ...)!
Comment 2 raal 2022-07-17 12:09:59 UTC
I can reproduce it. You can change text of one character bookmark, but cannot create two characters bookmark from one character. Probably bug 46895 will solve it?
Comment 3 Olivier 2022-07-17 18:24:06 UTC
@Rainer Bielefeld Retired
"Please be more detailed"

The only way I know to change the text of a bookmark is to go on it (either by LMB click or with the key arrows) and type additionnal characters with the keyboard, and possibly use Suppr/Backspace.

In my example, I just want to add character "1" after the characer "A" of the existing bookmark. Problem: "1" is always added out of the bookmark range.

If you know another standard way, please instruct us. 

@raal
"You can change text of one character bookmark"

I suppose that you did press Suppr/Backspace and then added some characters. 
Yes, I confirm that it is possible to change one character, but the supplementary charcters are added out of the bookmark range.
Comment 4 Rainer Bielefeld Retired 2022-07-19 05:03:31 UTC
Created attachment 181318 [details]
Sample Document

> The only way I know
is the problem ...

Until now I even don't know what you want to do. Modify the NAME of a Bookmark? Or do you want to modify the string to which the particular bookmark is allocated? Or something completely different?

My steps:
0. Launch  Server Installation of Version: 7.5.0.0.alpha0+  
   Build ID: 8061b3e9204bef6b321a21033174034a5e2ea88e
   CPU-Threads: 4; BS: Windows 6.1 Service Pack 1 Build 7601; 
   UI-Render: Skia/Raster; VCL: win
   Locale: de-DE (de_DE); UI: de-DE
   Calc: CL |  Auto Colibre Theme  |  
   Special devUserProfile  (based on my normal one)
1. Via LibO Dialog open attached Sample document from HDD
   » Caret flashes left from "C"
2. In Navigator Sidebar ˋRightclick "B"-Bookmark → Renameˊ
   » "B" in document becomes highlighted, Rename Dialog opens with "B" in 
     "New Name" Input line highlighted
3. Type "xyz" (into "New Name" Input line) 
   » Contents of "New Name" Input line shows "xyz"
4. [OK]
   » Bookmark behind text string "B" has become renamed to "xyz", as you can
     see in Sidebar.

@Olivier, @raal, 
What exactly is your problem? Something different to what I did?
Comment 5 Olivier 2022-07-19 19:30:38 UTC
@Rainer Bielefeld

A bookmark is a LABEL pointing to a TEXT. With this definition in mind, please review my bug report.

You are talking about changing the LABEL, but the bug is about changing the TEXT, when it is one-character long.
Comment 6 Rainer Bielefeld Retired 2022-07-20 08:48:39 UTC
Created attachment 181341 [details]
Screenshot of document with 'edit bookmarks' dialog

Well, I hope I understood: We are talking about the strings in the 'Text' column of the bookmarks dialog?!

So this is not a "single character text"problem. For further research you should activate visibility of bookmarks borders - the square brackets in the screenshot around the bookmarks. Menu ˋTools  → Options → Writer → Formatting aids → Formatting aidsˊ.
Comment 7 Rainer Bielefeld Retired 2022-07-20 09:05:49 UTC
(In reply to Rainer Bielefeld Retired from comment #6)
And then do test with Sample Document:

11. place caret (by mouseclick ...) left from "A" and type "y"
   » "y" appears outside bookmarks-limits, so of course will not be added to the 
     Bookmark Text
12. place caret (by mouseclick ...) right from "A" and type "y"
   » "y" appears (right) outside bookmarks-limits, so of course will not be
      added to the Bookmark Text
13. Do test (11-12) with "B", "C", 
   » same result
14. Now add a new string "ab1cd" below the existing Bookmarks and add 
    Bookmark  
   » Bookmark Brackets appear left form "a" and right from "d" (as you see in 
     my screenshot)
15. place caret (by mouseclick ...) left from "a" and type "y"
   » "y" appears outside bookmarks-limits, so of course will not be added to the 
     Bookmark Text
16. place caret (by mouseclick ...) right from "d" and type "y"
   » "y" appears outside bookmarks-limits, so of course will not be added to the 
     Bookmark Text
17. A further test will show that characters typed within the string (right from
    "a" and left from "d" will be taken to the bookmark Text.

So the problem is not limited to single character text bookmarks.

NEW 
and modified Subject due to test result.
Comment 8 Rainer Bielefeld Retired 2022-07-20 09:07:40 UTC
No obvious DUPs found with query <https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs150017&sharer_id=19321>, so


NEW 

and I modified Subject due to test result.
Comment 9 Rainer Bielefeld Retired 2022-07-20 09:30:26 UTC
BTW, there is a 

WORKAROUND
----------
if you really really need to replace a single character Bookmark Text string by a longer one. for Example the "A" in the sample document by "1A2":
* get "1A2" to clipboard (for example by copying it from this comment)
* select / highlight Bookmark text string ("A") you want to modify
* <ctrl+v> to paste clipboard contents ("1A2")
   » as hoped "1A2" appears within bookmark string brackets
* Check in Edit Bookmarks Dialog
   » as hoped Bookmark Text string has become modified from "A" to "1A2" 

Of course that trick also works for adding characters at in front of beginning or behind multipls character Bookmark Text Strings:
* Copy-Paste Bookmark Text string to somewhere else
* Modify string as required
* select new string, <cntrl+c> to copy it to clipboard
* select bookmark text string you want to modify in document
* <cntrl+v> fpr paste
   » Tadah ...
Comment 10 Olivier 2022-07-20 18:47:18 UTC
Your modification of the subject makes sense and is more general.

However, I would like to point out that the main problem that could block a user is when the bookmark text is one character long, because there is no immediate way to add text to it (other than deleting and making a new bookmark from scratch). If it is more than two characters long, it is easy to handle the situation by adding text in the middle and then adjusting the beginning or the end with delete/suppr.

Your workaround is right, but it may not be found easily by everyone, while everyone will wonder why he cannot add text.

I do this remark not to criticize your change of the subject, but to focus on what the main annoyance is.

I do not know what the right behavior should be:
- Should it be left like this, and a hint be written in the documentation?
- Should it be allowed to add text to the bookmark when the cursor is at the start? at the end? at both?
Comment 11 Rainer Bielefeld Retired 2022-07-20 20:47:30 UTC
Yes, of course. From user's PoV the "single character bookmark text" causes the most annoying problem.

The summary more reflects the roots of the problem.
Comment 12 sdc.blanco 2022-07-20 22:14:23 UTC
(In reply to Olivier from comment #10)
> I do not know what the right behavior should be:
> - Should it be left like this, and a hint be written in the documentation?
> - Should it be allowed to add text to the bookmark when the cursor is at the
> start? at the end? at both?
Sensible questions. Let's ask Design Team...
Comment 13 Commit Notification 2022-07-26 13:25:07 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7974cea6c788e02d7c36573e2d10dcc51884f70e

tdf#150017 sw: Replace should not shorten bookmarks

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Commit Notification 2022-07-26 18:16:43 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/aa6ec3f79607478213272283b7eb17ec2116173c

tdf#150017 sw: allow editing bookmark text in Insert->Bookmarks dialog

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2022-07-26 18:16:51 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a89b221afe2d2d8aa670236fce6e95022ffa1cd9

tdf#150017 vcl,sw: add UITest

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Heiko Tietze 2022-07-27 07:21:59 UTC
@mst, is this issue fixed or do you need input from UX?
Comment 17 Michael Stahl (allotropia) 2022-07-27 14:55:45 UTC
so... i was asked to add a feature that allows replacing the text content of a bookmark (between start and end) with different text - because due to the implementation details that is kind of tricky when editing the text, as the bookmark start and end aren't distinct characters that you can position the cursor before or after.

this is now possible on the Insert->Bookmarks dialog with a button "Edit Text"; the new text typed in will then replace the existing text (it's only possible if the existing text is less than 50 characters in one paragraph).

i think this should fix this bug report, but can't be 100% sure :)
Comment 18 Heiko Tietze 2022-07-28 09:03:26 UTC
Olivier, please reopen if the issue is not fixed. Test with the latest nightly build from https://dev-builds.libreoffice.org/daily/