Bug 139986 - Some problems with "Delete spaces and tabs at beginning and end of paragraph" option in AutoCorrect
Summary: Some problems with "Delete spaces and tabs at beginning and end of paragraph"...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2021-01-28 23:28 UTC by sdc.blanco
Modified: 2023-05-15 13:29 UTC (History)
2 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 sdc.blanco 2021-01-28 23:28:03 UTC
0. Tools > AutoCorrect > AutoCorrect Options - Options tab
   uncheck all [T] fields.  uncheck all [M] fields, except for 
   "Delete spaces and tabs at end and start of paragraph" 

1. Be sure to use "Default Paragraph Style" for all tests (because does not work with other PS)

2.  Make some paragraphs with spaces and tabs at beginning and end (dt F3 is handy)

3.  Tools > AutoCorrect > Apply  (can be handy to make a keyboard shortcut for testing)

Problems with Help

According to:  https://help.libreoffice.org/7.2/en-US/text/shared/01/06040100.html

Delete spaces and tabs at beginning and end of paragraph

Removes spaces and tabs at the beginning of a paragraph. To use this option, the Apply Styles option must also be selected. 

Two Problems.
H1.  For [M], do not need to use "Apply Styles"
H2.  Spaces and tabs at end are deleted (as the option says), but help page does not mention "end".


Problems with Implementation
I1. If a paragraph starts with a digit followed by a period (and with spaces/tabs), then spaces/tabs are removed, but the paragraph is assigned "Numbering 1" PS.  

I2.  If a paragraph starts with spaces or tab or both, it is converted to "First Line Indent" PS (with the spaces/tabs) removed.

In both these two cases -- given that the option is to remove spaces/tabs -- then it should not be changing to these PS.
    - the first is closer to "Bulleted and numbered lists" option, which is supposed to be for [T] only; 
    - I2 is particularly bad -- more or less undercutting the utility of the option. It has presupposed that a space or tab means an intention for First Line Indent, when a main reason to want to use this option is to remove spaces and tabs, not to convert to an indent!
    - no need to mention that otherwise this option converts to Text Body PS (bug 90507)

I3.  Paragraphs that consist only of spaces and tabs (in different combinations) do not have spaces and tabs removed (i.e., nothing seems to happen) 

     Expected (and desired) that the spaces and tabs are removed, because then AC could be used to "clean up" a document (or selection) that has empty paragraphs with spaces and tabs.


Have not tried to "exhaust" possible problems.  There may be others (e.g., some of the other options have trouble depending on the context (e.g., a blank before or not before), but this selection should be enough to motivate the need for a critical review of the operations of this option.  

It seems like a good thing to have an option (that can be applied manually, on a whole document or a selection) to remove tabs and spaces at the start and end of the paragraph -- and even better if it did what its label suggests.
Comment 1 Stéphane Guillou (stragu) 2023-05-15 13:29:15 UTC
Thanks Seth.

(In reply to sdc.blanco from comment #0)

> Two Problems.
> H1.  For [M], do not need to use "Apply Styles"

Still current.

> H2.  Spaces and tabs at end are deleted (as the option says), but help page
> does not mention "end".

Still current.
 
> Problems with Implementation
> I1. If a paragraph starts with a digit followed by a period (and with
> spaces/tabs), then spaces/tabs are removed, but the paragraph is assigned
> "Numbering 1" PS.  

Reproduced, happens even if the "Bulleted and numbered lists" option if off (which should apply only while typing anyway).

> I2.  If a paragraph starts with spaces or tab or both, it is converted to
> "First Line Indent" PS (with the spaces/tabs) removed.

Reproduced, but I get "Body text, indented" (previously "Text Body Indent") or "Hanging Indent" depending on the case. Issue remains.

> I3.  Paragraphs that consist only of spaces and tabs (in different
> combinations) do not have spaces and tabs removed (i.e., nothing seems to
> happen) 
> Expected (and desired) that the spaces and tabs are removed, because
> then AC could be used to "clean up" a document (or selection) that has empty
> paragraphs with spaces and tabs.

Reproduced and agreed.

In a recent master build:

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 73b35219cc9ed42072506ed18a5767f072e1da02
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

As well as:

Version: 6.0.0.3
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk2; 
Locale: en-AU (en_AU.UTF-8); Calc: group