Absolutely Unexpected or Incorrect Change Revisions (internal ref. 39757 )

Hi,

After comparing the attached documents, we get a completely unexpected set of change revisions.

In essence, a new paragraph was added to the document and the number in the third paragraph was changed (see attached image). That’s all the changes.

When we go over all the changes and summarize them, it will look as follows:

1. Inserted Paragraph. Revision 50:

AAAOrganization1 détient également depuis le DateTime3   Quantity2  du capital de la société Organization3, concessionnaire d’une section de Quantity3  de l’A8989 entre Location2 dans Location Location3  dans la Location4  , qui a été intégralement mise en service en DateTime4.

Au total, le réseau couvre 2 987

2. Deleted Text(Runs). Revisions 51-52:

Au total, le réseau couvre 2 324

3. Inserted Text(Runs). Revisions 53-76:

AAAOrganization1 détient également depuis le DateTime3   Quantity2  du capital de la société Organization3, concessionnaire d’une section de Quantity3  de l’A8989 entre Location2 dans Location Location3  dans la Location4  , qui a été intégralement mise en service en DateTime4.

4. Inserted Paragraph. Revisions 77-79:

AAAOrganization1 détient également depuis le DateTime3   Quantity2  du capital de la société Organization3, concessionnaire d’une section de Quantity3  de l’A8989 entre Location2 dans Location Location3  dans la Location4  , qui a été intégralement mise en service en DateTime4.

Au total, le réseau couvre 2 987

Which doesn’t quite correlate with the changes that were actually made and looks like something broke along the way.


39757.zip (51.6 KB)

@dkorolev I have check comparison of your documents using MS Word and in the resulting document there are also more then two revisions as it is expected:
ms.docx (42.1 KB)

Disabling formatting changes comparison and setting granularity to char level gives more or less the expected result:

CompareOptions opt = new CompareOptions();
opt.Granularity = Granularity.CharLevel;
opt.IgnoreFormatting = true;

Document v1 = new Document(@"C:\Temp\v1.docx");
Document v2 = new Document(@"C:\Temp\v2.docx");
v1.Compare(v2, "test", DateTime.Now, opt);
v1.Save(@"C:\Temp\out.docx");

out.docx (21.5 KB)

I added the options that you indicated, it did somehow affect the results, but I can’t say that it made them more expected.

Here are some examples:

1. Insertion, paragraph (Rev. 24):

AAOrganization1 détient également depuis le DateTime3 Quantity2 du capital de la société Organization3, concessionnaire d’une section de Quantity3 de l’A8989 entre Location2 dans Location Location3 dans la Location4 , qui a été intégralement mise en service en DateTime4.

Au total, le r

2. Run Delition (Rev. 25)

u total, le r

I don’t understand how from these “excerpts” of text it is possible to reconstruct a more or less understandable history of changes that could be shown to the user

@dkorolev Compare function is not intended to provide a history of changes made to the document. It provides a list of differences between the documents, just like MS Word does upon comparing documents. In Aspose.Words compare feature we are trying to mimic MS Word behavior upon comparing documents not more.