Issue 12731 - Annotation not in content enumeration
Summary: Annotation not in content enumeration
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Linux, all
: P3 Trivial
Target Milestone: ---
Assignee: stephan.wunderlich
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-27 17:13 UTC by zagy
Modified: 2013-02-24 21:09 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
script showing the error (1.09 KB, text/plain)
2003-03-27 17:13 UTC, zagy
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description zagy 2003-03-27 17:13:09 UTC
1. add an annotation to a text range cur
2. cur.createContentEnumeration(...) returns an empty enumeration
(see attachment)

script prints:
(u'com.sun.star.text.TextContent',)
0
Comment 1 zagy 2003-03-27 17:13:53 UTC
Created attachment 5285 [details]
script showing the error
Comment 2 ooo 2003-04-04 14:42:52 UTC
This might be OOo 1.1 Beta 2 relevant
Comment 3 thomas.lange 2003-04-09 08:41:36 UTC
TL->SW: OS said an annotation is not part of the content enumeration.
Thus this is OK.
It should be part of the enumeration returned by createEnumeration though.
Please check.
Comment 4 stephan.wunderlich 2003-04-14 09:39:26 UTC
SW->TL: the textfield 'annotation' is part of the portionenumeration,
but there seems to be a problem to get it after the annotation is
freshly inserted. In the macro below the first element of the portion
enumeration is the text itself, but after recreating the cursor it is
the textfield.

doc =
stardesktop.loadComponentFromURL("private:factory/swriter","_blank",
0, dimArray())

BodyText = doc.getText()
cur = BodyText.createTextCursor()
cur.setString("Text")

a = doc.createInstance("com.sun.star.text.TextField.Annotation")
a.Author = "Dr. No"
a.Content = "foobar"
BodyText.insertTextContent(cur, a, False)

enum = cur.createEnumeration()
paragraph = enum.nextElement
portions = paragraph.createEnumeration 
portion = portions.nextElement
print portion.TextPortionType


print "second try"
BodyText = doc.getText()
cur = BodyText.createTextCursor()
enum = cur.createEnumeration()
paragraph = enum.nextElement
portions = paragraph.createEnumeration 
portion = portions.nextElement
print portion.TextPortionType	
Comment 5 stephan.wunderlich 2003-04-14 09:40:01 UTC
SW: changed target
Comment 6 thomas.lange 2003-05-15 11:36:08 UTC
.
Comment 7 thomas.lange 2003-05-15 11:38:10 UTC
.
Comment 8 thomas.lange 2003-11-11 13:30:48 UTC
Everyting is as it should be.

In the first step you created the enumeration directly after the
insertTextContent (which had placed the cursor after the inserted text
field at position 1) and in the second try you create a new cursor
that starts before the text field (at position 0).
If you recreated the cursor in the frist try *after* the
insertTextContent call the order of the called code is the same and
you'll get the same result.
Comment 9 thomas.lange 2003-11-11 13:31:45 UTC
Set to invalid.
Comment 10 stephan.wunderlich 2004-05-11 09:32:00 UTC
closed as invalid