Message de Regina Henschel  date 2010-01-09 18:55 :

OK, I see that all EllipseShape properties are without "value change may be listened". So I have to find another way.

But the property "ZoomValue" has got "value change may be listened", and there is no reaction on changing zoom in Writer, Draw and Impress, but only in Calc. Why?

After some tests I conclude that the implementation is approximate regarding this listener...

Calc :
the property attribute of ZoomValue is : zero.
It should not fire a PropertyChangeEvent.
Yet, it does fire. But disposing is not fired when closing the window.

Draw/Impress :
the property attribute of ZoomValue is : 2.
It should fire a PropertyChangeEvent.
But it does not. Yet it fires the disposing event when closing the window.

Writer :
ZoomValue is a property of CurrentController.ViewSettings.
The property attribute of ZoomValue is : zero.
It should not fire a PropertyChangeEvent.
It does not, as expected.


---- Basic code, in container "My macros" for easier use ----

Option Explicit

Global propsObject as object
Global oListener as object

Sub listenPropertyChange
Dim propsObject As Object
Dim sListenerName as string, sProperty as string

sListenerName = "com.sun.star.beans.XPropertyChangeListener"
if IsNull(propsObject)  then
  oListener = CreateUnoListener( "myChangeListener_", sListenerName )
  propsObject = ThisComponent.CurrentController ' Calc, Draw, Impress
'  propsObject = ThisComponent.CurrentController.ViewSettings ' Writer
  sProperty = "ZoomValue"
  propsObject.addPropertyChangeListener(sProperty, oListener)
  MsgBox("Listener installed")
else
  MsgBox("Listener already in use", 16)
end if
End Sub


sub stopListener
if IsNull(propsObject)  then
  MsgBox("Listener not installed", 16)
else
  propsObject.removePropertyChangeListener(sProperty,oListener)
  propsObject = Nothing
  oListener = Nothing
  MsgBox("Listener removed")
end if
end sub


Sub myChangeListener_disposing(oEvt As Object)
MsgBox("myChangeListener disposing")
  propsObject = Nothing
  oListener = Nothing
End Sub

Sub myChangeListener_propertyChange(oEvt As Object)
xray oEvt
End Sub

----

Regards
  Bernard





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

Reply via email to