Let's talk the API and the commpare logic through, we might will look at implementing it.
How would you want to compare the styles?
A style has a few properties of its own (owner document, style name, style id, style type, id of the based on style, id of the next style and so on) as well as one or more collections of formatting attributes (font and paragraph).
I don't think that simple approach
will be acceptable. By looking at this code I would expect that it compares all properties of a style, but I doubt comparing all properties of a style will ever make sense.
A style can have same formatting, but different id in different documents. A style can have same formatting, but be based on different styles. There are many scenarios to consider.
How do you want the compare operation to take into account based on styles? These are the styles that the style "inherits" from.
If we can figure out how it should be in the API it will not be a problem to do it.