To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=73568
                 Issue #|73568
                 Summary|inserting textcontent into the anchor of a collapsed b
                        |ookmark doesn't extend the bookmark
               Component|api
                 Version|OOo 2.0.2
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|jsc
             Reported by|clutz





------- Additional comments from [EMAIL PROTECTED] Wed Jan 17 07:37:43 -0800 
2007 -------
There is a document insertIntoCollapsedBookmark.odt attached that contains two
bookmarks. The first one (named "collapsed") is collapsed and the other one
(named "notCollapsed") has some textcontent.

when running the code

Sub Main
    bookmark = ThisComponent.getBookmarks().getByName("collapsed")
    bookmark.Anchor.setString("foo")

    bookmark = ThisComponent.getBookmarks().getByName("notCollapsed")
    bookmark.Anchor.setString("bar")
End Sub

the bookmark "collapsed" doesn't get extended with the new textcontent and is
still collapsed, while the other bookmark "notCollapsed" is extended correctly.
So selecting the bookmark "collapsed" in the navigator does not select the word
"foo", while selecting the bookmark "notCollapsed" selects the word "bar".

so here is how to reproduce:
1) open insertIntoCollapsedBookmark.odt
2) run the included macro "main"
3) open the navigator and select the bookmark "collapsed" and look at the
selected content
4) select the bookmark "notCollapsed" and look at the selected content

For me a collapsed bookmark is a bookmark where bookmark.Anchor.getStart() ==
bookmark.Anchor.getEnd(). There seems to be two ways of representing such
bookmarks internally:

Type A) 
The collapsed bookmark is represented by two objects ob Type XTextContent. The
first one has the attributes IsStart==true and IsCollapsed==false, the last one
has the attribute IsStart == false. There is no other textcontent between the
start mark and the end mark, so the bookmark is empty (or collapsed). The
XML-Representation of such a bookmark is:

<text:bookmark-start text:name="collapsed"/><text:bookmark-end
text:name="collapsed"/>

Type B) 
The collapsed bookmark is represented by only one object of type XTextContent.
The object has the properties IsStart==true and IsCollapsed==true. The XML
representation of such a bookmark is (please note: it's a different 
XML-element!!):

<text:bookmark text:name="collapsed"/>

The bookmark "collapsed" with the incorrect behaviour is of Type B!

So I manually changed the representation of the bookmark in the content.xml to
get a bookmark of type A. The document
insertIntoCollapsedBookmark_patchedContentXML.odt contains the result and shows,
that bookmarks of type A behave correct.

so here is how to reproduce the correct bahaviour of type A bookmarks:
1) open insertIntoCollapsedBookmark_patchedContentXML.odt
2) run the included macro "main"
3) open the navigator and select the bookmark "collapsed" and look at the
selected content
4) select the bookmark "notCollapsed" and look at the selected content

Please note: this in a very serious issue for us since our letterhead system
relies in the fact, that bookmarks always contain the correct content.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to