Bug 54819 - EDITING: with "track changes" the paragraph following a deleted paragraph changes its style
Summary: EDITING: with "track changes" the paragraph following a deleted paragraph cha...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0 target:6.4.0
Keywords:
: 61239 (view as bug list)
Depends on:
Blocks: Track-Changes
  Show dependency treegraph
 
Reported: 2012-09-12 15:31 UTC by stfhell
Modified: 2023-02-02 12:49 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document to illustrate formatting bug when deleting a paragraph (11.07 KB, application/vnd.oasis.opendocument.text)
2012-09-12 15:31 UTC, stfhell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stfhell 2012-09-12 15:31:48 UTC
Created attachment 67055 [details]
Sample document to illustrate formatting bug when deleting a paragraph

Deleting a complete paragraph with "track changes" (redlining) enabled applies the paragraph style of the paragraph being deleted to the following paragraph.

Reproduce:

The attached document Redline_delete_paragraph.odt has a chapter heading and 2 text paragraphs.
Turn on "track changes" if it is turned off (and also enable "show changes", if necessary).
Delete the first paragraph with the chapter heading by marking the complete text line "Delete this paragraph including new-line and save file" _plus_ the following "character" (i.e. the new-line marker).
Either save the file or disable "show changes".
The text paragraph following the deleted paragraph is reformatted in the heading paragraph style of the deleted paragraph.


When you save the document as DOC, you can delete the entire first paragraph without having the following paragraph reformatted. (If you disable "show changes" for the DOC file, the bug shows again, however.)

The only way to retain the format of the document as it's supposed to be is
- either to delete only the text part of the paragraph - but then after accepting all tracked changes there remain all those empty paragraphs in the document;
- or to change the format of the paragraph to be deleted before deleting it (to the format that the following paragraph should have) - which is undesirable if you reject the tracked changes or want to view the deleted text properly.

I am reporting this bug for LO 3.4.4/Linux 64bit, but has been present in OpenOffice and LibreOffice for years.
Comment 1 A (Andy) 2012-12-27 20:05:03 UTC
reproducible with LO 3.6.4.3. (Win7 Home, 64bit)

But actually these are two cases with bugs.

Case 1: Select in the attached sample text with left mouse clicking beginning with the word "Delete" until the end of the first paragraph ending with the word "simultaneously", but do not stop and go on with the mouse into the next line before the word "Whether", but without selecting this following line or this word "Whether" (the cursor should blink before the "W" of the word "Whether").  Then delete the selected text and the deletion will be shown by the record changes function.  Now save this file and you will see that the following paragraph will be reformatted to Heading 1.  It is necessary to save this file.  If you would accept the changes before saving then the bug would not occur.  

Case 2: Select in the attached sample text with left mouse clicking beginning with the word "Delete" until the end of the first paragraph ending with the word "simultaneously", but now do not go to the next line, stop after the word "simultaneously" (the cursor should blink after the "y." of the word "simultaneously").  Then delete the selected text and the deletion will be shown by the record changes function.  For this case it does not matter whether you save the file or not.  Then accept the changes.  Afterwards, you will see an empty line before the new first paragraph which is also formatted as Heading 1.
Comment 2 Harald Koester 2013-08-16 08:40:40 UTC
*** Bug 61239 has been marked as a duplicate of this bug. ***
Comment 3 Harald Koester 2013-08-16 08:44:18 UTC
Reproduced with Version 4.0.1.4. and 3.5.3 on Win7. Hence Platform changed to "All".
Comment 4 Jürgen Sanne 2013-11-19 17:29:57 UTC
Reproducable with Version 4.1.2.3 and 4.1.3.2 on Win7

Remark to case 2:
This behaviour is independent of "track changes" (redlining) enabled or not.
Comment 5 QA Administrators 2016-01-17 20:04:21 UTC Comment hidden (obsolete)
Comment 6 Harald Koester 2016-01-18 18:51:54 UTC
Bug still exists in version 5.0.4 with Win7.
Comment 7 Jürgen Sanne 2016-06-12 14:10:12 UTC Comment hidden (obsolete)
Comment 8 Jürgen Sanne 2017-04-14 11:36:49 UTC
Still reproducable with Version 5.3.1.2 (x64) on Win7.
Tested according to comment#1 and comment#4.
Comment 9 QA Administrators 2018-04-15 02:31:29 UTC Comment hidden (obsolete)
Comment 10 Jürgen Sanne 2018-04-18 17:12:41 UTC
Faulty behaviour still present with Version 6.0.3.2 (x64)
Build-ID: 8f48d515416608e3a835360314dac7e47fd0b821
CPU-Threads: 8; BS: Windows 6.1; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group on Win7.
Tested according to comment#1 and comment#4.

Additionally retested it with old version LibreOffice 3.3.0 
OOO330m19 (Build:6) 
tag libreoffice-3.3.0.4 on Win7. 
It was present, therefor version changed to 'inherited from OOo'.
Comment 11 Commit Notification 2018-09-05 05:41:38 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=22639148ae5400bac98f32a75d7431b857c80195

