Bug 156801 - Inconsistent updating of selected character count
Summary: Inconsistent updating of selected character count
Status: RESOLVED DUPLICATE of bug 98889
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-17 17:47 UTC by William Friedman
Modified: 2023-12-11 23:29 UTC (History)
3 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 William Friedman 2023-08-17 17:47:50 UTC
Description:
When selecting text, the number of selected characters should update as more characters are selected, no matter what the selected character is. This behavior is inconsistent, however, when word boundaries are crossed or non-letters are present. Below I give an example with punctuation, but equally-strange if not stranger behavior occurs if there are numbers in the words (e.g., try selecting character-by-character the string "Wo1 Wo2 Wo3"). This bug makes this feature useless for actually counting characters.

Steps to Reproduce:
1. Open a new document.
2. Write "ab cd! ef"
3. Position the cursor at the beginning of the text.
4. Press shift-right to select the first character. Bottom bar reads correctly: "Selected: 1 word, 1 character."
5. Press shift-right again. The characters "ab" should be selected. Bottom bar reads correctly: "Selected: 1 word, 2 characters."
6. Press shift-right again. The characters "ab " should be selected. Bottom bar reads correctly: "Selected: 1 word, 3 characters."
7. Press shift-right again. The characters "ab c" should be selected. Bottom bar reads *incorrectly*: "Selected: 1 word, 3 characters."
8. Press shift-right again. The characters "ab cd" should be selected. Bottom bar reads *incorrectly*: "Selected: 1 word, 3 characters."
9. Press shift-right again. The characters "ab cd!" should be selected. Bottom bar reads correctly: "Selected: 2 words, 6 characters."
10. Press shift-right again. The characters "ab cd! " should be selected. Bottom bar reads correctly: "Selected: 2 words, 7 characters."
11. Press shift-right again. The characters "ab cd! e" should be selected. Bottom bar reads *incorrectly*: "Selected: 2 words, 7 characters."
12. Press shift-right again. The characters "ab cd! ef" should be selected. Bottom bar reads correctly: "Selected: 3 words, 9 characters."
13. Press shift-left. The characters: "ab cd! e" should be selected. Bottom bar reads correctly: "Selected 3 words, 8 characters."
14. Press shift-left. The characters: "ab cd! " should be selected. Bottom bar reads *incorrectly*: "Selected: 3 words, 8 characters."

Actual Results:
Bottom bar incorrectly reports the number of characters selected in certain circumstances.

Expected Results:
Bottom bar should correctly report the number of characters selected in all circumstances.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 1 toi 2023-08-18 02:39:49 UTC
It's interesting to track again old version in how differently they count these statistics (compared to your 14-step procedure with 4 incorrect counts):

1. Version 4.0.6.2 (Build ID: 2e2573268451a50806fcd60ae2d9fe01dd0ce24) (count words only, 14 steps, no incorrect): In this version, it counts only number of words, and does not count number of characters. Applying your procedure results in all correct counts for number of words.

2. Version 5.2.7.2
Build ID: 2b7f1e640c46ceb28adf43ee075a6e8b8439ed10
CPU Threads: 8; OS Version: Linux 6.1; UI Render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
(count words and characters, 14 steps with 4 incorrect counts, for counting characters inside words)
In this version, it does update the number of words when you getting first character after space. However, it does not update  number of selected characters after you keep moving to the right in the same word.

3. Version: 6.0.7.3
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
This is the first version I observed the same reproducible behaviors like your 7.5.3.2.
Comment 2 m_a_riosv 2023-08-18 12:09:29 UTC
Reproducible
Version: 7.5.7.0.0+ (X86_64) / LibreOffice Community
Build ID: f847a74a2ceffe3938736cb5ee88f81b2160a6b7
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8b9643960117612b7e1cae1ed8325c2630232d0f
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 3 Stéphane Guillou (stragu) 2023-12-11 23:29:08 UTC
The behaviour has been wrong for a while, just in a slightly different way since 5.4.
The two different stages I see:
- Character and word count don't update unless cursor _reaches_ a word boundary (for both directions), which was still true in 5.3.0.3
- Character and word count don't update unless cursor _reaches_ a word boundary if using the Right arrow, and unless it _leaves_ a word boundary if using the Left arrow, which is the case in 5.4.0.3.

Let's mark as duplicate of earlier bug 98889, and give more details there.

*** This bug has been marked as a duplicate of bug 98889 ***