Bug 119495 - New case "Sentence case" during cycling Shift+F3 is applied to whole sentence
Summary: New case "Sentence case" during cycling Shift+F3 is applied to whole sentence
Status: RESOLVED DUPLICATE of bug 49033
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CaseFolding
  Show dependency treegraph
 
Reported: 2018-08-25 18:13 UTC by Laurent Balland
Modified: 2021-10-18 10:41 UTC (History)
8 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 Laurent Balland 2018-08-25 18:13:43 UTC
Description:
Resolution of bug 116315 is not totally satisfactory:
When cycling (Shift+F3) through "Sentence case" it is the total sentence which is modified even if only one word is selected

Steps to Reproduce:
Hi,


1. Write a sentence with some words uppercase
2. Select one word
3. Shift+F3 => uppercase for the selected word
4. Shift+F3 => lower for the selected word
5. Shift+F3 => capitalize first letter of the selected word
6. Shift+F3 


Actual Results:
the whole sentence is capitalized as a sentence

Expected Results:
only the selected word should be modified according to its place in the sentence.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 ydutrieux 2018-08-25 19:25:20 UTC
Confirmed on Ubuntu 18.04 - Libreoffice 6.1.0.3

Yves
Comment 2 Heiko Tietze 2018-08-26 08:35:39 UTC
Code-wise, the sequence is now TITLE_CASE, SENTENCE_CASE (newly inserted at this position), LOWERCASE_UPPERCASE, UPPERCASE_LOWERCASE [1] with the options of [2]. And 'sentence case' was the requested option. If you want to toggle the word you have to press 4x shift+F3. => WFM

[1] https://cgit.freedesktop.org/libreoffice/core/tree/unotools/source/i18n/caserotate.cxx?id=84f8e28d092676aad830a9fbae8145a57c6301bc
[2] https://opengrok.libreoffice.org/xref/core/include/i18nutil/transliteration.hxx#31
Comment 3 Xisco Faulí 2018-08-27 14:04:20 UTC
I can't reproduce it in

Version: 6.2.0.0.alpha0+
Build ID: 63f8c506637c910ed1efa572f23ff1af7715e7e3
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: threaded

instead, what i see is:

1. Write a sentence with some words uppercase
2. Select one word
3. Shift+F3 => uppercase for the selected word
4. Shift+F3 

=> lower for the selected word and the word before it...
Comment 4 Xisco Faulí 2018-08-30 10:40:37 UTC
@Laurent, @Heiko,
Do you reproduce what I say in comment 3 ?
Comment 5 Heiko Tietze 2018-08-31 08:10:24 UTC
(In reply to Xisco Faulí from comment #4)
> Do you reproduce what I say in comment 3 ?

Selection in brackets

Start: [He heard quiet steps behind him.]
[He Heard Quiet Steps Behind Him.]
[He heard quiet steps behind him.]
[HE HEARD QUIET STEPS BEHIND HIM.]
[he heard quiet steps behind him.]

Start: He heard [quiet steps] behind him.
He heard [quiet steps] behind him.
He heard [QUIET STEPS] behind him.
He heard [Quiet Steps] behind him.
He heard [quiet steps] behind him.
(not perfectly sure about the sequence)

So LBP is right, the procedure takes into account whether the selection is part of a sentence or not. Users likely expect:

Start: He heard [quiet steps] behind him.
He heard [Quiet Steps] behind him.
He heard [Quiet steps] behind him.
He heard [QUIET STEPS] behind him.
He heard [quiet steps] behind him.
Comment 6 Philip Rayment 2018-09-01 03:30:20 UTC
I get the same results as in comment 5, but the problem is that that example doesn't properly test the function.

Part of the issue is that Shift-F3 starts with the next case after the last one used, even if that was on a different bit of text.

Perform the following steps:
1. Write two sentences as follows:
  This should be title case.
  John Smith and Joe Blow wrote to fred jones.
2. Select the first sentence and press Shift-F3 once or as many times as needed to have every initial letter capitalised, i.e. "This Should Be Title Case."
3. Select "fred jones" and press Shift-F3
The result is that sentence case is applied to the whole sentence, which now reads as "John smith and joe blow wrote to fred jones."  So this has just uncapitalised "Smith", "Joe", and "Blow", and done nothing to "fred jones".
4. Press Shift-F3 three more times and "fred jones" will become "Fred Jones".  5. Now select "joe blow" and press Shift-F3.  This changes "Fred Jones" back to "fred jones"!  Without stepping through cases on a different bit of text, there is no way to get the correct capitalisation through using Shift-F3.  It cannot be done.
Comment 7 Philip Rayment 2018-09-01 04:58:02 UTC
My previous comment was perhaps overly complicated.  Simply try this:
Type the sentence "john smith and joe blow wrote to fred jones.  Now, using Shift-F3 as many times you like and selecting whatever parts of the text you'd like, capitalise the first letter if each name, and only those letters.
If you can do it, I'd like to know how.
Comment 8 Xisco Faulí 2018-09-01 09:29:00 UTC
Patch in gerrit: https://gerrit.libreoffice.org/#/c/59894/
Comment 9 Heiko Tietze 2018-09-01 09:57:58 UTC
(In reply to Xisco Faulí from comment #8)
> Patch in gerrit: https://gerrit.libreoffice.org/#/c/59894/

Thios is work in progress. What I can do is to start from zero after 3 seconds, which solves what Philip reports. From the UX POV it would be nice to have a feedback on the cycle either per tooltip or preferably as a text in the status bar. Failed with both and need help. 

Bigger issue that I'm not able to solve is Laurent's problem (see also comment 6) - and I don't know if we want to change the behavior.
Comment 10 Philip Rayment 2018-09-01 13:26:26 UTC
Instead of resetting the cycle after three seconds, what if it was reset when the cursor is moved?  If the cursor is moved to another bit of text, or a new selection made in the same bit (which involves moving the cursor), I think starting the cycle again is warranted.

Resetting the cycle after three seconds will cause different behaviours for different people depending on how fast they operate.

And I don't think that anything ought to be changed outside the selection.  Therefore sentence case is only applied if the whole sentence is selected, or if the selection includes the start of the sentence, but even then only to the selection.

You could also apply sentence case to the whole sentence if there is no selection, but even this is contrary to similar behaviour.  If there is no selection (but the cursor is in a word), bolding, etc. is applied only to the word.  So if there is no selection, I think that sentence case should not be applied even in that case.
Comment 11 Heiko Tietze 2018-09-07 14:28:20 UTC
The timer idea was too simple. Abandoning patch https://gerrit.libreoffice.org/#/c/59894/ as dealing with caret position is beyond my skills.
Comment 12 Mike Kaganski 2018-09-20 08:44:26 UTC
This is actually bug 49033. It simply started to affect the cycle case function.
Comment 13 Mike Kaganski 2018-09-21 20:40:27 UTC
*** Bug 120039 has been marked as a duplicate of this bug. ***
Comment 14 pibarnas 2018-09-21 20:52:13 UTC
(In reply to Mike Kaganski from comment #12)
> This is actually bug 49033. It simply started to affect the cycle case
> function.

Yep. You are right.
Comment 15 Mike Kaganski 2018-10-01 22:42:54 UTC
*** Bug 120254 has been marked as a duplicate of this bug. ***
Comment 16 V Stuart Foote 2019-01-25 17:37:41 UTC

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