tdf#54819 change tracking: keep paragraph style after full deletion

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Jürgen Sanne 2019-04-08 11:20:17 UTC
Tested both cases (see comment#1) with Version: 6.2.2.2 (x64)
Build-ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
CPU-Threads: 8; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: CL:

Case 1:
When deleting the heading of the first paragraph as described in comment#1 case 1, the format of the heading is reset from heading 1 to text. This is not correct.

If you want to cancel the change, the sentence will not be rebuild with the correct format, it remains in the text format. This is not correct.

Case 2:
When deleting the heading together with the first paragraph as described in comment#1 case 2, the format of the heading is reset from heading 1 to text, too. This is not correct.

Furthermore you can't roll back with <CTRL>-Z in both cases.

If you want to cancel/revert the change, the heading marked for deletion will not be rebuild to the correct format, it remains in the text format. This is not correct. It should stay in the same format if it is marked to be deleted.
Comment 13 Harald Koester 2019-04-08 17:39:24 UTC
(In reply to Jürgen Sanne from comment #12)
> Tested both cases (see comment#1) with Version: 6.2.2.2 (x64)
> Build-ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
> CPU-Threads: 8; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
> Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
> Calc: CL:
> 
> Case 1:
> When deleting the heading of the first paragraph as described in comment#1
> case 1, the format of the heading is reset from heading 1 to text. This is
> not correct.
> 
> If you want to cancel the change, the sentence will not be rebuild with the
> correct format, it remains in the text format. This is not correct.
> 
> Case 2:
> When deleting the heading together with the first paragraph as described in
> comment#1 case 2, the format of the heading is reset from heading 1 to text,
> too. This is not correct.
> 
> Furthermore you can't roll back with <CTRL>-Z in both cases.
> 
> If you want to cancel/revert the change, the heading marked for deletion
> will not be rebuild to the correct format, it remains in the text format.
> This is not correct. It should stay in the same format if it is marked to be
> deleted.

I can confirm all your observations. But why did you change this bug to VERIFIED WONTFIX?
Comment 14 Jürgen Sanne 2019-04-08 17:43:07 UTC
(In reply to Harald Koester from comment #13)
> (In reply to Jürgen Sanne from comment #12)
> > Tested both cases (see comment#1) with Version: 6.2.2.2 (x64)
> > Build-ID: 2b840030fec2aae0fd2658d8d4f9548af4e3518d
> > CPU-Threads: 8; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
> > Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
> > Calc: CL:
> > 
> > Case 1:
> > When deleting the heading of the first paragraph as described in comment#1
> > case 1, the format of the heading is reset from heading 1 to text. This is
> > not correct.
> > 
> > If you want to cancel the change, the sentence will not be rebuild with the
> > correct format, it remains in the text format. This is not correct.
> > 
> > Case 2:
> > When deleting the heading together with the first paragraph as described in
> > comment#1 case 2, the format of the heading is reset from heading 1 to text,
> > too. This is not correct.
> > 
> > Furthermore you can't roll back with <CTRL>-Z in both cases.
> > 
> > If you want to cancel/revert the change, the heading marked for deletion
> > will not be rebuild to the correct format, it remains in the text format.
> > This is not correct. It should stay in the same format if it is marked to be
> > deleted.
> 
> I can confirm all your observations. But why did you change this bug to
> VERIFIED WONTFIX?
Was it wrong? What would be the expected status? REOPEN?
Comment 15 Jürgen Sanne 2019-04-08 17:53:49 UTC
Sorry, I had chnaged the bug to a wrong status. REOPENED is the better choice.
Comment 16 Commit Notification 2019-06-24 07:38:44 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/b69c518df68ce673b28d589da6626bd3d860f309%5E%21

tdf#54819 keep style & numbering at tracked deletion

It will be available in 6.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 17 László Németh 2019-06-24 08:03:59 UTC
Now the improved workaround supports Undo (Ctrl-Z), so the behavior of wholly paragraph deletion is the same as without change tracking: the paragraph after the deletion keeps its style, numbering and direct formatting, without inheriting the direct and other formatting of the deleted paragraph.

Currently the workaround needs style copying for the deletion, losing the original style of the first paragraph of the deletion at saving. This needs an other bug report (and there are a few of them already: see Bug 125311 and Bug 125984 about numbering). [As a similar, but original problem, the recent OpenDocument implementation of LibreOffice doesn't support rejection of tracked formatting only changes, see Bug 58813.]
Comment 18 Xisco Faulí 2019-08-02 13:10:07 UTC
The deleted paragraph changed its style in

Version: 6.3.1.0.0+
Build ID: 8b81a453b22611f25674f5e44ae411d78c2fcada
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

but not in

Version: 6.4.0.0.alpha0+
Build ID: 620fff54ca9cd04459cc5d963ef94d4438129fe4
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

Fixed by
https://gerrit.libreoffice.org/plugins/gitiles/core/+/1aac73a1fb260e4c76a483a68f003913fdd2c4bb

@Lásló, Two questions:
1. Should we create a unittest for it?
2. Should it be backported to 6.3 ?