Issue 50692 - XText.insertTextContent(XTextRange, XTextContent, boolean) crash-down
Summary: XText.insertTextContent(XTextRange, XTextContent, boolean) crash-down
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows XP
: P3 Trivial
Target Milestone: ---
Assignee: stephan.wunderlich
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-14 03:11 UTC by liaoyu7879
Modified: 2013-02-24 21:09 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description liaoyu7879 2005-06-14 03:11:01 UTC
When inserting a TextContent with XText.insertTextContent(XTextRange, 
XTextContent, boolean), with an XTextViewCursor as XTextRange, the OOo text 
document crashes down.
The following is the example code:
         ....
        try {
              XTextViewCursorSupplier xTVCS= (XTextViewCursorSupplier)
UnoRuntime.queryInterface(XTextViewCursorSupplier.class, xController);
              XTextViewCursor xTextViewCursor= xTVCS.getViewCursor();
              XTextCursor xTextCursor = (XTextCursor)
XText.createTextCursorByRange(xTextViewCursor.getStart());
              Object aField= cMSF.createInstance
("com.sun.star.text.TextField.Annotation");
              XPropertySet pSet= (XPropertySet)UnoRuntime.queryInterface
(XPropertySet.class, aField);
              pSet.setPropertyValue("Content", "222222");
              com.sun.star.text.XTextField aNote= (com.sun.star.text.XTextField)
UnoRuntime.queryInterface(com.sun.star.text.XTextField.class, aField);
              xText.insertTextContent(xTextCursor.getEnd(),  aNote,  false);

       }
       catch(...){
       ...
       }
Comment 1 stephan.wunderlich 2005-06-14 08:33:50 UTC
sw->liaoyu7879: I ran the following macro with src680_m106 and had no problems
to insert an annotation. Could you check the latest build if your problem still
persists please.
The macro I used, comparable to your java-code:
	view = thiscomponent.currentController
	xText = thiscomponent.Text
	xTextViewCursor = view.ViewCursor
	xTextCursor = xText.createTextCursorByRange(xTextViewCursor.getStart())
    aField= thiscomponent.createInstance("com.sun.star.text.TextField.Annotation")
    aField.setPropertyValue("Content", "222222")
    xText.insertTextContent(xTextCursor.getEnd(),  aField,  false)
Comment 2 liaoyu7879 2005-06-16 07:04:44 UTC
I've tested it under OOo1.9.104, and the crash-down didn't occur. So this must 
have been fixed.