Hi there,

getSelection is working correctly...that is not the problem..i am clearly
descriping the scenario here
i had inserted a shape inside impress document and made interaction (Onclick)
of the shape to call a macro. this macro contains the code to get the
currently selected shape.

So if i click the shape the macro is called before the shape got
selected...so the macro code cannot find the selected shape...what iam
asking now is is there any other way get the shape which is clicked.

now that is a bit inconvenient :-)
What I'd do is add a SelectionChangeListener ... when your "Shape" is clicked and an "selectionChanged" event should be fired and you can work with that. In Basic something like the following should work when binding the "OnClick" event to the method "OnClick"

global xListener

Sub OnClick
xListener = createUNOListener ("cb_","com.sun.star.view.XSelectionChangeListener")
xView = ThisComponent.currentController
xView.addSelectionChangeListener(xListener)
End Sub

sub cb_selectionChanged()
xView = ThisComponent.currentController
xSelection = xView.getSelection

REM "remove Listener"
xView.removeSelectionChangeListener(xListener)

if not isEmpty(xSelection) then
        msgbox xSelection.dbg_supportedInterfaces
endif
end sub

Hope that helps

Regards

Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to