List Info

Thread: Listening to TextRange string




Listening to TextRange string
user name
2006-09-20 10:03:07
Hi everybody,

Is there a way to be notified when the content (the string,
I mean) of a 
TextRange is changed ?

I feel that the answer is negative, from some mails I've
read in this 
list, but in case there is a miracle...

TextRange publishes XPropertySet, which enables registration
of a 
property listener, but there is no such thing as a
'string' property (at 
least, documented).

Thank you if you know a trick on this,

Julien Galand

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

Listening to TextRange string
user name
2006-09-20 09:21:34
Hi Julien,

> Is there a way to be notified when the content (the
string, I mean)  
> of a TextRange is changed ?
>
> I feel that the answer is negative, from some mails
I've read in  
> this list, but in case there is a miracle...

As far as I know there is no way to be notified when a
specific  
XTextRange is changed.

> TextRange publishes XPropertySet, which enables
registration of a  
> property listener, but there is no such thing as a
'string'  
> property (at least, documented).

The PropertyChanged event is called for "bound"
properties and the  
PropertyVeto event is called for "constrained"
properties. The  
XPropertySet has as far as I know neither of them and so the
 
Listeners will never be called anyway.

> Thank you if you know a trick on this,

If you are "just" after changes via UI you could
add a ModifyListener  
to your document and in case it is called you could get the 

ViewCursor and so have the currently changed TextRange.

Hope that helps

Regards

Stephan

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

Listening to TextRange string
user name
2006-09-20 09:21:34
Hi Julien,

> Is there a way to be notified when the content (the
string, I mean)  
> of a TextRange is changed ?
>
> I feel that the answer is negative, from some mails
I've read in  
> this list, but in case there is a miracle...

As far as I know there is no way to be notified when a
specific  
XTextRange is changed.

> TextRange publishes XPropertySet, which enables
registration of a  
> property listener, but there is no such thing as a
'string'  
> property (at least, documented).

The PropertyChanged event is called for "bound"
properties and the  
PropertyVeto event is called for "constrained"
properties. The  
XPropertySet has as far as I know neither of them and so the
 
Listeners will never be called anyway.

> Thank you if you know a trick on this,

If you are "just" after changes via UI you could
add a ModifyListener  
to your document and in case it is called you could get the 

ViewCursor and so have the currently changed TextRange.

Hope that helps

Regards

Stephan

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )