Odd, it either hangs in the "was not selected loop" or
throws an error (the macro window pops up).
I changed your code slightly, but I don't see that my
changes are the problem. You can see the method below.
If you think it is worth investigating I can probably
save the file and send it to you. What you see in the
file is that the lines are "in the background" while
all my other objects are in the foreground. Could
there be a limit on Zordering, I mean I get up to a
hundred sometimes.
Pity there is no parameter for this, or another way. I
have a bit of bad feeling regarding performance and
stability about sending a macro to get those lines on
the right layer. I suppose I could try connected
lines.
thanks
kent
###
sub SetObjectToForeground (oDocument as Object,
drawPage as Object)
xShape = drawPage(0)
oDocument.currentController.select(xShape)
'ensure that the shape is selected
xSel = oDocument.currentController.getSelection
wasSelected = EqualUnoObjects(xShape,xSel(0))
while not wasSelected
'wait for selection
wend
dim dispatcher as object
'document = ThisComponent.CurrentController.Frame
dispatcher =
createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(oDocument,
".uno:SetObjectToForeground", "", 0, Array())
end sub
--- Stephan Wunderlich <[EMAIL PROTECTED]>
wrote:
> Hi Kent,
>
> > I render some objects - textframes, graphic frames
> and
> > lines.
> >
> > For all of these I explicitly set the zOrder.
> >
> > Somehow though my lines get put onto a different
> layer
> > (I presume).
> >
> > What looks like a solution is when I press the
> button
> > "To Foreground" on the line then zOrdering looks
> ok,
> > the problem is that "To Foreground" is no where
> > documented. How do I set this property with a
> macro or
> > from java?
> >
> > I know through the dispatcher I could issue the
> > SetObjectToForeground, but I can't figure out how
> to
> > pass the dispatcher a line for example so that it
> > knows what to set to the foreground.
> >
> > does anyone have any ideas?
>
> generally setting the z-order should work ... but
> well it doesn't seem
> to in your case, but I'd have to look into the used
> code to see if it is
> an issue or something in your code.
>
> For the dispatch ... the one you want to use reacts
> to the currently
> selected shape as far as I know, so the following
> macro should bring the
> first shape in your document to the foreground
>
> xShape = ThisComponent.drawpage(0)
> thiscomponent.currentController.select(xShape)
>
> 'ensure that the shape is selected
> xSel = thisComponent.currentController.getSelection
> wasSelected = EqualUnoObjects(xShape,xSel(0))
>
> while not wasSelected
> 'wait for selection
> wend
>
> dim document as object
> dim dispatcher as object
>
> document = ThisComponent.CurrentController.Frame
> dispatcher =
>
createUnoService("com.sun.star.frame.DispatchHelper")
> dispatcher.executeDispatch(document,
> ".uno:SetObjectToForeground", "",
> 0, Array())
>
> Hope that helps
>
> Regards
>
> Stephan
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]