hasRevisions() returns true unexpectedly

I need to detect if a document has unaccepted tracked changes.

I would expect the hasRevisions() method to return true if the document has unaccepted tracked changes and false if not. But in practice this method is returning true if the doucment has ever had any tracked changes, even if those changes have been accepted. Is this a bug or is this by design? The documentation says “Returns true if the document has any tracked changes”.

If this is the intended behavior, is there a way to detect only unaccepted tracked changes?

Thanks!

Hi,

Please attach a document that returns true after tracking changes have been accepted. It might be a bug.

Try this one.

Thank you for attachment. Indeed, HasRevisions is true. I have logged this as defect Auckland-78 and hopefully it will be fixed until the next minor release is out.

The thing about your document is that although MS Word says there are no revisions in your document, there is in fact one revision. It can be seen if you save the document as WordML or RTF in Microsoft Word.

For some reason MS Word does not report it as a revision, but Aspose.Words does (because by all means it looks like a revision). I’m going to look at this more.

We have released a new version of Aspose.Words that contains a fix for your issue.

The new version is available at:

https://downloads.aspose.com/words

Best regards,

Thanks, I’m actually using the Java version though. Any estmate on when this fix will be available in the java version?

Thanks.

Hi,

I have contacted our Java developer and he stated porting of the current fixes including this one to Java may take 1-2 months.

Ok, Let me know when it’s ready. Thanks!

How is this coming along? Any estimate for the next Java release?

Thanks!!

We will try to implement it in our next release, which is due in a week, but I cannot promise it for sure yet.

Ok, that would be great if it makes it in!

Thanks.

Any update on this?

Thanks!

Sorry, no update yet. I will post a notification here as soon as there will be any news regarding this issue.

Best regards,

Aspose.Words for Java 2.2 was released and it has Document.getVersionCount() that you are after.

Actually I was waiting for a bug fix in the hasRevisions method(). Is that included in the latest Java release?

Thanks!

That was fixed even in 2.2 (one before).

I just downloaded the latest Aspose words for Java and it doesn’t look like this is fixed. I’m getting the same incorrect behavior from the hasRevisions() method as described above.

I see a Document.getVersionsCount() method but not a getVersionCount(). What does getVersionsCount() do? I don’t see it mentioned in any documentation.

Thanks.

public int getVersionsCount()

Gets the number of document versions that was stored in the DOC document.

Versions in Microsoft Word are accessed via the File/Versions menu. Microsoft Word supports versions only for DOC files (no versions in RTF and WordprocessingML).

This property allows to detect if there were document versions stored in this document before it was opened in Aspose.Words. Aspose.Words provides no other support for document versions. If you save this document using Aspose.Words, the document will be saved without versions.

Sorry, I think getVersionsCount was for another customer, I got it all crossed. I was sure by implementing getVersionsCount I’m resolving the hasRevisions issue for you. In this case next update of Aspose.Words for Java will contain the fix.