Apache OpenOffice (AOO) Bugzilla – Issue 126110
Incompatible API change in Annotations
Last modified: 2015-07-17 21:16:43 UTC
Apache OpenOffice version 4.1 has introduced in Writer annotations over a text range. Previously, annotations were only on a collapsed range. https://cwiki.apache.org/confluence/display/OOOUSERS/AOO+4.1+Release+Notes#AOO4.1ReleaseNotes-Comments/Annotationsontextranges When scanning a Writer text, paragraph per paragraph, and successive text portions within a paragraph, the property TextPortionType provides a string describing the type of the portion, see service co.sun.star.text.TextPortion. Before version 4.1 an annotation (always on a collapsed range) returns PortionType = "TextField" From version 4.1 the same annotation returns PortionType = "Annotation" This means that an existing code cannot handle old annotations on version 4.1, since it does not understand this new PortionType. Note that for new annotations over a range, you get a PortionType = "Annotation", then a PortionType = "Text", then PortionType = "AnnotationEnd." To resolve the incompatibility for old annotations, the API should return PortionType "TextField" for "collapsed range annotations", and return the new Portion Types "Annotation" and "AnnotationEnd" only for annotations over a range.
Created attachment 84508 [details] Text with an annotation created with AOO 3.4.1 Contains a macro exploring the text. In AOO 3.4.1 it shows TextPortionType = "TextField" In AOO 4.1 it shows TextPortionType = "Annotation"
This will definitely need evaluation on the API list, where I just forwarded a link to this issue with explanations. So: this is an incompatible change that was introduced in 4.1.0; your suggestion (but we have no patches for it) would reintroduce the old behavior for the Annotations (aka Notes, Comments) that were allowed until 4.0.1, and use the new behavior only for the new Annotations/Notes/Comments, those that apply to Text Ranges. Your suggestion makes sense to me, but we will need that someone contributes a patch to include this in 4.1.2.
@bmarcelly: by the way, thank you for attaching a very clear sample document. I confirm that 4.0.1 and 4.1.1 give two different results.