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]