Issue 126110 - Incompatible API change in Annotations
Summary: Incompatible API change in Annotations
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 4.1.1
Hardware: All All
: P5 (lowest) Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-16 11:16 UTC by bmarcelly
Modified: 2015-07-17 21:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---
marcelly.bernard: 4.1.2_release_blocker?


Attachments
Text with an annotation created with AOO 3.4.1 (12.07 KB, application/vnd.oasis.opendocument.text)
2015-02-16 11:22 UTC, bmarcelly
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description bmarcelly 2015-02-16 11:16:46 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.
Comment 1 bmarcelly 2015-02-16 11:22:04 UTC
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"
Comment 2 Andrea Pescetti 2015-07-17 21:15:32 UTC
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.
Comment 3 Andrea Pescetti 2015-07-17 21:16:43 UTC
@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.