I have already reviewed the patch (upload soon), but I would like to have it reviewed by someone outside of Sun as well.
Before of this some ODF background knowledge about ODF shapes:
In ODF a style (ie. style:style) is always identified not alone by its name, but as well by its style:family. Elements are in general predefined to one style:family.
For instance, a paragraph (text) will have a style from the style:family="paragraph", a span (text:span) would have a style:family="text"
Only ODF shapes (e.g. draw:frame) can choose between two different style:family values, ie. 'presentation' and 'graphic'.
The idea behind is that 'graphic' family shapes have a style that belong to the document similar as all other styles, but 'presentation' family shapes have a style that belongs to a master page.
Whenever in an application the master page of a page is being changed, all 'graphic' shapes look the same, only the 'presentation' shapes will get a new look-and-feel from the new master page.
(added the explanation as JavaDoc to OdfStylablePresentationElement)
The problem here:
The previous fix in OdfStylablePresentationElement (now called OdfStylableShapeElement) did not work anymore as during parsing the document in the OdfDocument.startElement(..) function, the attribute is created upon:
instead as previous by:
element.setAttributeNS(uri, localname, value);
This was done to enable validation within an attribute class about the possible attribute values, which depend on the element context (parent).
For this reason the overridden method in OdfStylableShapeElement did not work/was not called:
public void setAttributeNS(String uri, String localname, String value)
Solution: Add the same fix for the new signature being called
public Attr setAttributeNodeNS(Attr newAttr)
String uri = newAttr.getNamespaceURI();
String localname = newAttr.getName();
After this fix, indexing methods of used styles work again (see test case).