css.document.XDocumentEventBroadcaster supported since when and by who?

View: New views
2 Messages — Rating Filter:   Alert me  

css.document.XDocumentEventBroadcaster supported since when and by who?

by Ariel Constenla-Haile :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there,

I used the css.document.XDocumentEventBroadcaster that is supposed to replace
"the XEventBroadcaster interface, which should not be used anymore" , but
http://svn.services.openoffice.org/opengrok/xref/DEV300_m61/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
has no since tag and a Job that added a listener did nothing, so I changed the
code to work both with the old and the new interfaces:


    // only listen for documents that can be printed
    uno::Reference< view::XPrintable > xPrintable( xModel, uno::UNO_QUERY );
    if ( xPrintable.is() )
    {
        uno::Reference< document::XDocumentEventBroadcaster > xBroadcaster(
xModel, uno::UNO_QUERY );
        if ( xBroadcaster.is() )
        {
            uno::Reference< document::XDocumentEventListener > xDocListener(
static_cast< document::XDocumentEventListener* >( new
MyUpdateOnPrintListener() ), uno::UNO_QUERY);
            xBroadcaster->addDocumentEventListener( xDocListener );
        }
        else
        {
            uno::Reference< document::XEventBroadcaster > xOldBroadcaster(
xModel, uno::UNO_QUERY );
            if ( xOldBroadcaster.is() )
            {
                uno::Reference< document::XEventListener > xDocListener(
static_cast< document::XEventListener* >( new MyUpdateOnPrintListener() ),
uno::UNO_QUERY);
                xOldBroadcaster->addEventListener( xDocListener );
            }
        }
    }

to my surprise, xBroadcaster.is() evaluates to false for every office document
(where xPrintable.is() evaluates to true  - that, I guess, is every document
but OOo Base's ones).
The "should not be used anymore" is rather misleading: or there is a new way
to get this broadcaster interface from a document, or no office document is
supporting this right now, so you must stay with the old one.
Is XDocumentEventBroadcaster supported? By which services? since when?

Regards
--
Ariel Constenla-Haile
La Plata, Argentina

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: css.document.XDocumentEventBroadcaster supported since when and by who?

by Frank Schoenheit, Sun Microsystems Germany :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ariel,

> I used the css.document.XDocumentEventBroadcaster that is supposed to replace
> "the XEventBroadcaster interface, which should not be used anymore" , but
> http://svn.services.openoffice.org/opengrok/xref/DEV300_m61/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
> has no since tag

shame on me, I forgot adding it, corrected in some 3.2 CWS. The
interface was new in 3.1.

> to my surprise, xBroadcaster.is() evaluates to false for every office document
> (where xPrintable.is() evaluates to true  - that, I guess, is every document
> but OOo Base's ones).

IIRC, I added it to the global event broadcaster implementation, but not
to the SFX-based documents (which is: all documents except database
documents :-\ ). Mikhail recently said something about adding it there,
but I am not sure he finished this for 3.2.

> The "should not be used anymore" is rather misleading:

I was probably too optimistic in writing this, though, speaking
strictly, it is true: Implementations should not use this interface
anymore - sad SFX still does :)

Ciao
Frank


--
- Frank Schönheit, Software Engineer         frank.schoenheit@... -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...