First, it is late and I am tired, so I may not be thinking clearly....

Pedro wrote:

   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);
           }

<snip>

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.

<snip>

The cursor seems that goRight method move a random distance.
The random amounts are probably because you move the cursor one character at a time, and you do not know how wide a character is. Take a look at AndrewMacro.odt and read section 7.17 Where is the Display Cursor? This is a very short section (page or two). I have not verified that this works in 3.x, but it should...

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


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

Reply via email to