Revisoin not working properly

TEST DOCUMENT.docx (14.8 KB)

attached document have one Revision. But this Revision have two step. First User add that text and second user delete that text. Now when I reject this revision it deleted line. Can you help me here

@Vipin_Paliwal Thank you for reporting this problem to us, For a sake of correction it has been logged as WORDSNET-23876. We will keep you informed and let you know once it is resolved or we have additional information for you.

Hi Team, Please update

@Vipin_Paliwal The issue is currently is in a que for analysis. Once analysis is done we will provide you more information.

The issues you have found earlier (filed as WORDSNET-23876) have been fixed in this Aspose.Words for .NET 22.6 update also available on NuGet.

Hi Team,

is there any way to identified, Revision have two leveal.

@Vipin_Paliwal You can identify whether several revisions are applied to the same node. For example see the following code:

Document doc = new Document(@"C:\Temp\in.docx");

Dictionary<Node, List<Revision>> nodeToRevisionsMap = new Dictionary<Node, List<Revision>>();

foreach (Revision r in doc.Revisions)
{
    if (!nodeToRevisionsMap.ContainsKey(r.ParentNode))
        nodeToRevisionsMap.Add(r.ParentNode, new List<Revision>());

    nodeToRevisionsMap[r.ParentNode].Add(r);
}

foreach (Node key in nodeToRevisionsMap.Keys)
{
    Console.WriteLine(key.NodeType);
    Console.WriteLine(key.ToString(SaveFormat.Text).Trim());

    foreach (Revision r in nodeToRevisionsMap[key])
        Console.WriteLine("\t{0}", r.RevisionType);
}

In your case the Run node with text “TEST SAMPLE DATA” has two revisions - insertion and deletion.

Hi Team,

How I delete one revision ?
Because when I try to reject one revision it reject both revision.
Below code I use to delete one revision

foreach (Aspose.Words.Revision r in doc.Revisions)
{
    if (!nodeToRevisionsMap.ContainsKey(r.ParentNode))
        nodeToRevisionsMap.Add(r.ParentNode, new List<Aspose.Words.Revision>());

    nodeToRevisionsMap[r.ParentNode].Add(r);
}

foreach (Aspose.Words.Node key in nodeToRevisionsMap.Keys)
{
    Console.WriteLine(key.NodeType);
    Console.WriteLine(key.ToString(Aspose.Words.SaveFormat.Text).Trim());

    if (nodeToRevisionsMap[key].Count > 1)
    {
        Aspose.Words.Revision r = nodeToRevisionsMap[key][0];
        r.Reject();

    }
}

@Vipin_Paliwal The provided code rejects insertion revision. But deletion revision is preserved, but since the text that is under delete revision was removed by rejecting insert revision it shows an empty deleted text: out.docx (11.8 KB)

As I can see, MS Word behaves the same. I think, you will get the desired output by accepting insert revision. out_accepted_insertion.docx (11.8 KB)