Bug 139922 - Tools > Autocorrect > Apply with "Capitalize first letter in every sentence" [M] does not work on first sentence of a document following an initial empty paragraph
Summary: Tools > Autocorrect > Apply with "Capitalize first letter in every sentence" ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected) Master
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
Reported: 2021-01-26 10:51 UTC by sdc.blanco
Modified: 2021-02-17 17:14 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2021-01-26 10:51:06 UTC
0. Tools > AutoCorrect > AutoCorrect Options - Options tab
   uncheck all [T] fields.  uncheck all [M] fields, except for 
   "Capitalize first letter of every sentence"

1.  Use "Default Paragraph Style" for all tests.

Test 1.

1. Open New Document.
2. On first line of document, write:  this is a sentence.   
3. Tools > AutoCorrect > Apply

Actual and Expected result:  "this" is changed to "This"

Test 2. 

1. Open New Document
2. Press Enter
3. on second line of document, write:  this is a sentence.
4. Tools > AutoCorrect > Apply

Actual result:  No change.
Expected result:  "this" --> "This"

Test 3. 

1. Open New Document
2. Press Enter
3. on second line of document, write:  this is a sentence. this is another.
4. Tools > AutoCorrect > Apply

Actual result:  The first "this" does not change.  The second "this" -> "This"
Expected result:  Both "this" --> "This"

Additional information:  
 - have also conducted these tests with longer paragraph (dt F3), with same results.
 - afterwards tried again with all settings unchecked in Localized Options, with same results
 - Does not matter if there are spaces or tabs before the first sentence (or not).  
 - Critical feature seems to be "first sentence" in paragraph (and not top of page).

Tested with:
Version: (x64) / LibreOffice Community
Build ID: 86c8c775bbefe333d684e12c99855a3c1de68051
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DK); UI: en-US
Calc: threaded
Comment 1 V Stuart Foote 2021-01-26 16:31:20 UTC
Confirmed. But, note that the Default PS of the text in now 2nd paragraph is changed to Text Body PS, so an autoformat was applied. 

Just not the AF capitalization of the first sentence following an initial empty paragraph. Subsequent empty paragraphs do not affect capitalization of following paragraphs.
Comment 2 sdc.blanco 2021-01-29 15:43:03 UTC
 // Capitalize first letter of every sentence
844  void SvxAutoCorrect::FnCapitalStartSentence

Comment 3 V Stuart Foote 2021-01-29 17:04:02 UTC
Suspect work on bug 108795 making the autocorrect stateful in the SvxAutoCorrect::DoAutoCorrect


This issue does not occur in a build of on hand, but needs a proper bibisect.
Comment 4 raal 2021-02-17 17:13:47 UTC
This seems to have begun at the below commit.
Adding Cc: to Michael Stahl ; Could you possibly take a look at this one?
01607703b961a83952bb39822a023c4d75c3136c is the first bad commit
commit 01607703b961a83952bb39822a023c4d75c3136c
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Fri Dec 7 19:26:05 2018 +0100

    source sha:4cf5a46f16dec8ce16c6662ce5c17903e28b8fa3

commit	4cf5a46f16dec8ce16c6662ce5c17903e28b8fa3	[log]
author	Michael Stahl <Michael.Stahl@cib.de>	Wed Nov 28 15:51:02 2018 +0100
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	Fri Dec 07 13:08:58 2018 +0100
tree	e65deb9f6801c6b45ad5cbdebb1d6baaae51a969
parent	180e5f515c9cd21fb8057c797a480eca7d9ed260 [diff]

sw_redlinehide_4a: SwAutoCorrDoc iterates frames, not nodes
Comment 5 raal 2021-02-17 17:14:20 UTC
bisected Test 2.