From bb121c864cc3c101ef733a4088c7ba3e36eced14 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 14 Dec 2012 12:58:00 +0200 Subject: fdo#46808, Convert frame::Desktop to new style service. I had to drop XEventBroadcaster from the merged interface because it introduced method name conflicts (addEventListener). Shouldn't be an issue since it was scheduled to be dropped anyhow, and the service implementation still implements it, so existing clients will be fine. I dropped the interface XPropertySet from the combined IDL because nobody seems to be using it, and it's primary purpose appears to be to set weird flags. I dropped the optional interfaces XStatusIndicatorFactory XDispatchInformationProvider from the combined IDL because the service does not implement them, and nobody seems to be using them. I suspect they were mistakenly copied from XFrame. I also did not convert the Title, UserDefinedAttributes and LayoutManager properties to attributes, again because no-one is using them. Change-Id: I678a00006ed2cca2d6c37c4e39465811442c33af --- remotebridges/examples/officeclient.cxx | 69 +++++++++++++++------------------ 1 file changed, 32 insertions(+), 37 deletions(-) (limited to 'remotebridges') diff --git a/remotebridges/examples/officeclient.cxx b/remotebridges/examples/officeclient.cxx index c672dd8463c6..400459e8e081 100644 --- a/remotebridges/examples/officeclient.cxx +++ b/remotebridges/examples/officeclient.cxx @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -157,47 +158,41 @@ sal_Int32 OfficeClientMain::run( const Sequence< OUString > & aArguments ) throw Reference< XMultiServiceFactory > rRemoteSMgr( r , UNO_QUERY ); - Reference < XComponentLoader > rLoader( - rRemoteSMgr->createInstance( OUString( "com.sun.star.frame.Desktop" )), - UNO_QUERY ); - - if( rLoader.is() ) + Reference < XDesktop2 > rLoader = Desktop::create( comphelper::getComponentContext(r) ); + + sal_Char *urls[] = { + "private:factory/swriter", + "private:factory/sdraw", + "private:factory/simpress", + "private:factory/scalc" + }; + + sal_Char *docu[]= { + "a new writer document ...\n", + "a new draw document ...\n", + "a new schedule document ...\n" , + "a new calc document ...\n" + }; + sal_Int32 i; + for( i = 0 ; i < 4 ; i ++ ) { + printf( "press any key to open %s\n" , docu[i] ); + getchar(); + + Reference< XComponent > rComponent = + rLoader->loadComponentFromURL( + OUString::createFromAscii( urls[i] ) , + OUString( "_blank"), + 0 , + Sequence < ::com::sun::star::beans::PropertyValue >() ); - sal_Char *urls[] = { - "private:factory/swriter", - "private:factory/sdraw", - "private:factory/simpress", - "private:factory/scalc" - }; - - sal_Char *docu[]= { - "a new writer document ...\n", - "a new draw document ...\n", - "a new schedule document ...\n" , - "a new calc document ...\n" - }; - sal_Int32 i; - for( i = 0 ; i < 4 ; i ++ ) + if( 0 == i ) { - printf( "press any key to open %s\n" , docu[i] ); - getchar(); - - Reference< XComponent > rComponent = - rLoader->loadComponentFromURL( - OUString::createFromAscii( urls[i] ) , - OUString( "_blank"), - 0 , - Sequence < ::com::sun::star::beans::PropertyValue >() ); - - if( 0 == i ) - { - testWriter( rComponent ); - } - printf( "press any key to close the document\n" ); - getchar(); - rComponent->dispose(); + testWriter( rComponent ); } + printf( "press any key to close the document\n" ); + getchar(); + rComponent->dispose(); } } -- cgit