To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=52776
                  Issue #:|52776
                  Summary:|Problem with XTextViewCursor and Image
                Component:|api
                  Version:|680m118
                 Platform:|All
                      URL:|
               OS/Version:|Windows 2003
                   Status:|UNCONFIRMED
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|DEFECT
                 Priority:|P3
             Subcomponent:|code
              Assigned to:|sw
              Reported by:|muifull





------- Additional comments from [EMAIL PROTECTED] Tue Aug  2 01:21:49 -0700 
2005 -------
Hi all,

I play with OfficeBean and Writer (OOo 2.0), and experience a problem.

I would like to create an embedded-image in the document and then 
position the viewCursor to a specified range.

The embedded-image did create successfully, but unfortunately, I could 
not ask the viewCursor to do anything after that. Whatever operations 
(gotoStart(), gotoRange(), goRight…) generated the following exception:

com.sun.star.uno.RuntimeException: no text selection

It seems like the viewCursor is trapped by the image and is no longer 
available. Here is my code:

// Create the image through the dispatch interface (component is an object 
subclass-ed from OOoBean)
OfficeCommand officeCommand = new OfficeCommand((short)10241);
officeCommand.appendParameter("FileName", imagePath);
officeCommand.appendParameter("FilterName", "<All formats>");
officeCommand.appendParameter("AsLink", new Boolean(false));
officeCommand.appendParameter("Style", "Graphics");
officeCommand.execute(component, component.getXURLTransformer(), 
component.getXDispatchProvider());

// Ask the viewCursor to go to the Start of the page
XTextViewCursorSupplier xTextViewCursorSupplier = 
(XTextViewCursorSupplier)UnoRuntime.queryInterface
(XTextViewCursorSupplier.class, 
component.getDocument().getCurrentController());
XTextViewCursor cursor = xTextViewCursorSupplier.getViewCursor();
cursor.gotoStart(false);

As I remember, the same set of operations worked fine with OOo1.1.x.

Could anyone please help me? Thanks in advance.

Best regards
MuiFull

---------------------------------------------------------------------
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