Bug 63432 - FORMATTING: "Change Case" does not work in some situations when symbols appear
Summary: FORMATTING: "Change Case" does not work in some situations when symbols appear
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 57397 79605 (view as bug list)
Depends on:
Blocks: Character CaseFolding
  Show dependency treegraph
 
Reported: 2013-04-11 15:37 UTC by webofht-libreofficebugs002
Modified: 2023-10-14 16:51 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document showing text containing symbols (13.41 KB, application/vnd.oasis.opendocument.text)
2013-04-11 15:40 UTC, webofht-libreofficebugs002
Details
Test change case (8.66 KB, application/vnd.oasis.opendocument.text)
2014-02-11 09:27 UTC, Ákos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description webofht-libreofficebugs002 2013-04-11 15:37:15 UTC
Problem description: If a symbol such as the open quotation mark appears right before a word, the following “Format → Change Case” functions do not work as expected.


Steps to reproduce:
I save this attached file using LibreOffice Version 4.0.2.2 (Build ID: 4c82dcdd6efcd48b1d8bba66bfe1989deee49c3)

Select the text (including the symbol) → Format 
→ Change Case → Sentence case → (It does not work)

Select the text (including the symbol) → Format 
→ Change Case → Capitalize Every Word → (It does not work)

Select the text (including the symbol) → Format 
→ Change Case → tOGGLE cASE → (It does not work)

Sample text:
hi! 'quotation marks' may cause the problem
hi! “quotation marks” may cause the problem
hi! "quotation marks" may cause the problem
hi! (brackets mmm...) may cause the problem
hi! [square brackets mmm...] may cause the problem
hi! *asterisks may cause the problem
hi! -minuses may cause the problem

'quotation marks' may cause the problem
“quotation marks” may cause the problem
"quotation marks" may cause the problem
(brackets mmm...) may cause the problem
[square brackets mmm...] may cause the problem
*asterisks may cause the problem
-minuses may cause the problem


Current behavior: The three specified "Change Case" features do not work.

Expected behavior: These three specified "Change Case" features should work.


Potential problem in the programming code (a guess): Nothing checks the symbol.

Potential solution (a guess): Add a checking function (e.g. using regular expressions, etc.) to check the first character of each word first for the symbol. If the symbol exists, check the next character for another symbol until a letter appears. When the letter appears, apply the format. This could be one of the new Easy Hacks.

I hope that this will help you to solve the programming problems.

Regards,
C. H. D.
Comment 1 webofht-libreofficebugs002 2013-04-11 15:40:13 UTC
Created attachment 77818 [details]
Sample document showing text containing symbols
Comment 2 Joel Madero 2013-04-11 16:50:57 UTC
Thank you for reporting this issue! I have been able to confirm the issue on:
Version 3.6.5.2 
Platform: Bodhi Linux 2.2 x64
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
As I've been able to confirm this problem on an earlier release I am changing the version number as version is the earliest version that we can confirm the bug, we use comments to say that the bug exists in newer versions as well.

Marking as:

New (confirmed)
Minor - doesn't prevent high quality work but slows it down
Low - default seems appropriate, not a hugely used feature, only happens with symbols


Note: Easiest way to see all of these issues is to highlight everything and apply the formatting styles, you'll see what works and what doesn't.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:
https://wiki.documentfoundation.org/QA/BugTriage

There are also other ways to get involved including with marketing, UX, documentation, and of course developing -  http://www.libreoffice.org/get-help/mailing-lists/. 

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
Comment 3 Ákos 2014-02-11 09:27:12 UTC
Created attachment 93852 [details]
Test change case

I can reproduce Change Case problems without symbols:
1. Select all the test from file Change Case
2. Select Format -> Change Case -> UPPERCASE
3. Select Format -> Change Case -> tOGGLE cASE

The result is all lowercase, and if you test in random order the 5 Change Case options (Sentence case, lowercase, UPPERCASE, Capitalize Every Word tOGGLE cASE), the result is not in all case, that you expect.

I can reproduce the bug in LibreOffice 4.1.4.2 and 4.2.0.4
Comment 4 tommy27 2014-06-04 05:08:21 UTC
*** Bug 57397 has been marked as a duplicate of this bug. ***
Comment 5 tommy27 2014-06-04 05:12:34 UTC
*** Bug 79605 has been marked as a duplicate of this bug. ***
Comment 6 tommy27 2014-06-04 05:18:55 UTC
I think the root of the problem is that if you have a sentence like:

"hello world"

and you apply the first letter capitalization, LibO sees the quotation mark (or any other symbol) as the first letter and capitalizes it (you won't notice any visual difference since there's no upper/lower case for those symbols) instead of letter h which is actually seen as the second letter

maybe developers should tweak the code and put an exception to skip those symbols as first letters in a sentence and apply capitalization to the very first letter of a word.

the issue is inherited from OOo and affects AOO 4.1 as well.

I add Writer developer to CC list to hear advice from him.
Comment 7 Ákos 2014-06-04 06:15:33 UTC
I can reproduce with LibreOffice 4.3.0.0beta1
Comment 8 QA Administrators 2015-06-08 14:42:32 UTC Comment hidden (obsolete)
Comment 9 Buovjaga 2015-08-02 10:13:31 UTC
Confirmed with attachment 77818 [details]

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 902255645328efde34ddf62227c8278e8dd61ff0
TinderBox: Win-x86@39, Branch:master, Time: 2015-07-30_03:52:07
Locale: en-US (fi_FI)
Comment 10 QA Administrators 2016-09-20 10:21:29 UTC Comment hidden (obsolete)
Comment 11 QA Administrators 2021-02-24 04:05:18 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2023-02-25 03:24:06 UTC Comment hidden (obsolete)
Comment 13 Tex2002ans 2023-10-14 16:28:59 UTC
I confirm this is still an issue in:

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 56f7684011345957bbf33a7ee678afaf4d2ba333
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

I used the document in Comment #9.

- - -

These 2 seem correct:

- Format > Text > Capitalize Every Word
- Format > Text > tOGGLE cASE

but this one is partially broken:

- Format > Text > Sentence Case

- - -

I think tommy27 put his finger on it in Comment #6... it seems like LO currently says:

- If the first character in sentence is punctuation...
   - Do nothing.
   - (Or "Capitalize the punctuation"... which does nothing.)

When it should be:

- If first character in sentence is punctuation...
   - Find the next valid character/letter to capitalize.

- - -

I also tested Steps 1–3 in Comment #3 by Ákos:

- That now works fine.