Bug 139987 - Italic and strikethrough do not work with Tools > AutoCorrect > Apply, when using Automatic *bold*, /italic/, -strikeout- and _underline_ option in AutoCorrect
Summary: Italic and strikethrough do not work with Tools > AutoCorrect > Apply, when ...
Status: RESOLVED DUPLICATE of bug 117651
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+ Master
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2021-01-29 01:19 UTC by sdc.blanco
Modified: 2021-01-30 16:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test document (9.04 KB, application/vnd.oasis.opendocument.text)
2021-01-30 16:11 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sdc.blanco 2021-01-29 01:19:26 UTC
According to https://help.libreoffice.org/7.2/en-US/text/shared/01/06040100.html

Automatic *bold*, /italic/, -strikeout- and _underline_

Automatically applies bold, italic, strikethrough or underline formatting to text enclosed by asterisks (*), slashes (/), hyphens (-), and underscores (_), respectively. These characters disappear after the formatting is applied.
	

0. Tools > AutoCorrect > AutoCorrect Options - Options tab
   uncheck all [T] and [M] fields, except for 
   "Capitalize first letter of every sentence"


For [M]
1. Use "Default Paragraph Style" for all tests (because does not work with other PS).

2. Tools > AutoCorrect > While Typing (disabled)

3. Mark-up -- following "help" 

4. Tools > AutoCorrect > Apply

Actual result:  

bold and underline (almost OK), but the last character is not formatted.

italic and strikethrough do not work.



For [T]

1. Tools > AutoCorrect > While Typing (enabled)
2. mark-up - following "help"

Actual result:

bold and underline worked as described
italic and strikethrough did not work

worked for the 3 or 4 different PS that I tried (unexpected, but good)
Comment 1 sdc.blanco 2021-01-29 01:22:15 UTC
Correction to step 0 in comment 0:  The only selected option should be:
   Automatic *bold*, /italic/, -strikeout- and _underline_
Comment 2 BogdanB 2021-01-29 22:04:36 UTC
I unchecked everything except that line and everything works normal for all 4.

Tested in
Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: f2389a70da606768a39ee599de6a5b24058734aa
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 3 BogdanB 2021-01-29 22:09:06 UTC
I let all 2 options activated T and M for that 4 options. In the same time, and this way is working well.
Comment 4 sdc.blanco 2021-01-30 12:12:37 UTC
Have attempted again -- now in Safe Mode -- 

Setup:

Only [T) and [M] options enabled for "Automatic *bold*, /italic/, -strikeout- and _underline_"  in AutoCorrect Options (all others unchecked)

Make sure to "Apply" only on Default PS.

1.  No problems with "While Typing"  [T]   
    (and works with all kinds of PS)

2.  Two problems with manual (Tools > AutoCorrect > Apply) [M]

  a.  /italic/ does not work
  b.  -strikethrough- does not work
      
      (no problems with *bold* or _underline_)

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 86c8c775bbefe333d684e12c99855a3c1de68051
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: default; VCL: win
Locale: en-US (en_DK); UI: en-US
Calc: threaded

Is it a Windows only problem?
Comment 5 V Stuart Foote 2021-01-30 16:05:42 UTC
(In reply to sdc.blanco from comment #4)

Confirm findings 1. & 2.

> 
> Is it a Windows only problem?

No, Fedora 33 as VM has exact issue.

Version: 7.0.4.2 (x64)
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Version: 7.0.2.2
Build ID: 00(Build:2)
CPU threads: 1; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 6 V Stuart Foote 2021-01-30 16:11:27 UTC
Created attachment 169307 [details]
test document

Simple one line tests of each "markdown" type.

Select each in turn and apply: Tools -> Autocorrect -> Apply
Comment 7 sdc.blanco 2021-01-30 16:24:46 UTC
SvxAutoCorrect::FnChgWeightUnderl

https://opengrok.libreoffice.org/xref/core/editeng/source/misc/svxacorr.cxx?r=94306083#756

(interesting function name, given that it only seems to work with Weight and Underl, even though Posture and Strikeout are also included)
Comment 8 V Stuart Foote 2021-01-30 16:58:43 UTC
Wait this is a duplicate of bug 117651, the italic (/) and strikethrough (-) were added to master against 5.4.0. But as Mike K points out in dupe, looks to have an implementation error.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=6bfe94a631b5c5029a1f96a52b000d25e33bad4a

https://gerrit.libreoffice.org/c/core/+/31076
https://gerrit.libreoffice.org/c/core/+/37127

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