Bug 116315 - Cycle Case does not use Sentence case or tOGGLE cASE
Summary: Cycle Case does not use Sentence case or tOGGLE cASE
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.4.5.1 release
Hardware: All All
: medium enhancement
Assignee: Heiko Tietze
URL:
Whiteboard: target:6.1.0 target:7.3.0
Keywords: difficultyBeginner, easyHack, skillCpp
: 90163 (view as bug list)
Depends on:
Blocks: AutoCorrect-Complete CaseFolding
  Show dependency treegraph
 
Reported: 2018-03-09 13:55 UTC by Kruno
Modified: 2021-10-18 10:42 UTC (History)
11 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 Kruno 2018-03-09 13:55:42 UTC
Description:
In Pootle string for cycling case shows Title Case, UPPERCASE, lowercase but what should be added is 'First word in uppercase' as some languages doesn't use Title Case and thus this feature is not practical for such cases.

Setting version to 6.1 (master) as string happens in Pootle under 'LibreOffice Master'.

Steps to Reproduce:
1. use cycle case

Actual Results:  
No result with only 'First word in uppercase'

Expected Results:
Cycle should have option to do 'First word in uppercase'


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Firefox/52.0
Comment 1 Jacques Guilleron 2018-03-10 14:00:52 UTC
Hi Kruno,

This is a Localised setting. I find it in:
Tools > AutoCorrect > AutoCorrect Options...
Capitalise first letter of every sentence, ticked
Does this help?
Comment 2 Kruno 2018-03-10 18:41:18 UTC
No, it's that's not it - it's not autocorrection.

Write any number of words in all caps, select those words, try SHIFT + F3 to activate cycle case feature. Keep pressing SHIFT + F3.

You get this:

   ALL CAPS
   All Caps
   all caps

but I would expect

   All caps

also as Title Case is not used in some languages and it's logical that Cycle case covers all four possibilities.
Comment 3 Buovjaga 2018-03-11 15:01:51 UTC
UX: any reason to skip these case cases?
Comment 4 V Stuart Foote 2018-03-11 17:50:06 UTC
Seems reasonable. The Cycle case <Shift><F3> control rotates through just 3 ICU Transliteration configurations as initially implemented [1].

Adding a fourth for SentenceCase [2][3] should be possible, and seems appropriate--especially as the uno.ChangeCaseToSentenceCase action is otherwise just available in the Format -> Text menu, but can be added in customize.

The translated Function name "Cycle Case (Title Case, UPPERCASE, lowercase)" wss getting rather long--suggest we remove the parenthetical examples and assign it a tooltip instead?

Caolán, your thoughts on adding an additional Transliteration to the rotation?

=-ref-=
[1] https://opengrok.libreoffice.org/xref/core/unotools/source/i18n/caserotate.cxx

[2] https://opengrok.libreoffice.org/xref/core/svx/sdi/svx.sdi#1050
[3] https://opengrok.libreoffice.org/xref/core/include/i18nutil/transliteration.hxx#62
Comment 5 Caolán McNamara 2018-03-12 14:18:42 UTC
I've no opinion on it.
Comment 6 László Németh 2018-03-12 14:58:33 UTC
It would be really nice to add the sentence capitalization.

(I think, LibreOffice needs also a real title case here or somewhere. This ugly “start case” is only an obsolete poor man's version of the common title cases, see https://en.wikipedia.org/wiki/Letter_case#Headings_and_publication_titles.)
Comment 7 Heiko Tietze 2018-03-19 14:54:47 UTC
No one disagree, so please do it. Qualified easyhack with code pointers in comment 4.
Comment 8 Kruno 2018-03-20 06:37:53 UTC
I guess that only switch statement in caserotate.cxx should be updated?
Comment 9 Heiko Tietze 2018-03-21 09:27:16 UTC
Sentence case is now #2 in the sequence. Didn't add toggle case as there wasn't agreement about it - and the longer the more iterations we have the less useful this command becomes. But could be done easily.

Patch https://gerrit.libreoffice.org/#/c/51696/
Comment 10 Commit Notification 2018-03-26 12:59:52 UTC
heiko tietze committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=84f8e28d092676aad830a9fbae8145a57c6301bc

tdf#116315 - Cycle Case including Sentence case

It will be available in 6.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 11 Laurent Balland 2018-08-25 17:10:15 UTC
Hi,

The resolution is not totally satisfactory:
When cycling through "Sentence case" it is the total sentence which is modified even if only one word is selected:
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 result:
the whole sentence is capitalized as a sentence

Expected result:
only the selected word should be modified according to its place in the sentence.
Comment 12 Xisco Faulí 2018-08-25 17:13:40 UTC
@Laurent BP, should it be reported in a follow-up bug ?
Comment 13 Laurent Balland 2018-08-25 18:14:13 UTC
(In reply to Xisco Faulí from comment #12)
> @Laurent BP, should it be reported in a follow-up bug ?

I opened bug 119495
Comment 14 Buovjaga 2021-07-05 14:03:30 UTC
*** Bug 90163 has been marked as a duplicate of this bug. ***
Comment 15 elmau 2021-08-26 19:09:58 UTC
I test in 7.2

Write any sentence all in UPPERCASE, for example:

LIBREOFFICE IS THE BEST

Select "only" one word, for example "THE" and press SHIFT+F3 three times, the result is:

Actual Results:  
Libreoffice is the best

Expected Results:
LIBREOFFICE IS the BEST

Reproducible: Always

Additional Info:
Version: 7.2.0.4 / LibreOffice Community
Build ID: 20(Build:4)
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
7.2.0-1
Calc: threaded
Comment 16 V Stuart Foote 2021-08-26 20:40:01 UTC
(In reply to elmau from comment #15)

That is see also bug 48033 (and dupes); the cycle case control does not handle selection correctly. The Sentence case transliteration is applied against the full sentence and not limited to a selection when made.
Comment 17 ConorBike 2021-08-26 20:58:33 UTC
(In reply to V Stuart Foote from comment #16)
> (In reply to elmau from comment #15)
> 
> That is see also bug 48033 (and dupes); the cycle case control does not
> handle selection correctly. The Sentence case transliteration is applied
> against the full sentence and not limited to a selection when made.

Bug reproduced in the operating systems:
- Mac Os High Sierra with Libreoffice version 7.1.5
- Linux Mint 220.2 with Libreoffice (Linux Mint repositories) version 6.4.7.2
Comment 18 V Stuart Foote 2021-08-26 21:02:41 UTC
Do not reopen. This enhancement was Resolved Fixed by commit in comment 10. The issues it caused are on the see also.
Comment 19 elmau 2021-08-26 22:13:18 UTC
(In reply to V Stuart Foote from comment #16)
> 
> That is see also bug 48033 (and dupes); the cycle case control does not
> handle selection correctly. The Sentence case transliteration is applied
> against the full sentence and not limited to a selection when made.


ok, this is wrong
Comment 20 Carloseugenio 2021-08-27 02:30:44 UTC
I have the same problem.

Only one word is selected to change and all the phrase goes lowercase.

LibreOffice 7.2.0.4 in Linux Mint 19.1 64 bits
Comment 21 V Stuart Foote 2021-08-27 03:49:39 UTC
Closed. Issues are on bug 49033
Comment 22 Commit Notification 2021-08-27 10:19:39 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/1864e6353179678a2ca1a175c203fd9e0cc5a580

tdf#116315: sw_uiwriter3: Add unittest

It will be available in 7.3.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.