diff options
author | Noel Grandin <noel@peralex.com> | 2012-12-14 12:58:00 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2012-12-21 10:57:09 +0200 |
commit | bb121c864cc3c101ef733a4088c7ba3e36eced14 (patch) | |
tree | 2d528ca830aace6e563b7cdc93eb8f8d6c4f70cf /remotebridges | |
parent | 6d818ed651aaafcfb12ebc21449d35947d2e85a9 (diff) |
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
Diffstat (limited to 'remotebridges')
-rw-r--r-- | remotebridges/examples/officeclient.cxx | 69 |
1 files changed, 32 insertions, 37 deletions
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 <com/sun/star/lang/XMain.hpp> #include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/text/XTextDocument.hpp> @@ -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(); } } |