Bug 169791 - When selecting multiple text runs and adding ruby, extra characters are added
Summary: When selecting multiple text runs and adding ruby, extra characters are added
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
25.2.6.2 release
Hardware: All All
: medium normal
Assignee: Jonathan Clark
URL:
Whiteboard: target:26.8.0 target:25.8.5 target:26...
Keywords:
Depends on:
Blocks: Ruby CJK
  Show dependency treegraph
 
Reported: 2025-12-02 12:24 UTC by Shinji Enoki
Modified: 2025-12-09 13:03 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
This is a sample file. It shows the state before putting Ruby, the correct state, and the actual state. (11.40 KB, application/vnd.oasis.opendocument.text)
2025-12-02 12:32 UTC, Shinji Enoki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shinji Enoki 2025-12-02 12:24:38 UTC
Description:
When using the Ctrl key to select a distant string and add ruby, extra characters are added.



Steps to Reproduce:
1.Open the sample file in Writer
2.Use the Ctrl key to select multiple distant kanji characters
3.Select Menu [Format]-[Asian Phonetic Guide]
4.Input to "Ruby text" and push "Apply" button

Actual Results:
The second and subsequent strings with ruby ​​annotation are added after the first string.

Expected Results:
Ruby is placed in the correct position of the text.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 12; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: en-US
Calc: threaded

I couldn't reproduce it below:
Version: 24.8.7.2 (X86_64) / LibreOffice Community
Build ID: e07d0a63a46349d29051da79b1fde8160bab2a89
CPU threads: 12; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded

According to Sabr0's comment, this was caused by the following commit change:
https://git.libreoffice.org/core/+/3d9b8701cb1751e4139ffa24f72bb836eb877fd1
https://ask.libreoffice.org/t/topic/129480/3
Comment 1 Shinji Enoki 2025-12-02 12:32:18 UTC
Created attachment 204379 [details]
This is a sample file. It shows the state before putting Ruby, the correct state, and the actual state.
Comment 2 Shinji Enoki 2025-12-02 12:35:35 UTC
@jonathan,
Could you please check this issue?
Comment 3 Jonathan Clark 2025-12-02 12:59:52 UTC
Writer should behave better in this case, so I'm marking this bug new.

Writer's Asian Phonetic Guide assumes the selection will always be contiguous. This makes it possible to edit the base text from within the dialog, but it's not clear how to allow that with non-contiguous selections (adding selection mode). More design work is needed.
Comment 4 LeroyG 2025-12-02 13:25:15 UTC
Related question in the ask site:
https://ask.libreoffice.org/t/topic/129480
Comment 5 Commit Notification 2025-12-08 20:49:35 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1e275b2e0f07249a88d760b5a9c63a9589737d3e

tdf#169791 sw: Fix trampled ruby base text with adding selection

It will be available in 26.8.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 6 Commit Notification 2025-12-09 13:03:14 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

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

tdf#169791 sw: Fix trampled ruby base text with adding selection

It will be available in 25.8.5.

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 7 Commit Notification 2025-12-09 13:03:17 UTC
Jonathan Clark committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/1cf5e10ad9575262f04cd163afb07766ddbb7da0

tdf#169791 sw: Fix trampled ruby base text with adding selection

It will be available in 26.2.0.0.beta2.

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.