Pedro escribió:
Peter Eberlein escribió:
Hi Pedro,
Oliver-Rainer Wittmann - Software Engineer - Sun Microsystems schrieb:

BTW, XShape::getPosition() at a shape in Writer shall return the position of this shape relative to its anchor. It is not the absolute position of the shape on the text document's page.

Yes, to get the absolute position you have to jump with the XTextViewCursor to the anchor and "merge" both positions. Please keep in mind, that you must not use the lockControllers() method. Otherwise you will get wrong values of the viewCursors position,

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Hi again, I'm trying to get the partial image position with XTextViewCursor, but I'm not be able to obtain this. I only can get Text. There's an example that obtain positions of a imagen or a text portion?
I have this example code:

   XTextViewCursor vc = xViewCursorSupplier.getViewCursor();
   for (short i = 0; i < 150; i++) {
               vc.goRight(i, false);
               Point p = (Point) vc.getPosition();
               System.out.println(" Position x:" + p.X
                       + " y:" + p.Y);
           }


With this code I want to know the positios of each character and the image. The text document that it reads has this format:
######
Textline
IMAGE
Textline
######

After execute my code I obtain strange data:
Position x:0 y:0 Position x:185 y:0 Position x:572 y:0 Position x:965 y:0 Position x:1702 y:0 Position x:2401 y:0 Position x:3239 y:0 Position x:4311 y:0 Position x:5877 y:0 Position x:7389 y:0 Position x:7682 y:0 Position x:7682 y:0 Position x:7682 y:0 Position x:901 y:9682 Position x:3133 y:9682 Position x:5385 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682 Position x:8119 y:9682
..... ..... .....
I can't understand the meaning of X and Y coordinates, and i don't know if this coordinates contain image values or not.
Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

More information about the problem. I have changed the output text and now i recive that:

Position x:185 y:0 Read:T
Position x:572 y:0 Read:Tex
Position x:979 y:0 Read:Text b
Position x:1637 y:0 Read:Text befor
Position x:2501 y:0 Read:Text before ima
Position x:3325 y:0 Read:Text before image in
Position x:4535 y:0 Read:Text before image in odt doc
Position x:5650 y:0 Read:Text before image in odt document. Position x:5650 y:0 Read:Text before image in odt document. Position x:5650 y:0 Read:Text before image in odt document. Position x:5650 y:0 Read:Text before image in odt document. Position x:760 y:9682 Leido Text before image in odt document. Text Position x:2773 y:9682 Leido Text before image in odt document. Text after image i Position x:5304 y:9682 Leido Text before image in odt document. Text after image in odt document

The cursor seems that goRight method move a random distance.

Greetings

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to