From 7371e3dbeb3637587eab141ee20f4cd8a4fc9373 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 17 Sep 2012 16:45:30 +0200 Subject: Attempt at adapting Windows-only code to ucbhelper::Content changes Change-Id: Ib17e2153746da9e097cccef1bd70bbbd349c7920 --- fpicker/source/odma/ODMAFilePicker.cxx | 12 ++++++------ fpicker/source/odma/ODMAFilePicker.hxx | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/odma/ODMAFilePicker.cxx b/fpicker/source/odma/ODMAFilePicker.cxx index 21063f086c83..291f3f2c1ac3 100644 --- a/fpicker/source/odma/ODMAFilePicker.cxx +++ b/fpicker/source/odma/ODMAFilePicker.cxx @@ -62,7 +62,7 @@ using namespace ::utl; //------------------------------------------------------------------------------------ // class ODMAFilePicker //------------------------------------------------------------------------------------ -ODMAFilePicker::ODMAFilePicker( const Reference < XMultiServiceFactory >& xFactory ) : +ODMAFilePicker::ODMAFilePicker( const Reference < XComponentContext >& rxContext ) : cppu::WeakComponentImplHelper9< XFilterManager, XFilterGroupManager, @@ -73,14 +73,15 @@ ODMAFilePicker::ODMAFilePicker( const Reference < XMultiServiceFactory >& xFacto XCancellable, XEventListener, XServiceInfo>( m_rbHelperMtx ), + m_xContext( rxContext ), m_bMultiSelectionMode( sal_False ), m_aDefaultName( ), m_aFiles( ), m_nDialogKind( OPEN ) { m_bUseDMS = ::odma::DMSsAvailable(); - m_xSystemFilePicker = xFactory->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.Win32FilePicker" ) )); + m_xSystemFilePicker = rxContext->getServiceManager()->createInstanceWithContext( + "com.sun.star.ui.dialogs.Win32FilePicker", rxContext); } // XExecutableDialog functions @@ -198,7 +199,7 @@ sal_Int16 SAL_CALL ODMAFilePicker::execute( ) // Create a Content for the odma URL so that // odma::ContentProvider will learn about the DOCID we // just created. - ucbhelper::Content content( s, Reference< XCommandEnvironment >() ); + ucbhelper::Content content( s, Reference< XCommandEnvironment >(), m_xContext ); m_aFiles = Sequence< rtl::OUString >( &s, 1 ); return ExecutableDialogResults::OK; } @@ -538,8 +539,7 @@ Reference< XInterface > SAL_CALL ODMAFilePicker::impl_createInstance( const Reference< XComponentContext >& rxContext) throw( Exception ) { - Reference< XMultiServiceFactory > xServiceManager (rxContext->getServiceManager(), UNO_QUERY_THROW); - return Reference< XInterface >( *new ODMAFilePicker( xServiceManager ) ); + return Reference< XInterface >( *new ODMAFilePicker( rxContext ) ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/fpicker/source/odma/ODMAFilePicker.hxx b/fpicker/source/odma/ODMAFilePicker.hxx index bb389d8cb8cb..8ec400a69408 100644 --- a/fpicker/source/odma/ODMAFilePicker.hxx +++ b/fpicker/source/odma/ODMAFilePicker.hxx @@ -58,6 +58,8 @@ class ODMAFilePicker : ::com::sun::star::lang::XServiceInfo > { private: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > + m_xContext sal_Bool m_bUseDMS; sal_Bool m_bMultiSelectionMode; rtl::OUString m_aDefaultName; @@ -72,7 +74,7 @@ protected: public: - ODMAFilePicker( const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& xFactory ); + ODMAFilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); // XFilterManager functions -- cgit