Bug 142701 - EDITING Support change tracking deletion of images anchored to character
Summary: EDITING Support change tracking deletion of images anchored to character
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: László Németh
URL:
Whiteboard: target:7.3.0 target:7.2.0.2
Keywords: implementationError
Depends on:
Blocks: Track-Changes-Image
  Show dependency treegraph
 
Reported: 2021-06-07 08:42 UTC by NISZ LibreOffice Team
Modified: 2021-08-03 10:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the original document in Writer (104.63 KB, image/png)
2021-06-07 08:42 UTC, NISZ LibreOffice Team
Details
Screenshot of the problem in Writer (126.95 KB, image/png)
2021-06-07 08:42 UTC, NISZ LibreOffice Team
Details
attachment 172666 after deleting one image with TC enabled (120.46 KB, application/vnd.oasis.opendocument.text)
2021-06-07 08:48 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2021-06-07 08:42:16 UTC
Created attachment 172671 [details]
Screenshot of the original document in Writer

This is a followup to bug #142699
When an image is anchored to character in a file with change tracking enabled and then deleted, its anchoring changes to “As character”. This changes the document layout a bit, and after rejecting the deletion is not reverted to “To Character” anchoring.

This is side effect from fixing bug #59463 I think, changing anchoring was considered the lesser evil compared to not change tracking such images, but it would be better to not change the anchoring.

Steps to reproduce:
    1. Open attachment 172666 [details] 
    2. Select any of the images and press Delete
    3. Reject the change

Actual results:
The image anchoring changed after deleting in step 2 and was not restored after step 3.

Expected results:
No anchoring change in step 2, document layout is the same after CT-deleting an image and rejecting the change.

LibreOffice details:
Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 3b57ebb445df8a2bc3d916ea79f8af45e20e4e62
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 1 NISZ LibreOffice Team 2021-06-07 08:42:38 UTC
Created attachment 172672 [details]
Screenshot of the problem in Writer
Comment 2 NISZ LibreOffice Team 2021-06-07 08:48:18 UTC
Created attachment 172673 [details]
attachment  172666 [details] after deleting one image with TC enabled
Comment 3 Dieter 2021-06-22 07:01:03 UTC
(In reply to NISZ LibreOffice Team from comment #0)

> Steps to reproduce:
>     1. Open attachment 172666 [details] 
>     2. Select any of the images and press Delete

Writer crashes
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: de7356c2e0cb099fac396808b5a86a0393b48e5f
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL


Also happens with a new file. Bug might be fixed in a more recent version of master. Will test it later.
Comment 4 NISZ LibreOffice Team 2021-06-22 14:55:38 UTC
(In reply to Dieter from comment #3)
> (In reply to NISZ LibreOffice Team from comment #0)
> 
> > Steps to reproduce:
> >     1. Open attachment 172666 [details] 
> >     2. Select any of the images and press Delete
> 
> Writer crashes
> Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: de7356c2e0cb099fac396808b5a86a0393b48e5f
> CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL:
> win
> Locale: de-DE (de_DE); UI: en-GB
> Calc: CL
> 
> 
> Also happens with a new file. Bug might be fixed in a more recent version of
> master. Will test it later.

I don't get a crash with yesterdays nightly:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 2a7e64da7f385de8dbba1802530e251cf29259fb
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 5 Aron Budea 2021-06-27 00:15:53 UTC
Confirmed in LO Version: 7.3.0.0.alpha0+ (51754ca5349d7bf655d57ded37381188d0bc4bcf) / Ubuntu.
Comment 6 Commit Notification 2021-07-13 11:32:11 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b50d386dfa70f7c1d4eb1a49091ec9dd782b767b

tdf#142701 track changes: fix layout regression of image deletion

It will be available in 7.3.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 7 László Németh 2021-07-13 11:47:59 UTC
tdf#142701 track changes: fix layout regression of image deletion

Commit d6322bcedc197a654abc7d64bfea8cf570f123bf
(tdf#59463 track changes: record deletion of images) converted
image anchors to AS_CHAR, which resulted loss of the original
layout during rejecting the tracked image deletion.

Now keep the original AT_CHAR (also AS_CHAR) anchorings, also convert
the AT_PARA and other anchoring types to AT_CHAR using the following
workaround: add an invisible text-based anchoring point with ZWJs.

Follow-up to commit 8726cf692299ea262a7455adcf6ec25451c7869d
(tdf#142700 DOCX: fix lost track changes of images).
Comment 8 Commit Notification 2021-07-13 14:52:16 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/1e3340a6ac8511d35f7520261fa14a99a9bef4c4

tdf#142701 track changes: fix layout regression of image deletion

It will be available in 7.2.0.2.

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 9 NISZ LibreOffice Team 2021-08-03 10:24:55 UTC
Verified in: 

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: ad1b12686da88bea57582df10fa85268ada209b8
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded