Bug 144851 - Title Case Applied Outside of Selection
Summary: Title Case Applied Outside of Selection
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium minor
Assignee: Michael Warner
URL:
Whiteboard: target:7.4.0
Keywords:
: 150725 (view as bug list)
Depends on:
Blocks: CaseFolding
  Show dependency treegraph
 
Reported: 2021-10-01 13:06 UTC by Michael Warner
Modified: 2022-08-31 19:34 UTC (History)
4 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 Michael Warner 2021-10-01 13:06:43 UTC
Description:
This is a follow-on report from bug 49033. While changing sentence case to apply strictly to a user's selection, it was found that title case will go outside of a user's selection.

Steps to Reproduce:
1. Write a word, for example, "met"
2. Select the e and the t
3. Apply title case formatting by selecting Format->Text->Capitalize Every Word


Actual Results:
The 'm' has been capitalized, even though it was not selected.

Expected Results:
Either that the 'e' would be capitalized or that nothing would be capitalized.


Reproducible: Always


User Profile Reset: No



Additional Info:
None
Comment 1 Deep17 2021-10-13 16:25:47 UTC
I can reproduce the bug in stable version

Version: 7.2.1.2 (x64) / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

I can not reproduce the bug in master build

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 56883788d0090383dad58552f5a11044ffe64a44
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 2 Michael Warner 2021-10-13 21:50:39 UTC
I would like UX team or somebody to tell me what it should do in this case.
Comment 3 V Stuart Foote 2021-10-13 22:52:43 UTC
Michael,

Wearing my UX hat, I'm torn. Without selection I think we need to work at ICP word bounds at the edit cursor.

With a selection, for consistency honor the selection--same as sentence case.

Thoug trying to split a word by selection and then apply cycle case is a fools effort, wrong tool. Especially as double click is an easy full word selection (triple for sentence, quad for para).

But with selection made (whole word or not) the transliterations should honor the selection made--weird though it may be to be title case in the middle of a word.

Stuart
Comment 4 Heiko Tietze 2021-10-14 05:47:15 UTC
What use case would a user try to solve? So I'd prefer forgiveness of unprecise selections and apply _sentence_ to word boundary.
Comment 5 V Stuart Foote 2021-10-14 13:22:56 UTC
(In reply to Heiko Tietze from comment #4)
> What use case would a user try to solve? So I'd prefer forgiveness of
> unprecise selections and apply _sentence_ to word boundary.

No they are distinct ICU transliterations, and cycle case applies them in sequence. Only sentence case was the special (expanding selection to sentence bounds).  But lower, capital, title are word bounded without selection.

But point is Title case is not Sentence case, and question is what to pass out to Title transliteration when selection has been made. Should Title case with a selection affect only the selection, or should it expand selection to work at word bounds (and look like the Sentence transliteration).

The expansion of the selection is what causes grief--don't do it for consistency, honor the selection. Even if it is consistently wrong when applied to a selection in the middle of a word.
Comment 6 Heiko Tietze 2021-10-18 07:17:44 UTC
Michael assigned to the issue, so I think he got enough input from UX. More is welcome of course.
Comment 7 Commit Notification 2022-02-01 10:17:08 UTC
Michael Warner committed a patch related to this issue.
It has been pushed to "master":

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

tdf#144851 Honor Selection When Applying Title Case Format

It will be available in 7.4.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 8 Heiko Tietze 2022-02-01 14:23:27 UTC
Patch broke master and was reverted in I4c1049607e8ad71cf0ac63e1433d3d66d7709fa9
Comment 9 Michael Warner 2022-02-14 03:57:31 UTC
(In reply to Heiko Tietze from comment #8)
> Patch broke master and was reverted in
> I4c1049607e8ad71cf0ac63e1433d3d66d7709fa9

See comments in the gerrit review for some meaningful context to this statment:
https://gerrit.libreoffice.org/c/core/+/124102

As it happens,  I4c1049607e8ad71cf0ac63e1433d3d66d7709fa9 was never applied, because the test case in question was updated instead. See:
https://gerrit.libreoffice.org/c/core/+/129295
Comment 10 V Stuart Foote 2022-08-31 19:34:35 UTC
*** Bug 150725 has been marked as a duplicate of this bug. ***