Bug 54068 - The "Edit>Compare Documents" command does not detect changes in tables properly
Summary: The "Edit>Compare Documents" command does not detect changes in tables properly
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 116139 120184 (view as bug list)
Depends on:
Blocks: Writer-UX Document-Comparison
  Show dependency treegraph
 
Reported: 2012-08-26 05:40 UTC by narayanaras
Modified: 2024-10-18 07:50 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments
The "Compare documents" command cannot handle changes in a table (259.10 KB, application/x-7z-compressed)
2012-08-26 05:46 UTC, narayanaras
Details
Original.odt (23.47 KB, application/vnd.oasis.opendocument.text)
2017-07-03 08:19 UTC, Albrecht Müller
Details
Changed.odt (23.49 KB, application/vnd.oasis.opendocument.text)
2017-07-03 08:20 UTC, Albrecht Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description narayanaras 2012-08-26 05:40:39 UTC
The "Edit>Compare Documents" command does not detect changes in tables properly.

If I make a minor change in a table, Writer has the following problems:
(1) The whole table is shown as "deleted",
(2) A new table (with the changed cell) is shown as "inserted".

The impression is that Writer treats the table as atomic change (it cannot detect changes at cell/row/column level).

(3) While the Writer shows one deleted table and one inserted table, the "Accept or reject changes" window does not have related entries. 

Even if you go through all entries in this window one by one, Writer will never highlight the inserted table OR the deleted table, and offer you to accept or reject that particular change.

In other words, the earlier impression that "Writer treats entire table as a single unit" does not hold true now!

(4) The "Accept or reject changes" window can highlight only the first and last cells of inserted table; not the entire "inserted" table. 

Note that these cells may not be changed at all!

(5) The "Accept or reject changes" window can NOT highlight the deleted table at all.

(6) The actually changed cell (which should have been the SOLE focus of this exercise) is NOT highlighted at all.

To sum up, the Writer misses the entire point of highlighting just the changes, and letting the user decide whether to accept it.

*****

I conducted an experiment, in which I created a simple document with some text and a table. I duplicated that document and added a small text to one cell of the table. 

Then I compared these documents using Edit>Compare documents.
I turned on the Edit>Changes>Show option.
I also turned on the Edit>Changes>Accept or reject... option.

I took screenshot of this result, and created a third document called "analysis" to explain what exactly is wrong.

All three documents are attached.

Also see Bug#44847.
Comment 1 narayanaras 2012-08-26 05:46:14 UTC
Created attachment 66123 [details]
The "Compare documents" command cannot handle changes in a table

There are three files:
1. Original (contains free-flowing text and a table)
2. Modified (contains some small edits in both the text and table)
3. Analysis of the problem (contains annotated screenshot and analysis)
Comment 2 A (Andy) 2012-12-26 22:22:06 UTC
reproducible with LO 3.6.4.3. (Win7 Home, 64bit)

If you have in the table e.g. two changes and you want to accept one and one not then you can also not distinguish that.
Comment 3 Joel Madero 2015-05-02 15:42:37 UTC Comment hidden (obsolete)
Comment 4 Gordo 2015-05-13 23:13:16 UTC
Still reproducible.

1. New Text Document.
2. Table → Insert Table: 2 x 2.
3. Type “test” in each cell.
4. Save document.
5. Select “test” in cell A2 and delete.
6. Save document with different name.
7. Edit → Compare Document → Select first document and Open.
Result:
There are two tables.  Manage Changes shows an insertion and a deletion.  The insertion shows cells A1 and B2 highlighted.  The deletion does not highlight anything.
Expected Result:
One table with redlining showing strikethrough of “test” and Manage Changes showing a deletion.

Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Comment 5 Rusbitech 2016-02-15 16:20:16 UTC
Yes, I have revealed this bug in 5.0.2, 5.0.4 and 5.1 release. It's awfully, because there are a lot of documents including big tables.
Comment 6 Albrecht Müller 2017-07-03 08:19:00 UTC
Created attachment 134441 [details]
Original.odt
Comment 7 Albrecht Müller 2017-07-03 08:20:09 UTC
Created attachment 134442 [details]
Changed.odt
Comment 8 Albrecht Müller 2017-07-03 08:27:39 UTC
A little gift to this bugs 14th(*) birthday: Use LibreOffice Writers  "Edit -> Track changes -> Compare Document ..." feature to find out the difference between the two documents Original.odt and Changed.odt you find in the attachments. Hint: Their contents differ by a single character.


* https://issues.apache.org/ooo/show_bug.cgi?id=16398
Comment 9 Buovjaga 2018-03-10 14:27:48 UTC
*** Bug 116139 has been marked as a duplicate of this bug. ***
Comment 10 Buovjaga 2018-10-23 13:35:52 UTC
*** Bug 120184 has been marked as a duplicate of this bug. ***
Comment 11 Julien Nabet 2020-04-06 13:32:01 UTC
Michael/Miklos: It seems LO can only compare a whole table.

Here the steps I did on pc Debian x86-64 with master sources updated today:
- Created a brand new odt file
- Inserted a table 2x2
- Inserted "Test1" in each cell
- Saved the file into Test1.odt
- Changed one cell with Test2
- Saved as the file into Test2.odt
- Compared both files
=> the whole table is indicated.

I put some traces on SwCompareLine::CompareNode (see https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/doccomp.cxx?r=525f75b7#1112
"SimpleTableToText" seems to take the whole table.

Any thoughts?
(I put you both of you on cc because I didn't know whom to ping about this).
Comment 12 kkivi 2020-09-16 08:30:02 UTC
I found this problem very annoying. While this bug is not resolved for 8 years,
I propose a dirty workaround - add a command 'convert ALL tables to text', 
similar to 'convert table to text', but in a single command, so that it will be possible to at least quickly review changes.
Comment 13 Matt McCutchen 2022-12-07 14:47:33 UTC
(In reply to kkivi from comment #12)
> I propose a dirty workaround - add a command 'convert ALL tables to text', 
> similar to 'convert table to text', but in a single command, so that it will
> be possible to at least quickly review changes.

A workaround that's available today: Convert the whole document to text using a command-line tool (https://www.systutorials.com/3-ways-of-odt-to-txt-file-conversion-in-command-line-in-linux/ has a few decent options) and then diff the text files using a word-diff tool (I'm abusing "git diff --no-index --word-diff=color" since Git is available for many OSes).  That's what I'm using; it's adequate for my current needs.
Comment 14 Gerry 2024-10-17 07:11:21 UTC
This bug still persists in LO 24.2. A single change in a table still marks the *entire* table as added/deleted when using "Compare documents". This is a big pain-point when working on documents in teams. 

I need to compare documents frequently and this use case still makes it necessary to use MS Word (in Wine) in order to compare tracked changes in documents with tables.  


Version: 24.2.6.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: en-CA (en_CA.UTF-8); UI: en-US
Ubuntu package version: 4:24.2.6-0ubuntu0.24.04.1
Calc: threaded